Documentation ¶
Index ¶
- Constants
- Variables
- func AcquireConfig(dir, file string, cfg *Config) error
- func ExpandMask(word string) ([]string, error)
- func ExpandMaskWordlist(wordlist []string) ([]string, error)
- func GetListFromFile(path string) ([]string, error)
- func OutputDirectory(dir ...string) string
- type Config
- func (c *Config) AbsPathFromConfigDir(path string) (string, error)
- func (c *Config) AcquireScripts() ([]string, error)
- func (c *Config) AddDomain(domain string)
- func (c *Config) AddDomains(domains ...string)
- func (c *Config) AddResolver(resolver string)
- func (c *Config) AddResolvers(resolvers ...string)
- func (c *Config) AddTrustedResolver(resolver string)
- func (c *Config) AddTrustedResolvers(resolvers ...string)
- func (c *Config) BlacklistSubdomain(name string)
- func (c *Config) Blacklisted(name string) bool
- func (c *Config) CalcMaxQPS()
- func (c *Config) CheckSettings() error
- func (c *Config) CheckTransformations(from string, tos ...string) (*Matches, error)
- func (c *Config) DomainRegex(domain string) *regexp.Regexp
- func (c *Config) Domains() []string
- func (c *Config) GetDataSourceConfig(source string) *DataSource
- func (c *Config) IsAddressInScope(addr string) bool
- func (c *Config) IsDomainInScope(name string) bool
- func (c *Config) LoadSettings(path string) error
- func (c *Config) LocalDatabaseSettings(dbs []*Database) *Database
- func (c *Config) SetResolvers(resolvers ...string)
- func (c *Config) SetTrustedResolvers(resolvers ...string)
- func (c *Config) UpdateConfig(update Updater) error
- func (c *Config) WhichDomain(name string) string
- type Credentials
- type DataSource
- type DataSourceConfig
- type Database
- type EngAPI
- type Matches
- type ParseIPs
- type Scope
- type Transformation
- type Updater
Constants ¶
const DefaultQueriesPerBaselineResolver = 15
DefaultQueriesPerBaselineResolver is the number of queries sent to each trusted DNS resolver per second.
const DefaultQueriesPerPublicResolver = 5
DefaultQueriesPerPublicResolver is the number of queries sent to each public DNS resolver per second.
Variables ¶
var PublicResolvers = []string{
"8.8.8.8",
"1.1.1.1",
"9.9.9.9",
"77.88.8.1",
}
PublicResolvers includes the addresses of public resolvers obtained dynamically.
Functions ¶
func AcquireConfig ¶
AcquireConfig populates the Config struct provided by the Config argument.
func ExpandMask ¶
ExpandMask will return a slice of words that a "hashcat-style" mask matches.
func ExpandMaskWordlist ¶
ExpandMaskWordlist performs ExpandMask on a slice of words.
func GetListFromFile ¶
GetListFromFile reads a wordlist text or gzip file and returns the slice of words.
func OutputDirectory ¶
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 `yaml:"-" json:"-"` // A Universally Unique Identifier (UUID) for the enumeration UUID uuid.UUID `yaml:"-" json:"-"` // The pseudo-random number generator Rand *rand.Rand `yaml:"-" json:"-"` // Logger for error messages Log *log.Logger `yaml:"-" json:"-"` // The date/time that discoveries must be active since to be included in the findings CollectionStartTime time.Time `yaml:"-" json:"-"` // Scope struct that contains ASN, CIDR, Domain, IP, and ports in scope Scope *Scope `yaml:"scope,omitempty" json:"scope,omitempty"` // Defines options like datasources config path and stuff like that Options map[string]interface{} `yaml:"options,omitempty" json:"-"` // Filepath of the configuration file. It is needed as a seed incase of relative paths in the config. Filepath string `yaml:"-" json:"-"` // Alternative directory for scripts provided by the user ScriptsDirectory string `yaml:"-" json:"-"` // The directory that stores the bolt db and other files created Dir string `yaml:"-" json:"-"` // The graph databases used by the system / enumerations GraphDBs []*Database `yaml:"-" json:"database,omitempty"` // The maximum number of concurrent DNS queries MaxDNSQueries int `yaml:"-" json:"-"` // The list of words to use when generating names Wordlist []string `yaml:"-" json:"wordlist,omitempty"` // Will the enumeration including brute forcing techniques BruteForcing bool `yaml:"-" json:"brute_force,omitempty"` // Will recursive brute forcing be performed? Recursive bool `yaml:"-" json:"-"` // Minimum number of subdomain discoveries before performing recursive brute forcing MinForRecursive int `yaml:"-" json:"-"` // Maximum depth for bruteforcing MaxDepth int `yaml:"-" json:"-"` // Will discovered subdomain name alterations be generated? Alterations bool `yaml:"-" json:"alterations,omitempty"` FlipWords bool `yaml:"-" json:"-"` FlipNumbers bool `yaml:"-" json:"-"` AddWords bool `yaml:"-" json:"-"` AddNumbers bool `yaml:"-" json:"-"` MinForWordFlip int `yaml:"-" json:"-"` EditDistance int `yaml:"-" json:"-"` AltWordlist []string `yaml:"-" json:"alt_worldlist,omitempty"` // Only access the data sources for names and return results? Passive bool `yaml:"-" json:"-"` // Determines if zone transfers will be attempted Active bool `yaml:"-" json:"-"` // A list of data sources that should not be utilized SourceFilter struct { Include bool `yaml:"-" json:"-"` // true = include, false = exclude Sources []string `yaml:"-" json:"-"` } `yaml:"-" json:"-"` // The minimum number of minutes that data source responses will be reused MinimumTTL int `yaml:"-" json:"-"` // Type of DNS records to query for RecordTypes []string `yaml:"-" json:"-"` // Resolver settings Resolvers []string `yaml:"-" json:"resolvers"` ResolversQPS int `yaml:"-" json:"-"` TrustedResolvers []string `yaml:"-" json:"trusted_resolvers,omitempty"` TrustedQPS int `yaml:"-" json:"-"` // Option for verbose logging and output Verbose bool `yaml:"-" json:"-"` // Names provided to seed the enumeration ProvidedNames []string `yaml:"-" json:"-"` // Mode should be determined based on scripts utilized Mode string `yaml:"-" json:"-"` // The data source configurations DataSrcConfigs *DataSourceConfig `yaml:"-" json:"datasource_config"` // The Transformations map will contain incoming assets, and what handlers should be called. Transformations map[string]*Transformation `yaml:"transformations" json:"transformations"` // The engine APIURI configuration EngineAPI *EngAPI `yaml:"-" json:"-"` // contains filtered or unexported fields }
Config passes along Amass configuration settings and options.
func (*Config) AbsPathFromConfigDir ¶
AbsPathFromConfigDir Creates a file path that is relative the the configuration file location. If the path is already absolute, return it as is.
func (*Config) AcquireScripts ¶
AcquireScripts returns all the default and user provided scripts for data sources.
func (*Config) AddDomain ¶
AddDomain appends the domain name provided in the parameter to the list in the configuration.
func (*Config) AddDomains ¶
AddDomains appends the domain names provided in the parameter to the list in the configuration.
func (*Config) AddResolver ¶
AddResolver appends the untrusted resolver name provided in the parameter to the list in the configuration.
func (*Config) AddResolvers ¶
AddResolvers appends the untrusted resolver names provided in the parameter to the list in the configuration.
func (*Config) AddTrustedResolver ¶
AddTrustedResolver appends the trusted resolver name provided in the parameter to the list in the configuration.
func (*Config) AddTrustedResolvers ¶
AddTrustedResolvers appends the trusted resolver names provided in the parameter to the list in the configuration.
func (*Config) BlacklistSubdomain ¶
BlacklistSubdomain adds a subdomain name to the config blacklist.
func (*Config) Blacklisted ¶
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 ¶
CheckSettings runs some sanity checks on the configuration options selected.
func (*Config) CheckTransformations ¶
CheckTransformations checks if the given 'From' type has a valid transformation to any of the given 'To' types.
func (*Config) DomainRegex ¶
DomainRegex returns the Regexp object for the domain name identified by the parameter.
func (*Config) GetDataSourceConfig ¶
func (c *Config) GetDataSourceConfig(source string) *DataSource
GetDataSourceConfig returns the DataSourceConfig associated with the data source name argument.
func (*Config) IsAddressInScope ¶
IsAddressInScope returns true if the addr parameter matches provided network scope and when no network scope has been set.
func (*Config) IsDomainInScope ¶
IsDomainInScope returns true if the DNS name in the parameter ends with a domain in the config list.
func (*Config) LoadSettings ¶
LoadSettings parses settings from an .yaml file and assigns them to the Config.
func (*Config) LocalDatabaseSettings ¶
LocalDatabaseSettings returns the Database for the local bolt store.
func (*Config) SetResolvers ¶
SetResolvers assigns the untrusted resolver names provided in the parameter to the list in the configuration.
func (*Config) SetTrustedResolvers ¶
SetTrustedResolvers assigns the trusted resolver names provided in the parameter to the list in the configuration.
func (*Config) UpdateConfig ¶
UpdateConfig allows the provided Updater to update the current configuration.
func (*Config) WhichDomain ¶
WhichDomain returns the domain in the config list that the DNS name in the parameter ends with.
type Credentials ¶
type Credentials struct { Name string `yaml:"-" json:"-"` Username string `yaml:"username,omitempty" json:"username,omitempty"` Password string `yaml:"password,omitempty" json:"password,omitempty"` Apikey string `yaml:"apikey,omitempty" json:"apikey,omitempty"` Secret string `yaml:"secret,omitempty" json:"secret,omitempty"` }
Credentials contains values required for authenticating with web APIs.
type DataSource ¶
type DataSource struct { Name string `yaml:"name,omitempty" json:"name,omitempty"` TTL int `yaml:"ttl,omitempty" json:"ttl,omitempty"` Creds map[string]*Credentials `yaml:"creds,omitempty" json:"creds,omitempty"` }
DataSource contains the configurations specific to a data source.
func (*DataSource) AddCredentials ¶
func (ds *DataSource) AddCredentials(accountName string, cred *Credentials) error
AddCredentials adds the Credentials provided to the configuration.
type DataSourceConfig ¶
type DataSourceConfig struct { Datasources []*DataSource `yaml:"datasources,omitempty" json:"datasources,omitempty"` GlobalOptions map[string]int `yaml:"global_options,omitempty" json:"global_options,omitempty"` }
DataSourceConfig contains the configuration for multiple data sources.
func (*DataSourceConfig) GetCredentials ¶
func (dsc *DataSourceConfig) GetCredentials(dsName string) *Credentials
GetCredentials returns the first set of Credentials associated with the given DataSource name.
func (*DataSourceConfig) MapNames ¶
func (dsc *DataSourceConfig) MapNames()
MapNames assigns the name of the DataSource to each associated Credential's Name field. This is especially useful after unmarshalling data where the relationship between a DataSource and its credentials may not have been explicitly set in the source data.
type Database ¶
type Database struct { System string `json:"system,omitempty"` // Database system type (Postgres, MySQL, etc.) Primary bool `json:"primary,omitempty"` // Whether this database is the primary store URL string `json:"url,omitempty"` // Full URI to the database Username string `json:"username,omitempty"` // Username for authentication Password string `json:"password,omitempty"` // Password for authentication Host string `json:"host,omitempty"` // Host of the database Port string `json:"port,omitempty"` // Port of the database DBName string `json:"db_name,omitempty"` // Name of the database Options string `json:"options,omitempty"` // Extra options used while connecting to the database }
Database contains values required for connecting with graph database.
type EngAPI ¶
type EngAPI struct { Scheme string // Engine API scheme (http, https) URL string // Full URI to the Engine API Username string // Username for authentication Password string // Password for authentication Host string // Host of the Engine API Port string // Port of the Engine API Path string // Name of the Engine API Options string // Extra options used while connecting to the Engine API }
EngAPI structure holds various components necessary for establishing a connection with an Engine API. It includes fields for the scheme (http or https), the full API URL, authentication credentials (username, password), host and port information, the specific path (name) of the API, and any extra options that may be used during the connection.
type Matches ¶
type Matches struct {
// contains filtered or unexported fields
}
Matches represents a collection of transform matches.
type ParseIPs ¶
ParseIPs represents a slice of net.IP addresses.
type Scope ¶
type Scope struct { // The root domain names that the enumeration will target Domains []string `yaml:"domains,omitempty" json:"domains,omitempty"` // IP Net.IP Addresses []net.IP `yaml:"-" json:"ips,omitempty"` // The IP addresses specified as in scope IP []string `yaml:"ips,omitempty" json:"-"` // ASNs specified as in scope ASNs []int `yaml:"asns,omitempty" json:"asns,omitempty"` // CIDR IPNET CIDRs []*net.IPNet `yaml:"-" json:"cidrs,omitempty"` // CIDR in scope CIDRStrings []string `yaml:"cidrs,omitempty" json:"-"` // The ports checked for certificates Ports []int `yaml:"ports,omitempty" json:"ports,omitempty"` // A blacklist of subdomain names that will not be investigated Blacklist []string `yaml:"blacklist,omitempty" json:"blacklist,omitempty"` }
Scope represents the configuration for the enumeration scope.
type Transformation ¶
type Transformation struct { From string `yaml:"-" json:"-"` To string `yaml:"-" json:"-"` Priority int `yaml:"priority,omitempty" json:"priority,omitempty"` Confidence int `yaml:"confidence,omitempty" json:"confidence,omitempty"` Exclude []string `yaml:"exclude,omitempty" json:"exclude,omitempty"` }
Transformation represents an individual transofmration with optional priority & confidence.
func (*Transformation) Split ¶
func (t *Transformation) Split(key string) error
Split splits the key into 'From' and 'To' components, expecting a "->" delimiter. Requires a non-nil Transformation pointer and a valid key format. Example: FQDN->IPaddress
func (*Transformation) Validate ¶
func (t *Transformation) Validate(c *Config) error
Validate checks the validity of a given transformation with respect to OAM & previously registered transformations. The function ensures OAM compliance & that there are no conflicts between transformations with 'none' (indicating no action) and other valid transformations for the same 'From' type.