Skip to main content

version pyversions license status

wordz

Wordlists builder

Introduction

This tool evolved from the helper scripts used for the brutas project. It is used for generating and managing wordlists for password cracking, content discovery, fuzzing etc.

Requirements

  • GNU/Linux, macOS
  • hashcat
  • hashcat-utils
  • GNU tools: cat, awk, comm, sort, uniq

Recommended

  • If lzop is detected it will be used by sort to compress temporary file, especially useful with large datasets.

Usage

Sources

Let's say you have some tests/data/keywords.txt like the following:

acapulco
cerveja

Also, you know of a few common suffixes (tests/data/bits.txt) used in this particular case, namely:

!
123

We would use a modest set of Hashcat rules (tests/data/hashcat.rule): one that simply passes a keyword, and the other one that makes it upper case. Like these:

:
u

Classes

Now it's time to design a class that will build the wordlist for us according to some requirements, e.g.:

  • bits after each keyword
  • bits before each keyword
  • and on both sides of a keyword
from wordz import Combinator


class Passwords(Combinator):

    wordlists = (
        'data/keywords.txt',
    )
    rules = (
        'data/hashcat.rule',
    )

    def process(self):

        self.merge(
            self.output('passwords.txt'),
            (
                self.right(self.temp('hashcat-data-keywords.txt'), self.base('data/bits.txt')),
                self.left(self.temp('hashcat-data-keywords.txt'), self.base('data/bits.txt')),
                self.both(self.temp('hashcat-data-keywords.txt'), self.base('data/bits.txt')),
            )
        )

What happens in the background is that wordz takes all wordlists defined on the class level and parses them using rules. It is done with the setup method which is launched before process, and which you can override with your own logic (however, you will probably want to keep self.wordlists_process() in there).

This is how we know the name of the file in the temporary directory: it is composed of the name of the rule (hashcat), the name of the parent directory (data) and name of the keywords file without extension (keywords).

There are three "shortcuts" for directories available in each Combinator instance: base(), temp() and output().

Building

Now it's time to build our lists:

$ mkdir tmp
$ wordz -p data/classes.py::Passwords

The result should now be in passwords.txt.

Advanced usage

If you want to see how it is used in more advanced cases, have a look into tests or the brutas project.

Command line

Once installed, you can call wordz from the command line. Here are the arguments you can use:

usage: wordz [-h] -p PATH [-b BASE_DIR] [-t TEMP_DIR] [-o OUTPUT_DIR] [-v] [--min-length MIN_LENGTH] [--cores CORES] [--memory MEMORY] [--bin-hashcat BIN_HASHCAT] [--bin-combinator BIN_COMBINATOR] [--bin-rli2 BIN_RLI2] [-d | -q]

options:
  -h, --help            show this help message and exit
  -p PATH, --path PATH  Class path (e.g. classes/passwords.py::ExtraPasswords)
  -b BASE_DIR, --base-dir BASE_DIR
                        Base directory path (default: .)
  -t TEMP_DIR, --temp-dir TEMP_DIR
                        Temporary directory path (default: tmp)
  -o OUTPUT_DIR, --output-dir OUTPUT_DIR
                        Output directory path (default: .)
  -v, --version         Print version
  --min-length MIN_LENGTH
                        Minimal length for a password when merging lists (default: 4)
  --cores CORES         Number of cores to be used for sorting (default: CPUs-based)
  --memory MEMORY       Percentage of memory to be used for sorting (default: 80%)
  --bin-hashcat BIN_HASHCAT
                        Hashcat binary (default: hashcat)
  --bin-combinator BIN_COMBINATOR
                        Hashcat utils `combinator` binary (default: combinator.bin)
  --bin-rli2 BIN_RLI2   Hashcat utils `rli2` binary (default: rli2.bin)
  -d, --debug           Debug mode
  -q, --quiet           Quiet mode

Metadata

Release files for wordz 0.1.7

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for wordz 0.1.7
File Size Uploaded
wordz-0.1.7.tar.gz 10.1 kB Details

Release files / wordz-0.1.7.tar.gz

Download URL wordz-0.1.7.tar.gz
Size 10.1 kB
Tags Source
SHA-256 checksum
How to use checksums
5aaa6dd5dac2ff687efb619987bce88fd6cbbff2cab9a968a6ce88f55b5419bf
BLAKE2b-256 checksum
How to use checksums
6de4d8216b52c33cab249dedd3360336d323e9df8559b208b4cb6d1fbd0aa3d4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.6.0 importlib_metadata/4.8.2 pkginfo/1.8.1 requests/2.28.1 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.16

Release history Release notifications | RSS feed

This release

0.1.7 This release

1 release file

0.1.6

1 release file

0.1.5

1 release file

0.1.4

1 release file

0.1.3

1 release file

0.1.2

1 release file

0.1.1

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page