protocol

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Sep 8, 2023 License: Apache-2.0 Imports: 15 Imported by: 10

Documentation

Index

Constants

This section is empty.

Variables

View Source
var GlobalUA = "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36" +
	"(KHTML, like Gecko) Chrome/105.0.0.0 Safari/537.36 Edg/105.0.1343.33"

Functions

func BuildURI added in v1.0.11

func BuildURI(paths ...string) string

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)

func CreateRequestParams

func CreateRequestParams(params map[string]string) string

converts a map of strings into a single string in application/x-www-urlencoded format (but does not encode the params!)

func CreateRequestParamsEncoded

func CreateRequestParamsEncoded(params map[string]string) string

CreateRequestParamsEncoded is the encoded version of CreateRequestParams.

func DoRawHTTPRequest

func DoRawHTTPRequest(rhost string, rport int, uri string, verb string) bool

Go doesn't always like sending our exploit URI so use this raw version. SSL not implemented.

func DoRequest

func DoRequest(client *http.Client, req *http.Request) (*http.Response, string, bool)

func GenerateURL

func GenerateURL(rhost string, rport int, ssl bool, uri string) string

Returns a valid HTTP/HTTPS URL provided the given input.

func HTTPSendAndRecv

func HTTPSendAndRecv(verb string, url string, payload string) (*http.Response, string, bool)

func HTTPSendAndRecvNoRedirect

func HTTPSendAndRecvNoRedirect(verb string, url string, payload string) (*http.Response, string, bool)

func HTTPSendAndRecvURLEncoded

func HTTPSendAndRecvURLEncoded(verb string, url string, params map[string]string) (*http.Response, string, bool)

func HTTPSendAndRecvURLEncodedAndHeaders

func HTTPSendAndRecvURLEncodedAndHeaders(verb string, url string, params map[string]string,
	headers map[string]string,
) (*http.Response, string, bool)

func HTTPSendAndRecvURLEncodedParams

func HTTPSendAndRecvURLEncodedParams(verb string, url string, params map[string]string) (*http.Response, string, bool)

func HTTPSendAndRecvURLEncodedParamsAndHeaders

func HTTPSendAndRecvURLEncodedParamsAndHeaders(verb string, url string, params map[string]string,
	headers map[string]string,
) (*http.Response, string, bool)

func HTTPSendAndRecvWithHeaders

func HTTPSendAndRecvWithHeaders(verb string, url string, payload string, headers map[string]string) (*http.Response, string, bool)

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

func MixedConnect(host string, port int, ssl bool) (net.Conn, bool)

Connections to the remote target with or without encryption depending on the ssl bool.

func MultipartAddField

func MultipartAddField(writer *multipart.Writer, name string, value string) bool

func MultipartAddFile added in v1.0.5

func MultipartAddFile(writer *multipart.Writer, name, filename, ctype, value string) bool

func MultipartCreateForm added in v1.0.6

func MultipartCreateForm() (*strings.Builder, *multipart.Writer)

func ParseCookies added in v1.0.9

func ParseCookies(resp *http.Response) string

ParseCookies parses an HTTP response and returns a string suitable for a Cookie header.

func SetRequestHeaders

func SetRequestHeaders(req *http.Request, headers map[string]string)

func TCPConnect

func TCPConnect(host string, port int) (net.Conn, bool)

Connects to a remote target without encryption.

func TCPReadAmount

func TCPReadAmount(conn net.Conn, amount int) ([]byte, bool)

func TCPWrite

func TCPWrite(conn net.Conn, data []byte) bool

func TLSConnect added in v1.0.17

func TLSConnect(host string, port int) (net.Conn, bool)

Connects to the remote target with encryption.

func UDPConnect added in v1.0.2

func UDPConnect(host string, port int) (*net.UDPConn, bool)

func UDPReadAmount added in v1.0.2

func UDPReadAmount(conn *net.UDPConn, amount int) ([]byte, bool)

func UDPWrite added in v1.0.2

func UDPWrite(conn *net.UDPConn, data []byte) bool

Types

This section is empty.

Directories

Path Synopsis
`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

Jump to

Keyboard shortcuts

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