http

package
v3.0.0-...-6f57ffb Latest Latest
Warning

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

Go to latest
Published: Feb 25, 2023 License: Apache-2.0 Imports: 24 Imported by: 0

Documentation

Index

Constants

View Source
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

View Source
var DefaultClient *http.Client

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

View Source
var (
	// UserAgent is the default user agent used by Amass during HTTP requests.
	UserAgent string
)

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

func CleanName(name string) string

CleanName will clean up the names scraped from the web.

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

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

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

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.

func TLSConn

func TLSConn(ctx context.Context, host string, port int) (*tls.Conn, error)

TLSConn attempts to make a TLS connection with the host on the given port.

Types

type BasicAuth

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