diff --git a/PERFORMANCE.md b/PERFORMANCE.md index 4668fd7..9bfc98b 100644 --- a/PERFORMANCE.md +++ b/PERFORMANCE.md @@ -17,3 +17,25 @@ def run(): @timefn: run took 0.0010941028594970703 seconds ``` +3. Cartesian product +``` +python3 -m cProfile -s calls ./src/pnk/__main__.py -c < src/tests/one.txt +@timefn: run took 0.0016446113586425781 seconds + 17880 function calls (17305 primitive calls) in 0.017 seconds + ncalls tottime percall cumtime percall filename:lineno(function) + 1437 0.000 0.000 0.000 0.000 {method 'append' of 'list' objects} +1180/1059 0.000 0.000 0.000 0.000 {built-in method builtins.len} + 1099 0.000 0.000 0.000 0.000 {method 'rstrip' of 'str' objects} + 1069 0.000 0.000 0.000 0.000 {built-in method builtins.isinstance} + 888 0.000 0.000 0.000 0.000 {method 'join' of 'str' objects} + 708 0.000 0.000 0.000 0.000 _parser.py:231(__next) + 690 0.000 0.000 0.000 0.000 _parser.py:162(__getitem__) + 575 0.000 0.000 0.000 0.000 _parser.py:252(get) + 540 0.000 0.000 0.000 0.000 :244(_verbose_message) + 531 0.000 0.000 0.001 0.000 :126(_path_join) + 531 0.000 0.000 0.000 0.000 :128() + 303 0.000 0.000 0.000 0.000 {built-in method builtins.print} + 296 0.000 0.000 0.000 0.000 {built-in method builtins.min} + 268 0.000 0.000 0.000 0.000 _parser.py:247(match) + 217 0.000 0.000 0.000 0.000 _parser.py:158(__len__) +``` diff --git a/README.md b/README.md index 2c1dc9b..c437c93 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,5 @@ # pnk -Produce a combination of subdomains - generates permutations P(n,k). +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 @@ -10,16 +10,18 @@ Produce a combination of subdomains - generates permutations P(n,k). 2. `stdout`: supports standard output. 3. Works with the next arguments: ``` -usage: pnk.py [-h] [-i] [-w WORDLIST] [FILE ...] +usage: pnk.py [-h] [-i | -c] [-v] [FILE ...] -Set CLI args pnk works with +Generates a new subdomains on provided input positional arguments: - FILE list of subdomains/hosts to process + FILE list of subdomains/hosts to process optional arguments: - -h, --help show this help message and exit - -i, --increment additionally increment digits on subdomains + -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 + -v, --version show program's version number and exit ``` ```bash $ cat subs1.txt subs2.txt | pnk @@ -79,7 +81,11 @@ $ 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): +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