typo

package
v0.0.0-...-c7ec0aa Latest Latest
Warning

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

Go to latest
Published: Nov 18, 2022 License: GPL-3.0 Imports: 26 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Extras = NewRegistry()

Extras is the registry for extra functions

View Source
var Filters = NewRegistry()

Filters ...

View Source
var Typos = NewRegistry()

Typos ...

Functions

This section is empty.

Types

type BasicConfig

type BasicConfig struct {
	Domains     []string `json:"domains,omitempty"`
	Keyboards   []string `json:"keyboards,omitempty"`
	Filters     []string `json:"filters,omitempty"`
	Typos       []string `json:"typos,omitempty"`
	Funcs       []string `json:"funcs,omitempty"`
	Storage     []string `json:"storage,omitempty"`
	Concurrency int      `json:"concurrency,omitempty"`
	Format      string   `json:"format,omitempty"`
	File        string   `json:"file,omitempty"`
	Verbose     bool     `json:"verbose,omitempty"`
	Timing      Timing   `json:"timing,omitempty"`
}

BasicConfig ...

func (*BasicConfig) Config

func (b *BasicConfig) Config() (c Config)

Config creates a Config

type Config

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

Config ...

func CobraConfig

func CobraConfig(cmd *cobra.Command, args []string) (c Config)

CobraConfig creates a configuration from a cobra command and arguments

func NewConfig

func NewConfig(basic BasicConfig) (config *Config)

NewConfig ...

func (*Config) GetConcurrency

func (c *Config) GetConcurrency(concurrency int)

GetConcurrency ...

func (*Config) GetDomains

func (c *Config) GetDomains(args []string)

GetDomains ...

func (*Config) GetFile

func (c *Config) GetFile(file string)

GetFile ...

func (*Config) GetFilters

func (c *Config) GetFilters(filters []string)

GetFilters ...

func (*Config) GetFormat

func (c *Config) GetFormat(format string)

GetFormat ...

func (*Config) GetFuncs

func (c *Config) GetFuncs(funcs []string)

GetFuncs ...

func (*Config) GetHeaders

func (c *Config) GetHeaders(funcs []Module)

GetHeaders ...

func (*Config) GetKeyboards

func (c *Config) GetKeyboards(keyboards []string)

GetKeyboards retrieves a list of keyboards

func (*Config) GetTiming

func (c *Config) GetTiming(delay, random time.Duration)

GetTiming ...

func (*Config) GetTypos

func (c *Config) GetTypos(typos []string)

GetTypos ...

func (*Config) GetVerbose

func (c *Config) GetVerbose(verbose bool)

GetVerbose ...

type DNS

type DNS struct {
	IPv4  []string    `json:"ipv4,omitempty"`
	IPv6  []string    `json:"ip46,omitempty"`
	NS    []dnsLib.NS `json:"ns,omitempty"`
	MX    []dnsLib.MX `json:"mx,omitempty"`
	CName []string    `json:"cname,omitempty"`
	TXT   []string    `json:"txt,omitempty"`
	// contains filtered or unexported fields
}

DNS ...

type Domain

type Domain struct {
	Subdomain string `json:"subdomain,omitempty"`
	Domain    string `json:"domain,omitempty"`
	Suffix    string `json:"suffix,omitempty"`
	Meta      Meta   `json:"meta,omitempty"`
	Live      bool   `json:"live,omitempty"`
}

Domain ...

func (*Domain) Idna

func (d *Domain) Idna() (punycode string)

Idna ...

func (*Domain) String

func (d *Domain) String() (domain string)

String ...

type ElasticStorage

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

ElasticStorage ...

func NewElasticsearch

func NewElasticsearch() (es ElasticStorage, err error)

NewElasticsearch ...

func (*ElasticStorage) Query

func (es *ElasticStorage) Query(r Domain) (res []Domain)

Query ...

func (*ElasticStorage) Save

func (es *ElasticStorage) Save(r Domain)

Save ...

type Meta

type Meta struct {
	Levenshtein int              `json:"Levenshtein,omitempty"`
	IDNA        string           `json:"idna,omitempty"`
	IP          []string         `json:"ip,omitempty"`
	Redirect    string           `json:"redirect,omitempty"`
	HTTP        httpLib.Response `json:"http,omitempty"`
	Geo         geoLib.Country   `json:"geo,omitempty"`
	DNS         DNS              `json:"dns,omitempty"`
	SSDeep      string           `json:"ssdeep,omitempty"`
	Similarity  int              `json:"similarity,omitempty"`
}

Meta ...

type Metadater

type Metadater interface {
	String() string
	Object() interface{}
}

Metadater ...

type Metric

type Metric struct {
	Time        int      `json:"time,omitempty"`
	Name        string   `json:"name,omitempty"`
	Variant     Domain   `json:"variant,omitempty"`
	TypoMetrics []Metric `json:"typometrics,omitempty"`
	InfoMetrics []Metric `json:"infometrics,omitempty"`
	Result      Result   `json:"result,omitempty"`
}

Metric ...

func (*Metric) Progress

func (m *Metric) Progress()

Progress ...

type Module

type Module struct {
	Code        string     `json:"code,omitempty"`
	Name        string     `json:"name,omitempty"`
	Description string     `json:"description,omitempty"`
	Fields      []string   `json:"-"`
	Exe         ModuleFunc `json:"-"`
}

Module ...

func (*Module) Exec

func (m *Module) Exec(res Result) []Result

Exec ...

func (*Module) Headers

func (m *Module) Headers() []string

Headers ...

type ModuleFunc

type ModuleFunc func(Result) []Result

ModuleFunc defines a function to register typos.

type Moduler

type Moduler interface {
	Exec(Result) []Result
	Headers() []string
}

Moduler ...

type OutputResult

type OutputResult map[string]interface{}

OutputResult ...

type Register

type Register interface {
	Set(string, ...Module)
	Get(...string) []Module
}

Register ...

type Registry

type Registry map[string][]Module

Registry ...

func NewRegistry

func NewRegistry() Registry

NewRegistry ...

func (Registry) Get

func (reg Registry) Get(names ...string) (mods []Module)

Get ...

func (Registry) Set

func (reg Registry) Set(name string, mod ...Module)

Set ...

type Result

type Result struct {
	Keyboards []languages.Keyboard `json:"-"`
	Languages []languages.Language `json:"-"`
	Original  Domain               `json:"original,omitempty"`
	Variant   Domain               `json:"variant,omitempty"`
	Typo      Module               `json:"typo,omitempty"`
	Data      map[string]string    `json:"data,omitempty"`
}

Result ...

func (*Result) GetData

func (m *Result) GetData(key string) string

GetData ...

func (*Result) SetData

func (m *Result) SetData(key string, obj string)

SetData ...

type Statser

type Statser interface{}

Statser ...

type Storager

type Storager interface {
	Query(Domain) []Domain
	Save(Domain)
}

Storager stores and queries result records

type Timing

type Timing struct {
	Delay  time.Duration `json:"delay,omitempty"`
	Random time.Duration `json:"random,omitempty"`
}

Timing ...

type Typosquatting

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

Typosquatting ...

func New

func New(conf Config) Typosquatting

New ...

func (*Typosquatting) Batch

func (typ *Typosquatting) Batch() (res []Result)

Batch returns all the results at once

func (*Typosquatting) Dedup

func (typ *Typosquatting) Dedup(in <-chan Result) <-chan Result

Dedup filters the results for unique variations of domains

func (*Typosquatting) DistChain

func (typ *Typosquatting) DistChain(in <-chan Result) <-chan Result

DistChain creates workers of chained functions

func (*Typosquatting) Execute

func (typ *Typosquatting) Execute()

Execute starts the program and outputs results. Primarily used for CLI tools

func (*Typosquatting) FilterChain

func (typ *Typosquatting) FilterChain(in <-chan Result) <-chan Result

FilterChain ...

func (*Typosquatting) FuncChain

func (typ *Typosquatting) FuncChain(funcs []Module, in <-chan Result) <-chan Result

FuncChain creates a chain of information gathering functions

func (*Typosquatting) GenTypoConfig

func (typ *Typosquatting) GenTypoConfig() <-chan Result

GenTypoConfig ...

func (*Typosquatting) Output

func (typ *Typosquatting) Output(in <-chan Result)

Output ...

func (*Typosquatting) Results

func (typ *Typosquatting) Results(in <-chan Result) <-chan Result

Results ...

func (*Typosquatting) Start

func (typ *Typosquatting) Start() <-chan Result

Start ...

func (*Typosquatting) Stream

func (typ *Typosquatting) Stream() <-chan Result

Stream returns the results one at a time

func (*Typosquatting) Typos

func (typ *Typosquatting) Typos(in <-chan Result) <-chan Result

Typos gives typo options to a pool of workers

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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