Documentation ¶
Index ¶
- Constants
- Variables
- func CheckCookie(urlString string, cookieName string) bool
- func CleanName(name string) string
- func CopyCookies(src string, dest string)
- func Crawl(ctx context.Context, u string, scope []string, max int, ...) error
- func NamesFromCert(cert *x509.Certificate) []string
- func PullCertificateNames(ctx context.Context, addr string, ports []int) []string
- func TLSConn(ctx context.Context, host string, port int) (*tls.Conn, error)
- type BasicAuth
- type Header
- type Request
- type Response
Constants ¶
const ( // Accept is the default HTTP Accept header value used by Amass. Accept = "text/html,application/json,application/xhtml+xml,application/xml;q=0.5,*/*;q=0.2" // AcceptLang is the default HTTP Accept-Language header value used by Amass. AcceptLang = "en-US,en;q=0.5" )
Variables ¶
var DefaultClient *http.Client
DefaultClient is the same HTTP client used by the package methods.
var ( // UserAgent is the default user agent used by Amass during HTTP requests. UserAgent string )
Functions ¶
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 Crawl ¶
func Crawl(ctx context.Context, u string, scope []string, max int, callback func(*Request, *Response)) error
Crawl will spider the web page at the URL argument looking while staying within the scope provided.
func NamesFromCert ¶
func NamesFromCert(cert *x509.Certificate) []string
NamesFromCert parses DNS names out of a TLS certificate.
func PullCertificateNames ¶
PullCertificateNames attempts to pull a cert from one or more ports on an IP.
Types ¶
type Header ¶
Header represents the HTTP headers for requests and responses.
func HdrToAmassHeader ¶
HdrToAmassHeader converts a net/http Header to an Amass Header.
type Request ¶
Request represents the HTTP request in the Amass preferred format.
func ReqToAmassRequest ¶
ReqToAmassRequest converts a net/http Request to an Amass Request.
type Response ¶
type Response struct { Status string StatusCode int Proto string ProtoMajor int ProtoMinor int Header Header Body string Length int64 TLS *tls.ConnectionState }
Response represents the HTTP response in the Amass preferred format.
func RequestWebPage ¶
RequestWebPage returns the response headers, body, and status code for the provided URL when successful.
func RespToAmassResponse ¶
RespToAmassResponse converts a net/http Response to an Amass Response.