tcp

package
v0.0.0-...-c534ef8 Latest Latest
Warning

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

Go to latest
Published: May 19, 2023 License: BSD-3-Clause Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AppendSendResults

func AppendSendResults(response Response, httpsData HTTPSData, results chan<- *Response)

func ConnSendRecv

func ConnSendRecv(InputServers []*InputServer, port uint, numRedirects int)

func ParseHTTPResponse

func ParseHTTPResponse(http string) (*zgrab2_http.Response, error)

func RequestWorker

func RequestWorker(jobs <-chan InputServer, results chan<- *Response, numRedirects int)

Types

type HTTPSData

type HTTPSData struct {
	StartTime           string
	EndTime             string
	IsDomainIncluded    bool
	Error               string
	Version             uint16
	HandshakeComplete   bool
	CipherSuite         uint16
	PeerCertificates    []byte
	HTTPResponseHeaders *zgrab2_http.Response
	HTTPResponseBody    string
	Redirects           []string
	RetryErrors         []string
}

func InitConn

func InitConn(host string, domain string) (*HTTPSData, *tls.Conn, error)

InitConn initiates a TLS connection to the host with the SNI field set to domain. Returns the parsed data from the TLS connection and the (open) connection object.

func SendHTTPRequest

func SendHTTPRequest(conn *tls.Conn, domain string, path string, httpsDataObject *HTTPSData) *HTTPSData

SendHTTPRequest sends a HTTP GET for the path with Host set to domain.

func SendHTTPRequestWithRedirects

func SendHTTPRequestWithRedirects(host string, domain string, numRedirects int) *HTTPSData

SendHTTPRequestWithRedirects initiates a TLS connection to the host with the SNI field set to domain. Then if successful, sends a HTTP GET request with Host header as domain, following up to numRedirects. Redirects determines the redirect host, domain, and path from the previously returned location and initiates a new TLS connection to the redirect host with the SNI field set to the redirect domain, then sends a HTTP GET request for the redirect path with Host header as the redirect domain. Returns the parsed data from the TLS connection and HTTP request.

type InputServer

type InputServer struct {
	Domain  string
	Ip      string
	Country string
}

type Response

type Response struct {
	Endpoint  InputServer
	Responses []HTTPSData
}

Jump to

Keyboard shortcuts

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