proxy

package
v0.0.0-...-2dd83b6 Latest Latest
Warning

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

Go to latest
Published: Apr 20, 2025 License: MIT Imports: 42 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddRequestToQueue

func AddRequestToQueue(w http.ResponseWriter, r *http.Request)

AddRequestToQueue godoc @Summary Add Request to Queue @Description add a request to the queue for scanning sites @Tags Requests @Security ApiKeyAuth @Param body body proxy.AddRequestToQueueParameters true "Request Details" @Success 200 @Failure 500 {string} string Error @Router /requests/queue [post]

func BulkRequestQueue

func BulkRequestQueue(w http.ResponseWriter, r *http.Request)

BulkRequestQueue godoc @Summary Add Multiple Requests to the Qeueue @Description add multiple requests to the queue for scanning sites @Tags Requests @Security ApiKeyAuth @Param body body proxy.BulkRequestQueueParameters true "Request and Injection Details" @Success 200 @Failure 500 {string} string Error @Router /requests/bulk_queue [post]

func CACertificate

func CACertificate(w http.ResponseWriter, r *http.Request)

CACertificate godoc @Summary Gets the root CA @Description returns the certificate authority root certificate @Tags Proxy @Produce plain @Security ApiKeyAuth @Success 200 {string} string certificate @Failure 500 {string} string Error @Router /proxy/ca_certificate.pem [get]

func CloseOutOfBandClient

func CloseOutOfBandClient()

func GetFuzzdbPayload

func GetFuzzdbPayload(w http.ResponseWriter, r *http.Request)

GetFuzzDB Payload godoc @Summary Get a fuzzdb file @Description gets a specific fuzzdb file @Tags Injection Operations @Produce json @Security ApiKeyAuth @Param file query string true "The file path of the fuzzdb file to fetch the payload for" @Success 200 {array} string @Failure 500 {string} string Error @Router /inject_operations/fuzzdb_payload [get]

func GetInjectPayloads

func GetInjectPayloads(w http.ResponseWriter, r *http.Request)

GetPayloads godoc @Summary Gets injection payloads @Description gets all available payloads available for injection @Tags Injection Operations @Produce json @Security ApiKeyAuth @Success 200 {object} proxy.PayloadEntry @Failure 500 {string} string Error @Router /inject_operations/payloads [get]

func GetInterceptedRequests

func GetInterceptedRequests(w http.ResponseWriter, r *http.Request)

GetInterceptRequests godoc @Summary Get Intercept Requests @Description gets a list of all requests which have been intercepted, which are awaiting a response @Tags Proxy @Produce json @Security ApiKeyAuth @Success 200 {array} project.InterceptedRequest @Failure 500 {string} string Error @Router /proxy/intercepted_requests [get]

func GetOOBURL

func GetOOBURL(w http.ResponseWriter, r *http.Request)

GetOOBURL godoc @Summary Get Out of Band URL @Description gets a unique URL which can be used to test out of band interactions @Tags Out of Band @Produce json @Security ApiKeyAuth @Success 200 {string} string @Failure 500 {string} string Error @Router /out_of_band/url [get]

func HandleInterceptSettingsRequest

func HandleInterceptSettingsRequest(w http.ResponseWriter, r *http.Request)

func HandleSettingsRequest

func HandleSettingsRequest(w http.ResponseWriter, r *http.Request)

func MakeRequest

func MakeRequest(w http.ResponseWriter, r *http.Request)

MakeRequest godoc @Summary Make a single request @Description makes a single request to a given server @Tags Requests @Accept json @Produce json @Security ApiKeyAuth @Param body body proxy.MakeRequestParameters true "Make Request Parameters in JSON format" @Success 200 {string} string Message @Failure 400 {string} string Error @Failure 500 {string} string Error @Router /requests/make [post]

func RestartListeners

func RestartListeners(settings *ProxySettings) error

RestartListeners restarts all proxy listeners, with the new addresses

func RunInjection

func RunInjection(w http.ResponseWriter, r *http.Request)

RunInjection godoc @Summary Run an Injection Operation @Description creates and runs an injection operation @Tags Injection Operations @Accept json @Produce json @Security ApiKeyAuth @Param body body project.InjectOperation true "Injection details in JSON format (not all fields can be set)" @Success 200 {string} string GUID @Failure 500 {string} string Error @Router /inject_operations/run [post]

func SaveSettings

func SaveSettings(settings *ProxySettings) error

func SetInterceptedResponse

func SetInterceptedResponse(w http.ResponseWriter, r *http.Request)

InterceptSettings godoc @Summary Modify Intercepted Request @Description set how an intercepted request will be responded to @Tags Proxy @Security ApiKeyAuth @Param body body proxy.InterceptedRequestResponse true "Proxy Intercept Response Object" @Success 200 @Failure 500 {string} string Error @Router /proxy/set_intercepted_response [put]

func StartHttpPreviewProxy

func StartHttpPreviewProxy(listener net.Listener) error

func StartListeners

func StartListeners() error

StartListeners starts all proxy listeners using either the default settings or the ones read from the configuration file

func StartOutOfBandClient

func StartOutOfBandClient() error

func StopListeners

func StopListeners() error

StopListeners stops all proxy listeners and closes the request queue

Types

type AddRequestToQueueParameters

type AddRequestToQueueParameters struct {
	Request  string `json:"request" example:"<base64 encoded request>"`
	Host     string `json:"host"`
	SSL      bool   `json:"ssl"`
	ScanID   string `json:"scan_id"`
	Payloads string `json:"payloads"`
}

type BulkRequestQueueParameters

type BulkRequestQueueParameters struct {
	Host         string                               `json:"host"`
	SSL          bool                                 `json:"ssl"`
	ScanID       string                               `json:"scan_id"`
	Replacements [][]string                           `json:"replacements"`
	Request      []project.InjectOperationRequestPart `json:"request"`
}

BulkRequestQueueParameters contains the parameters which are passed to the Bulk Request API call

type CertificateRecord

type CertificateRecord struct {
	CertificatePEM []byte
	PrivateKey     []byte
}

CertificateRecord contains the data required to present a valid certificate to browsers, and encrypt intercepted traffic

type InterceptSettings

type InterceptSettings struct {
	BrowserToServer bool
	ServerToBrowser bool
}

type InterceptedRequestResponse

type InterceptedRequestResponse struct {
	RequestGUID    string
	DataPacketGUID string
	Body           string `example:"<base64 encoded body>"`
	Direction      string `example:"Either browser_to_server or server_to_browser"`
	RequestAction  string `example:"One of: forward, forward_and_intercept_response or drop"`
}

type MakeRequestParameters

type MakeRequestParameters struct {
	RequestBase64 string `json:"request" example:"<base64 encoded request>"`
	Host          string `json:"host"`
	SSL           bool   `json:"ssl"`
	ScanID        string `json:"scan_id"`
	ClientCert    string `json:"client_cert"`
	ClientCertKey string `json:"client_cert_key"`
}

MakeRequestParameters contains the parameters which are passed to the Make Request API call

func (*MakeRequestParameters) Request

func (params *MakeRequestParameters) Request() []byte

Request returns the base64 decoded request

type PayloadEntry

type PayloadEntry struct {
	Filename       string
	IsDirectory    bool
	ResourcePath   string
	SamplePayloads []string
	SubEntries     []PayloadEntry
	Title          string
	PayloadCount   int
}

PayloadEntry contains a single entry within the payloads list

type PayloadFile

type PayloadFile struct {
	Title          string
	Filename       string
	SamplePayloads []string
}

type PayloadFileArray

type PayloadFileArray []PayloadFile

type PayloadOptions

type PayloadOptions struct {
	Attack     PayloadFileArray
	KnownFiles PayloadFileArray
}

PayloadOptions contains maps of filename[title] for each type of payload for injection

type ProxySettings

type ProxySettings struct {
	Http11ProxyAddr         string
	Http11UpstreamProxyAddr string
	MaxConnectionsPerHost   int
	Http11ProxyListening    bool

	OpenFile       string // cannot be set externally
	OpenTempFile   string // cannot be set externally
	OpenProcessPID int32  // cannot be set externally
}

func GetSettings

func GetSettings() (*ProxySettings, error)

Jump to

Keyboard shortcuts

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