Skip to content

haveibeensquatted/twistrs

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

299 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Twistr — Build & Test Status docs crates.io Discord invite

Twistr is a domain name permutation library powered by Rust. It aims to directly port the well-known dnstwist tool allowing for fast and flexible interfacing capabilities with the core libraries based on client's requirements.







Quickstart

This is particularly helpful if you're from outside the Rust space and would like to get up and running quickly.

  1. Install Rust
  2. git clone https://github.com/JuxhinDB/twistrs.git
  3. cd examples/twistrs-cli
  4. cargo r -- github.com

Keep in mind that this will not run with a release build and will be naturally slower, however it should allow you to explore some of the functionality.

Usage

The core library is composed of the domain permutation module.

use twistrs::filter::Permissive;
use twistrs::permutate::Domain;

fn main() {
    let domain = Domain::new("google.com").unwrap();
    for permutation in domain.all(&Permissive) {
        println!("{} {:?}", permutation.domain.fqdn, permutation.kind);
    }
}

Allocation-free API

For high-throughput use cases, use the visitor API to avoid allocating a new String/Domain per permutation:

use twistrs::filter::Permissive;
use twistrs::permutate::Domain;

fn main() {
    let domain = Domain::new("google.com").unwrap();
    domain.visit_all(&Permissive, |p| {
        println!("{} {:?}", p.domain.fqdn, p.kind);
    });
}

Features

  • Granular control over permutation algorithms (e.g. homoglyphs)
  • Allocation-free visitor API (Domain::visit_all)
  • Exceptionally fast end-to-end results
  • Core library allowing easy extensions (i.e. CLI, API & streams)

Miscellaneous


Frequently Asked Questions

Q: If I want to use a different set of dictionaries to the one provided out of the box by the libary, how can I achieve that?

A: Currently the library (for ease-of-use) bakes the dictionaries into the final binary through a build script. To customise this, you would need to update the relevant files under twistrs/data and compile the library using cargo b or cargo b --release. You can also reference the library in your own Cargo.toml, pointing to a local copy.

License

This project is licensed under the MIT license.

Contribution

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in Twistrs by you, shall be licensed as MIT, without any additional terms or conditions.

About

A domain name permutation and enumeration library powered by Rust.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors