⚠️ IMPORTANT: Don't forget to set your Mistral AI API key to use AI report features!Set API Key via Tool Menu:
./nmsf # Select option 3 (AI Options) # Select option 1 (Set/Update Mistral API key) # Enter your API key when prompted
All-in-One Terminal Tool - Convert Nmap XML scans to Metasploit resource scripts with automatic scanning capabilities.
- 🔍 Automatic Nmap Scanning: Scan targets directly from the tool
- 🔄 Automatic Conversion: Convert XML results to Metasploit .rc scripts
- 📊 AI-Powered Reports: Generate intelligent reports using Mistral AI
- 📁 Organized Output: Timestamped directories for each scan
- ⚙️ Custom Nmap Options: Full control over scan parameters
- 🧪 Built-in Testing: Sample data for testing
- 🐳 Docker Support: Containerized execution
- 🛡️ Safe Modules Only: Focus on enumeration, not exploitation
- 🤖 Multiple Report Formats: Markdown, JSON, HTML, and plain text
# Make executable
chmod +x nmsf
# Install dependencies (if needed)
pip install PyYAML requests./nmsf- 🔍 Scan & Convert - Automatic scanning and conversion
- 📊 Generate Reports - Generate reports from existing XML
- 🤖 AI Options - Set Mistral API key and AI features
- ⚙️ Settings - View configurations and mappings
- 🚪 Exit - Exit the tool
The Scan & Convert mode allows you to:
- Enter target: IP address, range, or hostname
- Select scan type:
- Quick scan (top 1000 ports)
- Full scan (all 65535 ports)
- Service detection scan
- Custom scan with your own Nmap options
- Choose workspace name
- Automatic execution in Metasploit
- AI report generation (optional)
-sS -sV -sC -T4 -p 1-1000
-sS -sV -sC -T4 --top-ports 100
-sS -sV -sC -T4 -p 22,80,443,8080
Each scan creates a timestamped directory:
scan_192.168.1.1_2025-01-10_14-30-15/
├── scan_result.xml # Nmap XML output
├── workspace_name.rc # Metasploit resource script
├── msf_output.txt # Metasploit execution output
├── _wrapper.rc # Wrapper script for output capture
└── ai_report.* # AI-generated reports (if enabled)
The tool includes AI-powered report generation using Mistral API:
- Run the tool:
./nmsf - Select option 3 (AI Options)
- Select option 1 (Set/Update Mistral API key)
- Enter your Mistral API key when prompted
- Multiple Formats: Generate reports in Markdown, JSON, HTML, or plain text
- Intelligent Analysis: AI analyzes Metasploit output and creates comprehensive reports
- Executive Summaries: High-level overviews of scan results
- Service Analysis: Detailed breakdown of discovered services
- Recommendations: AI-generated next steps and security recommendations
After running a scan and Metasploit script:
- The tool will ask if you want to generate AI reports
- Select your preferred format(s)
- AI will analyze the output and generate professional reports
Access additional features through the Settings menu:
View all supported service mappings:
- HTTP/HTTPS: Version detection, methods, directory scanning
- SSH: Version detection, user enumeration
- FTP: Version detection, anonymous access
- SMB: Version detection, share enumeration
- SNMP: Login attempts, enumeration
- MySQL: Version detection, login attempts
- RDP: Scanner modules
- And more...
Test the tool with built-in sample data:
- Select option 4 (Settings)
- Select option 2 (Test with sample data)
- Tool will create sample XML and test conversion
Generate a sample XML file for testing:
- Select option 4 (Settings)
- Select option 3 (Create sample XML file)
The tool automatically maps detected services to appropriate Metasploit modules:
- HTTP/HTTPS: Version detection, methods, directory scanning
- SSH: Version detection, user enumeration
- FTP: Version detection, anonymous access
- SMB: Version detection, share enumeration
- SNMP: Login attempts, enumeration
- MySQL: Version detection, login attempts
- RDP: Scanner modules
- And more...
Generated scripts include:
- Workspace creation
- Service-specific module selection
- RHOSTS configuration
- Background job execution (
run -j) - Safe enumeration modules only
# Build image
docker build -t nmsf .
# Run container
docker run -v $(pwd)/output:/app/output nmsf- Start the tool:
./nmsf - Set up AI (optional): Select option 3 (AI Options) → Set Mistral API key
- Select Scan & Convert: Option 1
- Enter target:
192.168.1.0/24 - Choose scan type: Custom scan
- Enter options:
-sS -sV -sC -T4 - Set workspace:
network_scan - Wait for completion
- Run in Metasploit:
msfconsole -r scan_20250110_143015/network_scan.rc - Generate AI reports: Select format when prompted
- Markdown: Professional documentation with headers and formatting
- JSON: Structured data for programmatic analysis
- HTML: Web-ready reports with styling
- Plain Text: Simple text format for quick review
If AI is unavailable, the tool generates basic reports with:
- Executive summary
- Service findings
- Recommendations
- Next steps
This tool is designed for authorized penetration testing only. Always ensure you have proper authorization before scanning any network or system.
Educational project for authorized testing purposes only.
Version: 4.0 (Enhanced Edition)
Author: Student Project
Purpose: Educational and authorized testing only