requests

package
v3.23.3 Latest Latest
Warning

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

Go to latest
Published: Jun 20, 2023 License: Apache-2.0 Imports: 9 Imported by: 6

Documentation

Index

Constants

View Source
const (
	NONE     = "none"
	ALT      = "alt"
	GUESS    = "guess"
	ARCHIVE  = "archive"
	API      = "api"
	AXFR     = "axfr"
	BRUTE    = "brute"
	CERT     = "cert"
	CRAWL    = "crawl"
	DNS      = "dns"
	RIR      = "rir"
	EXTERNAL = "ext"
	SCRAPE   = "scrape"
)

Request tag types.

View Source
const (
	NewNameTopic       = "amass:newname"
	NewAddrTopic       = "amass:newaddr"
	SubDiscoveredTopic = "amass:newsub"
	ASNRequestTopic    = "amass:asnreq"
	NewASNTopic        = "amass:newasn"
	WhoisRequestTopic  = "amass:whoisreq"
	NewWhoisTopic      = "amass:whoisinfo"
	LogTopic           = "amass:log"
	OutputTopic        = "amass:output"
)

Request Pub/Sub topics used across Amass.

Variables

This section is empty.

Functions

func SanitizeDNSRequest

func SanitizeDNSRequest(req *DNSRequest)

SanitizeDNSRequest cleans the Name and Domain elements of the receiver.

func TrustedTag

func TrustedTag(tag string) bool

TrustedTag returns true when the tag parameter is of a type that should be trusted even facing DNS wildcards.

Types

type ASNCache

type ASNCache struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

ASNCache builds a cache of ASN and netblock information.

func NewASNCache

func NewASNCache() *ASNCache

NewASNCache returns an empty ASNCache for saving and searching ASN and netblock information.

func (*ASNCache) ASNSearch

func (c *ASNCache) ASNSearch(asn int) *ASNRequest

ASNSearch returns the cached ASN / netblock info associated with the provided asn parameter, or nil when not found in the cache.

func (*ASNCache) AddrSearch

func (c *ASNCache) AddrSearch(addr string) *ASNRequest

AddrSearch returns the cached ASN / netblock info that the addr parameter belongs in, or nil when not found in the cache.

func (*ASNCache) DescriptionSearch

func (c *ASNCache) DescriptionSearch(s string) []*ASNRequest

DescriptionSearch matches the provided string against description fields in the cache and returns the ASN / netblock info for matching entries.

func (*ASNCache) Update

func (c *ASNCache) Update(req *ASNRequest)

Update saves the information in ASNRequest into the ASNCache.

type ASNRequest

type ASNRequest struct {
	Address        string
	ASN            int
	Prefix         string
	CC             string
	Registry       string
	AllocationDate time.Time
	Description    string
	Netblocks      []string
	Tag            string
	Source         string
}

ASNRequest handles all autonomous system information needed by Amass.

func (*ASNRequest) Clone

func (a *ASNRequest) Clone() pipeline.Data

Clone implements pipeline Data.

func (*ASNRequest) MarkAsProcessed

func (a *ASNRequest) MarkAsProcessed()

MarkAsProcessed implements pipeline Data.

func (*ASNRequest) Valid

func (a *ASNRequest) Valid() bool

Valid performs input validation of the receiver.

type AddrRequest

type AddrRequest struct {
	Address string
	InScope bool
	Domain  string
	Tag     string
	Source  string
}

AddrRequest handles data needed throughout Service processing of a network address.

func (*AddrRequest) Clone

func (a *AddrRequest) Clone() pipeline.Data

Clone implements pipeline Data.

func (*AddrRequest) MarkAsProcessed

func (a *AddrRequest) MarkAsProcessed()

MarkAsProcessed implements pipeline Data.

func (*AddrRequest) Valid

func (a *AddrRequest) Valid() bool

Valid performs input validation of the receiver.

type AddressInfo

type AddressInfo struct {
	Address     net.IP     `json:"ip"`
	Netblock    *net.IPNet `json:"-"`
	CIDRStr     string     `json:"cidr"`
	ASN         int        `json:"asn"`
	Description string     `json:"desc"`
}

AddressInfo stores all network addressing info for the Output type.

type DNSAnswer

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

DNSAnswer is the type used by Amass to represent a DNS record.

type DNSRequest

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

DNSRequest handles data needed throughout Service processing of a DNS name.

func (*DNSRequest) Clone

func (d *DNSRequest) Clone() pipeline.Data

Clone implements pipeline Data.

func (*DNSRequest) MarkAsProcessed

func (d *DNSRequest) MarkAsProcessed()

MarkAsProcessed implements pipeline Data.

func (*DNSRequest) Valid

func (d *DNSRequest) Valid() bool

Valid performs input validation of the receiver.

type Output

type Output struct {
	Name      string        `json:"name"`
	Domain    string        `json:"domain"`
	Addresses []AddressInfo `json:"addresses"`
	Tag       string        `json:"tag"`
	Sources   []string      `json:"sources"`
}

Output contains all the output data for an enumerated DNS name.

func (*Output) Clone

func (o *Output) Clone() pipeline.Data

Clone implements pipeline Data.

func (*Output) Complete

func (o *Output) Complete(passive bool) bool

Complete checks that all the required fields have been populated.

func (*Output) MarkAsProcessed

func (o *Output) MarkAsProcessed()

MarkAsProcessed implements pipeline Data.

type ResolvedRequest

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

func (*ResolvedRequest) Clone

func (r *ResolvedRequest) Clone() pipeline.Data

Clone implements pipeline Data.

func (*ResolvedRequest) MarkAsProcessed

func (r *ResolvedRequest) MarkAsProcessed()

MarkAsProcessed implements pipeline Data.

func (*ResolvedRequest) Valid

func (r *ResolvedRequest) Valid() bool

Valid performs input validation of the receiver.

type SubdomainRequest

type SubdomainRequest struct {
	Name    string
	Domain  string
	Records []DNSAnswer
	Tag     string
	Source  string
	Times   int
}

SubdomainRequest handles subdomain data processed by enumeration.

func (*SubdomainRequest) Clone

func (s *SubdomainRequest) Clone() pipeline.Data

Clone implements pipeline Data.

func (*SubdomainRequest) MarkAsProcessed

func (s *SubdomainRequest) MarkAsProcessed()

MarkAsProcessed implements pipeline Data.

func (*SubdomainRequest) Valid

func (s *SubdomainRequest) Valid() bool

Valid performs input validation of the receiver.

type WhoisRequest

type WhoisRequest struct {
	Domain     string
	Company    string
	Email      string
	NewDomains []string
	Tag        string
	Source     string
}

WhoisRequest handles data needed throughout Service processing of reverse whois.

type ZoneXFRRequest

type ZoneXFRRequest struct {
	Name   string
	Domain string
	Server string
	Tag    string
	Source string
}

ZoneXFRRequest handles zone transfer requests.

func (*ZoneXFRRequest) Clone

func (z *ZoneXFRRequest) Clone() pipeline.Data

Clone implements pipeline Data.

func (*ZoneXFRRequest) MarkAsProcessed

func (z *ZoneXFRRequest) MarkAsProcessed()

MarkAsProcessed implements pipeline Data.

Jump to

Keyboard shortcuts

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