config

package
v3.11.10 Latest Latest
Warning

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

Go to latest
Published: Mar 17, 2021 License: Apache-2.0 Imports: 27 Imported by: 0

Documentation

Index

Constants

View Source
const DefaultQueriesPerBaselineResolver = 50

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

View Source
const DefaultQueriesPerPublicResolver = 15

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",
	"209.244.0.3",
	"64.6.64.6",
	"84.200.69.80",
	"8.26.56.26",
	"109.69.8.51",
	"74.82.42.42",
	"77.88.8.8",
}

DefaultBaselineResolvers is a list of trusted public DNS resolvers.

View Source
var PublicResolvers []string

PublicResolvers includes the addresses of public resolvers obtained dynamically.

View Source
var (
	// StatikFS is the ./resources project directory embedded into the binary.
	StatikFS http.FileSystem
)

Functions

func AcquireConfig

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

AcquireConfig populates the Config struct provided by the Config argument.

func GetListFromFile

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

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

func LookupASNsByName added in v3.3.2

func LookupASNsByName(s string) ([]int, []string, error)

LookupASNsByName returns ASNs and descriptions for autonomous systems that have descriptions containing the string provided.

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"`

	// Use a local graph database
	LocalDatabase bool

	// 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

	// 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
	MonitorResolverRate bool

	// 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 added in v3.7.0

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 added in v3.5.0

func (c *Config) AddResolver(resolver string)

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

func (*Config) AddResolvers added in v3.5.0

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

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

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) 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 added in v3.10.0

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 added in v3.10.0

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

LocalDatabaseSettings returns the Database for the local bolt store.

func (*Config) SetResolvers added in v3.5.0

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

SetResolvers assigns the 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 added in v3.10.0

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 added in v3.10.0

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 added in v3.10.0

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

AddCredentials adds the Credentials provided to the configuration.

func (*DataSourceConfig) GetCredentials added in v3.10.0

func (dsc *DataSourceConfig) GetCredentials() *Credentials

GetCredentials returns randomly selected Credentials associated with the receiver configuration.

type Database added in v3.10.0

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 IP2ASN added in v3.10.4

type IP2ASN struct {
	FirstIP     net.IP
	LastIP      net.IP
	ASN         int
	CC          string
	Description string
}

IP2ASN is a range record provided by the iptoasn.com service.

func GetIP2ASNData added in v3.10.4

func GetIP2ASNData() ([]*IP2ASN, error)

GetIP2ASNData returns all the range records read from the 'ip2asn-combined.tsv.gz' file provided by the iptoasn.com service.

type Updater

type Updater interface {
	OverrideConfig(*Config) error
}

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

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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