This repository contains Python scripts for intelligent, AI-enhanced network scanning and device discovery. It allows you to scan IP ranges, discover open ports and services, and receive AI-generated security insights and remediation suggestions.
- 🔎 Fast and customizable Nmap-based scanning
- 🤖 AI-powered risk analysis and fix suggestions (via OpenAI)
- 🖥️ Device and service discovery
- ⚙️ CLI-friendly with configurable scan profiles
- 📝 Output in terminal and optional Markdown/JSON reports
- Python 3.8+
- Nmap (must be installed on your system)
- Python packages listed in
requirements.txt
-
Clone the repository:
git clone https://github.com/Daufm/AI-powered_Network_Scanner.git cd AI-powered_Network_Scanner -
Install dependencies:
pip install -r requirements.txt
-
Ensure Nmap is installed:
# Ubuntu/Debian sudo apt install nmap # macOS brew install nmap # Windows: https://nmap.org/download.html
python scanner.py 192.168.1.0/24 --out report.mdpython scanner.py 192.168.1.7 -p 1-65535 --profile vuln --out full_report.md- Markdown report:
report.md - Terminal summary with AI recommendations
-
Configure default scan profiles in
scanner.py -
Store your OpenAI API key via environment variable or
.envfile:OPENAI_API_KEY=sk-...yourkey...
python scanner.py 10.0.0.1 --profile full --out results.md-
Fork the repository
-
Create a feature branch:
git checkout -b feature/your-feature
-
Commit your changes:
git commit -m "Add new feature" -
Push to your fork:
git push origin feature/your-feature
-
Open a Pull Request
This project is licensed under the MIT License. See LICENSE for details.
To avoid dependency conflicts and keep your Python environment clean:
python3 -m venv venv
source venv/bin/activate
pip install -r requirements.txtThis ensures you're using the right versions of the required packages (like python-nmap, openai, etc.).
Some scan types (like SYN scans) require root access. If you run the scanner with sudo, your virtual environment may not be respected unless you use:
sudo $(which python3) scanner.py 192.168.1.7 --out report.mdWhy this works:
-
$(which python3)resolves the full path to your Python binary (including the virtual environment one). -
It prevents errors like:
ModuleNotFoundError: No module named 'nmap'- Nmap scan failures due to missing privileges