amass

package
v1.5.1 Latest Latest
Warning

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

Go to latest
Published: Apr 28, 2018 License: Apache-2.0 Imports: 26 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Version string = "v1.5.1"
	Author  string = "Jeff Foley (@jeff_foley)"
	// Tags used to mark the data source with the Subdomain struct
	ALT     = "alt"
	BRUTE   = "brute"
	SCRAPE  = "scrape"
	ARCHIVE = "archive"

	// An IPv4 regular expression
	IPv4RE = "((25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)[.]){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)"
	// This regular expression + the base domain will match on all names and subdomains
	SUBRE = "(([a-zA-Z0-9]{1}|[a-zA-Z0-9]{1}[a-zA-Z0-9-]{0,61}[a-zA-Z0-9]{1})[.]{1})+"

	USER_AGENT  = "Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/65.0.3325.181 Safari/537.36"
	ACCEPT      = "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8"
	ACCEPT_LANG = "en-US,en;q=0.8"
)
View Source
const (
	TypeNorm int = iota
	TypeNS
	TypeMX
	TypeWeb
)

Node types used in the Maltego local transform

Variables

View Source
var PublicResolvers = []string{
	"1.1.1.1:53",
	"8.8.8.8:53",
	"64.6.64.6:53",
	"208.67.222.222:53",
	"77.88.8.8:53",
	"74.82.42.42:53",
	"1.0.0.1:53",
	"8.8.4.4:53",
	"208.67.220.220:53",
	"77.88.8.1:53",
}

Public & free DNS servers

Functions

func AnySubdomainRegex added in v1.2.0

func AnySubdomainRegex() *regexp.Regexp

func CIDRSubset added in v1.2.1

func CIDRSubset(cidr *net.IPNet, addr string, num int) []string

getCIDRSubset - Returns a subset of the hosts slice with num elements around the addr element

func CheckConfig

func CheckConfig(config *AmassConfig) error

func GetARecordData added in v1.3.0

func GetARecordData(answers []DNSAnswer) string

Goes through the DNS answers looking for A and AAAA records, and returns the first Data field found for those types

func GetDefaultWordlist

func GetDefaultWordlist() []string

func GetWebPageWithDialContext added in v1.3.0

func GetWebPageWithDialContext(dc dialCtx, u string, hvals map[string]string) string

func NetHosts added in v1.2.0

func NetHosts(cidr *net.IPNet) []string

Obtained/modified the next two functions from the following: https://gist.github.com/kotakanbe/d3059af990252ba89a82

func NewUniqueElements

func NewUniqueElements(orig []string, add ...string) []string

NewUniqueElements - Removes elements that have duplicates in the original or new elements

func RangeHosts added in v1.2.0

func RangeHosts(start, end net.IP) []string

func ReverseDNSWithDialContext added in v1.3.0

func ReverseDNSWithDialContext(dc dialCtx, ip string) (string, error)

func ReverseIP added in v1.3.0

func ReverseIP(ip string) string

func StartEnumeration added in v1.3.0

func StartEnumeration(config *AmassConfig) error

func SubdomainRegex

func SubdomainRegex(domain string) *regexp.Regexp

func UniqueAppend

func UniqueAppend(orig []string, add ...string) []string

UniqueAppend - Behaves like the Go append, but does not add duplicate elements

Types

type ASRecord added in v1.3.0

type ASRecord struct {
	ASN            int
	Prefix         string
	CC             string
	Registry       string
	AllocationDate time.Time
	Description    string
	Netblocks      []string
}

type ActiveCertService added in v1.2.0

type ActiveCertService struct {
	BaseAmassService
	// contains filtered or unexported fields
}

func NewActiveCertService added in v1.2.0

func NewActiveCertService(in, out chan *AmassRequest, config *AmassConfig) *ActiveCertService

func (*ActiveCertService) OnStart added in v1.2.0

func (acs *ActiveCertService) OnStart() error

func (*ActiveCertService) OnStop added in v1.2.0

func (acs *ActiveCertService) OnStop() error

type AlterationService

type AlterationService struct {
	BaseAmassService
}

func NewAlterationService

func NewAlterationService(in, out chan *AmassRequest, config *AmassConfig) *AlterationService

func (*AlterationService) OnStart

func (as *AlterationService) OnStart() error

func (*AlterationService) OnStop

func (as *AlterationService) OnStop() error

type AmassConfig

type AmassConfig struct {
	sync.Mutex

	// The channel that will receive the results
	Output chan *AmassRequest

	// The ASNs that the enumeration will target
	ASNs []int

	// The CIDRs that the enumeration will target
	CIDRs []*net.IPNet

	// The IPs that the enumeration will target
	IPs []net.IP

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

	// Determines if active information gathering techniques will be used
	Active bool

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

	// Sets the maximum number of DNS queries per minute
	Frequency time.Duration

	// Preferred DNS resolvers identified by the user
	Resolvers []string

	// Indicate that Amass cannot add domains to the config
	AdditionalDomains bool
	// contains filtered or unexported fields
}

AmassConfig - Passes along optional configurations

func CustomConfig

func CustomConfig(ac *AmassConfig) *AmassConfig

Ensures that all configuration elements have valid values

func DefaultConfig

func DefaultConfig() *AmassConfig

DefaultConfig returns a config with values that have been tested

func (*AmassConfig) AddDomains added in v1.2.0

func (c *AmassConfig) AddDomains(names []string)

func (*AmassConfig) Blacklisted added in v1.4.0

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

func (*AmassConfig) DNSDialContext added in v1.3.0

func (c *AmassConfig) DNSDialContext(ctx context.Context, network, address string) (net.Conn, error)

func (*AmassConfig) DialContext added in v1.3.0

func (c *AmassConfig) DialContext(ctx context.Context, network, address string) (net.Conn, error)

func (*AmassConfig) Domains

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

func (*AmassConfig) ReverseWhois added in v1.4.0

func (c *AmassConfig) ReverseWhois(domain string) []string

-------------------------------------------------------------------------------------------------- ReverseWhois - Returns domain names that are related to the domain provided

func (*AmassConfig) Setup added in v1.3.0

func (c *AmassConfig) Setup()

func (*AmassConfig) SetupProxyConnection added in v1.3.0

func (c *AmassConfig) SetupProxyConnection(addr string) error

type AmassRequest

type AmassRequest struct {
	Name        string
	Type        int
	Domain      string
	Address     string
	Netblock    *net.IPNet
	ASN         int
	Description string
	Tag         string
	Source      string
	// contains filtered or unexported fields
}

AmassRequest - Contains data obtained throughout AmassService processing

type AmassService

type AmassService interface {
	// Start the service
	Start() error
	OnStart() error

	// Stop the service
	Stop() error
	OnStop() error

	// Returns the input channel for the service
	Input() <-chan *AmassRequest

	// Returns the output channel for the service
	Output() chan<- *AmassRequest

	// The request is sent non-blocking on the output chanel
	SendOut(req *AmassRequest)

	// Return true if the service is active
	IsActive() bool

	// Returns a channel that is closed when the service is stopped
	Quit() <-chan struct{}

	// String description of the service
	String() string
}

type ArchiveService

type ArchiveService struct {
	BaseAmassService
	// contains filtered or unexported fields
}

func NewArchiveService

func NewArchiveService(in, out chan *AmassRequest, config *AmassConfig) *ArchiveService

func (*ArchiveService) OnStart

func (as *ArchiveService) OnStart() error

func (*ArchiveService) OnStop

func (as *ArchiveService) OnStop() error

type Archiver

type Archiver interface {
	Search(req *AmassRequest)
}

Archiver - represents all objects that perform Memento web archive searches for domain names

func ArchiveIsArchive

func ArchiveIsArchive(out chan<- *AmassRequest) Archiver

func ArchiveItArchive

func ArchiveItArchive(out chan<- *AmassRequest) Archiver

func ArquivoArchive

func ArquivoArchive(out chan<- *AmassRequest) Archiver

func LibraryCongressArchive

func LibraryCongressArchive(out chan<- *AmassRequest) Archiver

func MementoWebArchive

func MementoWebArchive(u, name string, out chan<- *AmassRequest) Archiver

func UKGovArchive

func UKGovArchive(out chan<- *AmassRequest) Archiver

func UKWebArchive

func UKWebArchive(out chan<- *AmassRequest) Archiver

func WaybackMachineArchive

func WaybackMachineArchive(out chan<- *AmassRequest) Archiver

type BaseAmassService

type BaseAmassService struct {
	sync.Mutex
	// contains filtered or unexported fields
}

func NewBaseAmassService

func NewBaseAmassService(name string, config *AmassConfig, service AmassService) *BaseAmassService

func (*BaseAmassService) Config

func (bas *BaseAmassService) Config() *AmassConfig

func (*BaseAmassService) Input

func (bas *BaseAmassService) Input() <-chan *AmassRequest

func (*BaseAmassService) IsActive

func (bas *BaseAmassService) IsActive() bool

func (*BaseAmassService) IsStarted

func (bas *BaseAmassService) IsStarted() bool

func (*BaseAmassService) IsStopped

func (bas *BaseAmassService) IsStopped() bool

func (*BaseAmassService) OnStart

func (bas *BaseAmassService) OnStart() error

func (*BaseAmassService) OnStop

func (bas *BaseAmassService) OnStop() error

func (*BaseAmassService) Output

func (bas *BaseAmassService) Output() chan<- *AmassRequest

func (*BaseAmassService) Quit

func (bas *BaseAmassService) Quit() <-chan struct{}

func (*BaseAmassService) SendOut added in v1.1.0

func (bas *BaseAmassService) SendOut(req *AmassRequest)

func (*BaseAmassService) SetActive

func (bas *BaseAmassService) SetActive(active bool)

func (*BaseAmassService) SetStarted

func (bas *BaseAmassService) SetStarted()

func (*BaseAmassService) SetStopped

func (bas *BaseAmassService) SetStopped()

func (*BaseAmassService) Start

func (bas *BaseAmassService) Start() error

func (*BaseAmassService) Stop

func (bas *BaseAmassService) Stop() error

func (*BaseAmassService) String

func (bas *BaseAmassService) String() string

type BruteForceService

type BruteForceService struct {
	BaseAmassService
	// contains filtered or unexported fields
}

func NewBruteForceService

func NewBruteForceService(in, out chan *AmassRequest, config *AmassConfig) *BruteForceService

func (*BruteForceService) OnStart

func (bfs *BruteForceService) OnStart() error

func (*BruteForceService) OnStop

func (bfs *BruteForceService) OnStop() error

type DNSAnswer added in v1.3.0

type DNSAnswer struct {
	Name string `json:"name"`
	Type int    `json:"type"`
	TTL  int    `json:"TTL"`
	Data string `json:"data"`
}

func DNSExchangeConn added in v1.3.1

func DNSExchangeConn(conn net.Conn, name string, qtype uint16) []DNSAnswer

DNSExchange - Encapsulates miekg/dns usage

func ResolveDNSWithDialContext added in v1.3.0

func ResolveDNSWithDialContext(dc dialCtx, name, qtype string) ([]DNSAnswer, error)

type DNSService

type DNSService struct {
	BaseAmassService
	// contains filtered or unexported fields
}

func NewDNSService

func NewDNSService(in, out chan *AmassRequest, config *AmassConfig) *DNSService

func (*DNSService) OnStart

func (ds *DNSService) OnStart() error

func (*DNSService) OnStop

func (ds *DNSService) OnStop() error

type DomainLookup added in v1.3.0

type DomainLookup struct {
	// Requests are sent here to check the root domain of a subdomain name
	Requests chan *DomainRequest

	// The configuration being used by the amass enumeration
	Config *AmassConfig
}

func NewDomainLookup added in v1.3.0

func NewDomainLookup(config *AmassConfig) *DomainLookup

func (*DomainLookup) SubdomainToDomain added in v1.3.0

func (dl *DomainLookup) SubdomainToDomain(name string) string

type DomainRequest added in v1.3.0

type DomainRequest struct {
	Subdomain string
	Result    chan string
}

type IPHistoryService

type IPHistoryService struct {
	BaseAmassService
	// contains filtered or unexported fields
}

func NewIPHistoryService

func NewIPHistoryService(in, out chan *AmassRequest, config *AmassConfig) *IPHistoryService

func (*IPHistoryService) LookupIPs

func (ihs *IPHistoryService) LookupIPs(domain string)

LookupIPs - Attempts to obtain IP addresses from a root domain name

func (*IPHistoryService) OnStart

func (ihs *IPHistoryService) OnStart() error

func (*IPHistoryService) OnStop

func (ihs *IPHistoryService) OnStop() error

type NetblockService

type NetblockService struct {
	BaseAmassService
	// contains filtered or unexported fields
}

func NewNetblockService

func NewNetblockService(in, out chan *AmassRequest, config *AmassConfig) *NetblockService

func (*NetblockService) ASNRequest added in v1.3.1

func (ns *NetblockService) ASNRequest(r *cacheRequest)

func (*NetblockService) CIDRRequest added in v1.3.1

func (ns *NetblockService) CIDRRequest(r *cacheRequest)

func (*NetblockService) FetchOnlineData added in v1.3.0

func (ns *NetblockService) FetchOnlineData(addr string, asn int) *ASRecord

func (*NetblockService) FetchOnlineNetblockData added in v1.3.0

func (ns *NetblockService) FetchOnlineNetblockData(asn int) []string

func (*NetblockService) IPRequest added in v1.3.1

func (ns *NetblockService) IPRequest(r *cacheRequest)

func (*NetblockService) OnStart

func (ns *NetblockService) OnStart() error

func (*NetblockService) OnStop

func (ns *NetblockService) OnStop() error

type NgramService

type NgramService struct {
	BaseAmassService
	// contains filtered or unexported fields
}

func NewNgramService

func NewNgramService(in, out chan *AmassRequest, config *AmassConfig) *NgramService

func (*NgramService) AddGoodWords

func (ns *NgramService) AddGoodWords(words []string)

func (*NgramService) GoodWords

func (ns *NgramService) GoodWords() []string

func (*NgramService) IsGuessing

func (ns *NgramService) IsGuessing() bool

func (*NgramService) LastInput

func (ns *NgramService) LastInput() time.Time

func (*NgramService) MarkGuessing

func (ns *NgramService) MarkGuessing()

func (*NgramService) NextGuess

func (ns *NgramService) NextGuess() (string, error)

func (*NgramService) NumGood

func (ns *NgramService) NumGood() int

func (*NgramService) NumGuesses

func (ns *NgramService) NumGuesses() int

func (*NgramService) NumSubdomains

func (ns *NgramService) NumSubdomains() int

func (*NgramService) OnStart

func (ns *NgramService) OnStart() error

func (*NgramService) OnStop

func (ns *NgramService) OnStop() error

func (*NgramService) SetLastInput

func (ns *NgramService) SetLastInput(last time.Time)

func (*NgramService) StartGuessing

func (ns *NgramService) StartGuessing()

func (*NgramService) Subdomains

func (ns *NgramService) Subdomains() []*AmassRequest

func (*NgramService) Tag

func (ns *NgramService) Tag() string

func (*NgramService) Train

func (ns *NgramService) Train()

type ReverseDNSService added in v1.3.0

type ReverseDNSService struct {
	BaseAmassService
	// contains filtered or unexported fields
}

func NewReverseDNSService added in v1.3.0

func NewReverseDNSService(in, out chan *AmassRequest, config *AmassConfig) *ReverseDNSService

func (*ReverseDNSService) OnStart added in v1.3.0

func (rds *ReverseDNSService) OnStart() error

func (*ReverseDNSService) OnStop added in v1.3.0

func (rds *ReverseDNSService) OnStop() error

type Scraper added in v1.3.0

type Scraper interface {
	Scrape(domain string, done chan int)
	fmt.Stringer
}

Searcher - represents all types that perform searches for domain names

func AskScrape added in v1.3.1

func AskScrape(out chan<- *AmassRequest, config *AmassConfig) Scraper

func BaiduScrape added in v1.3.1

func BaiduScrape(out chan<- *AmassRequest, config *AmassConfig) Scraper

func BingScrape added in v1.3.1

func BingScrape(out chan<- *AmassRequest, config *AmassConfig) Scraper

func CensysScrape added in v1.3.1

func CensysScrape(out chan<- *AmassRequest, config *AmassConfig) Scraper

func CertDBScrape added in v1.3.2

func CertDBScrape(out chan<- *AmassRequest, config *AmassConfig) Scraper

CrtshSearch - A searcher that attempts to discover names from SSL certificates

func CertSpotterScrape added in v1.5.0

func CertSpotterScrape(out chan<- *AmassRequest, config *AmassConfig) Scraper

func CrtshScrape added in v1.3.1

func CrtshScrape(out chan<- *AmassRequest, config *AmassConfig) Scraper

CrtshSearch - A searcher that attempts to discover names from SSL certificates

func DNSDBScrape added in v1.5.1

func DNSDBScrape(out chan<- *AmassRequest, config *AmassConfig) Scraper

func DNSDumpsterScrape added in v1.3.1

func DNSDumpsterScrape(out chan<- *AmassRequest, config *AmassConfig) Scraper

func DogpileScrape added in v1.3.1

func DogpileScrape(out chan<- *AmassRequest, config *AmassConfig) Scraper

func ExaleadScrape added in v1.5.0

func ExaleadScrape(out chan<- *AmassRequest, config *AmassConfig) Scraper

func FindSubDomainsScrape added in v1.3.2

func FindSubDomainsScrape(out chan<- *AmassRequest, config *AmassConfig) Scraper

func GoogleScrape added in v1.3.1

func GoogleScrape(out chan<- *AmassRequest, config *AmassConfig) Scraper

func HackerTargetScrape added in v1.3.2

func HackerTargetScrape(out chan<- *AmassRequest, config *AmassConfig) Scraper

func NetcraftScrape added in v1.3.1

func NetcraftScrape(out chan<- *AmassRequest, config *AmassConfig) Scraper

func PTRArchiveScrape added in v1.3.2

func PTRArchiveScrape(out chan<- *AmassRequest, config *AmassConfig) Scraper

func RiddlerScrape added in v1.5.0

func RiddlerScrape(out chan<- *AmassRequest, config *AmassConfig) Scraper

func RobtexScrape added in v1.3.1

func RobtexScrape(out chan<- *AmassRequest, config *AmassConfig) Scraper

func SiteDossierScrape added in v1.5.0

func SiteDossierScrape(out chan<- *AmassRequest, config *AmassConfig) Scraper

func ThreatCrowdScrape added in v1.3.1

func ThreatCrowdScrape(out chan<- *AmassRequest, config *AmassConfig) Scraper

func ThreatMinerScrape added in v1.5.1

func ThreatMinerScrape(out chan<- *AmassRequest, config *AmassConfig) Scraper

func VirusTotalScrape added in v1.3.1

func VirusTotalScrape(out chan<- *AmassRequest, config *AmassConfig) Scraper

func YahooScrape added in v1.3.1

func YahooScrape(out chan<- *AmassRequest, config *AmassConfig) Scraper

type ScraperService added in v1.3.0

type ScraperService struct {
	BaseAmassService
	// contains filtered or unexported fields
}

func NewScraperService added in v1.3.0

func NewScraperService(in, out chan *AmassRequest, config *AmassConfig) *ScraperService

func (*ScraperService) OnStart added in v1.3.0

func (ss *ScraperService) OnStart() error

func (*ScraperService) OnStop added in v1.3.0

func (ss *ScraperService) OnStop() error

type SweepService

type SweepService struct {
	BaseAmassService
	// contains filtered or unexported fields
}

func NewSweepService

func NewSweepService(in, out chan *AmassRequest, config *AmassConfig) *SweepService

func (*SweepService) AttemptSweep

func (ss *SweepService) AttemptSweep(req *AmassRequest)

AttemptSweep - Initiates a sweep of a subset of the addresses within the CIDR

func (*SweepService) OnStart

func (ss *SweepService) OnStart() error

func (*SweepService) OnStop

func (ss *SweepService) OnStop() error

type Wildcards added in v1.3.0

type Wildcards struct {
	// Requests are sent through this channel to check DNS wildcard matches
	Request chan *wildcard

	// The amass enumeration configuration
	Config *AmassConfig
}

func NewWildcardDetection added in v1.3.0

func NewWildcardDetection(config *AmassConfig) *Wildcards

func (*Wildcards) DetectWildcard added in v1.3.0

func (wd *Wildcards) DetectWildcard(req *AmassRequest) bool

DetectWildcard - Checks subdomains in the wildcard cache for matches on the IP address

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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