crazymarky/pentest-skills/recon-port-scan
Claude Code and agent skill by crazymarky/pentest-skills
- community
Checking that the SKILL.md file is still in the repository.
Port scanning and service identification using nmap, masscan, and rustscan. Use this skill when user needs to discover open ports, identify running services, detect service versions, or fingerprint operating systems on target hosts.
Install
npx vskill@latest install crazymarky/pentest-skills/recon-port-scanSKILL.md
Port Scanning / Reconnaissance
Authorization Warning
IMPORTANT: Port scanning without proper authorization is illegal. Always ensure you have:
- Written permission from the target system owner
- Defined scope of authorized testing
- Legal compliance with local regulations
Prerequisites
Required tools that must be installed on your system:
- nmap -
sudo apt install nmap(Debian/Ubuntu) orbrew install nmap(macOS)
Optional tools:
- masscan - High-speed port scanner
- rustscan - Modern fast scanner with nmap integration
Quick Start
Most commonly used commands for port scanning:
Fast Common Port Scan
Quick scan of top 100 common ports.
Full Port Scan with Service Detection
Scan all 65535 ports with version detection and default scripts.
Stealth SYN Scan
Stealthy scan (requires root).
High-Speed Large Range Scan
Fast scanning of large IP ranges.
Common Scenarios
Scenario 1: Quick Reconnaissance
When you need fast results on common ports:
Parameters:
-T4- Aggressive timing template (faster)-F- Fast mode, scan top 100 ports<target>- IP address, hostname, or CIDR range
Example:
Scenario 2: Full Port Range Discovery
When you need to find all open ports (1-65535):
Parameters:
-p-- Scan all 65535 ports
Example:
With version detection:
Scenario 3: Service Version Detection
When you need to identify running service versions:
Parameters:
-sV- Probe open ports for service/version info-sC- Run default NSE scripts
Example:
More aggressive version detection:
Scenario 4: Stealth Scanning
When you need to avoid detection:
Parameters:
-sS- SYN scan (stealthier than connect scan)-T2- Polite timing (slower, less suspicious)-f- Fragment packets--data-length 24- Append random data to packets
Example:
Decoy scan:
Scenario 5: UDP Port Scanning
When you need to discover UDP services:
Parameters:
-sU- UDP scan--top-ports 100- Scan top 100 most common UDP ports
Example:
Combined TCP + UDP scan:
Scenario 6: OS Fingerprinting
When you need to identify the operating system:
Parameters:
-O- Enable OS detection
Example:
Combined with version detection:
Scenario 7: High-Speed Mass Scanning
When scanning large IP ranges:
Parameters:
-p1-65535- Port range--rate=10000- Packets per second (adjust based on bandwidth)-oL output.txt- Save results to file
Example:
Follow-up with nmap for detailed scanning:
Scenario 8: RustScan (Modern Fast Scanner)
Parameters:
-a- Target address--- Separator for nmap arguments (passed through to nmap)
Example:
Scenario 9: Output Formats
Save results in different formats:
Example:
Tool Selection Guide
| Scenario | Recommended Tool | Command | |
|---|---|---|---|
| Quick common port scan | nmap | nmap -T4 -F <target> | |
| Full port range | nmap | nmap -p- <target> | |
| Service version detection | nmap | nmap -sV -sC <target> | |
| Large network / speed critical | masscan | masscan -p1-65535 <target> --rate=10000 | |
| Stealth required | nmap | sudo nmap -sS -T2 <target> | |
| UDP service discovery | nmap | nmap -sU --top-ports 100 <target> | |
| OS fingerprinting | nmap | sudo nmap -O <target> | |
| Modern fast workflow | rustscan | rustscan -a <target> -- -sV |
Tool Comparison:
| Tool | Speed | Accuracy | Features | Use Case | |
|---|---|---|---|---|---|
| nmap | Medium | High | Most comprehensive | General purpose | |
| masscan | Very High | Medium | Basic port scan | Large networks | |
| rustscan | High | High | nmap integration | Modern workflows |
Timing Templates
Adjust scan speed with timing templates (0-5):
| Level | Name | Description | |
|---|---|---|---|
-T0 | Paranoid | Very slow, IDS evasion | |
-T1 | Sneaky | Slow, IDS evasion | |
-T2 | Polite | Medium-slow, reduces load | |
-T3 | Normal | Default speed | |
-T4 | Aggressive | Fast, recommended | |
-T5 | Insane | Very fast, may be inaccurate |
Example:
Script Categories
NSE (Nmap Scripting Engine) script categories:
Common Port Lists
Reference for common service ports:
| Ports | Services | |
|---|---|---|
| 21 | FTP | |
| 22 | SSH | |
| 23 | Telnet | |
| 25 | SMTP | |
| 53 | DNS | |
| 80, 8080, 8443 | HTTP | |
| 110 | POP3 | |
| 135, 139, 445 | SMB | |
| 143, 993 | IMAP | |
| 443, 8443 | HTTPS | |
| 3306 | MySQL | |
| 3389 | RDP | |
| 5432 | PostgreSQL | |
| 5900 | VNC | |
| 6379 | Redis | |
| 27017 | MongoDB |
Resources
Scripts
scripts/parse_nmap_xml.py- Parse nmap XML output to structured JSON formatscripts/masscan_to_nmap.py- Convert masscan results to nmap-compatible formatscripts/merge_scan_results.py- Combine multiple scan result files
References
references/nmap_cheatsheet.md- Comprehensive nmap reference guidereferences/masscan_guide.md- Detailed masscan usage documentationreferences/rustscan_guide.md- RustScan quick referencereferences/scanning_techniques.md- Advanced scanning techniques and evasion methods
Assets
assets/top-1000-ports.txt- Top 1000 common ports listassets/top-100-ports.txt- Top 100 common ports listassets/common-services.txt- Common service fingerprint data
Scenario 10: Persistent Storage of Scan Results
When you need to persist port scan results to the database for cross-session analysis and reporting:
Parameters:
--subsystem- Subsystem name (optional, omit for flat hierarchy)--scan-tool- Scan tool used (default: nmap)--xml-file- Path to nmap XML file (optional, reads from stdin if not provided)
Database location: ./data/results.db
Related skills: results-storage - Query data, generate reports
Security
- Security scanPassed, 100 of 100Pattern checks on the skill's files.
- Model reviewNot runA model review is scheduled for the next rescan.
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingrecon-port-scan/SKILL.md
Popularity
- Repository stars
- 216
- Repository forks
- 26
- 7-day trend score
- 27
Stars and forks are for the whole GitHub repository, not this skill alone. Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/crazymarky/pentest-skills/recon-port-scan)