Giter VIP home page Giter VIP logo

pnk's Introduction

pnk

Produce a new combination of subdomains - generates permutations P(n,k).

Make it work

  • swap subs themselves: web.test.domain.com -> test.web.domain.com
  • 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] [-r] [-t TARGET] [-w WORDLIST] [-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
  -r, --replace         replace underscores and dashes with dots
  -t TARGET, --target TARGET
                        target domain to find subs for (which will not be processed)
  -w WORDLIST, --wordlist WORDLIST
                        mixed subdomains with wordlist
  -v, --version         show program's version number and exit
$ cat subs1.txt subs2.txt | pnk

Make it fast

To turn this single process script into multiprocess use interlace

Features

Permutations:

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:

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:

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:

pip3 install --no-deps pnk

From the source code:

$ 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
  1. Does not ships with DNS resolver, use massdns
$ pnk < list.txt | massdns -
  1. Possible out of memory issues when redirecting stdout to a file, please read the Wiki

Feature request

See the open issue 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

pnk's People

Contributors

storenth avatar

Stargazers

 avatar  avatar

Watchers

 avatar

pnk's Issues

Replace each subdomain with word in wordlist

There is open question, do we need altdns \ dnsgen like functionality for this tool based on wordlist?

  • replace each subs with word in wordlist: test.v2.domain.com -> demo.v2.domain.com
  • prepend/append word by creating new subs: test.domain.com -> demo.test.domain.com, test.demo.domain, etc

Feature request:

  -w WORDLIST, --wordlist WORDLIST
                        wordlist file to mixed with subdomains

Pros:

  • All in one tool

Cons:

  • Heavy stuff: even for 10 words for 1 subdomain it is minimum 10x combinations based on replacement and 10x2 based on prepend-append actions for each subdomain, so in the average case is about C(n,k).
  • Large size of memory used in case of storing stdout in a file
  • Duplicated features of known bruteforce based subdomain enumeration tools

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.