session

package
v0.0.0-...-650caf5 Latest Latest
Warning

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

Go to latest
Published: May 14, 2019 License: BSD-3-Clause Imports: 14 Imported by: 0

Documentation

Overview

Package session contains code to manage the interactive session, modules, environment, etc.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AsTag

func AsTag(name string) string

func Prompt

func Prompt(s *Session)

Types

type Configuration

type Configuration struct {
	Protocol            string   `json:"-"`
	InstrumentationPort int      `json:"-"`
	SkipExtensions      []string `json:"-"`

	//
	// Proxy rules
	//
	Proxy struct {
		Phishing string `json:"phishing"`
		Target   string `json:"destination"`

		SkipContentType []string `json:"skipContentType"`

		Transform struct {
			Base64 struct {
				Enabled bool     `json:"enabled"`
				Padding []string `json:"padding"`
			} `json:"base64"`

			Request struct {
				Header []string `json:"header"`
			} `json:"request"`

			Response struct {
				Header []string `json:"header"`
				Body   struct {
					Universal [][]string `json:"universal"`
					Custom    [][]string `json:"custom"`
				} `json:"body"`
			} `json:"response"`
		} `json:"transform"`

		Remove struct {
			Request struct {
				Header []string `json:"header"`
			} `json:"request"`

			Response struct {
				Header []string `json:"header"`
			} `json:"response"`
		} `json:"remove"`

		Drop []struct {
			Url        string `json:"url"`
			RedirectTo string `json:"redirectTo"`
		} `json:"drop"`

		Log struct {
			Enabled          bool          `json:"enabled"`
			FilePath         string        `json:"filePath"`
			BufferedLogDelay time.Duration `json:"bufferedLogDelay"`
		} `json:"log"`
	} `json:"proxy"`

	//
	// TLS
	//
	TLS struct {
		Enabled         bool   `json:"enabled"`
		Expand          bool   `json:"expand"`
		Certificate     string `json:"certificate"`
		CertificateFile string `json:"-"`
		Key             string `json:"key"`
		KeyFile         string `json:"-"`
		Root            string `json:"root"`
		RootFile        string `json:"-"`
	} `json:"tls"`

	Crawler struct {
		Enabled bool `json:"enabled"`
		Depth   int  `json:"depth"`
		UpTo    int  `json:"upto"`

		ExternalOriginPrefix string            `json:"externalOriginPrefix"`
		ExternalOrigins      []string          `json:"externalOrigins"`
		OriginsMapping       map[string]string `json:"-"`
	} `json:"crawler"`

	//
	// Necrobrowser
	//
	NecroBrowser struct {
		Enabled  bool     `json:"enabled"`
		Endpoint string   `json:"endpoint"`
		Token    string   `json:"token"`
		Profile  string   `json:"profile"`
		Keywords []string `json:"keywords"`
	} `json:"necrobrowser"`

	//
	// Static Server
	//
	StaticServer struct {
		Enabled   bool   `json:"enabled"`
		Port      int    `json:"port"`
		LocalPath string `json:"localPath"`
		URLPath   string `json:"urlPath"`
	} `json:"staticServer"`

	//
	// Tracking
	//
	Tracking struct {
		Enabled    bool   `json:"enabled"`
		Identifier string `json:"identifier"`
		Regex      string `json:"regex"`

		Urls struct {
			Credentials []string `json:"credentials"`
			AuthSession []string `json:"authSession"`
		} `json:"urls"`
		Params   []string `json:"params"`
		Patterns []struct {
			Label    string `json:"label"`
			Matching string `json:"matching"`
			Start    string `json:"start"`
			End      string `json:"end"`
		} `json:"patterns"`
	} `json:"tracking"`
}

Configuration struct for JSON configuration

type Module

type Module interface {
	Name() string
	Description() string
	Author() string
}

type Session

type Session struct {
	Options core.Options   `json:"options"`
	Config  *Configuration `json:"configuration"`
	Modules moduleList     `json:"modules"`
}

Session structure

func New

func New() (*Session, error)

New session

func (*Session) GetConfiguration

func (s *Session) GetConfiguration() (err error)

GetConfiguration returns the configuration object

func (*Session) Module

func (s *Session) Module(name string) (mod Module, err error)

Module retrieves a module from session modules

func (*Session) Register

func (s *Session) Register(mod Module, err error)

Register appends the provided module to the session

func (*Session) UpdateConfiguration

func (s *Session) UpdateConfiguration(externalOrigins, subdomains, uniqueDomains *[]string) (err error)

type SessionModule

type SessionModule struct {
	Session *Session
	Name    string
	// contains filtered or unexported fields
}

func NewSessionModule

func NewSessionModule(name string, s *Session) SessionModule

func (*SessionModule) Debug

func (m *SessionModule) Debug(format string, args ...interface{})

func (*SessionModule) Error

func (m *SessionModule) Error(format string, args ...interface{})

func (*SessionModule) Fatal

func (m *SessionModule) Fatal(format string, args ...interface{})

func (*SessionModule) Important

func (m *SessionModule) Important(format string, args ...interface{})

func (*SessionModule) Info

func (m *SessionModule) Info(format string, args ...interface{})

func (*SessionModule) Warning

func (m *SessionModule) Warning(format string, args ...interface{})

Jump to

Keyboard shortcuts

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