├── README.md └── rustmap.py /README.md: -------------------------------------------------------------------------------- 1 | # Rustmap 2 | Uses Rustscan to find all ports and Nmap to scan them even more quickly! 3 | -------------------------------------------------------------------------------- /rustmap.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python3 2 | import shutil 3 | import argparse 4 | import subprocess 5 | import ipaddress 6 | import os 7 | def scan(): 8 | parser = argparse.ArgumentParser(description="Rustmap -> A scanner which uses rustscan to scan full ports and nmap to analyse") 9 | parser.add_argument("-ip",help="[!] Target IP Address is required",required=True) 10 | args = parser.parse_args() 11 | # ip = "10.10.11.51" 12 | IP = args.ip 13 | try: 14 | ipaddress.ip_address(IP) 15 | print("[+] Valid IP Address") 16 | except: 17 | print("[-] Enter a Valid IP") 18 | exit() 19 | print("[!] Checking for nmap and rustscan") 20 | if shutil.which("nmap"): 21 | print("[+] Nmap found ") 22 | else: 23 | print("[!] Nmap not found!") 24 | exit() 25 | if shutil.which("rustscan"): 26 | print("[+] Rustscan found") 27 | else: 28 | print("[-] Rustscan not found!") 29 | exit() 30 | 31 | print("[+] Running Rustscan to find out ports") 32 | subprocess.run(f"rustscan --range 1-65535 -a {IP} | awk '/\\/tcp/ {{print $1}}' | uniq -u | sed 's/\\/tcp$//g' | paste -sd , > rustports.txt",shell=True) 33 | 34 | print("[+] Created rustports.txt") 35 | subprocess.run(f"sed 's/^/[+] Discovered Ports are : /' rustports.txt",shell=True) 36 | 37 | print("[!] Now Initiating Nmap scan for the above ports found ") 38 | 39 | if not os.path.exists("nmap"): 40 | try: 41 | subprocess.run("mkdir nmap",shell=True) 42 | print("[+] Created nmap directory successfully!") 43 | 44 | except subprocess.CalledProcessError as e: 45 | print(f"[-] failed to create nmap directory:{e}") 46 | else: 47 | print("[-] Nmap directory already exists!") 48 | 49 | 50 | print("[!] Enter nmap output(gnmap,nmap,xml) file name:",end="") 51 | nmapout = str(input()) 52 | subprocess.run(f"nmap -sC -sV -v -p $(cat rustports.txt) -oA nmap/{nmapout} {IP}",shell=True) 53 | 54 | scan() 55 | --------------------------------------------------------------------------------