项目作者: fyxme

项目描述 :
Genx is a fast alternative domain name generator to help in generating potential subdomains of a target. Useful when starting recon on a domain.
高级语言: Rust
项目地址: git://github.com/fyxme/genx.git
创建时间: 2021-08-08T13:33:24Z
项目社区:https://github.com/fyxme/genx

开源协议:GNU General Public License v3.0

下载


Genx

Genx is a fast alternative domain name generator to help in generating potential subdomains of a target. Useful when starting recon on a domain.

Objectives of genx

  1. Be a general purpose subdomain generation tool
  2. Can generate large amounts of data very efficiently
  3. Be as fast as possible
  4. Allow for an array of cli commands
  5. Have all the capabilities of altdns (great tool) and more
  6. Finally: simply practice Rust

Compilation

To compile run:

A Makefile has been created so you can simply run:

  1. make

Otherwise, compile manually:

  1. rustc -O genx.rs

To cleanup:

  1. make clean

Usage

  1. ./genx <domains> <wordlist.txt> <out_file> [-g]

Speed comparaison

This part contains speed comparaisons between genx and it’s python and c equivalents.

Simple keyword to domain concatenation

Comparaison with the current version of genx which reads input from a file, and outputs the combined keyword+domain to a file or stdout.

Lets compare the speed with a python program aimed at the same task:

  1. import sys
  2. import string
  3. #./combine.py domain wordlist.txt output.txt
  4. domain = sys.argv[3]
  5. with open(sys.argv[2], 'w') as out:
  6. with open(sys.argv[1]) as f:
  7. for line in f:
  8. out.write("{}.{}".format(line.rstrip(),domain))

We start by generating a file (tmp.txt) with 10,000,000 lines of 8 chars each which we will pass to both programs. (See generator at other/speed-test/random-str.py for source-code)

We run the program as such:

python3 other/speed-test/random-str.py 10000000 > tmp.txt

For this test we will use the domain name “example.com”.

We use time to record the time it takes for the program to execute and we run the program 10 times to get an average execution time.

Python Script

We run the script as such:

time for i in {1..10}; do python other/speed-test/combine.py "example.com" tmp.txt /dev/null; done

and get the following times:

  1. bash-3.2$ time for i in {1..10}; do python other/speed-test/combine.py "example.com" tmp.txt /dev/null; done
  2. real 1m18.426s
  3. user 1m17.457s
  4. sys 0m0.637s

Genx

We run the script as such:

time for i in {1..10}; do ./genx "example.com" tmp.txt /dev/null; done

and get the following times:

  1. bash-3.2$ time for i in {1..10}; do ./genx "example.com" tmp.txt /dev/null; done
  2. real 0m20.861s
  3. user 0m20.271s
  4. sys 0m0.468s

Result

78.426/20.861 = 3.759

This results in 276% faster subdomain generation when using genx vs its python equivalent.

Domain text list to keyword concatenation

For this second test we will use the same tools as in the previous test except we will run this python script as comparaison:

  1. import sys
  2. import string
  3. with open(sys.argv[1]) as domains:
  4. with open(sys.argv[3], 'w') as out:
  5. for domain in domains:
  6. tmp = domain.rstrip()
  7. with open(sys.argv[2]) as keywords:
  8. for keyword in keywords:
  9. out.write("{}.{}\n".format(keyword.rstrip(),tmp))

We reduce the number of keywords to 1,000,000 and setup a file with 10 domains:

  1. example1.com
  2. example2.com
  3. example3.com
  4. example4.com
  5. example5.com
  6. example6.com
  7. example7.com
  8. example8.com
  9. example9.com
  10. example0.com

Python Script

We used this command to run the script:

time for i in {1..10}; do python other/speed-test/combine-list.py other/speed-test/domains.txt tmp.txt /dev/null; done

and got the following total time:

  1. bash-3.2$ time for i in {1..10}; do python other/speed-test/combine-list.py other/speed-test/domains.txt tmp.txt /dev/null; done
  2. real 1m21.109s
  3. user 1m18.348s
  4. sys 0m1.154s

C program

We used this command to run the program:

time for i in {1..10}; do ./other/speed-test/genc other/speed-test/domains.txt tmp.txt /dev/null; done

and got the following times:

  1. bash-3.2$ time for i in {1..10}; do ./other/speed-test/genc other/speed-test/domains.txt tmp2.txt /dev/null; done
  2. real 0m24.739s
  3. user 0m23.589s
  4. sys 0m0.750s
Genx

We used this command to run the program:

time for i in {1..10}; do ./genx other/speed-test/domains.txt tmp.txt /dev/null; done

and got the following times:

  1. bash-3.2$ time for i in {1..10}; do ./genx other/speed-test/domains.txt tmp.txt /dev/null; done
  2. real 0m21.099s
  3. user 0m20.373s
  4. sys 0m0.552s

Results

Genx outperformed both C and Python at the same task.

With an increase of 284% over its Python equivalent and 17.3% faster than the C version.