http

package
v3.11.2 Latest Latest
Warning

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

Go to latest
Published: Jan 28, 2021 License: Apache-2.0 Imports: 24 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// UserAgent is the default user agent used by Amass during HTTP requests.
	UserAgent = "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/87.0.4280.49 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

View Source
var DefaultClient *http.Client

DefaultClient is the same HTTP client used by the package methods.

Functions

func CheckCookie

func CheckCookie(urlString string, cookieName string) bool

CheckCookie checks if a cookie exists in the cookie jar for a given host

func CleanName added in v3.10.2

func CleanName(name string) string

CleanName will clean up the names scraped from the web.

func ClientCountryCode

func ClientCountryCode(ctx context.Context) string

ClientCountryCode returns the country code for the public-facing IP address for the host of the process.

func CopyCookies

func CopyCookies(src string, dest string)

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 added in v3.10.2

func Crawl(ctx context.Context, u string, scope []string, max int, filter stringfilter.Filter) ([]string, error)

Crawl will spider the web page at the URL argument looking for DNS names within the scope argument.

func PullCertificateNames

func PullCertificateNames(ctx context.Context, addr string, ports []int) []string

PullCertificateNames attempts to pull a cert from one or more ports on an IP.

func RequestWebPage

func RequestWebPage(ctx context.Context, u string, body io.Reader, hvals map[string]string, auth *BasicAuth) (string, error)

RequestWebPage returns a string containing the entire response for the provided URL when successful.

Types

type BasicAuth added in v3.11.2

type BasicAuth struct {
	Username string
	Password string
}

BasicAuth contains the data used for HTTP basic authentication.

Jump to

Keyboard shortcuts

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