[][src]Struct twistrs::permutate::Domain

pub struct Domain<'a> {
    pub fqdn: &'a str,
    // some fields omitted
}

Wrapper around an FQDN to perform permutations against.

Fields

fqdn: &'a str

The domain FQDN to generate permutations from.

Implementations

impl<'a> Domain<'a>[src]

pub fn new(fqdn: &'a str) -> Result<Domain<'a>, PermutationError>[src]

Wrap a desired FQDN into a Domain container. Internally will perform additional operations to break the domain into one or more chunks to be used during domain permutations.

pub fn all(&self) -> Result<Box<dyn Iterator<Item = String>>, PermutationError>[src]

Generate any and all possible domain permutations for a given Domain.

Returns Iterator<String> with an iterator of domain permutations and includes the results of all other individual permutation methods.

Any future permutations will also be included into this function call without any changes required from any client implementations.

pub fn addition(
    &self
) -> Result<Box<dyn Iterator<Item = String>>, PermutationError>
[src]

Add every ASCII lowercase character between the Domain (e.g. google) and top-level domain (e.g. .com).

pub fn bitsquatting(
    &self
) -> Result<Box<dyn Iterator<Item = String>>, PermutationError>
[src]

Following implementation takes inspiration from the following content:

  • https://github.com/artemdinaburg/bitsquat-script/blob/master/bitsquat.py
  • http://dinaburg.org/bitsquatting.html

Go through each char in the domain and XOR it against 8 separate masks:

 00000001 ^ chr
 00000010 ^ chr
 00000100 ^ chr
 00001000 ^ chr
 00010000 ^ chr
 00100000 ^ chr
 01000000 ^ chr
 10000000 ^ chr

Then check if the resulting bit operation falls within ASCII range.

pub fn homoglyph(
    &self
) -> Result<Box<dyn Iterator<Item = String>>, PermutationError>
[src]

Permutation method that replaces ASCII characters with multiple homoglyphs similar to the respective ASCII character.

pub fn hyphentation(
    &self
) -> Result<Box<dyn Iterator<Item = String>>, PermutationError>
[src]

Permutation method that inserts hyphens (i.e. -) between each character in the domain where valid.

pub fn insertion(
    &self
) -> Result<Box<dyn Iterator<Item = String>>, PermutationError>
[src]

Permutation method that inserts specific characters that are close to any character in the domain depending on the keyboard (e.g. Q next to W in qwerty keyboard layout.

pub fn omission(
    &self
) -> Result<Box<dyn Iterator<Item = String>>, PermutationError>
[src]

Permutation method that selectively removes a character from the domain.

pub fn repetition(
    &self
) -> Result<Box<dyn Iterator<Item = String>>, PermutationError>
[src]

Permutation method that repeats characters twice provided they are alphabetic characters (e.g. google.com -> gooogle.com).

pub fn replacement(
    &self
) -> Result<Box<dyn Iterator<Item = String>>, PermutationError>
[src]

Permutation method similar to insertion, except that it replaces a given character with another character in proximity depending on keyboard layout.

pub fn subdomain(
    &self
) -> Result<Box<dyn Iterator<Item = String>>, PermutationError>
[src]

pub fn transposition(
    &self
) -> Result<Box<dyn Iterator<Item = String>>, PermutationError>
[src]

Permutation method that swaps out characters in the domain (e.g. google.com -> goolge.com).

pub fn vowel_swap(
    &self
) -> Result<Box<dyn Iterator<Item = String>>, PermutationError>
[src]

Permutation method that swaps vowels for other vowels (e.g. google.com -> gougle.com).

Trait Implementations

impl<'a> Debug for Domain<'a>[src]

impl<'a> Default for Domain<'a>[src]

Auto Trait Implementations

impl<'a> RefUnwindSafe for Domain<'a>

impl<'a> Send for Domain<'a>

impl<'a> Sync for Domain<'a>

impl<'a> Unpin for Domain<'a>

impl<'a> UnwindSafe for Domain<'a>

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.