amass

package
v2.1.0+incompatible Latest Latest
Warning

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

Go to latest
Published: Jun 6, 2018 License: Apache-2.0 Imports: 24 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Version string = "v2.1.0"
	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"

	// Node types used in the Maltego local transform
	TypeNorm int = iota
	TypeNS
	TypeMX
	TypeWeb
)
View Source
const (
	// 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 HTMLEnd string = `` /* 151-byte string literal not displayed */
View Source
const HTMLStart string = `` /* 1589-byte string literal not displayed */

Variables

View Source
var (
	// Public & free DNS servers
	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",
	}

	CustomResolvers = []string{}
)

Functions

func AnySubdomainRegex added in v1.2.0

func AnySubdomainRegex() *regexp.Regexp

func CIDRRequest

func CIDRRequest(cidr *net.IPNet) (int, string)

func CIDRSubset added in v1.2.1

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

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

func CheckConfig

func CheckConfig(config *AmassConfig) error

func DNSDialContext

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

func DialContext

func DialContext(ctx context.Context, network, address string) (net.Conn, 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 IPRequest

func IPRequest(addr string) (int, *net.IPNet, string)

func IPv6NibbleFormat

func IPv6NibbleFormat(ip string) string

func LookupIPHistory

func LookupIPHistory(domain string) []string

LookupIPHistory - Attempts to obtain IP addresses used by a root domain name

func NetHosts added in v1.2.0

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

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 NextResolverAddress

func NextResolverAddress() string

NextResolverAddress - Requests the next server

func PullCertificate

func PullCertificate(addr string, config *AmassConfig, add bool)

pullCertificate - Attempts to pull a cert from several ports on an IP

func RangeHosts added in v1.2.0

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

func ReverseDNS

func ReverseDNS(ip string) (string, error)

func ReverseIP added in v1.3.0

func ReverseIP(ip string) string

func ReverseWhois

func ReverseWhois(domain string) []string

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

func SetCustomResolvers

func SetCustomResolvers(resolvers []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
}

func ASNRequest

func ASNRequest(asn int) *ASRecord

type AlterationService

type AlterationService struct {
	BaseAmassService
}

func NewAlterationService

func NewAlterationService(config *AmassConfig) *AlterationService

func (*AlterationService) OnStart

func (as *AlterationService) OnStart() error

func (*AlterationService) OnStop

func (as *AlterationService) OnStop() error

type AmassAddressInfo

type AmassAddressInfo struct {
	Address     net.IP
	Netblock    *net.IPNet
	ASN         int
	Description string
}

type AmassConfig

type AmassConfig struct {
	sync.Mutex

	Graph *Graph

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

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

	// The Neo4j URL used by the bolt driver to connect with the database
	Neo4jPath string
	// 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) Domains

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

func (*AmassConfig) IsDomainInScope

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

type AmassOutput

type AmassOutput struct {
	Name      string
	Domain    string
	Addresses []AmassAddressInfo
	Tag       string
	Source    string
	Type      int
}

type AmassRequest

type AmassRequest struct {
	Name    string
	Domain  string
	Records []DNSAnswer
	Tag     string
	Source  string
}

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

	NextRequest() *AmassRequest
	SendRequest(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(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) IsActive

func (bas *BaseAmassService) IsActive() bool

func (*BaseAmassService) IsStarted

func (bas *BaseAmassService) IsStarted() bool

func (*BaseAmassService) IsStopped

func (bas *BaseAmassService) IsStopped() bool

func (*BaseAmassService) NextRequest

func (bas *BaseAmassService) NextRequest() *AmassRequest

func (*BaseAmassService) OnStart

func (bas *BaseAmassService) OnStart() error

func (*BaseAmassService) OnStop

func (bas *BaseAmassService) OnStop() error

func (*BaseAmassService) Quit

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

func (*BaseAmassService) SendRequest

func (bas *BaseAmassService) SendRequest(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(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 ResolveDNS

func ResolveDNS(name, qtype string) ([]DNSAnswer, error)

type DNSService

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

func NewDNSService

func NewDNSService(config *AmassConfig) *DNSService

func (*DNSService) DetectWildcard

func (ds *DNSService) DetectWildcard(req *AmassRequest) bool

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

func (*DNSService) OnStart

func (ds *DNSService) OnStart() error

func (*DNSService) OnStop

func (ds *DNSService) OnStop() error

func (*DNSService) SubdomainToDomain

func (ds *DNSService) SubdomainToDomain(name string) string

type DataManagerService

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

func NewDataManagerService

func NewDataManagerService(config *AmassConfig) *DataManagerService

func (*DataManagerService) AttemptSweep

func (dms *DataManagerService) AttemptSweep(name, domain, addr string, cidr *net.IPNet)

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

func (*DataManagerService) OnStart

func (dms *DataManagerService) OnStart() error

func (*DataManagerService) OnStop

func (dms *DataManagerService) OnStop() error

type Edge

type Edge struct {
	From, To int
	Label    string
	// contains filtered or unexported fields
}

type Graph

type Graph struct {
	sync.Mutex
	Domains    map[string]*Node
	Subdomains map[string]*Node
	Addresses  map[string]*Node
	PTRs       map[string]*Node
	Netblocks  map[string]*Node
	ASNs       map[int]*Node
	// contains filtered or unexported fields
}

func NewGraph

func NewGraph() *Graph

func (*Graph) NewEdge

func (g *Graph) NewEdge(from, to int, label string) *Edge

func (*Graph) NewNode

func (g *Graph) NewNode(label string) *Node

func (*Graph) ToVisjs

func (g *Graph) ToVisjs() string

type Neo4j

type Neo4j struct {
	// contains filtered or unexported fields
}

func NewNeo4j

func NewNeo4j(url string) (*Neo4j, error)

url param will typically look like the following: neo4j:DoNotUseThisPassword@localhost:7687

type Node

type Node struct {
	Edges      []int
	Labels     []string
	Properties map[string]string
	// contains filtered or unexported fields
}

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

Jump to

Keyboard shortcuts

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