Repository navigation
NmapAnalyzer AgentFlow
AnythingLLM AgentFlow for automated nmap output analysis - takes raw nmap XML or text output and returns structured findings: open ports, service versions, OS fingerprints, and prioritized attack surface with CVE suggestions.
Parses nmap output (XML preferred), identifies services and versions, cross-references against known CVEs, flags high-risk configurations (open RDP, unauthenticated services, outdated software), and produces a prioritized findings list.
Turn raw nmap scan output into an actionable prioritized attack surface assessment in seconds rather than manually reviewing port lists.
After running an nmap scan against an authorized target; triaging a large scan with many open ports; building the service inventory section of a pentest report.
Name: NmapAnalyzer
Description:
Analyzes Nmap scan results, identifies critical findings, and provides next-step
recommendations based on security best practices.
Purpose: Automated port scan analysis and vulnerability prioritization
Define these variables in the "Flow Variables" section:
| Variable Name | Initial Value | Description |
|---|---|---|
scan_results |
(empty) | Raw Nmap scan output |
target_info |
(empty) | Target description/context |
parsed_findings |
(empty) | Structured vulnerability table |
recommendations |
(empty) | Next steps and tool suggestions |
Block Type: LLM Instruction
Instruction:
Analyze the following Nmap scan results and extract structured data:
Scan Results: ${scan_results}
Target: ${target_info}
Format as markdown table:
| Port | Service | Version | Risk | Notes |
Categorize each finding by risk level:
- **CRITICAL:** Services with known critical vulnerabilities
- **HIGH:** Outdated versions with exploits available
- **MEDIUM:** Services that should not be exposed
- **LOW:** Standard services with no obvious issues
Include specific observations:
- Exact version numbers
- End-of-life (EOL) software
- Default configurations
- Unnecessary services
- Missing security features
- Known CVE associations
Result Variable: parsed_findings
Purpose: Extract structured vulnerability data from raw scan
Block Type: LLM Instruction
Instruction:
Based on these scan findings, provide actionable recommendations:
Findings: ${parsed_findings}
Target Context: ${target_info}
Provide:
## Top 3 Critical Items
[Prioritize by severity and exploitability]
## Next Reconnaissance Steps
Suggest specific commands or tools:
- Further enumeration techniques
- Service-specific scans
- Vulnerability scanning tools
- Manual testing approaches
## Exploitation Possibilities
For each critical/high finding:
- Known exploits (with CVE references)
- Exploitation difficulty
- Potential impact
- Proof-of-concept availability
## Required Tools
List specific tools for deeper analysis:
- Vulnerability scanners (Nessus, OpenVAS)
- Service-specific tools (sqlmap, nikto, enum4linux)
- Exploitation frameworks (Metasploit modules)
- Manual testing utilities
## Security Observations
- Authentication mechanisms
- Encryption status
- Access controls
- Configuration issues
- Best practice violations
Format as actionable penetration testing guidance.
Result Variable: recommendations
Purpose: Provide next steps for penetration testing
Block Type: Flow Complete
Configuration:
- Flow will end here and return results
@agent use NmapAnalyzer flow
scan_results: [paste your Nmap output]
target_info: Production web server - authorized test
# Run Nmap scan
nmap -sV -sC -p- target.com -oN scan.txt
# Use flow
@agent use NmapAnalyzer flow
scan_results:
[paste contents of scan.txt]
target_info: Client XYZ external infrastructure assessmentparsed_findings - Structured table:
| Port | Service | Version | Risk | Notes |
|---|---|---|---|---|
| 3306 | MySQL | 5.5.62 | CRITICAL | EOL version, publicly accessible |
| 21 | FTP | vsftpd 3.0.3 | HIGH | Anonymous login enabled |
| 80 | HTTP | Apache 2.4.41 | MEDIUM | No HTTPS redirect |
recommendations - Actionable guidance:
- Top priority items
- Specific exploitation steps
- Tool recommendations
- Next testing phases
Typical Workflow:
- Run Nmap scan
- NmapAnalyzer (this flow) - Parse and prioritize findings
- CVELookup - Research each identified CVE
- VulnReportGenerator - Document each vulnerability
- Compile final penetration test report
Example Pipeline:
nmap scan
โ
NmapAnalyzer โ identifies MySQL 5.5.62 with CVE-2016-6662
โ
CVELookup โ CVE-2016-6662 details and remediation
โ
VulnReportGenerator โ Professional finding documentation
Quick Service Detection:
nmap -sV -p 21,22,23,25,80,443,3306,3389,8080 target.comComprehensive Scan:
nmap -sV -sC -p- target.com -oN scan.txtVulnerability Scan:
nmap -sV --script vuln target.comStealth Scan:
nmap -sS -sV -T2 target.comUDP Scan:
nmap -sU -sV --top-ports 100 target.comOS Detection:
nmap -O -sV target.comInput:
scan_results:
PORT STATE SERVICE VERSION
22/tcp open ssh OpenSSH 7.4
80/tcp open http Apache httpd 2.4.49
443/tcp open ssl/http Apache httpd 2.4.49
target_info: External web server for e-commerce site
Output:
PARSED FINDINGS:
| Port | Service | Version | Risk | Notes |
|------|---------|---------|------|-------|
| 443 | HTTPS | Apache 2.4.49 | CRITICAL | CVE-2021-41773 - Path traversal RCE |
| 80 | HTTP | Apache 2.4.49 | CRITICAL | CVE-2021-41773 - Path traversal RCE |
| 22 | SSH | OpenSSH 7.4 | LOW | Slightly outdated but no critical CVEs |
RECOMMENDATIONS:
Top 3 Critical Items:
1. Apache 2.4.49 - Immediate patching required (CVE-2021-41773)
2. HTTP port 80 open - Should redirect to HTTPS
3. Verify SSH key-only authentication
Next Steps:
- Test CVE-2021-41773 exploit (Metasploit module available)
- Check for directory traversal manually
- Enumerate web application
Required Tools:
- Metasploit (exploit/multi/http/apache_normalize_path_rce)
- Nikto for web server scanning
- dirb/gobuster for directory enumeration
Input:
scan_results:
PORT STATE SERVICE VERSION
3306/tcp open mysql MySQL 5.5.62
22/tcp open ssh OpenSSH 8.2p1
target_info: Database server - should be internal only
Output:
PARSED FINDINGS:
| Port | Service | Version | Risk | Notes |
|------|---------|---------|------|-------|
| 3306 | MySQL | 5.5.62 | CRITICAL | EOL (2018), internet-accessible, multiple CVEs |
| 22 | SSH | OpenSSH 8.2p1 | LOW | Current version, no issues |
RECOMMENDATIONS:
Top 3 Critical Items:
1. MySQL exposed to internet - CRITICAL misconfig
2. MySQL 5.5.62 EOL with known CVEs
3. Potential data breach risk
Next Steps:
- Attempt MySQL connection (test weak passwords)
- Check for anonymous access
- Enumerate databases and tables
- Test for SQL injection if web app present
Required Tools:
- mysql command-line client
- hydra for password attacks
- sqlmap for injection testing
- Nessus for full vulnerability scan
โ ๏ธ Authorization Required - Only scan authorized targets- Scope Compliance - Stay within engagement boundaries
- Documentation - Document all scans in engagement notes
- Rate Limiting - Respect target's resources
-
Scan Quality:
- Use
-sVfor version detection - Use
-sCfor default scripts - Full port scan
-p-takes longer but is comprehensive
- Use
-
False Positives:
- Version detection isn't always accurate
- Verify critical findings manually
- Cross-reference with other tools
-
Output Size:
- Large scans may hit token limits
- Break into smaller IP ranges if needed
- Enable summarization for very large scans
-
Include Version Information:
- Always use
-sVflag - Version numbers are critical for CVE mapping
- Always use
-
Use Script Scanning:
-
-sCruns default Nmap scripts - Provides additional service information
- Detects common misconfigurations
-
-
Provide Context:
- Describe target type (web server, database, etc.)
- Mention if internal or external
- Note if production or development
- Include authorization status
-
Specific Target Info:
target_info: Production e-commerce platform processing credit cards, PCI-DSS scope, external-facing, authorized pen test 2024-11-15 -
Include Multiple Hosts:
- Scan entire subnet
- Analyze patterns across systems
- Identify systemic issues
-
Combine with Vulnerability Scans:
- Run Nmap first for discovery
- Follow with Nessus/OpenVAS for deeper analysis
- Use NmapAnalyzer to prioritize targets
| Issue | Solution |
|---|---|
| Generic analysis | Provide more detailed target_info |
| Missing CVEs | Use --script vuln for vulnerability detection |
| Unclear priorities | Include business context in target_info |
| Token limit exceeded | Scan smaller IP ranges or summarize results |
| No service versions | Ensure -sV flag was used in scan |
| Incomplete scan | Use -p- for all ports, not just common ones |
Scan different port ranges:
# Quick scan common ports
nmap -sV -p 21,22,23,25,80,443,3389 target.com -oN quick.txt
# Full port scan
nmap -sV -p- target.com -oN full.txt
# UDP scan
nmap -sU --top-ports 100 target.com -oN udp.txtAnalyze all together:
@agent use NmapAnalyzer flow
scan_results:
[paste quick.txt]
[paste full.txt]
[paste udp.txt]
target_info: Complete port analysis - all protocols
# Scan entire subnet
nmap -sV 192.168.1.0/24 -oN subnet-scan.txt
# Analyze results
@agent use NmapAnalyzer flow
scan_results: [paste subnet-scan.txt]
target_info: Internal network - identify all services across 192.168.1.0/24After analyzing scan:
-
Prioritize Targets:
- Focus on CRITICAL and HIGH findings first
- Identify quick wins
- Plan testing approach
-
Research CVEs:
- Use CVELookup flow for each identified CVE
- Understand exploitability
- Check for public exploits
-
Deep Dive Testing:
- Service-specific enumeration
- Vulnerability validation
- Exploitation attempts (authorized)
-
Documentation:
- Use VulnReportGenerator for each finding
- Build evidence package
- Prepare client deliverable
1. Initial Scan:
nmap -sV -sC -p- target.com -oN initial.txt
2. Analysis:
@agent use NmapAnalyzer
โ Identifies: MySQL 5.5.62 (CVE-2016-6662), Apache 2.4.49 (CVE-2021-41773)
3. CVE Research:
@agent use CVELookup cve_id: CVE-2021-41773
โ Gets exploit details, CVSS 9.8
4. Manual Testing:
Test exploits, verify vulnerabilities
5. Documentation:
@agent use VulnReportGenerator
finding_title: Critical Apache Path Traversal
โ Professional report section
6. Compile Report:
Aggregate all findings into final deliverable
- v1.0 - Initial flow with parsing and recommendations
- Purpose: Automated Nmap scan analysis for penetration testing
- Last Updated: November 2025
- ThreatIntelCheck - Verify discovered IPs
- CVELookup - Research identified CVEs
- VulnReportGenerator - Document findings
- DomainRecon - Pre-scan reconnaissance
- README.md - AnythingLLM AgentFlow index
- flow-cve_lookup.md - CVE research on services identified by nmap
- flow-vulnreport_gen.md - Nmap findings feed directly into vuln reports
- anything_llm_agentflows.md - NmapAnalyzer in the assessment workflow chain
๐ Source: AI/AnythingLLM/flow-nmap_analyzer.md | โ๏ธ Suggest an edit | โฌ
๏ธ Back to Artificial Intelligence
- ๐บ๏ธ Browse by Topic
- ๐ All Repository Files
- ๐งญ Learning Paths
- ๐ Master Guide
- ๐ค Glossary
- โ๏ธ Legal & Disclaimer
๐ Foundations & Learning
๐ก๏ธ Defense & Investigations
- Incident Response
- Open Source Intelligence (OSINT)
- Reverse Engineering
- Operations Security (OPSEC)
- Compliance
โ๏ธ Platforms & Infrastructure
๐ก Hardware, Wireless & Field Projects
- PNWC Cyberdeck
- Hardware Testing
- Hardware Hacking
- Software-Defined Radio
- Wardriving
- uConsole
- Space Security
๐งฐ Assessment & Field Reference
๐ฆ Downloads & Project Resources
๐๏ธ Additional Topics