coreproxy

package
v1.0.0-alpha.4 Latest Latest
Warning

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

Go to latest
Published: Sep 2, 2020 License: GPL-3.0 Imports: 29 Imported by: 0

Documentation

Index

Constants

View Source
const (
	CopyURLLabel      = "Copy URL"
	CopyBaseURLLabel  = "Copy base URL"
	RepeatLabel       = "Repeat"
	ClearHistoryLabel = "Clear History"
	AddToScopeLabel   = "Add Host to Scope"
)

Variables

View Source
var Stg = &Settings{
	IP:            "127.0.0.1",
	Port:          8080,
	Interceptor:   false,
	ReqIntercept:  true,
	RespIntercept: false,
}

Functions

This section is empty.

Types

type Controller

type Controller struct {
	core.ControllerModule
	Module *Coreproxy
	Gui    *Gui
	Sess   *core.Session
	Filter *model.Filter
	// contains filtered or unexported fields
}

Controller represents the controller for the main intercetp proxy

func LoadCoreProxyModule

func LoadCoreProxyModule(s *core.Session) *Controller

LoadCoreProxyModule loads the core proxy module in the given session

func NewController

func NewController(proxy *Coreproxy, proxygui *Gui, s *core.Session) *Controller

NewController creates a new controller for the core intercetp proxy

func (*Controller) ExecCommand

func (c *Controller) ExecCommand(m string, args ...interface{})

ExecCommand execs commands submitted by other modules

func (*Controller) GetGui

func (c *Controller) GetGui() core.GuiModule

GetGui returns the Gui of the current controller

func (*Controller) GetModule

func (c *Controller) GetModule() core.Module

GetModule returns the module of the current controller

type Coreproxy

type Coreproxy struct {
	core.Module

	Sess *core.Session

	Address string
	Port    int
	Proxyh  *goproxy.ProxyHttpServer
	Req     int
	Resp    int
	Srv     *http.Server
	OnReq   func(*http.Request, *goproxy.ProxyCtx) (*http.Request, *http.Response)
	OnResp  func(*http.Response, *goproxy.ProxyCtx) *http.Response
	// contains filtered or unexported fields
}

Coreproxy represents the intercept proxy

func NewCoreProxy

func NewCoreProxy(s *core.Session) *Coreproxy

NewCoreProxy creates a new intercept proxy

func (*Coreproxy) ChangeIPPort

func (p *Coreproxy) ChangeIPPort(ip string, port int) error

ChangeIPPort is used to change the ip and port of the current intercept proxy

func (*Coreproxy) Description

func (p *Coreproxy) Description() string

Description returns the description of the current module

func (*Coreproxy) Name

func (p *Coreproxy) Name() string

Name returns the name of the current module

func (*Coreproxy) Start

func (p *Coreproxy) Start() error

Start bind the proxy for listening

func (*Coreproxy) Status

func (p *Coreproxy) Status() bool

Status returns the status of the current module if any

func (*Coreproxy) Stop

func (p *Coreproxy) Stop() error

Stop stops the proxy

type Gui

type Gui struct {
	core.GuiModule

	Sess *core.Session

	ControllerInit        func()
	StartProxy            func(bool)
	StopProxy             func()
	RowClicked            func(int)
	ApplyFilters          func(bool)
	ResetFilters          func(bool)
	CheckReqInterception  func(bool)
	CheckRespInterception func(bool)
	CheckIgnoreHTTPS      func(bool)
	SaveCAClicked         func(bool)
	RightItemClicked      func(string, int)

	RequestTextEdit        *widgets.QPlainTextEdit
	EditedRequestTextEdit  *widgets.QPlainTextEdit
	ResponseTextEdit       *widgets.QPlainTextEdit
	EditedResponseTextEdit *widgets.QPlainTextEdit

	// Filter
	TextSearchLineEdit    *widgets.QLineEdit
	ShowScopeOnlyCheckBox *widgets.QCheckBox
	ScopeLineEdit         *widgets.QLineEdit
	ApplyFiltersButton    *widgets.QPushButton
	ResetFiltersButton    *widgets.QPushButton
	S100CheckBox          *widgets.QCheckBox
	S200CheckBox          *widgets.QCheckBox
	S300CheckBox          *widgets.QCheckBox
	S400CheckBox          *widgets.QCheckBox
	S500CheckBox          *widgets.QCheckBox
	ShowExtensionLineEdit *widgets.QLineEdit
	HideExtensionLineEdit *widgets.QLineEdit
	ShowOnlyCheckBox      *widgets.QCheckBox
	HideOnlyCheckBox      *widgets.QCheckBox

	// settings tab
	ListenerLineEdit      *widgets.QLineEdit
	StartStopButton       *widgets.QPushButton
	ReqInterceptCheckBox  *widgets.QCheckBox
	RespInterceptCheckBox *widgets.QCheckBox
	SaveCAButton          *widgets.QPushButton

	// interceptor
	ForwardButton           *widgets.QPushButton
	DropButton              *widgets.QPushButton
	InterceptorToggleButton *widgets.QPushButton
	InterceptorTextEdit     *widgets.QPlainTextEdit
	Toggle                  func(bool)
	Forward                 func(bool)
	Drop                    func(bool)
	// contains filtered or unexported fields
}

Gui represents the GUI of the main intercept proxy

func NewGui

func NewGui(s *core.Session) *Gui

NewGui creates a new Gui for the main intercetp proxy

func (*Gui) FileSaveAs

func (g *Gui) FileSaveAs(s string) bool

FileSaveAs saves the CA file

func (*Gui) GetModuleGui

func (g *Gui) GetModuleGui() interface{}

GetModuleGui returns the Gui for the current module

func (*Gui) GetSettings

func (g *Gui) GetSettings() interface{}

func (g *Gui) settingsTabGui() widgets.QWidget_ITF {

func (*Gui) HideAllTabs

func (g *Gui) HideAllTabs()

HideAllTabs hides the tabs used to view details of a single row in the history table

func (*Gui) SetRightClickMenu

func (g *Gui) SetRightClickMenu()

SetRightClickMenu sets the menu items when right clicking an item in the history table

func (*Gui) SetTableModel

func (g *Gui) SetTableModel(m *model.SortFilterModel)

SetTableModel sets the table model along with some column width to use in the history table

func (*Gui) ShowEditedReqTab

func (g *Gui) ShowEditedReqTab(editedReq string)

ShowEditedReqTab shows the edited request tab for the currently selected item in the history table

func (*Gui) ShowEditedRespTab

func (g *Gui) ShowEditedRespTab(editedResp string)

ShowEditedRespTab shows the edited response tab for the currently selected item in the history table

func (*Gui) ShowReqTab

func (g *Gui) ShowReqTab(req string)

ShowReqTab shows the request tab for the currently selected item in the history table

func (*Gui) ShowRespTab

func (g *Gui) ShowRespTab(resp string)

ShowRespTab shows the response tab for the currently selected item in the history table

func (*Gui) Title

func (g *Gui) Title() string

Title returns the time of this Gui

type Settings

type Settings struct {
	IP            string
	Port          int
	Interceptor   bool
	ReqIntercept  bool
	RespIntercept bool
}

Settings represents the settings for the core intercept proxy TODO: fix it because you also have core.Config

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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