![version](https://img.shields.io/pypi/v/wordz) ![pyversions](https://img.shields.io/pypi/pyversions/wordz) ![license](https://img.shields.io/pypi/l/wordz) ![status](https://img.shields.io/pypi/status/wordz)
# wordz
> Wordlists builder
## Introduction
This tool evolved from the helper scripts used for the [brutas](https://github.com/tasooshi/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](https://github.com/tasooshi/wordz/tree/main/tests) or the [brutas](https://github.com/tasooshi/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
```
Raw data
{
"_id": null,
"home_page": "https://github.com/tasooshi/wordz",
"name": "wordz",
"maintainer": "",
"docs_url": null,
"requires_python": ">=3.9",
"maintainer_email": "",
"keywords": "wordlists,bruteforce,dictionary,generator,hashcat",
"author": "tasooshi",
"author_email": "tasooshi@pm.me",
"download_url": "https://files.pythonhosted.org/packages/e7/36/296dd484fe734e695e9f9c14ada1b4c98817f5ec00801fc4696fd8063ebf/wordz-0.1.6.tar.gz",
"platform": null,
"description": "![version](https://img.shields.io/pypi/v/wordz) ![pyversions](https://img.shields.io/pypi/pyversions/wordz) ![license](https://img.shields.io/pypi/l/wordz) ![status](https://img.shields.io/pypi/status/wordz)\n\n# wordz\n\n> Wordlists builder\n\n## Introduction\n\nThis tool evolved from the helper scripts used for the [brutas](https://github.com/tasooshi/brutas/) project. It is used for generating and managing wordlists for password cracking, content discovery, fuzzing etc.\n\n## Requirements\n\n* GNU/Linux, macOS\n* `hashcat`\n* `hashcat-utils`\n* GNU tools: `cat`, `awk`, `comm`, `sort`, `uniq`\n\n### Recommended\n\n* If `lzop` is detected it will be used by `sort` to compress temporary file, especially useful with large datasets.\n\n## Usage\n\n### Sources\n\nLet's say you have some `tests/data/keywords.txt` like the following:\n\n```\nacapulco\ncerveja\n```\n\nAlso, you know of a few common suffixes (`tests/data/bits.txt`) used in this particular case, namely:\n\n```\n!\n123\n```\n\nWe 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:\n\n```\n:\nu\n```\n\n### Classes\n\nNow it's time to design a class that will build the wordlist for us according to some requirements, e.g.:\n* bits after each keyword\n* bits before each keyword\n* and on both sides of a keyword\n\n```\nfrom wordz import Combinator\n\n\nclass Passwords(Combinator):\n\n wordlists = (\n 'data/keywords.txt',\n )\n rules = (\n 'data/hashcat.rule',\n )\n\n def process(self):\n\n self.merge(\n self.output('passwords.txt'),\n (\n self.right(self.temp('hashcat-data-keywords.txt'), self.base('data/bits.txt')),\n self.left(self.temp('hashcat-data-keywords.txt'), self.base('data/bits.txt')),\n self.both(self.temp('hashcat-data-keywords.txt'), self.base('data/bits.txt')),\n )\n )\n```\n\nWhat 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).\n\nThis 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`).\n\nThere are three \"shortcuts\" for directories available in each `Combinator` instance: `base()`, `temp()` and `output()`.\n\n### Building\n\nNow it's time to build our lists:\n\n```\n$ mkdir tmp\n$ wordz -p data/classes.py::Passwords\n```\n\nThe result should now be in `passwords.txt`.\n\n### Advanced usage\n\nIf you want to see how it is used in more advanced cases, have a look into [tests](https://github.com/tasooshi/wordz/tree/main/tests) or the [brutas](https://github.com/tasooshi/brutas/) project.\n\n## Command line\n\nOnce installed, you can call `wordz` from the command line. Here are the arguments you can use:\n\n```\nusage: 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]\n\noptions:\n -h, --help show this help message and exit\n -p PATH, --path PATH Class path (e.g. classes/passwords.py::ExtraPasswords)\n -b BASE_DIR, --base-dir BASE_DIR\n Base directory path (default: .)\n -t TEMP_DIR, --temp-dir TEMP_DIR\n Temporary directory path (default: tmp)\n -o OUTPUT_DIR, --output-dir OUTPUT_DIR\n Output directory path (default: .)\n -v, --version Print version\n --min-length MIN_LENGTH\n Minimal length for a password when merging lists (default: 4)\n --cores CORES Number of cores to be used for sorting (default: CPUs-based)\n --memory MEMORY Percentage of memory to be used for sorting (default: 80%)\n --bin-hashcat BIN_HASHCAT\n Hashcat binary (default: hashcat)\n --bin-combinator BIN_COMBINATOR\n Hashcat utils `combinator` binary (default: combinator.bin)\n --bin-rli2 BIN_RLI2 Hashcat utils `rli2` binary (default: rli2.bin)\n -d, --debug Debug mode\n -q, --quiet Quiet mode\n```\n",
"bugtrack_url": null,
"license": "BSD License",
"summary": "Wordlists builder",
"version": "0.1.6",
"project_urls": {
"Homepage": "https://github.com/tasooshi/wordz"
},
"split_keywords": [
"wordlists",
"bruteforce",
"dictionary",
"generator",
"hashcat"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "e736296dd484fe734e695e9f9c14ada1b4c98817f5ec00801fc4696fd8063ebf",
"md5": "aa7a8196ee9af1d585e9fe80aaa0c59b",
"sha256": "e07549d92dab17707d861a9f7a81f106336b80b88f7c549e6059683c3ecccc62"
},
"downloads": -1,
"filename": "wordz-0.1.6.tar.gz",
"has_sig": false,
"md5_digest": "aa7a8196ee9af1d585e9fe80aaa0c59b",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.9",
"size": 11113,
"upload_time": "2023-07-16T22:31:18",
"upload_time_iso_8601": "2023-07-16T22:31:18.750357Z",
"url": "https://files.pythonhosted.org/packages/e7/36/296dd484fe734e695e9f9c14ada1b4c98817f5ec00801fc4696fd8063ebf/wordz-0.1.6.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2023-07-16 22:31:18",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "tasooshi",
"github_project": "wordz",
"travis_ci": false,
"coveralls": true,
"github_actions": false,
"tox": true,
"lcname": "wordz"
}