Skip to content

Commit 0a97601

Browse files
committed
docs: update cartesian product notes
1 parent 135c2de commit 0a97601

File tree

2 files changed

+35
-7
lines changed

2 files changed

+35
-7
lines changed

PERFORMANCE.md

+22
Original file line numberDiff line numberDiff line change
@@ -17,3 +17,25 @@ def run():
1717

1818
@timefn: run took 0.0010941028594970703 seconds
1919
```
20+
3. Cartesian product
21+
```
22+
python3 -m cProfile -s calls ./src/pnk/__main__.py -c < src/tests/one.txt
23+
@timefn: run took 0.0016446113586425781 seconds
24+
17880 function calls (17305 primitive calls) in 0.017 seconds
25+
ncalls tottime percall cumtime percall filename:lineno(function)
26+
1437 0.000 0.000 0.000 0.000 {method 'append' of 'list' objects}
27+
1180/1059 0.000 0.000 0.000 0.000 {built-in method builtins.len}
28+
1099 0.000 0.000 0.000 0.000 {method 'rstrip' of 'str' objects}
29+
1069 0.000 0.000 0.000 0.000 {built-in method builtins.isinstance}
30+
888 0.000 0.000 0.000 0.000 {method 'join' of 'str' objects}
31+
708 0.000 0.000 0.000 0.000 _parser.py:231(__next)
32+
690 0.000 0.000 0.000 0.000 _parser.py:162(__getitem__)
33+
575 0.000 0.000 0.000 0.000 _parser.py:252(get)
34+
540 0.000 0.000 0.000 0.000 <frozen importlib._bootstrap>:244(_verbose_message)
35+
531 0.000 0.000 0.001 0.000 <frozen importlib._bootstrap_external>:126(_path_join)
36+
531 0.000 0.000 0.000 0.000 <frozen importlib._bootstrap_external>:128(<listcomp>)
37+
303 0.000 0.000 0.000 0.000 {built-in method builtins.print}
38+
296 0.000 0.000 0.000 0.000 {built-in method builtins.min}
39+
268 0.000 0.000 0.000 0.000 _parser.py:247(match)
40+
217 0.000 0.000 0.000 0.000 _parser.py:158(__len__)
41+
```

README.md

+13-7
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# pnk
2-
Produce a combination of subdomains - generates permutations P(n,k).
2+
Produce a new combination of subdomains - generates permutations P(n,k).
33

44
## Make it work
55
- [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).
1010
2. `stdout`: supports standard output.
1111
3. Works with the next arguments:
1212
```
13-
usage: pnk.py [-h] [-i] [-w WORDLIST] [FILE ...]
13+
usage: pnk.py [-h] [-i | -c] [-v] [FILE ...]
1414
15-
Set CLI args pnk works with
15+
Generates a new subdomains on provided input
1616
1717
positional arguments:
18-
FILE list of subdomains/hosts to process
18+
FILE list of subdomains/hosts to process
1919
2020
optional arguments:
21-
-h, --help show this help message and exit
22-
-i, --increment additionally increment digits on subdomains
21+
-h, --help show this help message and exit
22+
-i, --increment increment any one or two digits on subdomains
23+
-c, --cartesian increment digits on subdomains creating Cartesian product
24+
-v, --version show program's version number and exit
2325
```
2426
```bash
2527
$ cat subs1.txt subs2.txt | pnk
@@ -79,7 +81,11 @@ $ pnk < list.txt | massdns
7981
```
8082
3. Possible out of memory issues when redirecting `stdout` to a file, please read the [Wiki](https://github.com/storenth/pnk/wiki)
8183
## TODO
82-
1. Combinations of incrementations (cartesian product):
84+
1. Combinations of incrementations (cartesian product of all digits found in each sub):
8385
```
8486
5io5.33.ya.ru -> 0io0.00.ya.ru .. 9io9.99.ya.ru
8587
```
88+
How it works now:
89+
```
90+
5io5.33.ya.ru -> 0io5.00.ya.ru .. 9io5.99.ya.ru .. 5io0.00.ya.ru .. 5io9.99.ya.ru
91+
```

0 commit comments

Comments
 (0)