https://github.com/ethanolivertroy/nmap-GPT
This tool helps new security professionals actively learn how to address security concerns associated with open ports on a network device by scanning the device using Nmap and then leveraging the OpenAI API to provide insight on the specific security considerations that should be made for each open port.
https://github.com/ethanolivertroy/nmap-GPT
artificial-intelligence cybersecurity openai python
Last synced: 10 months ago
JSON representation
This tool helps new security professionals actively learn how to address security concerns associated with open ports on a network device by scanning the device using Nmap and then leveraging the OpenAI API to provide insight on the specific security considerations that should be made for each open port.
- Host: GitHub
- URL: https://github.com/ethanolivertroy/nmap-GPT
- Owner: ethanolivertroy
- Created: 2023-02-11T16:48:50.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2024-11-05T02:17:43.000Z (over 1 year ago)
- Last Synced: 2024-12-31T11:39:21.573Z (over 1 year ago)
- Topics: artificial-intelligence, cybersecurity, openai, python
- Language: Python
- Homepage:
- Size: 12.7 KB
- Stars: 21
- Watchers: 3
- Forks: 2
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
- Awesome-LLM4Security - nmap-GPT
README
# NMAP-GPT (2025 Edition)

This tool helps security professionals actively learn how to address security concerns associated with open ports on a network device. It works by scanning the device using Nmap or RustScan and then leveraging the OpenAI API to provide insights on specific security considerations for each open port, including the latest vulnerability information as of 2025.
## Features (2025 Edition)
- **Modern OpenAI API**: Updated to use the latest OpenAI client library and models
- **Enhanced Scanning**: Added advanced scanning options for more detailed vulnerability assessment
- **RustScan Integration**: Optional use of RustScan for faster port discovery
- **Comprehensive Reports**: Detailed reports with service version detection and OS fingerprinting
- **Export Options**: Save results in JSON or CSV format for further analysis
## Installation
1. Install required dependencies:
```bash
pip install python-nmap openai
```
2. For RustScan features, install RustScan:
```bash
# Using Cargo (Rust package manager)
cargo install rustscan
# Or using Docker
docker pull rustscan/rustscan:latest
```
3. Set your OpenAI API key:
```bash
export OPENAI_API_KEY="your-api-key-here"
```
## Usage
### Basic Nmap Scan
```bash
python3 nmap-gpt.py example.com -p 80
```
### Advanced Nmap Scan with Version Detection
```bash
python3 nmap-gpt.py example.com -p 1-1000 --scan-type advanced --output results.json
```
### Using RustScan for Faster Port Discovery
```bash
python3 experimental/rustscan-ai.py example.com -p 1-1000 --nmap-follow --output results.json
```
## Command Options
### Nmap-GPT Options
```
host Host or IP address to scan
-p PORT, --port PORT Port or port range to scan (default: '1-1024')
--output OUTPUT Output file to save results (JSON or CSV)
--model MODEL OpenAI model to use (default: 'gpt-4-turbo')
--scan-type {basic,advanced}
Type of scan to perform (default: 'basic')
```
### RustScan-AI Options
```
host Host or IP address to scan
-p PORT, --port PORT Port or port range to scan (default: '1-1024')
--output OUTPUT Output file to save results (JSON or CSV)
--model MODEL OpenAI model to use (default: 'gpt-4-turbo')
--nmap-follow Run nmap after RustScan for service detection
--ulimit ULIMIT Set ulimit for RustScan (default: 5000)
--timeout TIMEOUT Set timeout for RustScan in milliseconds (default: 1000)
--batch-size BATCH_SIZE
Set batch size for RustScan (default: 500)
```
## Examples
### Basic Port Scanning

### Advanced Security Analysis

### RustScan Integration
The experimental RustScan integration provides significantly faster port discovery:
```bash
python3 experimental/rustscan-ai.py example.com --nmap-follow
```
This combines RustScan's fast port discovery with Nmap's detailed service detection, followed by OpenAI analysis of potential vulnerabilities.
## Security Notes
- This tool is intended for educational purposes and authorized security testing only
- Always ensure you have permission to scan the target systems
- The OpenAI analysis provides general security information but should not replace professional security assessments