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)
- Addition - Addition of a single character to the end of a string
- BitSquatting - Generates a string with one bit difference from the input
- DoubleHit - Addition of a single character that is adjacent to each character (double hitting of a key)
- Homoglyph - Substituiton of a single character with another that looks similar
- Hyphenation - Addition of a hypen
-
between the first and last character in a string
- Omission - Removal of a single character in a string
- Prefix - Addition of predefined prefixes to the start of a string
- Repetition - Repetition of characters in a string (pressing a key twice)
- Replace - Replacement of a single character that is adjacent to each character (pressing wrong key)
- Similar - Replacement of a single character that looks the same. This is a subset of Homoglyph but is language specific.
- SubDomain - Addition of a period
.
between the first and last character in a string
- Transposition - Swapping of adjacent characters in a string
- VowelSwap - Swapping of vowels in string with all other vowels
- TLDReplace - Replaces the TLD with a list of commonly used TLDs. Only works with
FuzzDomain
.
- TLDRepeat - Repeats the TLD after the domain name. Only works with
FuzzDomain
.
Languages
The following strategies are language dependent:
DoubleHit
Replace
Similar
Supported languages include:
- English
- French
- German
- Spanish