Documentation
¶
Index ¶
- Constants
- func AnySubdomainRegex() *regexp.Regexp
- func CIDRSubset(cidr *net.IPNet, addr string, num int) []net.IP
- func CheckCookie(urlString string, cookieName string) bool
- func CopyCookies(src string, dest string)
- func CopyString(src string) string
- func HexString(b []byte) string
- func IPv6NibbleFormat(ip string) string
- func IsIPv4(ip net.IP) bool
- func IsIPv6(ip net.IP) bool
- func NetFirstLast(cidr *net.IPNet) (net.IP, net.IP)
- func NetHosts(cidr *net.IPNet) []net.IP
- func NewUniqueElements(orig []string, add ...string) []string
- func RangeHosts(start, end net.IP) []net.IP
- func RemoveAsteriskLabel(s string) string
- func RequestWebPage(urlstring string, body io.Reader, hvals map[string]string, uid, secret string) (string, error)
- func ReverseIP(ip string) string
- func SubdomainRegex(domain string) *regexp.Regexp
- func UniqueAppend(orig []string, add ...string) []string
- type ParseCIDRs
- type ParseIPs
- type ParseInts
- type ParseStrings
- type Queue
- type Semaphore
- type SimpleSemaphore
- type StringFilter
- type TimedSemaphore
Constants ¶
const ( // IPv4RE is a regular expression that will match an IPv4 address. 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]?)" // SUBRE is a regular expression that will match on all subdomains once the domain is appended. SUBRE = "(([a-zA-Z0-9]{1}|[_a-zA-Z0-9]{1}[_a-zA-Z0-9-]{0,61}[a-zA-Z0-9]{1})[.]{1})+" )
const ( // UserAgent is the default user agent used by Amass during HTTP requests. UserAgent = "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/72.0.3626.119 Safari/537.36" // Accept is the default HTTP Accept header value used by Amass. Accept = "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8" // AcceptLang is the default HTTP Accept-Language header value used by Amass. AcceptLang = "en-US,en;q=0.8" )
Variables ¶
This section is empty.
Functions ¶
func AnySubdomainRegex ¶
AnySubdomainRegex returns a Regexp object initialized to match any DNS subdomain name.
func CIDRSubset ¶
CIDRSubset returns a subset of the IP addresses contained within the cidr parameter with num elements around the addr element.
func CheckCookie ¶
CheckCookie checks if a cookie exists in the cookie jar for a given host
func CopyCookies ¶
CopyCookies copies cookies from one domain to another. Some of our data sources rely on shared auth tokens and this avoids sending extra requests to have the site reissue cookies for the other domains.
func CopyString ¶
CopyString return a new string variable with the same value as the parameter.
func HexString ¶
HexString returns a string that is the hex representation of the byte slice parameter.
func IPv6NibbleFormat ¶
IPv6NibbleFormat expects an IPv6 address in the ip parameter and returns the address in nibble format.
func NetFirstLast ¶
NetFirstLast return the first and last IP address of the provided CIDR/netblock.
func NetHosts ¶
NetHosts returns a slice containing all the IP addresses within the CIDR provided by the parameter. This implementation was obtained/modified from the following: https://gist.github.com/kotakanbe/d3059af990252ba89a82
func NewUniqueElements ¶
NewUniqueElements removes elements that have duplicates in the original or new elements.
func RangeHosts ¶
RangeHosts returns all the IP addresses (inclusive) between the start and stop addresses provided by the parameters.
func RemoveAsteriskLabel ¶
RemoveAsteriskLabel returns the provided DNS name with all asterisk labels removed.
func RequestWebPage ¶
func RequestWebPage(urlstring string, body io.Reader, hvals map[string]string, uid, secret string) (string, error)
RequestWebPage returns a string containing the entire response for the urlstring parameter when successful.
func ReverseIP ¶
ReverseIP returns an IP address that is the ip parameter with the numbers reversed.
func SubdomainRegex ¶
SubdomainRegex returns a Regexp object initialized to match subdomain names that end with the domain provided by the parameter.
func UniqueAppend ¶
UniqueAppend behaves like the Go append, but does not add duplicate elements.
Types ¶
type ParseCIDRs ¶
ParseCIDRs implements the flag.Value interface.
func (*ParseCIDRs) Set ¶
func (p *ParseCIDRs) Set(s string) error
Set implements the flag.Value interface.
func (*ParseCIDRs) String ¶
func (p *ParseCIDRs) String() string
type ParseIPs ¶
ParseIPs implements the flag.Value interface.
type ParseInts ¶
type ParseInts []int
ParseInts implements the flag.Value interface.
type ParseStrings ¶
type ParseStrings []string
ParseStrings implements the flag.Value interface.
func (*ParseStrings) Set ¶
func (p *ParseStrings) Set(s string) error
Set implements the flag.Value interface.
func (*ParseStrings) String ¶
func (p *ParseStrings) String() string
type Queue ¶
Queue implements a FIFO data structure.
type Semaphore ¶
type Semaphore interface { // Acquire blocks until num resource counts have been obtained Acquire(num int) // TryAcquire attempts to obtain num resource counts without blocking TryAcquire(num int) bool // Release causes num resource counts to be released Release(num int) }
Semaphore is the interface for the several types of semaphore implemented by Amass.
func NewSimpleSemaphore ¶
NewSimpleSemaphore returns a SimpleSemaphore initialized to max resource counts.
type SimpleSemaphore ¶
type SimpleSemaphore struct {
// contains filtered or unexported fields
}
SimpleSemaphore implements a synchronization object type capable of being a counting semaphore.
func (*SimpleSemaphore) Acquire ¶
func (s *SimpleSemaphore) Acquire(num int)
Acquire blocks until num resource counts have been obtained.
func (*SimpleSemaphore) Release ¶
func (s *SimpleSemaphore) Release(num int)
Release causes num resource counts to be released.
func (*SimpleSemaphore) TryAcquire ¶
func (s *SimpleSemaphore) TryAcquire(num int) bool
TryAcquire attempts to obtain num resource counts without blocking. The method returns true when successful in acquiring the resource counts.
type StringFilter ¶
type StringFilter struct {
// contains filtered or unexported fields
}
StringFilter implements an object that performs filtering of strings to ensure that only unique items get through the filter.
func NewStringFilter ¶
func NewStringFilter() *StringFilter
NewStringFilter returns an initialized StringFilter.
func (*StringFilter) Duplicate ¶
func (sf *StringFilter) Duplicate(s string) bool
Duplicate checks if the name provided has been seen before by this filter.
type TimedSemaphore ¶
type TimedSemaphore struct {
// contains filtered or unexported fields
}
TimedSemaphore implements a synchronization object type capable of being a counting semaphore.
func (*TimedSemaphore) Acquire ¶
func (t *TimedSemaphore) Acquire(num int)
Acquire blocks until num resource counts have been obtained.
func (*TimedSemaphore) Release ¶
func (t *TimedSemaphore) Release(num int)
Release causes num resource counts to be released.
func (*TimedSemaphore) TryAcquire ¶
func (t *TimedSemaphore) TryAcquire(num int) bool
TryAcquire attempts to obtain num resource counts without blocking. The method returns true when successful in acquiring the resource counts.