Skip to content

Commit

Permalink
docs: update cartesian product notes
Browse files Browse the repository at this point in the history
  • Loading branch information
storenth committed Jan 21, 2024
1 parent 135c2de commit 0a97601
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 7 deletions.
22 changes: 22 additions & 0 deletions PERFORMANCE.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 <frozen importlib._bootstrap>:244(_verbose_message)
531 0.000 0.000 0.001 0.000 <frozen importlib._bootstrap_external>:126(_path_join)
531 0.000 0.000 0.000 0.000 <frozen importlib._bootstrap_external>:128(<listcomp>)
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__)
```
20 changes: 13 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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
```

0 comments on commit 0a97601

Please sign in to comment.