Documentation ¶
Index ¶
- Variables
- func BasicAuth(username, password string) string
- func BuildURI(paths ...string) string
- func CreateRequest(verb string, url string, payload string, followRedirect bool) (*http.Client, *http.Request, bool)
- func CreateRequestParams(params map[string]string) string
- func CreateRequestParamsEncoded(params map[string]string) string
- func DoRawHTTPRequest(rhost string, rport int, uri string, verb string) bool
- func DoRequest(client *http.Client, req *http.Request) (*http.Response, string, bool)
- func GenerateURL(rhost string, rport int, ssl bool, uri string) string
- func GetSetCookieValue(resp *http.Response, name string) (string, bool)
- func HTTPGetCache(url string) (*http.Response, string, bool)
- func HTTPSendAndRecv(verb string, url string, payload string) (*http.Response, string, bool)
- func HTTPSendAndRecvNoRedirect(verb string, url string, payload string) (*http.Response, string, bool)
- func HTTPSendAndRecvURLEncoded(verb string, url string, params map[string]string) (*http.Response, string, bool)
- func HTTPSendAndRecvURLEncodedAndHeaders(verb string, url string, params map[string]string, headers map[string]string) (*http.Response, string, bool)
- func HTTPSendAndRecvURLEncodedParams(verb string, url string, params map[string]string) (*http.Response, string, bool)
- func HTTPSendAndRecvURLEncodedParamsAndHeaders(verb string, url string, params map[string]string, headers map[string]string) (*http.Response, string, bool)
- func HTTPSendAndRecvWithHeaders(verb string, url string, payload string, headers map[string]string) (*http.Response, string, bool)
- func HTTPSendAndRecvWithHeadersNoRedirect(verb string, url string, payload string, headers map[string]string) (*http.Response, string, bool)
- func MixedConnect(host string, port int, ssl bool) (net.Conn, bool)
- func MultipartAddField(writer *multipart.Writer, name string, value string) bool
- func MultipartAddFile(writer *multipart.Writer, name, filename, ctype, value string) bool
- func MultipartCreateForm() (*strings.Builder, *multipart.Writer)
- func ParseCookies(resp *http.Response) string
- func SetRequestHeaders(req *http.Request, headers map[string]string)
- func TCPConnect(host string, port int) (net.Conn, bool)
- func TCPReadAmount(conn net.Conn, amount int) ([]byte, bool)
- func TCPWrite(conn net.Conn, data []byte) bool
- func TLSConnect(host string, port int) (net.Conn, bool)
- func UDPConnect(host string, port int) (*net.UDPConn, bool)
- func UDPReadAmount(conn *net.UDPConn, amount int) ([]byte, bool)
- func UDPWrite(conn *net.UDPConn, data []byte) bool
Constants ¶
This section is empty.
Variables ¶
var GlobalCommTimeout = 10
GlobalCommTimeout is the default timeout for all socket communications.
var GlobalUA string
GlobalUA is the default User-Agent for all go-exploit comms
Functions ¶
func BasicAuth ¶ added in v1.7.0
BasicAuth takes a username and password and returns a string suitable for an Authorization header.
func BuildURI ¶ added in v1.0.11
Using the variable amount of paths, return a URI without any extra '/'.
func CreateRequest ¶
func CreateRequest(verb string, url string, payload string, followRedirect bool) (*http.Client, *http.Request, bool)
Creates the HTTP client, generates the HTTP request, and sets the default user-agent.
func CreateRequestParams ¶
converts a map of strings into a single string in application/x-www-urlencoded format (but does not encode the params!)
func CreateRequestParamsEncoded ¶
CreateRequestParamsEncoded is the encoded version of CreateRequestParams.
func DoRawHTTPRequest ¶
Go doesn't always like sending our exploit URI so use this raw version. SSL not implemented.
func DoRequest ¶
Provided an HTTP client and a req, this function triggers the HTTP request and converts the response body to a string.
func GenerateURL ¶
Returns a valid HTTP/HTTPS URL provided the given input.
func GetSetCookieValue ¶ added in v1.8.0
Provided an HTTP request, find the Set-Cookie headers, and extract the value of the specified cookie. Example:.
func HTTPSendAndRecv ¶
Generic send HTTP request and receive response.
func HTTPSendAndRecvNoRedirect ¶
func HTTPSendAndRecvNoRedirect(verb string, url string, payload string) (*http.Response, string, bool)
Send an HTTP request but do not follow the 302 redirect.
func HTTPSendAndRecvURLEncoded ¶
func HTTPSendAndRecvURLEncoded(verb string, url string, params map[string]string) (*http.Response, string, bool)
Send an HTTP request, with the provided parameters in the params map stored in the body. Return the response and response body.
Note that this function *will not* attempt to url encode the params.
func HTTPSendAndRecvURLEncodedAndHeaders ¶
func HTTPSendAndRecvURLEncodedAndHeaders(verb string, url string, params map[string]string, headers map[string]string, ) (*http.Response, string, bool)
Send an HTTP request, with the provided parameters in the params map stored in the body, and with extra headers specified in the headers map. Return the response and response body.
Note that this function *will not* attempt to url encode the params.
func HTTPSendAndRecvURLEncodedParams ¶
func HTTPSendAndRecvURLEncodedParams(verb string, url string, params map[string]string) (*http.Response, string, bool)
Send an HTTP request, with the provided parameters in the params map URL encoded in the body. Return the response and response body.
Note that this function *will* attempt to url encode the params.
func HTTPSendAndRecvURLEncodedParamsAndHeaders ¶
func HTTPSendAndRecvURLEncodedParamsAndHeaders(verb string, url string, params map[string]string, headers map[string]string, ) (*http.Response, string, bool)
Send an HTTP request, with the provided parameters in the params map URL encoded in the body, and with extra headers specified in the headers map. Return the response and response body.
Note that this function *will* attempt to url encode the params.
func HTTPSendAndRecvWithHeaders ¶
func HTTPSendAndRecvWithHeaders(verb string, url string, payload string, headers map[string]string) (*http.Response, string, bool)
Send an HTTP request with extra headers specified in the headers map. Return the response and response body.
func HTTPSendAndRecvWithHeadersNoRedirect ¶
func HTTPSendAndRecvWithHeadersNoRedirect(verb string, url string, payload string, headers map[string]string, ) (*http.Response, string, bool)
this naming scheme is a little out of control.
func MixedConnect ¶ added in v1.0.17
Connections to the remote target with or without encryption depending on the ssl bool.
func MultipartAddField ¶
func MultipartAddFile ¶ added in v1.0.5
func MultipartCreateForm ¶ added in v1.0.6
func ParseCookies ¶ added in v1.0.9
ParseCookies parses an HTTP response and returns a string suitable for a Cookie header.
func SetRequestHeaders ¶
Provided a map of headers, this function loops through them and sets them in the http request.
func TCPConnect ¶
Connects to a remote target without encryption.
func TLSConnect ¶ added in v1.0.17
Connects to the remote target with encryption.
func UDPReadAmount ¶ added in v1.0.2
Types ¶
This section is empty.
Directories ¶
Path | Synopsis |
---|---|
Package ajp is a very basic (and incomplete) implementation of the AJPv13 protocol.
|
Package ajp is a very basic (and incomplete) implementation of the AJPv13 protocol. |
`msg.go` contains the logic for building, reading, accessing, and serializing RouterOS M2 messages.
|
`msg.go` contains the logic for building, reading, accessing, and serializing RouterOS M2 messages. |
Package rocketmq is a very basic (and incomplete) implementation of RocketMQ remoting protocol
|
Package rocketmq is a very basic (and incomplete) implementation of RocketMQ remoting protocol |