#typosquatting #typogard #typosquat

typomania

A toolbox to check for typosquatting in package registries

3 releases

0.1.2 Nov 10, 2023
0.1.1 Oct 13, 2023
0.1.0 Sep 27, 2023
Download history 30/week @ 2024-07-19 45/week @ 2024-07-26 37/week @ 2024-08-02 30/week @ 2024-08-09 13/week @ 2024-08-16 18/week @ 2024-08-23 31/week @ 2024-08-30 18/week @ 2024-09-06 23/week @ 2024-09-13 34/week @ 2024-09-20 49/week @ 2024-09-27 19/week @ 2024-10-04 16/week @ 2024-10-11 68/week @ 2024-10-18 70/week @ 2024-10-25 67/week @ 2024-11-01

222 downloads per month

MIT/Apache

38KB
788 lines

typomania

The typomania project is a port to Rust of the excellent typogard, originally by a team led by Matthew Taylor at the University of Kansas and published alongside the Defending Against Package Typosquatting paper, and adapted by Dan Gardner for crates.io specifically.

Rather than being hard coded to a specific registry, this crate provides the same set of primitives that typogard uses to detect potential typosquatting as a reusable library that can be adapted to any registry by implementing the traits provided in this crate.

Features

  • rayon (enabled by default): enables Harness::check, which provides functionality to check many packages in parallel using Rayon.

Examples

Fake registry

A basic example is provided in examples/registry.rs that fakes a registry and then matches packages against it. To see it operate with some packages that generate potential typosquats, try:

cargo run --example registry -- -t abc,foo,foo-2 foo2 abd

crates.io

An example project that uses this crate to analyse a crates.io database dump can be found at typomania-crates.

Code of Conduct

The Rust Foundation has adopted a Code of Conduct that we expect project participants to adhere to. Please read the full text so that you can understand what actions will and will not be tolerated.

Contributing

See CONTRIBUTING.md.

Licenses

Rust is primarily distributed under the terms of both the MIT license and the Apache License (Version 2.0), with documentation portions covered by the Creative Commons Attribution 4.0 International license..

See LICENSE-APACHE, LICENSE-MIT, LICENSE-documentation, and COPYRIGHT for details.

You can also read more under the Foundation's intellectual property policy.

Other Policies

You can read about other Rust Foundation policies in the footer of the Foundation website.

Dependencies

~2.1–2.9MB
~56K SLoC