typogenerator

package module
v0.2.2 Latest Latest
Warning

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

Go to latest
Published: Jan 19, 2022 License: Apache-2.0 Imports: 2 Imported by: 0

README

Typogenerator: a typosquatting generator in Golang

A Golang typosquat generator utilizing various strategies to generate potential variants of a string. Some strategies are similar to those utilized by dnstwist. This library is not intended to be a complete port of dnstwist and may include additional strategies.

Usage

See files under cmd/ for example usage.

Fuzz
all := []strategy.Strategy{
	strategy.Omission,
	strategy.Repetition,
}

results, err := typogenerator.Fuzz("zenithar", all...)
if err != nil {
	fmt.Println(err)
}

for _, r := range results {
	for _, p := range r.Permutations {
		fmt.Println(p)
	}
}

// enithar
// znithar
// zeithar
// zenthar
// ...
FuzzDomain
all := []strategy.Strategy{
	strategy.Omission,
	strategy.Repetition,
}

results, err := typogenerator.FuzzDomain("example.com", all...)
if err != nil {
	fmt.Println(err)
}

for _, r := range results {
	for _, p := range r.Permutations {
		fmt.Println(p)
	}
}

// xample.com
// eample.com
// exmple.com
// exaple.com
// ...

Fuzzing Algorithms (strategies)

  1. Addition - Addition of a single character to the end of a string
  2. BitSquatting - Generates a string with one bit difference from the input
  3. DoubleHit - Addition of a single character that is adjacent to each character (double hitting of a key)
  4. Homoglyph - Substituiton of a single character with another that looks similar
  5. Hyphenation - Addition of a hypen - between the first and last character in a string
  6. Omission - Removal of a single character in a string
  7. Prefix - Addition of predefined prefixes to the start of a string
  8. Repetition - Repetition of characters in a string (pressing a key twice)
  9. Replace - Replacement of a single character that is adjacent to each character (pressing wrong key)
  10. Similar - Replacement of a single character that looks the same. This is a subset of Homoglyph but is language specific.
  11. SubDomain - Addition of a period . between the first and last character in a string
  12. Transposition - Swapping of adjacent characters in a string
  13. VowelSwap - Swapping of vowels in string with all other vowels
  14. TLDReplace - Replaces the TLD with a list of commonly used TLDs. Only works with FuzzDomain.
  15. TLDRepeat - Repeats the TLD after the domain name. Only works with FuzzDomain.

Languages

The following strategies are language dependent:

  1. DoubleHit
  2. Replace
  3. Similar

Supported languages include:

  1. English
  2. French
  3. German
  4. Spanish

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type FuzzResult

type FuzzResult struct {
	StrategyName string   `json:"name" yaml:"name"`
	Domain       string   `json:"domain" yaml:"domain"`
	Permutations []string `json:"permutations" yaml:"permutations"`
}

FuzzResult represents permutations results

func Fuzz

func Fuzz(name string, strategies ...strategy.Strategy) ([]FuzzResult, error)

Fuzz string using given strategies

func FuzzDomain added in v0.2.0

func FuzzDomain(domain string, strategies ...strategy.Strategy) ([]FuzzResult, error)

FuzzDomain splits a domain into (TRD + SLD) + TLD and fuzzes using given strategies

Directories

Path Synopsis
cmd

Jump to

Keyboard shortcuts

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