bettercap: github.com/bettercap/bettercap/modules/http_proxy Index | Files

package http_proxy

import "github.com/bettercap/bettercap/modules/http_proxy"

Index

Package Files

http_proxy.go http_proxy_base.go http_proxy_base_cookietracker.go http_proxy_base_filters.go http_proxy_base_hosttracker.go http_proxy_base_sslstriper.go http_proxy_cert_cache.go http_proxy_js_request.go http_proxy_js_response.go http_proxy_script.go

type CookieTracker Uses

type CookieTracker struct {
    sync.RWMutex
    // contains filtered or unexported fields
}

func NewCookieTracker Uses

func NewCookieTracker() *CookieTracker

func (*CookieTracker) Expire Uses

func (t *CookieTracker) Expire(req *http.Request) *http.Response

func (*CookieTracker) IsClean Uses

func (t *CookieTracker) IsClean(req *http.Request) bool

func (*CookieTracker) Track Uses

func (t *CookieTracker) Track(req *http.Request)

type HTTPProxy Uses

type HTTPProxy struct {
    Name        string
    Address     string
    Server      *http.Server
    Redirection *firewall.Redirection
    Proxy       *goproxy.ProxyHttpServer
    Script      *HttpProxyScript
    CertFile    string
    KeyFile     string
    Blacklist   []string
    Whitelist   []string
    // contains filtered or unexported fields
}

func NewHTTPProxy Uses

func NewHTTPProxy(s *session.Session) *HTTPProxy

func (*HTTPProxy) Configure Uses

func (p *HTTPProxy) Configure(address string, proxyPort int, httpPort int, scriptPath string, jsToInject string, stripSSL bool) error

func (*HTTPProxy) ConfigureTLS Uses

func (p *HTTPProxy) ConfigureTLS(address string, proxyPort int, httpPort int, scriptPath string, certFile string, keyFile string, jsToInject string, stripSSL bool) (err error)

func (*HTTPProxy) Debug Uses

func (p *HTTPProxy) Debug(format string, args ...interface{})

func (*HTTPProxy) Error Uses

func (p *HTTPProxy) Error(format string, args ...interface{})

func (*HTTPProxy) Fatal Uses

func (p *HTTPProxy) Fatal(format string, args ...interface{})

func (*HTTPProxy) Info Uses

func (p *HTTPProxy) Info(format string, args ...interface{})

func (*HTTPProxy) Start Uses

func (p *HTTPProxy) Start()

func (*HTTPProxy) Stop Uses

func (p *HTTPProxy) Stop() error

func (*HTTPProxy) TLSConfigFromCA Uses

func (p *HTTPProxy) TLSConfigFromCA(ca *tls.Certificate) func(host string, ctx *goproxy.ProxyCtx) (*tls.Config, error)

func (*HTTPProxy) Warning Uses

func (p *HTTPProxy) Warning(format string, args ...interface{})

type Host Uses

type Host struct {
    Hostname string
    Address  net.IP
    Resolved sync.WaitGroup
}

func NewHost Uses

func NewHost(name string) *Host

type HostTracker Uses

type HostTracker struct {
    sync.RWMutex
    // contains filtered or unexported fields
}

func NewHostTracker Uses

func NewHostTracker() *HostTracker

func (*HostTracker) Track Uses

func (t *HostTracker) Track(host, stripped string)

func (*HostTracker) Unstrip Uses

func (t *HostTracker) Unstrip(stripped string) *Host

type HttpProxy Uses

type HttpProxy struct {
    session.SessionModule
    // contains filtered or unexported fields
}

func NewHttpProxy Uses

func NewHttpProxy(s *session.Session) *HttpProxy

func (*HttpProxy) Author Uses

func (mod *HttpProxy) Author() string

func (*HttpProxy) Configure Uses

func (mod *HttpProxy) Configure() error

func (*HttpProxy) Description Uses

func (mod *HttpProxy) Description() string

func (*HttpProxy) Name Uses

func (mod *HttpProxy) Name() string

func (*HttpProxy) Start Uses

func (mod *HttpProxy) Start() error

func (*HttpProxy) Stop Uses

func (mod *HttpProxy) Stop() error

type HttpProxyScript Uses

type HttpProxyScript struct {
    *plugin.Plugin
    // contains filtered or unexported fields
}

func LoadHttpProxyScript Uses

func LoadHttpProxyScript(path string, sess *session.Session) (err error, s *HttpProxyScript)

func (*HttpProxyScript) OnCommand Uses

func (s *HttpProxyScript) OnCommand(cmd string) bool

func (*HttpProxyScript) OnRequest Uses

func (s *HttpProxyScript) OnRequest(original *http.Request) (jsreq *JSRequest, jsres *JSResponse)

func (*HttpProxyScript) OnResponse Uses

func (s *HttpProxyScript) OnResponse(res *http.Response) (jsreq *JSRequest, jsres *JSResponse)

type JSRequest Uses

type JSRequest struct {
    Client      map[string]string
    Method      string
    Version     string
    Scheme      string
    Path        string
    Query       string
    Hostname    string
    ContentType string
    Headers     string
    Body        string
    // contains filtered or unexported fields
}

func NewJSRequest Uses

func NewJSRequest(req *http.Request) *JSRequest

func (*JSRequest) GetHeader Uses

func (j *JSRequest) GetHeader(name, deflt string) string

func (*JSRequest) NewHash Uses

func (j *JSRequest) NewHash() string

func (*JSRequest) ParseForm Uses

func (j *JSRequest) ParseForm() map[string]string

func (*JSRequest) ReadBody Uses

func (j *JSRequest) ReadBody() string

func (*JSRequest) RemoveHeader Uses

func (j *JSRequest) RemoveHeader(name string)

func (*JSRequest) SetHeader Uses

func (j *JSRequest) SetHeader(name, value string)

func (*JSRequest) ToRequest Uses

func (j *JSRequest) ToRequest() (req *http.Request)

func (*JSRequest) UpdateHash Uses

func (j *JSRequest) UpdateHash()

func (*JSRequest) WasModified Uses

func (j *JSRequest) WasModified() bool

type JSResponse Uses

type JSResponse struct {
    Status      int
    ContentType string
    Headers     string
    Body        string
    // contains filtered or unexported fields
}

func NewJSResponse Uses

func NewJSResponse(res *http.Response) *JSResponse

func (*JSResponse) ClearBody Uses

func (j *JSResponse) ClearBody()

func (*JSResponse) GetHeader Uses

func (j *JSResponse) GetHeader(name, deflt string) string

func (*JSResponse) NewHash Uses

func (j *JSResponse) NewHash() string

func (*JSResponse) ReadBody Uses

func (j *JSResponse) ReadBody() string

func (*JSResponse) RemoveHeader Uses

func (j *JSResponse) RemoveHeader(name string)

func (*JSResponse) SetHeader Uses

func (j *JSResponse) SetHeader(name, value string)

func (*JSResponse) ToResponse Uses

func (j *JSResponse) ToResponse(req *http.Request) (resp *http.Response)

func (*JSResponse) UpdateHash Uses

func (j *JSResponse) UpdateHash()

func (*JSResponse) WasModified Uses

func (j *JSResponse) WasModified() bool

type SSLStripper Uses

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

func NewSSLStripper Uses

func NewSSLStripper(s *session.Session, enabled bool) *SSLStripper

func (*SSLStripper) Enable Uses

func (s *SSLStripper) Enable(enabled bool)

func (*SSLStripper) Enabled Uses

func (s *SSLStripper) Enabled() bool

func (*SSLStripper) Preprocess Uses

func (s *SSLStripper) Preprocess(req *http.Request, ctx *goproxy.ProxyCtx) (redir *http.Response)

sslstrip preprocessing, takes care of:

- handling stripped domains - making unknown session cookies expire

func (*SSLStripper) Process Uses

func (s *SSLStripper) Process(res *http.Response, ctx *goproxy.ProxyCtx)

Package http_proxy imports 33 packages (graph) and is imported by 5 packages. Updated 2019-06-20. Refresh now. Tools for package owners.