From b545ec18ea3d865802c98e12b54ffbf3a4819acf Mon Sep 17 00:00:00 2001 From: Kirill Zhdanov Date: Wed, 24 Jan 2024 23:09:15 +0700 Subject: [PATCH] docs: cartesian product option notes, demo; remove todo because its done --- README.md | 37 +++++++++++++++++++++---------------- 1 file changed, 21 insertions(+), 16 deletions(-) diff --git a/README.md b/README.md index ee29a95..c1e85c0 100644 --- a/README.md +++ b/README.md @@ -10,7 +10,7 @@ Produce a new combination of subdomains - generates permutations P(n,k). 2. `stdout`: supports standard output. 3. Works with the next arguments: ``` -usage: pnk.py [-h] [-i | -c] [-v] [FILE ...] +usage: pnk [-h] [-i | -c] [-v] [FILE ...] Generates a new subdomains on provided input @@ -20,7 +20,7 @@ positional arguments: 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 Cartesian product + -c, --cartesian increment digits on subdomains creating their Cartesian product -v, --version show program's version number and exit ``` ```bash @@ -28,7 +28,7 @@ $ cat subs1.txt subs2.txt | pnk ``` ## Make it fast -WIP: but for now, to turn this single process script into multiprocess use [interlace](https://github.com/codingo/Interlace) +To turn this single process script into multiprocess use [interlace](https://github.com/codingo/Interlace) # Features @@ -52,6 +52,19 @@ 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 @@ -65,10 +78,6 @@ $ cat subs1.txt subs2.txt | ./src/pnk/__main__.py ``` # Constraints -### Feature request -See the open [issue](https://github.com/storenth/pnk/issues/1#issue-2080221058) for the following feature requests: -- [ ] replace each subs with word in wordlist: v2.test.domain.com -> demo.test.domain.com -- [ ] prepend/append word by creating new subs: test.domain.com -> demo.test.domain.com, test.demo.domain.com ### Limitations 1. Does't handle incremet option in the following cases: more then two digits: ``` @@ -80,12 +89,8 @@ aws.1002030v.amazon.com -> aws.1002030v.amazon.com $ 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) -## TODO -1. Combinations of incrementations (cartesian product of all digits found in each sub): -``` -5io5.33.ya.ru -> 0io0.00.ya.ru .. 9io9.99.ya.ru -``` -How it works now: -``` -5io5.33.ya.ru -> 0io5.00.ya.ru .. 9io5.99.ya.ru .. 5io0.00.ya.ru .. 5io9.99.ya.ru -``` \ No newline at end of file + +### Feature request +See the open [issue](https://github.com/storenth/pnk/issues/1#issue-2080221058) for the following feature requests: +- [ ] replace each subs with word in wordlist: v2.test.domain.com -> demo.test.domain.com +- [ ] prepend/append word by creating new subs: test.domain.com -> demo.test.domain.com, test.demo.domain.com