proxy

package
v1.0.15 Latest Latest
Warning

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

Go to latest
Published: Jun 18, 2026 License: MIT Imports: 23 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type EndpointRecorder added in v1.0.1

type EndpointRecorder struct {
	// contains filtered or unexported fields
}

EndpointRecorder accumulates observed endpoints from intercepted traffic and exports them as an OpenAPI 3.0 document for later reuse.

func NewEndpointRecorder added in v1.0.1

func NewEndpointRecorder() *EndpointRecorder

NewEndpointRecorder creates an empty recorder.

func (*EndpointRecorder) Count added in v1.0.1

func (er *EndpointRecorder) Count() int

Count returns how many distinct endpoints have been recorded.

func (*EndpointRecorder) ExportOpenAPI added in v1.0.1

func (er *EndpointRecorder) ExportOpenAPI(path string) error

ExportOpenAPI writes an OpenAPI 3.0 document to the given path.

func (*EndpointRecorder) Record added in v1.0.1

func (er *EndpointRecorder) Record(r *http.Request, reqBody []byte, statusCode int)

Record ingests one observed request/response pair.

type ObservedEndpoint added in v1.0.1

type ObservedEndpoint struct {
	Method       string
	Host         string
	Scheme       string
	RawPath      string            // first observed concrete path
	TemplatePath string            // path with dynamic segments replaced by {param}
	QueryParams  map[string]string // param name -> sample value
	HeaderParams map[string]string // non-standard request headers -> sample
	BodyType     string            // application/json, form, etc.
	BodySample   string            // a sanitized sample body
	BodyFields   map[string]string // for JSON/form: field name -> inferred type
	StatusCodes  map[int]bool      // observed response status codes
	Hits         int               // how many times seen
}

ObservedEndpoint holds everything learned about one endpoint.

type Proxy

type Proxy struct {
	OnFinding func(*vulns.Finding)
	// contains filtered or unexported fields
}

Proxy is a MITM HTTP/HTTPS proxy with light fuzzing.

func NewProxy

func NewProxy(addr string) (*Proxy, error)

NewProxy creates a proxy with a fresh CA.

func (*Proxy) EndpointCount added in v1.0.1

func (p *Proxy) EndpointCount() int

EndpointCount returns how many distinct endpoints were observed.

func (*Proxy) ExportCA

func (p *Proxy) ExportCA(path string) error

ExportCA writes the CA cert PEM to a file.

func (*Proxy) ExportEndpoints added in v1.0.1

func (p *Proxy) ExportEndpoints(path string) error

ExportEndpoints writes the discovered endpoints as an OpenAPI 3.0 spec.

func (*Proxy) Findings

func (p *Proxy) Findings() []*vulns.Finding

Findings returns all collected findings.

func (*Proxy) ServeHTTP

func (p *Proxy) ServeHTTP(w http.ResponseWriter, r *http.Request)

func (*Proxy) SetScope added in v1.0.2

func (p *Proxy) SetScope(hosts []string)

SetScope restricts active fuzzing to hosts matching the given suffixes. Empty scope means everything is in scope. Recon mapping is never gated.

func (*Proxy) Start

func (p *Proxy) Start() error

Start begins listening.

Jump to

Keyboard shortcuts

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