pnk
Produce a new combination of subdomains - generates permutations P(n,k).
Make it work
- swap subs themselves: web.test.domain.com -> test.web.domain.com
- increase/decrease digits on subs with numbers: test1.domain.com -> test2.domain.com
Make it right
stdin: reads standard input. This is useful for capturing a pipeline’s contents at an intermediate stage of processing.stdout: supports standard output.- Works with the next arguments:
usage: pnk [-h] [-i | -c] [-d] [-r] [-t TARGET] [-w WORDLIST] [-v] [FILE ...]
Generates a new subdomains on provided input
positional arguments:
FILE list of subdomains/hosts to process
optional arguments:
-h, --help show this help message and exit
-i, --increment increment any one or two digits on subdomains
-c, --cartesian increment digits on subdomains creating their Cartesian product
-d, --data generate test data from the stdin
-r, --replace replace underscores and dashes with dots
-t TARGET, --target TARGET
target domain to find subs for (which will not be processed)
-w WORDLIST, --wordlist WORDLIST
mixed subdomains with wordlist
-v, --version show program's version number and exit
$ cat subs1.txt subs2.txt | pnk
Make it fast
To turn this single process script into multiprocess use interlace
Features
Permutations:
echo "aws3-3.s11.env2.tesla.com" | pnk
aws3-3.s11.env2.tesla.com
aws3-3.env2.s11.tesla.com
s11.aws3-3.env2.tesla.com
s11.env2.aws3-3.tesla.com
env2.aws3-3.s11.tesla.com
env2.s11.aws3-3.tesla.com
With incrementation option:
echo "aws3-3.s11.env2.tesla.com" | pnk -i
aws0-3.s11.env2.tesla.com
aws1-3.s11.env2.tesla.com
aws2-3.s11.env2.tesla.com
...
aws8-8.s11.env2.tesla.com
aws9-9.s11.env2.tesla.com
...
Using the cartesian product option:
echo "v0.1-v2.tcsbank.ru" | pnk -c
v0.dev0-v0.tcsbank.ru
v1.dev0-v0.tcsbank.ru
...
v0.dev1-v0.tcsbank.ru
v0.dev2-v0.tcsbank.ru
...
v9.dev9-v8.tcsbank.ru
v9.dev9-v9.tcsbank.ru
Install & Usage
PyPi:
pip3 install --no-deps pnk
From the source code:
$ cat subs1.txt subs2.txt | ./src/pnk/__main__.py
Constraints
Limitations
- Does't handle increment option in the following cases: more then two digits:
v123.tesla.com -> v123.tesla.com
aws.1002030v.amazon.com -> aws.1002030v.amazon.com
- Does not ships with DNS resolver, use massdns
$ pnk < list.txt | massdns -
- Possible out of memory issues when redirecting
stdoutto a file, please read the Wiki
Feature request
See the open issue for the following feature requests:
- replace keywords with word in wordlist: v2.test.domain.com -> v2.stage.domain.com .. v2.prod.domain.com
- prepend/append word by creating new subs: test.domain.com -> demo.test.domain.com, test.demo.domain.com
Metadata
Release files for pnk 3.0.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| pnk-3.0.0.tar.gz | 9.5 kB | Without provenance | Details for pnk-3.0.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| pnk-3.0.0-py3-none-any.whl | Python 3 | none | any | Details for pnk-3.0.0-py3-none-any.whl |
Total release size: 18.9 kB
Release files / pnk-3.0.0.tar.gz
| Download URL | pnk-3.0.0.tar.gz |
|---|---|
| Size | 9.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
6aa82d6e36e7e65d419dd942cddde1b48895df68c4f27ba73d2156e98a150c23
|
|
BLAKE2b-256 checksum How to use checksums |
79d558aefc87bd6968c2b8704db0a1da6220b74d91328ca07e0a98898eb14a8f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.11.1
|
Release files / pnk-3.0.0-py3-none-any.whl
| Download URL | pnk-3.0.0-py3-none-any.whl |
|---|---|
| Size | 9.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
f0a7f185a5076d9907317b257382082c041ed724ce0e0ebff84c7bf5f323c4f2
|
|
BLAKE2b-256 checksum How to use checksums |
428a540ed156b9624a58bc3e1cd9fe2cdd4c8e8514f803da574510e65edc1fff
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.11.1
|
Security for pnk 3.0.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.