# pnk
Produce a new combination of subdomains - generates permutations P(n,k).
## Make it work
- [x] swap subs themselves: web.test.domain.com -> test.web.domain.com
- [x] increase/decrease digits on subs with numbers: test1.domain.com -> test2.domain.com
## Make it right
1. `stdin`: reads standard input. This is useful for capturing a pipeline’s contents at an intermediate stage of processing.
2. `stdout`: supports standard output.
3. Works with the next arguments:
```
usage: pnk [-h] [-i | -c] [-d] [-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
-v, --version show program's version number and exit
```
```bash
$ cat subs1.txt subs2.txt | pnk
```
## Make it fast
To turn this single process script into multiprocess use [interlace](https://github.com/codingo/Interlace)
# Features
Permutations:
```bash
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:
```bash
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:
```bash
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:
```bash
pip3 install --no-deps pnk
```
From the source code:
```bash
$ cat subs1.txt subs2.txt | ./src/pnk/__main__.py
```
# Constraints
### Limitations
1. 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
```
2. Does not ships with DNS resolver, use [massdns](https://github.com/blechschmidt/massdns)
```bash
$ pnk < list.txt | massdns -
```
3. Possible out of memory issues when redirecting `stdout` to a file, please read the [Wiki](https://github.com/storenth/pnk/wiki)
### Feature request
See the open [issue](https://github.com/storenth/pnk/issues/1#issue-2080221058) 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
Raw data
{
"_id": null,
"home_page": "",
"name": "pnk",
"maintainer": "",
"docs_url": null,
"requires_python": ">=3.8",
"maintainer_email": "",
"keywords": "permutations,enumeration,recon,itertool,subdomains,bugbounty,subdomain-enumeration,infosec",
"author": "",
"author_email": "Zhdanov Kirill <storenth@yandex.ru>",
"download_url": "https://files.pythonhosted.org/packages/e4/6b/1d7ff64e992cd384d92f4a20edd768f326e4a444f96b155ff42d5d313e09/pnk-2.0.0.tar.gz",
"platform": null,
"description": "# pnk\nProduce a new combination of subdomains - generates permutations P(n,k).\n\n## Make it work\n- [x] swap subs themselves: web.test.domain.com -> test.web.domain.com\n- [x] increase/decrease digits on subs with numbers: test1.domain.com -> test2.domain.com\n\n## Make it right\n1. `stdin`: reads standard input. This is useful for capturing a pipeline\u2019s contents at an intermediate stage of processing.\n2. `stdout`: supports standard output.\n3. Works with the next arguments:\n```\nusage: pnk [-h] [-i | -c] [-d] [-v] [FILE ...]\n\nGenerates a new subdomains on provided input\n\npositional arguments:\n FILE list of subdomains/hosts to process\n\noptional arguments:\n -h, --help show this help message and exit\n -i, --increment increment any one or two digits on subdomains\n -c, --cartesian increment digits on subdomains creating their Cartesian product\n -d, --data generate test data from the stdin\n -v, --version show program's version number and exit\n```\n```bash\n$ cat subs1.txt subs2.txt | pnk\n```\n\n## Make it fast\nTo turn this single process script into multiprocess use [interlace](https://github.com/codingo/Interlace)\n\n\n# Features\nPermutations:\n```bash\necho \"aws3-3.s11.env2.tesla.com\" | pnk\naws3-3.s11.env2.tesla.com\naws3-3.env2.s11.tesla.com\ns11.aws3-3.env2.tesla.com\ns11.env2.aws3-3.tesla.com\nenv2.aws3-3.s11.tesla.com\nenv2.s11.aws3-3.tesla.com\n```\nWith incrementation option:\n```bash\necho \"aws3-3.s11.env2.tesla.com\" | pnk -i\naws0-3.s11.env2.tesla.com\naws1-3.s11.env2.tesla.com\naws2-3.s11.env2.tesla.com\n...\naws8-8.s11.env2.tesla.com\naws9-9.s11.env2.tesla.com\n...\n```\nUsing the cartesian product option:\n```bash\necho \"v0.1-v2.tcsbank.ru\" | pnk -c\nv0.dev0-v0.tcsbank.ru\nv1.dev0-v0.tcsbank.ru\n...\nv0.dev1-v0.tcsbank.ru\nv0.dev2-v0.tcsbank.ru\n...\nv9.dev9-v8.tcsbank.ru\nv9.dev9-v9.tcsbank.ru\n\n```\n\n## Install & Usage\nPyPi:\n```bash\npip3 install --no-deps pnk\n```\nFrom the source code:\n```bash\n$ cat subs1.txt subs2.txt | ./src/pnk/__main__.py\n```\n\n# Constraints\n### Limitations\n1. Does't handle increment option in the following cases: more then two digits:\n```\nv123.tesla.com -> v123.tesla.com\naws.1002030v.amazon.com -> aws.1002030v.amazon.com\n```\n2. Does not ships with DNS resolver, use [massdns](https://github.com/blechschmidt/massdns)\n```bash\n$ pnk < list.txt | massdns -\n```\n3. Possible out of memory issues when redirecting `stdout` to a file, please read the [Wiki](https://github.com/storenth/pnk/wiki)\n\n### Feature request\nSee the open [issue](https://github.com/storenth/pnk/issues/1#issue-2080221058) for the following feature requests:\n- [ ] replace keywords with word in wordlist: v2.test.domain.com -> v2.stage.domain.com .. v2.prod.domain.com\n- [ ] prepend/append word by creating new subs: test.domain.com -> demo.test.domain.com, test.demo.domain.com\n",
"bugtrack_url": null,
"license": "",
"summary": "Generates permutations on provided subdomains",
"version": "2.0.0",
"project_urls": {
"Homepage": "https://github.com/storenth/pnk",
"Issues": "https://github.com/storenth/pnk/issues"
},
"split_keywords": [
"permutations",
"enumeration",
"recon",
"itertool",
"subdomains",
"bugbounty",
"subdomain-enumeration",
"infosec"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "7b47ceb61b569ede94d3e751e2647a40d4fd35ef1c476f331efbce13c532b211",
"md5": "f3fd407d92056db19c0330cf70aa7789",
"sha256": "dd024bf325ee8a65cf7b75805ee103ea9cfb7b14f1b502c45a10981492d633f1"
},
"downloads": -1,
"filename": "pnk-2.0.0-py3-none-any.whl",
"has_sig": false,
"md5_digest": "f3fd407d92056db19c0330cf70aa7789",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.8",
"size": 8481,
"upload_time": "2024-02-03T07:09:08",
"upload_time_iso_8601": "2024-02-03T07:09:08.775197Z",
"url": "https://files.pythonhosted.org/packages/7b/47/ceb61b569ede94d3e751e2647a40d4fd35ef1c476f331efbce13c532b211/pnk-2.0.0-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "e46b1d7ff64e992cd384d92f4a20edd768f326e4a444f96b155ff42d5d313e09",
"md5": "a3fa78b656fe9b41e0c978b495b7e641",
"sha256": "56fbdbeb55666f5a2e0f14cd96f9e4edca1e08bd45d2ef192e5b08d720940c5d"
},
"downloads": -1,
"filename": "pnk-2.0.0.tar.gz",
"has_sig": false,
"md5_digest": "a3fa78b656fe9b41e0c978b495b7e641",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.8",
"size": 8407,
"upload_time": "2024-02-03T07:09:10",
"upload_time_iso_8601": "2024-02-03T07:09:10.522870Z",
"url": "https://files.pythonhosted.org/packages/e4/6b/1d7ff64e992cd384d92f4a20edd768f326e4a444f96b155ff42d5d313e09/pnk-2.0.0.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-02-03 07:09:10",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "storenth",
"github_project": "pnk",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"lcname": "pnk"
}