Documentation ¶
Index ¶
- Variables
- func ExtractHostsFromResponse(needles []*regexp.Regexp, haystack string) map[string]struct{}
- func ExtractHostsFromResponses(needles []*regexp.Regexp, haystacks []string) map[string]struct{}
- func FQDNTrim(name string) string
- func GetDepth(hostAddress string) (int, error)
- func GetETLD(hostAddress string) (string, error)
- func GetSubDomain(hostAddress string) (string, error)
- func GetSubDomainAndDomain(hostAddress string) (string, string, error)
- func IsBannedIP(ip string) bool
- func IsETLD(hostAddress string) bool
- func ParseArpa(arpa string) (string, bool)
- func ParseCookies(s string) []*http.Cookie
- func ParseHTML(dom string, fn HTMLParserFn) error
- func ParseIPv4Arpa(ipv4arpa string) (string, bool)
- func ParseIPv6Arpa(ipv4arpa string) (string, bool)
- func SpecialETLD(hostAddress string) string
- func SplitAddresses(hostAddress string) ([]string, error)
- func ToIPv6(in []byte) string
- type HTMLParserFn
Constants ¶
This section is empty.
Variables ¶
var BannedURLs = []string{
"https://169.254.*",
"https://127.*",
"https://[::1]*",
"https://[fe80::*]*",
"https://10.*",
"https://192.168.*",
"http://169.254.*",
"http://127.*",
"http://[::1]*",
"http://[fe80::*]*",
"http://10.*",
"http://192.168.*",
}
BannedURLs so we don't initiate bad requests
var (
ErrHostIsIPAddress = errors.New("provided host is an ip address")
)
var SpecialCaseTLDs = map[string]struct{}{}/* 333 elements not displayed */
Functions ¶
func ExtractHostsFromResponse ¶
ExtractHostsFromResponse returns potential hosts from a response TODO: make this a bit more robust.
func ExtractHostsFromResponses ¶
ExtractHostsFromResponses returns potential hosts from a response
func GetDepth ¶
GetDepth returns how many subdomains the host address has: ex: test1.test2.example.com would return 3. ex2: test2.example.com would return 2 ex3: test1.amazon.co.uk would return 2
func GetSubDomain ¶
GetSubDomain returns the last sub domain part of a host address
func GetSubDomainAndDomain ¶
GetSubDomainAndDomain returns the subdomain + the rest of the domain, or error
func IsBannedIP ¶
func IsETLD ¶
IsETLD returns true iff hostAddress is an etld amazon.co.uk == true sub.amazon.co.uk == false
func ParseCookies ¶
Parse cookies by creating a fake response
func ParseHTML ¶
func ParseHTML(dom string, fn HTMLParserFn) error
func ParseIPv4Arpa ¶
ParseIPv4Arpa uses sscanf to ensure we only get integer values for the in-addr.arpa string.
func ParseIPv6Arpa ¶
ParseIPv6Arpa uses sscanf to ensure we only get integer values for the in-addr.arpa string.
func SpecialETLD ¶
SpecialETLD case where publicsuffix doesn't fit what we want to test for etlds.
func SplitAddresses ¶
SplitAddresses preserving etld. sub1.sub2.test.co.uk would become []string{"test.co.uk", "sub2.test.co.uk"} returns nil if hostAddress = eltd and does not return the original address that was supplied.