├── img ├── rep.png ├── res.png └── netscaN.png ├── __pycache__ ├── banner.cpython-313.pyc ├── module.cpython-313.pyc └── NetscanPro.cpython-313.pyc ├── modules ├── __pycache__ │ ├── cve.cpython-313.pyc │ ├── banner.cpython-313.pyc │ ├── module.cpython-313.pyc │ ├── __init__.cpython-313.pyc │ └── report_gen.cpython-313.pyc ├── __init__.py ├── banner.py ├── report_gen.py ├── cve.py └── module.py ├── netscanpro.log ├── scan_history.json ├── setup.sh ├── LICENSE ├── NetscanPro.py └── README.md /img/rep.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MrpasswordTz/NetscanPro/HEAD/img/rep.png -------------------------------------------------------------------------------- /img/res.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MrpasswordTz/NetscanPro/HEAD/img/res.png -------------------------------------------------------------------------------- /img/netscaN.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MrpasswordTz/NetscanPro/HEAD/img/netscaN.png -------------------------------------------------------------------------------- /__pycache__/banner.cpython-313.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MrpasswordTz/NetscanPro/HEAD/__pycache__/banner.cpython-313.pyc -------------------------------------------------------------------------------- /__pycache__/module.cpython-313.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MrpasswordTz/NetscanPro/HEAD/__pycache__/module.cpython-313.pyc -------------------------------------------------------------------------------- /__pycache__/NetscanPro.cpython-313.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MrpasswordTz/NetscanPro/HEAD/__pycache__/NetscanPro.cpython-313.pyc -------------------------------------------------------------------------------- /modules/__pycache__/cve.cpython-313.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MrpasswordTz/NetscanPro/HEAD/modules/__pycache__/cve.cpython-313.pyc -------------------------------------------------------------------------------- /modules/__pycache__/banner.cpython-313.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MrpasswordTz/NetscanPro/HEAD/modules/__pycache__/banner.cpython-313.pyc -------------------------------------------------------------------------------- /modules/__pycache__/module.cpython-313.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MrpasswordTz/NetscanPro/HEAD/modules/__pycache__/module.cpython-313.pyc -------------------------------------------------------------------------------- /modules/__pycache__/__init__.cpython-313.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MrpasswordTz/NetscanPro/HEAD/modules/__pycache__/__init__.cpython-313.pyc -------------------------------------------------------------------------------- /modules/__pycache__/report_gen.cpython-313.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MrpasswordTz/NetscanPro/HEAD/modules/__pycache__/report_gen.cpython-313.pyc -------------------------------------------------------------------------------- /netscanpro.log: -------------------------------------------------------------------------------- 1 | 2025-09-03 03:09:17,334 - INFO - Starting basic scan on single target: localhost 2 | 2025-09-03 03:09:27,719 - INFO - Scan saved: localhost 3 | 2025-09-03 03:13:47,673 - INFO - Professional report generated: reports/localhost_report.html 4 | 2025-09-03 03:26:19,923 - INFO - Starting service version detection on: localhost 5 | -------------------------------------------------------------------------------- /modules/__init__.py: -------------------------------------------------------------------------------- 1 | # modules/__init__.py 2 | import os 3 | import importlib 4 | 5 | base_dir = os.path.dirname(__file__) 6 | 7 | for filename in os.listdir(base_dir): 8 | if filename.endswith(".py") and filename != "__init__.py": 9 | module_name = filename[:-3] 10 | module = importlib.import_module(f".{module_name}", package="modules") 11 | globals().update(vars(module)) # inject all functions/classes 12 | -------------------------------------------------------------------------------- /scan_history.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "name": "localhost", 4 | "target": "localhost", 5 | "timestamp": "2025-09-03T03:09:27.717855", 6 | "results": "Starting Nmap 7.95 ( https://nmap.org ) at 2025-09-03 03:09 EAT\nNmap scan report for localhost (127.0.0.1)\nHost is up (0.0000040s latency).\nOther addresses for localhost (not scanned): ::1\nNot shown: 997 closed tcp ports (reset)\nPORT STATE SERVICE\n22/tcp open ssh\n7070/tcp open realserver\n8000/tcp open http-alt\n\nNmap done: 1 IP address (1 host up) scanned in 0.13 seconds\n" 7 | } 8 | ] -------------------------------------------------------------------------------- /modules/banner.py: -------------------------------------------------------------------------------- 1 | banner = ''' 2 | ███╗ ██╗███████╗████████╗███████╗ ██████╗ █████╗ ███╗ ██╗██████╗ ██████╗ ██████╗ 3 | ████╗ ██║██╔════╝╚══██╔══╝██╔════╝██╔════╝██╔══██╗████╗ ██║██╔══██╗██╔══██╗██╔═══██╗ 4 | ██╔██╗ ██║█████╗ ██║ ███████╗██║ ███████║██╔██╗ ██║██████╔╝██████╔╝██║ ██║ 5 | ██║╚██╗██║██╔══╝ ██║ ╚════██║██║ ██╔══██║██║╚██╗██║██╔═══╝ ██╔══██╗██║ ██║ 6 | ██║ ╚████║███████╗ ██║ ███████║╚██████╗██║ ██║██║ ╚████║██║ ██║ ██║╚██████╔╝ 7 | ╚═╝ ╚═══╝╚══════╝ ╚═╝ ╚══════╝ ╚═════╝╚═╝ ╚═╝╚═╝ ╚═══╝╚═╝ ╚═╝ ╚═╝ ╚═════╝ 8 | 9 | V2.0 10 | ''' 11 | -------------------------------------------------------------------------------- /setup.sh: -------------------------------------------------------------------------------- 1 | 2 | 3 | #!/bin/bash 4 | 5 | # NetscanPro Setup Script 6 | # This script installs the necessary dependencies for NetscanPro 7 | 8 | set -e # Exit on any error 9 | 10 | echo "Setting up NetscanPro dependencies..." 11 | 12 | # Check if running as root 13 | if [[ $EUID -ne 0 ]]; then 14 | echo "This script must be run as root or with sudo privileges." 15 | exit 1 16 | fi 17 | 18 | echo "Updating package list..." 19 | apt update 20 | 21 | echo "Installing required packages..." 22 | apt install -y git wget python3 python3-pip nmap dnsutils whois 23 | 24 | echo "Installing Python dependencies..." 25 | pip3 install colorama 26 | 27 | echo "Installation complete!" 28 | echo "You can now run NetscanPro with: python3 NetscanPro.py" 29 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2025 Mr.passwordTZ 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /NetscanPro.py: -------------------------------------------------------------------------------- 1 | # NetscanPro.py 2 | from modules import * 3 | from colorama import Fore, Style, init 4 | 5 | 6 | init(autoreset=True) 7 | 8 | 9 | def main(): 10 | while True: 11 | owner = "GitHub By: MrpasswordTz\n" 12 | print(Fore.RED + owner +Fore.RESET) 13 | 14 | print("NetScannerPro Menu:\n") 15 | print("1. Basic Scanning") 16 | print("2. Discover Options") 17 | print("3. Advanced Scanning Options") 18 | print("4. Port Scanning Options") 19 | print("5. Version Detection") 20 | print("6. Firewall Evasion Techniques") 21 | print("7. Troubleshooting and Debugging") 22 | print("8. Fast Scan") 23 | print("9. Traceroute") 24 | print("10. NSE Scripts") 25 | print("11. Output Options") 26 | print("12. Timing Options") 27 | print("13. Miscellaneous") 28 | print("14. Configuration") 29 | print("15. Batch Processing") 30 | print("16. Generate Report") 31 | print("99. Update Script\n") 32 | print("0. Exit") 33 | choice = input("Enter your choice: ") 34 | print("\n") 35 | print("\n") 36 | if choice == "1": 37 | basic_scanning() 38 | elif choice == "2": 39 | discover_options() 40 | elif choice == "3": 41 | advanced_scanning_options() 42 | elif choice == "4": 43 | port_scanning_options() 44 | elif choice == "5": 45 | version_detection() 46 | elif choice == "6": 47 | firewall_evasion_techniques() 48 | elif choice == "7": 49 | troubleshooting_and_debugging() 50 | elif choice == "8": 51 | fast_scan() 52 | elif choice == "9": 53 | trace_route() 54 | elif choice == "10": 55 | nse_scripts() 56 | elif choice == "11": 57 | output_options() 58 | elif choice == "12": 59 | timing_options() 60 | elif choice == "13": 61 | miscellaneous() 62 | elif choice == "14": 63 | configuration_menu() 64 | elif choice == "15": 65 | batch_processing_menu() 66 | elif choice == "16": 67 | generate_report_menu() 68 | elif choice == "99": 69 | check_for_update() 70 | elif choice == "0": 71 | break 72 | else: 73 | print("Invalid choice. Please try again.") 74 | 75 | if __name__ == "__main__": 76 | main() 77 | -------------------------------------------------------------------------------- /modules/report_gen.py: -------------------------------------------------------------------------------- 1 | # New feature: Generate simple report 2 | import os 3 | import datetime 4 | from .module import ensure_reports_dir, REPORTS_DIR, logger, analyze_vulnerabilities 5 | 6 | def generate_professional_report(scan_data): 7 | ensure_reports_dir() 8 | scan_name = scan_data['name'] 9 | target = scan_data['target'] 10 | timestamp = scan_data['timestamp'] 11 | results = scan_data['results'] 12 | vulnerabilities = analyze_vulnerabilities(results) 13 | report_file = os.path.join(REPORTS_DIR, f"{scan_name}_report.html") 14 | with open(report_file, "w") as f: 15 | f.write(f""" 16 | 17 | 18 | 19 | 20 | 21 | NetscanPro V2 Report - {scan_name} 22 | 33 | 34 | 35 |
36 |

NetscanPro Security Scan V2 Report

37 |

Scan Name: {scan_name}

38 |

Target: {target}

39 |

Scan Date: {timestamp}

40 |
41 | 42 |
43 |

Scan Results

44 |
{results}
45 |
46 | 47 |
48 |

Vulnerability Analysis

49 | """) 50 | 51 | if vulnerabilities: 52 | for vuln in vulnerabilities: 53 | f.write(f""" 54 |
55 |

Port {vuln['port']} - {vuln['service']}

56 | """) 57 | for v in vuln['vulnerabilities']: 58 | f.write(f""" 59 |

CVE: {v['cve']}

60 |

Description: {v['description']}

61 |

Impact: {v['impact']}

62 |

Recommendation: {v['fix']}

63 | """) 64 | f.write("
") 65 | else: 66 | f.write('

No known vulnerabilities detected in the scan results.

') 67 | 68 | f.write(""" 69 |
70 | 71 |
72 |

Recommendations

73 | 79 |
80 | 81 | 82 | """) 83 | 84 | print(f"Professional report generated: {report_file}") 85 | logger.info(f"Professional report generated: {report_file}") 86 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # NetscanPro V2.0 2 | 3 |

4 | NetscanPro Logo 5 |

6 | 7 |

8 | License 9 | Release 10 | Stars 11 | Forks 12 | Issues 13 |

14 | 15 | ## Table of Contents 16 | 17 | - [Description](#description) 18 | - [Features](#features) 19 | - [Installation](#installation) 20 | - [Usage](#usage) 21 | - [Screenshots](#screenshots) 22 | - [Contributing](#contributing) 23 | - [License](#license) 24 | - [Disclaimer](#disclaimer) 25 | 26 | ## Description 27 | 28 | NetscanPro is a comprehensive, user-friendly network scanning tool built on top of Nmap. It empowers cybersecurity professionals, network administrators, and enthusiasts to perform advanced network reconnaissance, vulnerability detection, and security audits. With an intuitive menu-driven interface, NetscanPro simplifies complex Nmap operations, making network scanning accessible to users of all skill levels. 29 | 30 | The tool provides detailed insights into network topology, identifies active devices, detects open ports, services, and potential vulnerabilities. It supports various scanning techniques, output formats, and includes features like batch processing, report generation, and configuration management. 31 | 32 | ## Features 33 | 34 | ### Core Scanning Capabilities 35 | - **Basic Scanning**: Single target, multiple targets, IP ranges, subnets, random hosts, aggressive scans, IPv6 support 36 | - **Discovery Options**: Multiple ping types (ICMP, TCP SYN/ACK, UDP, SCTP INIT, etc.) 37 | - **Advanced Scanning**: SYN, Connect, UDP, NULL, FIN, Xmas, ACK scans, custom flags, IP protocol scans 38 | - **Port Scanning**: Fast scans, specific ports, port ranges, service-based, all ports, top ports 39 | - **Version Detection**: Service and OS fingerprinting 40 | - **Firewall Evasion**: Fragmentation, decoys, spoofing techniques 41 | - **NSE Scripts**: Run default, vulnerability, and discovery scripts 42 | 43 | ### Additional Features 44 | - **Traceroute**: Network path tracing with various options 45 | - **Fast Scan**: Quick DNS lookups and WHOIS queries 46 | - **Output Options**: Normal, XML, Grepable, Script Kiddie, and all formats 47 | - **Timing Options**: Paranoid to Insane timing templates 48 | - **Miscellaneous**: Verbose output, debugging, resume scans, host exclusion 49 | - **Configuration Management**: Save and load custom settings 50 | - **Batch Processing**: Execute multiple scan commands simultaneously 51 | - **Report Generation**: Professional HTML reports with vulnerability analysis 52 | - **Scan History**: Save and manage previous scan results 53 | - **Logging**: Comprehensive logging with configurable levels 54 | 55 | ### User Experience 56 | - **Intuitive Menu Interface**: Easy navigation without command-line knowledge 57 | - **Cross-Platform**: Supports Linux and Termux (Android) 58 | - **Color-Coded Output**: Enhanced readability with colorama 59 | - **Progress Indicators**: Real-time feedback during scans 60 | - **Error Handling**: Robust error management and user guidance 61 | - **Open Source**: Fully transparent and community-driven 62 | 63 | ## Installation 64 | 65 | ### Prerequisites 66 | - Python 3.6+ 67 | - Nmap 68 | - Root/administrator privileges (recommended for full functionality) 69 | 70 | ### Linux Installation 71 | ```bash 72 | git clone https://github.com/MrpasswordTz/NetscanPro.git 73 | cd NetscanPro 74 | chmod +x setup.sh 75 | sudo ./setup.sh 76 | ``` 77 | 78 | ### Termux (Android) Installation 79 | ```bash 80 | pkg update 81 | pkg install git 82 | git clone https://github.com/MrpasswordTz/NetscanPro.git 83 | cd NetscanPro 84 | chmod +x setup.sh 85 | ./setup.sh 86 | ``` 87 | 88 | ### Manual Installation 89 | If the setup script doesn't work: 90 | ```bash 91 | # Install system dependencies 92 | sudo apt update 93 | sudo apt install -y nmap dnsutils whois 94 | 95 | # Install Python dependencies 96 | pip3 install colorama 97 | ``` 98 | 99 | ## Usage 100 | 101 | 1. Run the tool: 102 | ```bash 103 | python3 NetscanPro.py 104 | ``` 105 | 106 | 2. Navigate through the menu options (1-16) to select your desired scan type 107 | 108 | 3. Follow the prompts to enter target information and scan parameters 109 | 110 | 4. View results in the terminal or generate professional reports 111 | 112 | ### Example Usage 113 | - Select option 1 for Basic Scanning 114 | - Choose a scan type (e.g., single target) 115 | - Enter the target IP or hostname 116 | - The tool will execute the Nmap scan and display results 117 | - Optionally save the scan for reporting 118 | 119 | ## Screenshots 120 | 121 | ### Main Menu 122 | ![Main Menu](https://raw.githubusercontent.com/MrpasswordTz/NetscanPro/refs/heads/main/img/netscaN.png) 123 | 124 | ### Scan Results 125 | ![Scan Results](https://raw.githubusercontent.com/MrpasswordTz/NetscanPro/refs/heads/main/img/res.png) 126 | 127 | ### Generated Report 128 | ![Generated Report](https://raw.githubusercontent.com/MrpasswordTz/NetscanPro/refs/heads/main/img/rep.png) 129 | 130 | *Screenshots will be added soon. For now, the tool provides detailed terminal output.* 131 | 132 | ## Contributing 133 | 134 | We welcome contributions from the community! Here's how you can help: 135 | 136 | 1. Fork the repository 137 | 2. Create a feature branch: `git checkout -b feature-name` 138 | 3. Make your changes and commit: `git commit -m 'Add new feature'` 139 | 4. Push to the branch: `git push origin feature-name` 140 | 5. Submit a Pull Request 141 | 142 | ### Development Setup 143 | ```bash 144 | git clone https://github.com/MrpasswordTz/NetscanPro.git 145 | cd NetscanPro 146 | pip3 install -r requirements.txt # If requirements.txt is added 147 | ``` 148 | 149 | ### Guidelines 150 | - Follow PEP 8 style guidelines 151 | - Add docstrings to new functions 152 | - Test your changes thoroughly 153 | - Update documentation as needed 154 | 155 | ## License 156 | 157 | This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details. 158 | 159 | ## Disclaimer 160 | 161 | **⚠️ WARNING**: This tool is intended for educational and authorized security testing purposes only. Unauthorized use of NetscanPro against networks or systems you do not own or have explicit permission to test may violate laws and regulations. The developers and contributors are not responsible for any misuse or damage caused by this tool. 162 | 163 | Always ensure you have proper authorization before performing any network scanning activities. Use responsibly and ethically. 164 | 165 | --- 166 | 167 | **Developed by**: [MrpasswordTz](https://github.com/MrpasswordTz) 168 | **Contributors**: [iamunix](https://github.com/iamunix) 169 | 170 | *This tool is under active development. 🚧 🏗️* 171 | -------------------------------------------------------------------------------- /modules/cve.py: -------------------------------------------------------------------------------- 1 | # CVE Database for vulnerabilities 2 | CVE_DATABASE = { 3 | "22/tcp": { 4 | "service": "SSH", 5 | "vulnerabilities": [ 6 | { 7 | "cve": "CVE-2018-15473", 8 | "description": "OpenSSH user enumeration vulnerability", 9 | "impact": "Information disclosure", 10 | "fix": "Upgrade OpenSSH to version 7.7 or later" 11 | }, 12 | { 13 | "cve": "CVE-2020-15778", 14 | "description": "OpenSSH command injection vulnerability", 15 | "impact": "Remote code execution", 16 | "fix": "Upgrade OpenSSH to version 8.3 or later" 17 | }, 18 | { 19 | "cve": "CVE-2023-38408", 20 | "description": "OpenSSH privilege escalation vulnerability", 21 | "impact": "Privilege escalation", 22 | "fix": "Upgrade OpenSSH to version 9.3 or later" 23 | } 24 | ] 25 | }, 26 | "80/tcp": { 27 | "service": "HTTP", 28 | "vulnerabilities": [ 29 | { 30 | "cve": "CVE-2019-11043", 31 | "description": "PHP-FPM vulnerability allowing remote code execution", 32 | "impact": "Remote code execution", 33 | "fix": "Update PHP-FPM and configure properly" 34 | }, 35 | { 36 | "cve": "CVE-2021-44228", 37 | "description": "Apache Log4j remote code execution vulnerability", 38 | "impact": "Remote code execution", 39 | "fix": "Update Log4j to version 2.17.0 or later" 40 | }, 41 | { 42 | "cve": "CVE-2021-41773", 43 | "description": "Apache HTTP Server path traversal vulnerability", 44 | "impact": "Path traversal, information disclosure", 45 | "fix": "Update Apache to version 2.4.51 or later" 46 | }, 47 | { 48 | "cve": "CVE-2017-5638", 49 | "description": "Apache Struts remote code execution vulnerability", 50 | "impact": "Remote code execution", 51 | "fix": "Update Apache Struts to version 2.3.32 or 2.5.10.1" 52 | } 53 | ] 54 | }, 55 | "443/tcp": { 56 | "service": "HTTPS", 57 | "vulnerabilities": [ 58 | { 59 | "cve": "CVE-2020-0601", 60 | "description": "Windows CryptoAPI spoofing vulnerability", 61 | "impact": "Man-in-the-middle attacks", 62 | "fix": "Apply Windows security updates" 63 | }, 64 | { 65 | "cve": "CVE-2014-0160", 66 | "description": "Heartbleed OpenSSL information disclosure", 67 | "impact": "Information disclosure, private key exposure", 68 | "fix": "Update OpenSSL to version 1.0.1g or later" 69 | }, 70 | { 71 | "cve": "CVE-2021-3449", 72 | "description": "OpenSSL denial of service vulnerability", 73 | "impact": "Denial of service", 74 | "fix": "Update OpenSSL to version 1.1.1k or later" 75 | } 76 | ] 77 | }, 78 | "21/tcp": { 79 | "service": "FTP", 80 | "vulnerabilities": [ 81 | { 82 | "cve": "CVE-2011-2523", 83 | "description": "VSFTPD backdoor vulnerability", 84 | "impact": "Remote code execution", 85 | "fix": "Update VSFTPD to version 2.3.5 or later" 86 | }, 87 | { 88 | "cve": "CVE-2020-9490", 89 | "description": "ProFTPD mod_copy remote code execution", 90 | "impact": "Remote code execution", 91 | "fix": "Update ProFTPD to version 1.3.6b or later" 92 | } 93 | ] 94 | }, 95 | "23/tcp": { 96 | "service": "Telnet", 97 | "vulnerabilities": [ 98 | { 99 | "cve": "CVE-2020-10188", 100 | "description": "Multiple Telnet vulnerabilities", 101 | "impact": "Denial of service, information disclosure", 102 | "fix": "Update Telnet service or disable in favor of SSH" 103 | } 104 | ] 105 | }, 106 | "25/tcp": { 107 | "service": "SMTP", 108 | "vulnerabilities": [ 109 | { 110 | "cve": "CVE-2021-34429", 111 | "description": "Exim SMTP server remote code execution", 112 | "impact": "Remote code execution", 113 | "fix": "Update Exim to version 4.94.2 or later" 114 | }, 115 | { 116 | "cve": "CVE-2019-15846", 117 | "description": "Exim off-by-one remote code execution", 118 | "impact": "Remote code execution", 119 | "fix": "Update Exim to version 4.92.3 or later" 120 | } 121 | ] 122 | }, 123 | "53/tcp": { 124 | "service": "DNS", 125 | "vulnerabilities": [ 126 | { 127 | "cve": "CVE-2020-1350", 128 | "description": "Windows DNS Server wormable vulnerability", 129 | "impact": "Remote code execution", 130 | "fix": "Apply Windows security updates" 131 | }, 132 | { 133 | "cve": "CVE-2021-25216", 134 | "description": "BIND denial of service vulnerability", 135 | "impact": "Denial of service", 136 | "fix": "Update BIND to version 9.16.13 or later" 137 | } 138 | ] 139 | }, 140 | "53/udp": { 141 | "service": "DNS", 142 | "vulnerabilities": [ 143 | { 144 | "cve": "CVE-2020-1350", 145 | "description": "Windows DNS Server wormable vulnerability", 146 | "impact": "Remote code execution", 147 | "fix": "Apply Windows security updates" 148 | }, 149 | { 150 | "cve": "CVE-2021-25216", 151 | "description": "BIND denial of service vulnerability", 152 | "impact": "Denial of service", 153 | "fix": "Update BIND to version 9.16.13 or later" 154 | } 155 | ] 156 | }, 157 | "110/tcp": { 158 | "service": "POP3", 159 | "vulnerabilities": [ 160 | { 161 | "cve": "CVE-2020-12667", 162 | "description": "Dovecot POP3/IMAP vulnerability", 163 | "impact": "Information disclosure", 164 | "fix": "Update Dovecot to version 2.3.11.3 or later" 165 | } 166 | ] 167 | }, 168 | "135/tcp": { 169 | "service": "MSRPC", 170 | "vulnerabilities": [ 171 | { 172 | "cve": "CVE-2021-34527", 173 | "description": "Windows Print Spooler remote code execution", 174 | "impact": "Remote code execution", 175 | "fix": "Apply Windows security updates" 176 | }, 177 | { 178 | "cve": "CVE-2020-1472", 179 | "description": "Netlogon elevation of privilege vulnerability", 180 | "impact": "Privilege escalation", 181 | "fix": "Apply Windows security updates" 182 | } 183 | ] 184 | }, 185 | "139/tcp": { 186 | "service": "NetBIOS", 187 | "vulnerabilities": [ 188 | { 189 | "cve": "CVE-2017-0143", 190 | "description": "EternalBlue SMB remote code execution", 191 | "impact": "Remote code execution", 192 | "fix": "Apply MS17-010 security update" 193 | }, 194 | { 195 | "cve": "CVE-2020-0796", 196 | "description": "SMBv3 compression buffer overflow", 197 | "impact": "Remote code execution", 198 | "fix": "Apply Windows security updates" 199 | } 200 | ] 201 | }, 202 | "143/tcp": { 203 | "service": "IMAP", 204 | "vulnerabilities": [ 205 | { 206 | "cve": "CVE-2020-12667", 207 | "description": "Dovecot POP3/IMAP vulnerability", 208 | "impact": "Information disclosure", 209 | "fix": "Update Dovecot to version 2.3.11.3 or later" 210 | } 211 | ] 212 | }, 213 | "445/tcp": { 214 | "service": "SMB", 215 | "vulnerabilities": [ 216 | { 217 | "cve": "CVE-2017-0143", 218 | "description": "EternalBlue SMB remote code execution", 219 | "impact": "Remote code execution", 220 | "fix": "Apply MS17-010 security update" 221 | }, 222 | { 223 | "cve": "CVE-2020-0796", 224 | "description": "SMBv3 compression buffer overflow", 225 | "impact": "Remote code execution", 226 | "fix": "Apply Windows security updates" 227 | }, 228 | { 229 | "cve": "CVE-2021-34527", 230 | "description": "Windows Print Spooler remote code execution", 231 | "impact": "Remote code execution", 232 | "fix": "Apply Windows security updates" 233 | } 234 | ] 235 | }, 236 | "993/tcp": { 237 | "service": "IMAPS", 238 | "vulnerabilities": [ 239 | { 240 | "cve": "CVE-2020-12667", 241 | "description": "Dovecot POP3/IMAP vulnerability", 242 | "impact": "Information disclosure", 243 | "fix": "Update Dovecot to version 2.3.11.3 or later" 244 | } 245 | ] 246 | }, 247 | "995/tcp": { 248 | "service": "POP3S", 249 | "vulnerabilities": [ 250 | { 251 | "cve": "CVE-2020-12667", 252 | "description": "Dovecot POP3/IMAP vulnerability", 253 | "impact": "Information disclosure", 254 | "fix": "Update Dovecot to version 2.3.11.3 or later" 255 | } 256 | ] 257 | }, 258 | "1433/tcp": { 259 | "service": "MSSQL", 260 | "vulnerabilities": [ 261 | { 262 | "cve": "CVE-2021-1636", 263 | "description": "SQL Server remote code execution vulnerability", 264 | "impact": "Remote code execution", 265 | "fix": "Apply SQL Server security updates" 266 | } 267 | ] 268 | }, 269 | "1434/tcp": { 270 | "service": "MSSQL Browser", 271 | "vulnerabilities": [ 272 | { 273 | "cve": "CVE-2021-1636", 274 | "description": "SQL Server remote code execution vulnerability", 275 | "impact": "Remote code execution", 276 | "fix": "Apply SQL Server security updates" 277 | } 278 | ] 279 | }, 280 | "1434/udp": { 281 | "service": "MSSQL Browser", 282 | "vulnerabilities": [ 283 | { 284 | "cve": "CVE-2021-1636", 285 | "description": "SQL Server remote code execution vulnerability", 286 | "impact": "Remote code execution", 287 | "fix": "Apply SQL Server security updates" 288 | } 289 | ] 290 | }, 291 | "3306/tcp": { 292 | "service": "MySQL", 293 | "vulnerabilities": [ 294 | { 295 | "cve": "CVE-2021-27928", 296 | "description": "MySQL Server wormable vulnerability", 297 | "impact": "Remote code execution", 298 | "fix": "Update MySQL to version 8.0.23 or later" 299 | }, 300 | { 301 | "cve": "CVE-2020-14812", 302 | "description": "MySQL Server privilege escalation", 303 | "impact": "Privilege escalation", 304 | "fix": "Update MySQL to version 8.0.22 or later" 305 | } 306 | ] 307 | }, 308 | "3389/tcp": { 309 | "service": "RDP", 310 | "vulnerabilities": [ 311 | { 312 | "cve": "CVE-2019-0708", 313 | "description": "BlueKeep RDP remote code execution", 314 | "impact": "Remote code execution", 315 | "fix": "Apply Windows security updates" 316 | }, 317 | { 318 | "cve": "CVE-2020-0609", 319 | "description": "RDP gateway denial of service", 320 | "impact": "Denial of service", 321 | "fix": "Apply Windows security updates" 322 | } 323 | ] 324 | }, 325 | "5432/tcp": { 326 | "service": "PostgreSQL", 327 | "vulnerabilities": [ 328 | { 329 | "cve": "CVE-2021-23214", 330 | "description": "PostgreSQL privilege escalation", 331 | "impact": "Privilege escalation", 332 | "fix": "Update PostgreSQL to version 13.3 or later" 333 | }, 334 | { 335 | "cve": "CVE-2020-25695", 336 | "description": "PostgreSQL information disclosure", 337 | "impact": "Information disclosure", 338 | "fix": "Update PostgreSQL to version 13.1 or later" 339 | } 340 | ] 341 | }, 342 | "5900/tcp": { 343 | "service": "VNC", 344 | "vulnerabilities": [ 345 | { 346 | "cve": "CVE-2019-15690", 347 | "description": "RealVNC authentication bypass", 348 | "impact": "Authentication bypass", 349 | "fix": "Update RealVNC to version 6.7.1 or later" 350 | }, 351 | { 352 | "cve": "CVE-2020-25708", 353 | "description": "TigerVNC denial of service", 354 | "impact": "Denial of service", 355 | "fix": "Update TigerVNC to version 1.11.0 or later" 356 | } 357 | ] 358 | }, 359 | "6379/tcp": { 360 | "service": "Redis", 361 | "vulnerabilities": [ 362 | { 363 | "cve": "CVE-2021-32761", 364 | "description": "Redis Lua sandbox escape", 365 | "impact": "Remote code execution", 366 | "fix": "Update Redis to version 6.2.6 or later" 367 | }, 368 | { 369 | "cve": "CVE-2022-24735", 370 | "description": "Redis remote code execution", 371 | "impact": "Remote code execution", 372 | "fix": "Update Redis to version 7.0.0 or later" 373 | } 374 | ] 375 | }, 376 | "9200/tcp": { 377 | "service": "Elasticsearch", 378 | "vulnerabilities": [ 379 | { 380 | "cve": "CVE-2015-1427", 381 | "description": "Elasticsearch Groovy sandbox escape", 382 | "impact": "Remote code execution", 383 | "fix": "Update Elasticsearch to version 1.4.3 or later" 384 | }, 385 | { 386 | "cve": "CVE-2019-7611", 387 | "description": "Elasticsearch privilege escalation", 388 | "impact": "Privilege escalation", 389 | "fix": "Update Elasticsearch to version 6.8.3 or later" 390 | } 391 | ] 392 | }, 393 | "27017/tcp": { 394 | "service": "MongoDB", 395 | "vulnerabilities": [ 396 | { 397 | "cve": "CVE-2021-20330", 398 | "description": "MongoDB denial of service", 399 | "impact": "Denial of service", 400 | "fix": "Update MongoDB to version 4.4.6 or later" 401 | }, 402 | { 403 | "cve": "CVE-2019-2391", 404 | "description": "MongoDB privilege escalation", 405 | "impact": "Privilege escalation", 406 | "fix": "Update MongoDB to version 4.0.12 or later" 407 | } 408 | ] 409 | } 410 | } -------------------------------------------------------------------------------- /modules/module.py: -------------------------------------------------------------------------------- 1 | import subprocess 2 | import os 3 | import signal 4 | import logging 5 | import json 6 | import threading 7 | import datetime 8 | from colorama import Fore, Style, init 9 | from .banner import * 10 | from .cve import * 11 | 12 | 13 | 14 | init() # Initialize colorama 15 | 16 | def setup_logger(): 17 | """Set up the logger for the application.""" 18 | logger = logging.getLogger('netscanpro') 19 | logger.setLevel(logging.INFO) 20 | handler = logging.StreamHandler() 21 | formatter = logging.Formatter('%(asctime)s - %(levelname)s - %(message)s') 22 | handler.setFormatter(formatter) 23 | logger.addHandler(handler) 24 | return logger 25 | 26 | logger = setup_logger() 27 | 28 | print(Fore.BLUE + banner + Fore.RESET) 29 | 30 | # Set up logging 31 | logging.basicConfig(filename='netscanpro.log', level=logging.INFO, format='%(asctime)s - %(levelname)s - %(message)s') 32 | 33 | 34 | 35 | 36 | 37 | # New feature: Configuration file support 38 | CONFIG_FILE = "netscanpro_config.json" 39 | 40 | def load_config(): 41 | if os.path.exists(CONFIG_FILE): 42 | with open(CONFIG_FILE, "r") as f: 43 | try: 44 | config = json.load(f) 45 | logger.info("Configuration loaded from file.") 46 | return config 47 | except json.JSONDecodeError: 48 | print("Error: Configuration file is corrupted.") 49 | logger.error("Configuration file is corrupted.") 50 | return {} 51 | else: 52 | return {} 53 | 54 | def save_config(config): 55 | with open(CONFIG_FILE, "w") as f: 56 | json.dump(config, f, indent=4) 57 | logger.info("Configuration saved to file.") 58 | 59 | # Scan history and reports 60 | SCAN_HISTORY_FILE = "scan_history.json" 61 | REPORTS_DIR = "reports" 62 | 63 | def ensure_reports_dir(): 64 | if not os.path.exists(REPORTS_DIR): 65 | os.makedirs(REPORTS_DIR) 66 | logger.info(f"Created reports directory: {REPORTS_DIR}") 67 | 68 | def save_scan(scan_name, target, results): 69 | ensure_reports_dir() 70 | history = load_scan_history() 71 | scan_entry = { 72 | "name": scan_name, 73 | "target": target, 74 | "timestamp": datetime.datetime.now().isoformat(), 75 | "results": results 76 | } 77 | history.append(scan_entry) 78 | with open(SCAN_HISTORY_FILE, "w") as f: 79 | json.dump(history, f, indent=4) 80 | logger.info(f"Scan saved: {scan_name}") 81 | 82 | def load_scan_history(): 83 | if os.path.exists(SCAN_HISTORY_FILE): 84 | with open(SCAN_HISTORY_FILE, "r") as f: 85 | try: 86 | return json.load(f) 87 | except json.JSONDecodeError: 88 | return [] 89 | return [] 90 | 91 | 92 | def analyze_vulnerabilities(scan_results): 93 | """Analyze scan results for known vulnerabilities.""" 94 | recommendations = [] 95 | lines = scan_results.split('\n') 96 | for line in lines: 97 | if '/tcp' in line and 'open' in line: 98 | port = line.split('/')[0] + '/tcp' 99 | if port in CVE_DATABASE: 100 | vuln_info = CVE_DATABASE[port] 101 | recommendations.append({ 102 | "port": port, 103 | "service": vuln_info["service"], 104 | "vulnerabilities": vuln_info["vulnerabilities"] 105 | }) 106 | return recommendations 107 | 108 | # New feature: Progress indicator for scans 109 | def progress_indicator(): 110 | import time 111 | import sys 112 | spinner = ['|', '/', '-', '\\'] 113 | idx = 0 114 | while True: 115 | sys.stdout.write(f"\rScanning... {spinner[idx % len(spinner)]}") 116 | sys.stdout.flush() 117 | idx += 1 118 | time.sleep(0.1) 119 | 120 | # New feature: Save scan results 121 | def save_scan_results(scan_name, results): 122 | filename = f"{scan_name}_results.txt" 123 | with open(filename, "w") as f: 124 | f.write(results) 125 | print(f"Scan results saved to {filename}") 126 | logger.info(f"Scan results saved to {filename}") 127 | 128 | # New feature: Batch processing mode 129 | def batch_process(scan_commands): 130 | threads = [] 131 | for cmd in scan_commands: 132 | t = threading.Thread(target=safe_run_command, args=(cmd,)) 133 | threads.append(t) 134 | t.start() 135 | for t in threads: 136 | t.join() 137 | 138 | # Global variable to store last scan result 139 | last_scan_result = "" 140 | 141 | 142 | def validate_target(target): 143 | """Basic validation for target input.""" 144 | if not target or target.strip() == "": 145 | return False 146 | # Check for basic shell metacharacters 147 | dangerous_chars = [';', '&', '|', '`', '$', '(', ')'] 148 | if any(char in target for char in dangerous_chars): 149 | return False 150 | return True 151 | 152 | def safe_run_command(command): 153 | """Run command with better error handling and result capture.""" 154 | global last_scan_result 155 | try: 156 | result = subprocess.run(command, check=True, capture_output=True, text=True) 157 | full_output = result.stdout + result.stderr 158 | print(full_output) 159 | last_scan_result = full_output # Store the result 160 | # Prompt to save scan 161 | print("\n" + "="*50) 162 | print("SCAN COMPLETED!") 163 | save_choice = input("Save this scan for reporting? (y/n): ").lower().strip() 164 | if save_choice == 'y': 165 | scan_name = input("Enter scan name: ").strip() 166 | if scan_name: 167 | target = command[-1] if len(command) > 1 else "unknown" 168 | save_scan(scan_name, target, full_output) 169 | print(f"Scan '{scan_name}' saved successfully!") 170 | else: 171 | print("Scan name cannot be empty.") 172 | else: 173 | print("Scan not saved.") 174 | print("="*50 + "\n") 175 | return True 176 | except subprocess.CalledProcessError as e: 177 | error_msg = f"Error running command: {e}\nError output: {e.stderr}" 178 | print(error_msg) 179 | last_scan_result = error_msg 180 | return False 181 | except FileNotFoundError: 182 | msg = "Command not found. Please ensure required tools are installed." 183 | print(msg) 184 | last_scan_result = msg 185 | return False 186 | 187 | 188 | 189 | def signal_handler(sig, frame): 190 | print("\nProgram stopped. Goodbye!") 191 | exit(0) 192 | 193 | signal.signal(signal.SIGINT, signal_handler) 194 | 195 | def run_nmap_command(args): 196 | try: 197 | subprocess.run(["nmap"] + args, check=True) 198 | except subprocess.CalledProcessError as e: 199 | print(f"Error: {e}") 200 | return False 201 | return True 202 | 203 | def get_user_input(prompt): 204 | while True: 205 | user_input = input(prompt) 206 | if user_input: 207 | return user_input 208 | print("Invalid input. Please try again.") 209 | 210 | lines = "---------------------------------------------------------------------->\n" 211 | results = Fore.BLUE + "#RESULTS #...please wait...\n" + Fore.RESET 212 | 213 | def basic_scanning(): 214 | print(lines) 215 | print("Basic Scanning Options:\n") 216 | print("1. Scan Multiple Targets") 217 | print("2. Scan a Single Target") 218 | print("3. Scan a Range of Hosts") 219 | print("4. Scan an Entire Subnet") 220 | print("5. Scan Random Hosts") 221 | print("6. Perform an Aggressive Scan") 222 | print("7. Scan an IPv6 Target") 223 | choice = input("Enter your choice: ") 224 | if choice == "1": 225 | targets = input("Enter multiple targets (comma separated): ") 226 | if validate_target(targets): 227 | print("\n") 228 | print(results) 229 | logger.info(f"Starting basic scan on multiple targets: {targets}") 230 | safe_run_command(["nmap", "-sT", targets]) 231 | print(lines) 232 | else: 233 | print("Invalid target input. Please try again.") 234 | elif choice == "2": 235 | target = input("Enter a single target: ") 236 | if validate_target(target): 237 | print("\n") 238 | print(results) 239 | logger.info(f"Starting basic scan on single target: {target}") 240 | safe_run_command(["nmap", target]) 241 | print(lines) 242 | else: 243 | print("Invalid target input. Please try again.") 244 | elif choice == "3": 245 | target = input("Enter a target with range (e.g. 192.168.1.1-100): ") 246 | if validate_target(target): 247 | print("\n") 248 | print(results) 249 | logger.info(f"Starting range scan on: {target}") 250 | safe_run_command(["nmap", "-sT", target]) 251 | print(lines) 252 | else: 253 | print("Invalid target input. Please try again.") 254 | elif choice == "4": 255 | target = input("Enter a target with subnet (e.g. 192.168.1.0/24): ") 256 | if validate_target(target): 257 | print("\n") 258 | print(results) 259 | logger.info(f"Starting subnet scan on: {target}") 260 | safe_run_command(["nmap", "-sT", target]) 261 | print(lines) 262 | else: 263 | print("Invalid target input. Please try again.") 264 | elif choice == "5": 265 | target = input("Enter a target for random hosts: ") 266 | if validate_target(target): 267 | print("\n") 268 | print(results) 269 | logger.info(f"Starting random hosts scan on: {target}") 270 | safe_run_command(["nmap", "-iR", target]) 271 | print(lines) 272 | else: 273 | print("Invalid target input. Please try again.") 274 | elif choice == "6": 275 | target = input("Enter a target for aggressive scan: ") 276 | if validate_target(target): 277 | print("\n") 278 | print(results) 279 | logger.info(f"Starting aggressive scan on: {target}") 280 | safe_run_command(["nmap", "-A", target]) 281 | print(lines) 282 | else: 283 | print("Invalid target input. Please try again.") 284 | elif choice == "7": 285 | target = input("Enter an IPv6 target: ") 286 | if validate_target(target): 287 | print("\n") 288 | print(results) 289 | logger.info(f"Starting IPv6 scan on: {target}") 290 | safe_run_command(["nmap", "-6", target]) 291 | print(lines) 292 | else: 293 | print("Invalid target input. Please try again.") 294 | 295 | def discover_options(): 296 | print(lines) 297 | print("Discover Options:\n") 298 | print("1. Only Single IP Protocol Ping") 299 | print("2. UDP Ping") 300 | print("3. CMP Address Mask Ping") 301 | print("4. ICMP Echo Ping") 302 | print("5. TCP ACK Ping") 303 | print("6. TCP SYN Ping") 304 | print("7. ICMP Timestamp Ping") 305 | print("8. SCTP INIT Ping") 306 | choice = input("Enter your choice: ") 307 | if choice == "1": 308 | target = input("Enter Target ip for single ping ") 309 | subprocess.run(["nmap", "-sP", target]) 310 | elif choice == "2": 311 | target = input("Enter a target for UDP ping: ") 312 | subprocess.run(["nmap", "-sU", target]) 313 | elif choice == "3": 314 | target = input("Enter ICMP Address Mask Ping: ") 315 | print("\n") 316 | print(results) 317 | subprocess.run(["nmap", "-PM", target]) 318 | print(lines) 319 | elif choice == "4": 320 | target = input("Enter ECHO ICMP ping: ") 321 | print("\n") 322 | print(results) 323 | subprocess.run(["nmap", "-PE", target]) 324 | print(lines) 325 | elif choice == "5": 326 | target = input("Enter TCP ACK ping: ") 327 | print("\n") 328 | print(results) 329 | subprocess.run(["nmap", "-PA", target]) 330 | print(lines) 331 | elif choice == "6": 332 | target = input("Enter TCP SYN ping: ") 333 | print("\n") 334 | print(results) 335 | subprocess.run(["nmap", "-PS", target]) 336 | print(lines) 337 | elif choice == "7": 338 | target = input("Enter ICMP Timestamp ping: ") 339 | print("\n") 340 | print(results) 341 | subprocess.run(["nmap", "-PP", target]) 342 | print(lines) 343 | elif choice == "8": 344 | target = input("Enter IP protocol to ping: ") 345 | print("\n") 346 | print(results) 347 | subprocess.run(["nmap", "-PO", target]) 348 | print(lines) 349 | #... implement other options... 350 | 351 | def advanced_scanning_options(): 352 | print(lines) 353 | print("Advanced Scanning Options:\n") 354 | print("1. TCP SYN Scan") 355 | print("2. TCP Connect Scan") 356 | print("3. UDP Scan") 357 | print("4. TCP NULL Scan") 358 | print("5. TCP FIN Scan") 359 | print("6. Xmas Scan") 360 | print("7. TCP ACK Scan") 361 | print("8. Custom TCP Scan") 362 | print("9. IP Protocol Scan") 363 | print("10. Send Raw Ethernet Packets") 364 | print("11. Send IP Packets") 365 | choice = input("Enter your choice: ") 366 | if choice == "1": 367 | target = input("Enter a target for TCP SYN scan: ") 368 | print("\n") 369 | print(results) 370 | subprocess.run(["nmap", "-sS", target]) 371 | print(lines) 372 | elif choice == "2": 373 | target = input("Enter a target for TCP connect scan: ") 374 | print("\n") 375 | print(results) 376 | subprocess.run(["nmap", "-sT", target]) 377 | print(lines) 378 | elif choice == "3": 379 | target = input("Enter a target for UDP connect scan: ") 380 | print("\n") 381 | print(results) 382 | subprocess.run(["nmap", "-sU", target]) 383 | print(lines) 384 | elif choice == "4": 385 | target = input("Enter a target for TCP NULL scan: ") 386 | print("\n") 387 | print(results) 388 | subprocess.run(["nmap", "-sN", target]) 389 | print(lines) 390 | elif choice == "5": 391 | target = input("Enter a target for TCP FIN scan: ") 392 | print("\n") 393 | print(results) 394 | subprocess.run(["nmap", "-sF", target]) 395 | print(lines) 396 | elif choice == "6": 397 | target = input("Enter a target for Xmas scan: ") 398 | print("\n") 399 | print(results) 400 | subprocess.run(["nmap", "-sX", target]) 401 | print(lines) 402 | elif choice == "7": 403 | target = input("Enter a target for TCP ACK scan: ") 404 | print("\n") 405 | print(results) 406 | subprocess.run(["nmap", "-sA", target]) 407 | print(lines) 408 | elif choice == "8": 409 | target = input("Enter a target for Custom TCP scan: ") 410 | print("\n") 411 | print(results) 412 | subprocess.run(["nmap", "-scanflags SYNFIN", target]) 413 | print(lines) 414 | elif choice == "9": 415 | target = input("Enter a target for Ip protocol scan: ") 416 | print("\n") 417 | print(results) 418 | subprocess.run(["nmap", "-sO", target]) 419 | print(lines) 420 | elif choice == "10": 421 | target = input("Enter a target for SendRaw Ethernet: ") 422 | print("\n") 423 | print(results) 424 | subprocess.run(["nmap", "-send-eth", target]) 425 | print(lines) 426 | elif choice == "11": 427 | target = input("Enter a target for Send Ip Packets: ") 428 | print("\n") 429 | print(results) 430 | subprocess.run(["nmap", "-send-ip", target]) 431 | print(lines) 432 | 433 | #... implement other options... 434 | 435 | def port_scanning_options(): 436 | print(lines) 437 | print("Port Scanning Options:\n") 438 | print("1. Perform a Fast Scan") 439 | print("2. Scan Specific Ports") 440 | print("3. Scan Ports by Name") 441 | print("4. Scan Ports by Protocol") 442 | print("5. Scan All Ports") 443 | print("6. Scan Top Ports") 444 | print("7. Perform a Sequential Port Scan") 445 | choice = input("Enter your choice: ") 446 | if choice == "1": 447 | target = input("Enter a target for fast scan: ") 448 | if validate_target(target): 449 | print("\n") 450 | print(results) 451 | logger.info(f"Starting fast scan on: {target}") 452 | safe_run_command(["nmap", "-F", target]) 453 | print(lines) 454 | else: 455 | print("Invalid target input. Please try again.") 456 | elif choice == "2": 457 | target = input("Enter a target and specific ports (e.g. 22,80): ") 458 | print("\n") 459 | print(results) 460 | subprocess.run(["nmap", "-p", target]) 461 | print(lines) 462 | elif choice == "4": 463 | target = input("Enter a protocol port to scan: ") 464 | print("\n") 465 | print(results) 466 | subprocess.run(["nmap", "-sU", "-sT", "-p", "U:" + target]) 467 | print(lines) 468 | elif choice == "3": 469 | target = input("Enter a target for Port Name To Scan: Example http, ftp - ") 470 | print("\n") 471 | print(results) 472 | subprocess.run(["nmap", "-p", target]) 473 | print(lines) 474 | elif choice == "5": 475 | target = input("Enter Scan All Ports: ") 476 | print("\n") 477 | print(results) 478 | subprocess.run(["nmap", "-p-", target]) 479 | print(lines) 480 | elif choice == "6": 481 | target = input("Enter Scan Top Ports: ") 482 | print("\n") 483 | print(results) 484 | subprocess.run(["nmap", "--top-ports", target]) 485 | print(lines) 486 | elif choice == "7": 487 | target = input("Enter Port to perform Sequential: ") 488 | print("\n") 489 | print(results) 490 | subprocess.run(["nmap", "-r", target]) 491 | print(lines) 492 | #... implement other options... 493 | 494 | def version_detection(): 495 | print(lines) 496 | print("Version Detection Options:\n") 497 | print("1. Operating System Detection") 498 | print("2. Attempt to Guess an Unknown OS") 499 | print("3. Service Version Detection") 500 | print("4. Troubleshooting Version Scans") 501 | print("5. Perform a RPC Scan") 502 | choice = input("Enter your choice: ") 503 | if choice == "1": 504 | target = input("Enter a target for OS detection: ") 505 | print("\n") 506 | print(results) 507 | subprocess.run(["nmap", "-O", target]) 508 | print(lines) 509 | elif choice == "2": 510 | target = input("Enter a target forunknown OS guess: ") 511 | print("\n") 512 | print(results) 513 | subprocess.run(["nmap", "-O", "--osscan-guess", target]) 514 | print(lines) 515 | elif choice == "3": 516 | target = input("Enter Your Target: ") 517 | if validate_target(target): 518 | print("\n") 519 | print(results) 520 | logger.info(f"Starting service version detection on: {target}") 521 | safe_run_command(["nmap", "-sV", target]) 522 | print(lines) 523 | else: 524 | print("Invalid target input. Please try again.") 525 | elif choice == "4": 526 | target = input("Enter Your Target: ") 527 | print("\n") 528 | print(results) 529 | subprocess.run(["nmap" , "-sV -version-trace" , target]) 530 | print(lines) 531 | elif choice =="5": 532 | target = input("Enter Your Target: ") 533 | print("\n") 534 | print(results) 535 | subprocess.run(["nmap", "-sR", target]) 536 | print(lines) 537 | #... implement other options... 538 | 539 | def firewall_evasion_techniques(): 540 | print(lines) 541 | print("Firewall Evasion Techniques:\n") 542 | print("1. Augment Packets") 543 | print("2. Pacify a Specific MTU") 544 | print("3. Use a Decoy") 545 | print("4. Spoof Mac Address") 546 | print("5. Le Zombie Scan") 547 | choice = input("Enter your choice: ") 548 | if choice == "1": 549 | target = input("Enter a target for augment packets: ") 550 | print("\n") 551 | print(results) 552 | subprocess.run(["nmap", "-f", target]) 553 | print(lines) 554 | elif choice == "2": 555 | target = input("Enter a target and MTU (e.g. 1500): ") 556 | print("\n") 557 | print(results) 558 | subprocess.run(["nmap", "--mtu", target]) 559 | print(lines) 560 | elif choice == "3": 561 | target = input("Enter a Decoy: ") 562 | print("\n") 563 | print(results) 564 | subprocess.run(["nmap" , "-D RND:", target ]) 565 | print(lines) 566 | elif choice == "4": 567 | target = input("Enter a Mac Address: ") 568 | print("\n") 569 | print(results) 570 | subprocess.run(["nmap", "-spoof-mac", target]) 571 | print(lines) 572 | elif choice == "5": 573 | target = input("Enter Le Zombie Target:") 574 | print("\n") 575 | print(results) 576 | subprocess.run(["nmap", " -sI", target]) 577 | print(lines) 578 | 579 | #... implement other options... 580 | 581 | def troubleshooting_and_debugging(): 582 | print(lines) 583 | print("Troubleshooting and Debugging Options:\n") 584 | print("1. Trace Packet") 585 | print("2. Debugging") 586 | print("3. Open Ports") 587 | choice = input("Enter your choice: ") 588 | if choice == "1": 589 | target = input("Enter a target for trace packet: ") 590 | print("\n") 591 | print(results) 592 | subprocess.run(["nmap", "--packet-trace", target]) 593 | print(lines) 594 | elif choice == "2": 595 | target = input("Enter a target for debugging: ") 596 | print("\n") 597 | print(results) 598 | subprocess.run(["nmap", "-d", target]) 599 | print(lines) 600 | elif choice == "3": 601 | target = input("Enter a target for open ports: ") 602 | print("\n") 603 | print(results) 604 | subprocess.run(["nmap", "--open", target]) 605 | print(lines) 606 | 607 | def fast_scan(): 608 | print(lines) 609 | print("Fast Scan:\n") 610 | print("1. nslookup") 611 | print("2. whois") 612 | choice = input("Enter your choice: ") 613 | if choice == "1": 614 | target = input("Enter the Target: ") 615 | print("\n") 616 | print(results) 617 | subprocess.run(["nslookup", target]) 618 | print(lines) 619 | elif choice == "2": 620 | target = input("Enter the Target: ") 621 | print("\n") 622 | print(results) 623 | subprocess.run(["whois", target]) 624 | print(lines) 625 | 626 | def trace_route(): 627 | print(lines) 628 | print("Traceroute Menu:\n") 629 | print("1. Packet Routing") 630 | print("2. Packet Routing V4") 631 | print("3. Packet Routing V6") 632 | print("4. Do Not Fragment Packet") 633 | print("5. Start From The Ttl Hop") 634 | print("6. Route Packet Through The Gate") 635 | print("7. Set Max Number Of Hops") 636 | print("8. Don't Resolve Ip addr to Dns") 637 | print("9. Set Destination Port") 638 | print("10. Set Number Of Probes Per Hop") 639 | print("11. The Full Packet Length") 640 | choice = input("Enter your choice: ") 641 | if choice == "1": 642 | target = input("Enter packet Tracerouting: ") 643 | print("\n") 644 | print(results) 645 | subprocess.run(["traceroute", target]) 646 | print(lines) 647 | elif choice == "2": 648 | target = input("Enter packet route V4: ") 649 | print("\n") 650 | print(results) 651 | subprocess.run(["traceroute", "-4", target]) 652 | print(lines) 653 | elif choice == "3": 654 | target = input("Enter packet route V6: ") 655 | print("\n") 656 | print(results) 657 | subprocess.run(["traceroute", "-6", target]) 658 | print(lines) 659 | elif choice == "4": 660 | target = input("Dont fragment packet: ") 661 | print("\n") 662 | print(results) 663 | subprocess.run(["traceroute", "-F", target]) 664 | print(lines) 665 | elif choice == "5": 666 | target = input("Enter your Target: ") 667 | print("\n") 668 | print(results) 669 | subprocess.run(["traceroute", "-f", target]) 670 | print(lines) 671 | elif choice == "6": 672 | target = input("Enter your Target: ") 673 | print("\n") 674 | print(results) 675 | subprocess.run(["traceroute", "-g", target]) 676 | print(lines) 677 | elif choice == "7": 678 | target = input("Enter target: ") 679 | print("\n") 680 | print(results) 681 | subprocess.run(["traceroute", "-m", target]) 682 | print(lines) 683 | elif choice == "8": 684 | target = input("Enter Your target: ") 685 | print("\n") 686 | print(results) 687 | subprocess.run(["traceroute", "-n", target]) 688 | print(lines) 689 | elif choice == "9": 690 | target = input("Enter Your target: ") 691 | print("\n") 692 | print(results) 693 | subprocess.run(["traceroute", "-p", target]) 694 | print(lines) 695 | elif choice == "10": 696 | target = input("Enter Your target: ") 697 | print("\n") 698 | print(results) 699 | subprocess.run(["traceroute", "-q", target]) 700 | print(lines) 701 | elif choice == "11": 702 | target = input("Enter Your target: ") 703 | print("\n") 704 | print(results) 705 | subprocess.run(["traceroute", "--packetlen", target]) 706 | print(lines) 707 | #update checking program management 708 | def check_for_update(): 709 | update = "Checking for Update\n" 710 | print(Fore.CYAN + update + Fore.RESET) 711 | print("Y / N") 712 | choice = input("Enter your choice (Y/N): ").upper() 713 | 714 | if choice == "Y": 715 | try: 716 | subprocess.run(["git", "pull"], cwd="/home/zynix/projects/NetscanPro") 717 | print("Update completed.") 718 | except: 719 | print("Git pull failed. Please ensure you are in a git repository.") 720 | elif choice == "N": 721 | print("Update cancelled.\n") 722 | else: 723 | print("Invalid option. Please enter Y or N.") 724 | 725 | 726 | 727 | 728 | def nse_scripts(): 729 | print(lines) 730 | print("NSE Scripts Options:\n") 731 | print("1. Run Default Scripts") 732 | print("2. Run Vulnerability Scripts") 733 | print("3. Run Discovery Scripts") 734 | print("4. Run Specific Script") 735 | print("5. List Available Scripts") 736 | choice = input("Enter your choice: ") 737 | if choice == "1": 738 | target = input("Enter target: ") 739 | print("\n") 740 | print(results) 741 | subprocess.run(["nmap", "-sC", target]) 742 | print(lines) 743 | elif choice == "2": 744 | target = input("Enter target: ") 745 | print("\n") 746 | print(results) 747 | subprocess.run(["nmap", "--script=vuln", target]) 748 | print(lines) 749 | elif choice == "3": 750 | target = input("Enter target: ") 751 | print("\n") 752 | print(results) 753 | subprocess.run(["nmap", "--script=discovery", target]) 754 | print(lines) 755 | elif choice == "4": 756 | script = input("Enter script name: ") 757 | target = input("Enter target: ") 758 | print("\n") 759 | print(results) 760 | subprocess.run(["nmap", "--script=" + script, target]) 761 | print(lines) 762 | elif choice == "5": 763 | subprocess.run(["nmap", "--script-help"]) 764 | print(lines) 765 | 766 | def output_options(): 767 | print(lines) 768 | print("Output Options:\n") 769 | print("1. Normal Output") 770 | print("2. XML Output") 771 | print("3. Grepable Output") 772 | print("4. Script Kiddie Output") 773 | print("5. All Formats") 774 | choice = input("Enter your choice: ") 775 | target = input("Enter target: ") 776 | scan_type = input("Enter scan type (e.g., -sS for SYN scan): ") 777 | if choice == "1": 778 | file = input("Enter output file name: ") 779 | subprocess.run(["nmap", scan_type, "-oN", file, target]) 780 | elif choice == "2": 781 | file = input("Enter output file name: ") 782 | subprocess.run(["nmap", scan_type, "-oX", file, target]) 783 | elif choice == "3": 784 | file = input("Enter output file name: ") 785 | subprocess.run(["nmap", scan_type, "-oG", file, target]) 786 | elif choice == "4": 787 | file = input("Enter output file name: ") 788 | subprocess.run(["nmap", scan_type, "-oS", file, target]) 789 | elif choice == "5": 790 | file = input("Enter output file name: ") 791 | subprocess.run(["nmap", scan_type, "-oA", file, target]) 792 | 793 | def timing_options(): 794 | print(lines) 795 | print("Timing Options:\n") 796 | print("1. Paranoid") 797 | print("2. Sneaky") 798 | print("3. Polite") 799 | print("4. Normal") 800 | print("5. Aggressive") 801 | print("6. Insane") 802 | choice = input("Enter your choice: ") 803 | target = input("Enter target: ") 804 | if choice == "1": 805 | subprocess.run(["nmap", "-T0", target]) 806 | elif choice == "2": 807 | subprocess.run(["nmap", "-T1", target]) 808 | elif choice == "3": 809 | subprocess.run(["nmap", "-T2", target]) 810 | elif choice == "4": 811 | subprocess.run(["nmap", "-T3", target]) 812 | elif choice == "5": 813 | subprocess.run(["nmap", "-T4", target]) 814 | elif choice == "6": 815 | subprocess.run(["nmap", "-T5", target]) 816 | 817 | def miscellaneous(): 818 | print(lines) 819 | print("Miscellaneous Options:\n") 820 | print("1. Verbose Output") 821 | print("2. Debug Output") 822 | print("3. Resume Scan") 823 | print("4. Exclude Hosts") 824 | choice = input("Enter your choice: ") 825 | if choice == "1": 826 | target = input("Enter target: ") 827 | subprocess.run(["nmap", "-v", target]) 828 | elif choice == "2": 829 | target = input("Enter target: ") 830 | subprocess.run(["nmap", "-d", target]) 831 | elif choice == "3": 832 | file = input("Enter resume file: ") 833 | subprocess.run(["nmap", "--resume", file]) 834 | elif choice == "4": 835 | exclude = input("Enter hosts to exclude: ") 836 | target = input("Enter target: ") 837 | subprocess.run(["nmap", "--exclude", exclude, target]) 838 | 839 | def configuration_menu(): 840 | print(lines) 841 | print("Configuration Menu:\n") 842 | print("1. Load Configuration") 843 | print("2. Save Current Settings") 844 | print("3. View Current Configuration") 845 | choice = input("Enter your choice: ") 846 | if choice == "1": 847 | config = load_config() 848 | if config: 849 | print("Configuration loaded:") 850 | for key, value in config.items(): 851 | print(f"{key}: {value}") 852 | else: 853 | print("No configuration file found.") 854 | elif choice == "2": 855 | # Example: save some settings 856 | config = {"default_scan_type": "basic", "verbose": True} 857 | save_config(config) 858 | print("Configuration saved.") 859 | elif choice == "3": 860 | config = load_config() 861 | if config: 862 | print("Current Configuration:") 863 | for key, value in config.items(): 864 | print(f"{key}: {value}") 865 | else: 866 | print("No configuration loaded.") 867 | 868 | def batch_processing_menu(): 869 | print(lines) 870 | print("Batch Processing Menu:\n") 871 | print("Enter scan commands separated by semicolons (e.g., nmap -sS 192.168.1.1;nmap -sU 192.168.1.1)") 872 | commands_input = input("Enter commands: ") 873 | commands = [cmd.strip().split() for cmd in commands_input.split(';') if cmd.strip()] 874 | if commands: 875 | print("Starting batch processing...") 876 | batch_process(commands) 877 | print("Batch processing completed.") 878 | else: 879 | print("No valid commands entered.") 880 | 881 | def generate_report_menu(): 882 | from .report_gen import generate_professional_report 883 | print(lines) 884 | print("Generate Report Menu:\n") 885 | history = load_scan_history() 886 | if not history: 887 | print("No saved scans found. Please run and save a scan first.") 888 | return 889 | 890 | print("Available Scans:") 891 | for i, scan in enumerate(history, 1): 892 | print(f"{i}. {scan['name']} - {scan['target']} - {scan['timestamp']}") 893 | 894 | choice = input("Select scan number to generate report: ") 895 | try: 896 | scan_index = int(choice) - 1 897 | if 0 <= scan_index < len(history): 898 | selected_scan = history[scan_index] 899 | generate_professional_report(selected_scan) 900 | else: 901 | print("Invalid selection.") 902 | except ValueError: 903 | print("Invalid input.") 904 | --------------------------------------------------------------------------------