New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

zntr.io/typogenerator

Package Overview
Dependencies
Alerts
File Explorer
Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

zntr.io/typogenerator

  • v0.2.2
  • Go
  • Socket score

Version published
Created
Source

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

FAQs

Package last updated on 19 Jan 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc