dnsenum

package
v0.0.24 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 25, 2023 License: GPL-3.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ShowOutput added in v0.0.19

func ShowOutput(eo *EnumOpts) error

function designed to set the display flag, indicating to show the enumeration results as it is happening. this will display output using the enumerator's Outputter object.

func UseHeader

func UseHeader(eo *EnumOpts) error

opts func to set the TestHeader flag, indicating to place the subdomain value in the Host header during enumeration.

func WithHTTPS added in v0.0.19

func WithHTTPS(eo *EnumOpts) error

opts func to set the HTTPS flag, indicating to use HTTPS when enumerating subdomains for the target.

Types

type EnumOpts

type EnumOpts struct {

	// max number of milliseconds a thread should wait
	// in between requests.
	Delay int

	// flag indicating whether to use the printer during
	// enumeration. if false, no output will be presented
	// to the user.
	Display bool

	// specified if the user wants the enumerator to
	// use an existing HTTP client. this will override
	// the client defined in the Enuerator struct.
	ExistingClient *http.Client

	// specify HTTPS for testing
	Https bool

	// user-defined list of proxies to use during enum.
	Proxies []string

	// boolean flag indicating whether to use proxyscraper.
	ProxyScraper *proxyscrape.ProxyScraper

	// flag indicating whether the enumerator should test
	// the domain using "Host: <subdomain>" to search
	// for subdomains.
	TestHeader bool

	// number of threads to use in enumeration.
	ThreadCount int

	// amount of time (in seconds) to wait before dropping
	// the request if it has not responded.
	Timeout float64

	// wordlist to use for enumeration. this defaults
	// to subdomains.txt.
	Wordlist string
}

type EnumOptsFunc

type EnumOptsFunc func(*EnumOpts) error

type alias for a function that can set options in an EnumOpts object. this is used in the NewEnumerator function.

func WithDelay added in v0.0.19

func WithDelay(delay int) EnumOptsFunc

opts func to set the max delay between requests. this is to make sure the enumerator does not overload the target or get blocked.

func WithProxies added in v0.0.20

func WithProxies(proxies []string) EnumOptsFunc

opts func to set the proxy slice to use when enumerating a target domain.

func WithProxyScraper added in v0.0.20

func WithProxyScraper(scraper *proxyscrape.ProxyScraper) EnumOptsFunc

opts func to set the proxyscraper to use when enumerating the target domain. if the input to this function is nil, a new proxyscraper will be generated with the country set to "us", the anonymity set to "elite" and the protocol being set to HTTP with no SSL.

func WithThreadCount added in v0.0.19

func WithThreadCount(count int) EnumOptsFunc

opts func to specify the number of threads to use.

func WithTimeout

func WithTimeout(duration float64) EnumOptsFunc

opts func to specify the timeout duration for the client.

func WithWordlist

func WithWordlist(wordlist string) EnumOptsFunc

opts func to specify the wordlist to use during enumeration.

type Enumerator

type Enumerator struct {

	// HTTP client that will make a request to the
	// top-level domain and test for subdomains.
	Client *http.Client

	// slice containing the discovered subdomains.
	Discovered []string

	// flag indicating whether the enumerator should test
	// the domain using "Host: <subdomain>" to search
	// for subdomains.
	TestHeader bool

	// top-level domain to test for subdomains.
	TLD string

	// length of top-level domain return.
	TLDLength int

	// wordlist to use for enumeration. this defaults
	// to subdomains.txt.
	Wordlist string
	// contains filtered or unexported fields
}

structure designed to represent a DNS enumerator. this will hold all the necessary information for the user to execute DNS enumeration.

func NewEnumerator

func NewEnumerator(tld string, opts ...EnumOptsFunc) (enumerator *Enumerator, err error)

function designed to create an initialize a DNS enumerator object.

func (*Enumerator) EnumSubdomainsGET added in v0.0.19

func (e *Enumerator) EnumSubdomainsGET() (err error)

function designed to enumerate a top-level domain for subdomains using GET request enumeration. this will use the wordlist provided to the enumerator.

func (*Enumerator) EnumSubdomainsVHOST added in v0.0.19

func (e *Enumerator) EnumSubdomainsVHOST() (err error)

function designed to enumerate a top-level domain for subdomains using VHost enumeration. this will use the wordlist provided to the enumerator.

func (*Enumerator) GetTLDLength added in v0.0.19

func (e *Enumerator) GetTLDLength() (err error)

function designed to grab the return length of a GET request to the top-level domain.

func (*Enumerator) GoogleDork added in v0.0.20

func (e *Enumerator) GoogleDork() (err error)

function designed to use a google dork to attempt to locate subdomains of the given domain.

func (*Enumerator) TestSubdomainHead

func (e *Enumerator) TestSubdomainHead(subdomain string, https bool) (err error)

function designed to test a subdomain to see if it returns without error when a HEAD request is made against it.

note: the subdomain must be <subdomain>.<tld> (ex: test.example.com)

func (*Enumerator) TestSubdomainHost added in v0.0.19

func (e *Enumerator) TestSubdomainHost(subdomain string, targetip string, tldlen int, https bool) (err error)

function designed to test a subdomain to see if it returns without error when the HOST header is manipulated.

note: the subdomain must be <subdomain>.<tld> (ex: test.example.com)

func (*Enumerator) TestTLD

func (e *Enumerator) TestTLD() (err error)

function designed to see if the TLD provided is reachable using HEAD and is, therefore, a valid site or if the domain is comprised enitrely of subdomains (if any).

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL