Git Product home page Git Product logo

twister's Introduction

Twister

Permutation engine for generating and checking the availability of malicious Twitter usernames. Several edit operations are supported: substitution, transposition, insertion, deletion, and prefix/suffix. Inspired by dnstwist.

Twister Screenshot

Prerequisites

  • Python 3

Install

git clone https://github.com/mh0x/twister.git

Usage

usage: twister.py [-h] [-c] [-q] [-o OUTPUT] [-n THREADS]
                  [-r RETRIES] [-t TIMEOUT] profile user [user ...]

positional arguments:
  profile                        generator profile json
  user                           target username(s)

optional arguments:
  -h, --help                     show this help message and exit
  -c, --check                    check availability of generated usernames
  -q, --quiet                    suppress messages sent to stdout
  -o OUTPUT, --output OUTPUT     output results to csv file
  -n THREADS, --threads THREADS  max concurrent requests (default: 5)
  -r RETRIES, --retries RETRIES  max request retries (default: 2)
  -t TIMEOUT, --timeout TIMEOUT  request timeout, secs (default: 10)

edit operations:                              notation:
  {"sub": {x: [y, ...], ...}, "max": n}         x, y  characters
  {"tra": [[x, y], ...], "max": n}              u     strings
  {"ins": {x: [y, ...], ...}, "max": n}         n     positive integers
  {"del": [x, ...], "max": n}
  {"pre": [u, ...]}
  {"suf": [u, ...]}

Profiles

A generator profile is a JSON description of a pipeline of edit operations:

[ o1 , o2 , o3 , ... on ]

The output of o1 passed to o2, whose output is passed to o3, and so on to on.

Operations

Supported edit operations are described below using the following notation:

  • x’ and ‘y’ range over characters;
  • u’ and ‘v’ range over strings;
  • n’ ranges over positive integers;
  • asterisks denote Kleene star (ignoring comma separators).

Note: Operations that perform single-character edits have a max property that specifies their maximum edit distance.

Substitution (uxvuyv)

{"sub":{ (" x ":[ (" y ")* ])* },"max": n }

Transposition (uxyvuyxv)

{"tra":[ ([" x "," y "])* ],"max": n }

Insertion (uxvuxyv)

{"ins":{ (" x ":[ (" y ")* ])* },"max": n }

Deletion (uxvuv)

{"del":[ (" x ")* ],"max": n }

Prefix (uvu)

{"pre":[ (" v ")* ]}

Suffix (uuv)

{"suf":[ (" v ")* ]}

Examples

Some examples of individual edit operations are provided in ops/:

Note: max values are provisionally set to 1.

Complex Profiles

The profile argument accepts a JSON string or a path to a JSON file. The latter option is useful for specifying complex profiles. Alternatively, individual edit operations may be saved (cf. ops/) and composed on the command line:

twister.py [args ...] <<< echo "[$(cat op1.json), $(cat op2.json), ...]" user [user ...]

Usernames

Twitter usernames are case-insensitive strings of 1–15 characters (az, AZ, 09, _) [5]. Hence, user and profile arguments are converted to lower-case.

Output

The -o/--output option outputs the results to a given file, in CSV format. The first column contains generated usernames. If the -c/--check option is specified, there is a second column that contains their availability status (1 available, 0 unavailable, -1 error).

References

  1. Sloppy Typing
    https://datagenetics.com/blog/november42012/index.html

  2. Copmany Suffixes
    https://www.harborcompliance.com/information/company-suffixes

  3. List of Visually Similar Characters for Detecting Spoofing and Social Engineering Attacks
    https://security.stackexchange.com/a/128463

  4. ISO 639.2: Codes for the Representation of Names of Languages
    https://www.loc.gov/standards/iso639-2/php/code_list.php

  5. Help with Username Registration
    https://help.twitter.com/en/managing-your-account/twitter-username-rules

License

MIT © 2018 mh0x

Disclaimer

Taken from MIT License:

IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

twister's People

Contributors

mh0x avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.