config

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Sep 21, 2022 License: Apache-2.0 Imports: 26 Imported by: 0

Documentation

Index

Constants

View Source
const DefaultQueriesPerBaselineResolver = 10

DefaultQueriesPerBaselineResolver is the number of queries sent to each trusted DNS resolver per second.

View Source
const DefaultQueriesPerPublicResolver = 5

DefaultQueriesPerPublicResolver is the number of queries sent to each public DNS resolver per second.

Variables

View Source
var DefaultBaselineResolvers = []string{
	"8.8.8.8",
	"1.1.1.1",
	"9.9.9.9",
	"208.67.222.222",
	"84.200.69.80",
	"64.6.64.6",
	"8.26.56.26",
	"205.171.3.65",
	"134.195.4.2",
	"185.228.168.9",
	"76.76.19.19",
	"37.235.1.177",
	"77.88.8.1",
	"94.140.14.140",
	"38.132.106.139",
	"74.82.42.42",
	"76.76.2.0",
}

DefaultBaselineResolvers is a list of trusted public DNS resolvers.

View Source
var PublicResolvers []string

PublicResolvers includes the addresses of public resolvers obtained dynamically.

Functions

func AcquireConfig

func AcquireConfig(dir, file string, cfg *Config) error

AcquireConfig populates the Config struct provided by the Config argument.

func ExpandMask

func ExpandMask(word string) ([]string, error)

ExpandMask will return a slice of words that a "hashcat-style" mask matches.

func ExpandMaskWordlist

func ExpandMaskWordlist(wordlist []string) ([]string, error)

ExpandMaskWordlist performs ExpandMask on a slice of words.

func GetListFromFile

func GetListFromFile(path string) ([]string, error)

GetListFromFile reads a wordlist text or gzip file and returns the slice of words.

func GetPublicDNSResolvers

func GetPublicDNSResolvers() error

GetPublicDNSResolvers obtains the public DNS server addresses from public-dns.info and assigns them to PublicResolvers.

func OutputDirectory

func OutputDirectory(dir ...string) string

OutputDirectory returns the file path of the Amass output directory. A suitable path provided will be used as the output directory instead.

Types

type Config

type Config struct {
	sync.Mutex

	// A Universally Unique Identifier (UUID) for the enumeration
	UUID uuid.UUID

	// Logger for error messages
	Log *log.Logger

	// The directory that stores the bolt db and other files created
	Dir string `ini:"output_directory"`

	// Alternative directory for scripts provided by the user
	ScriptsDirectory string `ini:"scripts_directory"`

	// The graph databases used by the system / enumerations
	GraphDBs []*Database

	// The maximum number of concurrent DNS queries
	MaxDNSQueries int `ini:"maximum_dns_queries"`

	// Names provided to seed the enumeration
	ProvidedNames []string

	// The IP addresses specified as in scope
	Addresses []net.IP

	// CIDR that is in scope
	CIDRs []*net.IPNet

	// ASNs specified as in scope
	ASNs []int

	// The ports that will be checked for certificates
	Ports []int

	// The list of words to use when generating names
	Wordlist []string

	// Will the enumeration including brute forcing techniques
	BruteForcing bool

	// Will recursive brute forcing be performed?
	Recursive bool

	// Minimum number of subdomain discoveries before performing recursive brute forcing
	MinForRecursive int

	// Maximum depth for bruteforcing
	MaxDepth int

	// Will discovered subdomain name alterations be generated?
	Alterations    bool
	FlipWords      bool
	FlipNumbers    bool
	AddWords       bool
	AddNumbers     bool
	MinForWordFlip int
	EditDistance   int
	AltWordlist    []string

	// Only access the data sources for names and return results?
	Passive bool

	// Determines if zone transfers will be attempted
	Active bool

	// A blacklist of subdomain names that will not be investigated
	Blacklist []string

	// A list of data sources that should not be utilized
	SourceFilter struct {
		Include bool // true = include, false = exclude
		Sources []string
	}

	// The minimum number of minutes that data source responses will be reused
	MinimumTTL int

	// Type of DNS records to query for
	RecordTypes []string

	// Resolver settings
	Resolvers        []string
	ResolversQPS     int
	TrustedResolvers []string
	TrustedQPS       int

	// Option for verbose logging and output
	Verbose bool
	// contains filtered or unexported fields
}

Config passes along Amass configuration settings and options.

func NewConfig

func NewConfig() *Config

NewConfig returns a default configuration object.

func (*Config) AcquireScripts

func (c *Config) AcquireScripts() ([]string, error)

AcquireScripts returns all the default and user provided scripts for data sources.

func (*Config) AddDomain

func (c *Config) AddDomain(domain string)

AddDomain appends the domain name provided in the parameter to the list in the configuration.

func (*Config) AddDomains

func (c *Config) AddDomains(domains ...string)

AddDomains appends the domain names provided in the parameter to the list in the configuration.

func (*Config) AddResolver

func (c *Config) AddResolver(resolver string)

AddResolver appends the untrusted resolver name provided in the parameter to the list in the configuration.

func (*Config) AddResolvers

func (c *Config) AddResolvers(resolvers ...string)

AddResolvers appends the untrusted resolver names provided in the parameter to the list in the configuration.

func (*Config) AddTrustedResolver

func (c *Config) AddTrustedResolver(resolver string)

AddTrustedResolver appends the trusted resolver name provided in the parameter to the list in the configuration.

func (*Config) AddTrustedResolvers

func (c *Config) AddTrustedResolvers(resolvers ...string)

AddTrustedResolvers appends the trusted resolver names provided in the parameter to the list in the configuration.

func (*Config) BlacklistSubdomain

func (c *Config) BlacklistSubdomain(name string)

BlacklistSubdomain adds a subdomain name to the config blacklist.

func (*Config) Blacklisted

func (c *Config) Blacklisted(name string) bool

Blacklisted returns true is the name in the parameter ends with a subdomain name in the config blacklist.

func (*Config) CalcMaxQPS

func (c *Config) CalcMaxQPS()

CalcMaxQPS updates the MaxDNSQueries field of the configuration based on current settings.

func (*Config) CheckSettings

func (c *Config) CheckSettings() error

CheckSettings runs some sanity checks on the configuration options selected.

func (*Config) DomainRegex

func (c *Config) DomainRegex(domain string) *regexp.Regexp

DomainRegex returns the Regexp object for the domain name identified by the parameter.

func (*Config) Domains

func (c *Config) Domains() []string

Domains returns the list of domain names currently in the configuration.

func (*Config) GetDataSourceConfig

func (c *Config) GetDataSourceConfig(source string) *DataSourceConfig

GetDataSourceConfig returns the DataSourceConfig associated with the data source name argument.

func (*Config) IsAddressInScope

func (c *Config) IsAddressInScope(addr string) bool

IsAddressInScope returns true if the addr parameter matches provided network scope and when no network scope has been set.

func (*Config) IsDomainInScope

func (c *Config) IsDomainInScope(name string) bool

IsDomainInScope returns true if the DNS name in the parameter ends with a domain in the config list.

func (*Config) LoadSettings

func (c *Config) LoadSettings(path string) error

LoadSettings parses settings from an .ini file and assigns them to the Config.

func (*Config) LocalDatabaseSettings

func (c *Config) LocalDatabaseSettings(dbs []*Database) *Database

LocalDatabaseSettings returns the Database for the local bolt store.

func (*Config) SetResolvers

func (c *Config) SetResolvers(resolvers ...string)

SetResolvers assigns the untrusted resolver names provided in the parameter to the list in the configuration.

func (*Config) SetTrustedResolvers

func (c *Config) SetTrustedResolvers(resolvers ...string)

SetTrustedResolvers assigns the trusted resolver names provided in the parameter to the list in the configuration.

func (*Config) UpdateConfig

func (c *Config) UpdateConfig(update Updater) error

UpdateConfig allows the provided Updater to update the current configuration.

func (*Config) WhichDomain

func (c *Config) WhichDomain(name string) string

WhichDomain returns the domain in the config list that the DNS name in the parameter ends with.

type Credentials

type Credentials struct {
	Name     string
	Username string `ini:"username"`
	Password string `ini:"password"`
	Key      string `ini:"apikey"`
	Secret   string `ini:"secret"`
}

Credentials contains values required for authenticating with web APIs.

type DataSourceConfig

type DataSourceConfig struct {
	Name string
	TTL  int `ini:"ttl"`
	// contains filtered or unexported fields
}

DataSourceConfig contains the configurations specific to a data source.

func (*DataSourceConfig) AddCredentials

func (dsc *DataSourceConfig) AddCredentials(cred *Credentials) error

AddCredentials adds the Credentials provided to the configuration.

func (*DataSourceConfig) GetCredentials

func (dsc *DataSourceConfig) GetCredentials() *Credentials

GetCredentials returns randomly selected Credentials associated with the receiver configuration.

type Database

type Database struct {
	System   string
	Primary  bool   `ini:"primary"`
	URL      string `ini:"url"`
	Username string `ini:"username"`
	Password string `ini:"password"`
	DBName   string `ini:"database"`
	Options  string `ini:"options"`
}

Database contains values required for connecting with graph databases.

type Updater

type Updater interface {
	OverrideConfig(*Config) error
}

Updater allows an object to implement a method that updates a configuration.

Jump to

Keyboard shortcuts

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