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.
This is particularly helpful if you're from outside the Rust space and would like to get up and running quickly.
- Install Rust
git clone https://github.com/JuxhinDB/twistrs.gitcd examples/twistrs-clicargo 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.
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);
}
}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);
});
}- 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)
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.
This project is licensed under the MIT license.
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.
