Security Scanning Tools
安全扫描工具
Master essential security scanning tools for network discovery, vulnerability assessment, web application testing, wireless security, and compliance validation. This skill covers tool selection, configuration, and practical usage across different scanning categories.
掌握用于网络发现、漏洞评估、Web应用测试、无线安全和合规验证的核心安全扫描工具。本技能涵盖不同扫描类别下的工具选择、配置及实际使用方法。
- Linux-based system (Kali Linux recommended)
- Network access to target systems
- Proper authorization for scanning activities
- 基于Linux的系统(推荐Kali Linux)
- 目标系统的网络访问权限
- 扫描活动的合法授权
- Basic networking concepts (TCP/IP, ports, protocols)
- Understanding of common vulnerabilities
- Familiarity with command-line interfaces
- 基础网络概念(TCP/IP、端口、协议)
- 常见漏洞的理解
- 熟悉命令行界面
Outputs and Deliverables
输出与交付物
- Network Discovery Reports - Identified hosts, ports, and services
- Vulnerability Assessment Reports - CVEs, misconfigurations, risk ratings
- Web Application Security Reports - OWASP Top 10 findings
- Compliance Reports - CIS benchmarks, PCI-DSS, HIPAA checks
- 网络发现报告 - 已识别的主机、端口和服务
- 漏洞评估报告 - CVE漏洞、配置错误、风险评级
- Web应用安全报告 - OWASP Top 10 检测结果
- 合规报告 - CIS基准、PCI-DSS、HIPAA合规检查
Phase 1: Network Scanning Tools
阶段1:网络扫描工具
Nmap (Network Mapper)
Nmap(网络映射器)
Primary tool for network discovery and security auditing:
Host discovery
Host discovery
nmap -sn 192.168.1.0/24 # Ping scan (no port scan)
nmap -sL 192.168.1.0/24 # List scan (DNS resolution)
nmap -Pn 192.168.1.100 # Skip host discovery
nmap -sn 192.168.1.0/24 # Ping scan (no port scan)
nmap -sL 192.168.1.0/24 # List scan (DNS resolution)
nmap -Pn 192.168.1.100 # Skip host discovery
Port scanning techniques
Port scanning techniques
nmap -sS 192.168.1.100 # TCP SYN scan (stealth)
nmap -sT 192.168.1.100 # TCP connect scan
nmap -sU 192.168.1.100 # UDP scan
nmap -sA 192.168.1.100 # ACK scan (firewall detection)
nmap -sS 192.168.1.100 # TCP SYN scan (stealth)
nmap -sT 192.168.1.100 # TCP connect scan
nmap -sU 192.168.1.100 # UDP scan
nmap -sA 192.168.1.100 # ACK scan (firewall detection)
Port specification
Port specification
nmap -p 80,443 192.168.1.100 # Specific ports
nmap -p- 192.168.1.100 # All 65535 ports
nmap -p 1-1000 192.168.1.100 # Port range
nmap --top-ports 100 192.168.1.100 # Top 100 common ports
nmap -p 80,443 192.168.1.100 # Specific ports
nmap -p- 192.168.1.100 # All 65535 ports
nmap -p 1-1000 192.168.1.100 # Port range
nmap --top-ports 100 192.168.1.100 # Top 100 common ports
Service and OS detection
Service and OS detection
nmap -sV 192.168.1.100 # Service version detection
nmap -O 192.168.1.100 # OS detection
nmap -A 192.168.1.100 # Aggressive (OS, version, scripts)
nmap -sV 192.168.1.100 # Service version detection
nmap -O 192.168.1.100 # OS detection
nmap -A 192.168.1.100 # Aggressive (OS, version, scripts)
Timing and performance
Timing and performance
nmap -T0 192.168.1.100 # Paranoid (slowest, IDS evasion)
nmap -T4 192.168.1.100 # Aggressive (faster)
nmap -T5 192.168.1.100 # Insane (fastest)
nmap -T0 192.168.1.100 # Paranoid (slowest, IDS evasion)
nmap -T4 192.168.1.100 # Aggressive (faster)
nmap -T5 192.168.1.100 # Insane (fastest)
nmap --script=vuln 192.168.1.100 # Vulnerability scripts
nmap --script=http-enum 192.168.1.100 # Web enumeration
nmap --script=smb-vuln* 192.168.1.100 # SMB vulnerabilities
nmap --script=default 192.168.1.100 # Default script set
nmap --script=vuln 192.168.1.100 # Vulnerability scripts
nmap --script=http-enum 192.168.1.100 # Web enumeration
nmap --script=smb-vuln* 192.168.1.100 # SMB vulnerabilities
nmap --script=default 192.168.1.100 # Default script set
Output formats
Output formats
nmap -oN scan.txt 192.168.1.100 # Normal output
nmap -oX scan.xml 192.168.1.100 # XML output
nmap -oG scan.gnmap 192.168.1.100 # Grepable output
nmap -oA scan 192.168.1.100 # All formats
nmap -oN scan.txt 192.168.1.100 # Normal output
nmap -oX scan.xml 192.168.1.100 # XML output
nmap -oG scan.gnmap 192.168.1.100 # Grepable output
nmap -oA scan 192.168.1.100 # All formats
High-speed port scanning for large networks:
Basic scanning
Basic scanning
masscan -p80 192.168.1.0/24 --rate=1000
masscan -p80,443,8080 192.168.1.0/24 --rate=10000
masscan -p80 192.168.1.0/24 --rate=1000
masscan -p80,443,8080 192.168.1.0/24 --rate=10000
Full port range
Full port range
masscan -p0-65535 192.168.1.0/24 --rate=5000
masscan -p0-65535 192.168.1.0/24 --rate=5000
Large-scale scanning
Large-scale scanning
masscan 0.0.0.0/0 -p443 --rate=100000 --excludefile exclude.txt
masscan 0.0.0.0/0 -p443 --rate=100000 --excludefile exclude.txt
Output formats
Output formats
masscan -p80 192.168.1.0/24 -oG results.gnmap
masscan -p80 192.168.1.0/24 -oJ results.json
masscan -p80 192.168.1.0/24 -oX results.xml
masscan -p80 192.168.1.0/24 -oG results.gnmap
masscan -p80 192.168.1.0/24 -oJ results.json
masscan -p80 192.168.1.0/24 -oX results.xml
Banner grabbing
Banner grabbing
masscan -p80 192.168.1.0/24 --banners
masscan -p80 192.168.1.0/24 --banners
Phase 2: Vulnerability Scanning Tools
阶段2:漏洞扫描工具
Enterprise-grade vulnerability assessment:
Start Nessus service
Start Nessus service
sudo systemctl start nessusd
sudo systemctl start nessusd
Access web interface
Access web interface
Command-line (nessuscli)
Command-line (nessuscli)
nessuscli scan --create --name "Internal Scan" --targets 192.168.1.0/24
nessuscli scan --list
nessuscli scan --launch <scan_id>
nessuscli report --format pdf --output report.pdf <scan_id>
Key Nessus features:
- Comprehensive CVE detection
- Compliance checks (PCI-DSS, HIPAA, CIS)
- Custom scan templates
- Credentialed scanning for deeper analysis
- Regular plugin updates
nessuscli scan --create --name "Internal Scan" --targets 192.168.1.0/24
nessuscli scan --list
nessuscli scan --launch <scan_id>
nessuscli report --format pdf --output report.pdf <scan_id>
Nessus核心功能:
- 全面的CVE漏洞检测
- 合规性检查(PCI-DSS、HIPAA、CIS)
- 自定义扫描模板
- 基于凭据的深度分析扫描
- 定期插件更新
OpenVAS (Greenbone)
OpenVAS(Greenbone)
Open-source vulnerability scanning:
Install OpenVAS
Install OpenVAS
sudo apt install openvas
sudo gvm-setup
sudo apt install openvas
sudo gvm-setup
Start services
Start services
Access web interface (Greenbone Security Assistant)
Access web interface (Greenbone Security Assistant)
Command-line operations
Command-line operations
gvm-cli socket --xml "<get_version/>"
gvm-cli socket --xml "<get_tasks/>"
gvm-cli socket --xml "<get_version/>"
gvm-cli socket --xml "<get_tasks/>"
Create and run scan
Create and run scan
gvm-cli socket --xml '
<create_target>
<name>Test Target</name>
<hosts>192.168.1.0/24</hosts>
</create_target>'
gvm-cli socket --xml '
<create_target>
<name>Test Target</name>
<hosts>192.168.1.0/24</hosts>
</create_target>'
Phase 3: Web Application Scanning Tools
阶段3:Web应用扫描工具
Comprehensive web application testing:
Proxy configuration
Proxy configuration
- Set browser proxy to 127.0.0.1:8080
- Import Burp CA certificate for HTTPS
- Add target to scope
- Set browser proxy to 127.0.0.1:8080
- Import Burp CA certificate for HTTPS
- Add target to scope
- Proxy: Intercept and modify requests
- Spider: Crawl web applications
- Scanner: Automated vulnerability detection
- Intruder: Automated attacks (fuzzing, brute-force)
- Repeater: Manual request manipulation
- Decoder: Encode/decode data
- Comparer: Compare responses
Core testing workflow:
1. Configure proxy and scope
2. Spider the application
3. Analyze sitemap
4. Run active scanner
5. Manual testing with Repeater/Intruder
6. Review findings and generate report
- Proxy: Intercept and modify requests
- Spider: Crawl web applications
- Scanner: Automated vulnerability detection
- Intruder: Automated attacks (fuzzing, brute-force)
- Repeater: Manual request manipulation
- Decoder: Encode/decode data
- Comparer: Compare responses
核心测试流程:
1. 配置代理和扫描范围
2. 爬取Web应用
3. 分析站点地图
4. 运行主动扫描
5. 使用Repeater/Intruder进行手动测试
6. 查看检测结果并生成报告
Open-source web application scanner:
Automated scan from CLI
Automated scan from CLI
Generate report
Generate report
zap-cli report -o report.html -f html
zap-cli report -o report.html -f html
zap.sh -daemon -port 8080 -config api.key=<your_key>
zap.sh -daemon -port 8080 -config api.key=<your_key>
Docker-based scanning
Docker-based scanning
docker run -t owasp/zap2docker-stable zap-full-scan.py
-t
https://target.com -r report.html
docker run -t owasp/zap2docker-stable zap-full-scan.py
-t
https://target.com -r report.html
Baseline scan (passive only)
Baseline scan (passive only)
docker run -t owasp/zap2docker-stable zap-baseline.py
-t
https://target.com -r report.html
docker run -t owasp/zap2docker-stable zap-baseline.py
-t
https://target.com -r report.html
Web server vulnerability scanner:
Scan specific port
Scan specific port
nikto -h target.com -p 8080
nikto -h target.com -p 8080
Scan with SSL
Scan with SSL
Multiple targets
Multiple targets
Output formats
Output formats
nikto -h target.com -o report.html -Format html
nikto -h target.com -o report.xml -Format xml
nikto -h target.com -o report.csv -Format csv
nikto -h target.com -o report.html -Format html
nikto -h target.com -o report.xml -Format xml
nikto -h target.com -o report.csv -Format csv
Tuning options
Tuning options
nikto -h target.com -Tuning 123456789 # All tests
nikto -h target.com -Tuning x # Exclude specific tests
nikto -h target.com -Tuning 123456789 # All tests
nikto -h target.com -Tuning x # Exclude specific tests
Phase 4: Wireless Scanning Tools
阶段4:无线扫描工具
Aircrack-ng Suite
Aircrack-ng Suite
Wireless network penetration testing:
Check wireless interface
Check wireless interface
Enable monitor mode
Enable monitor mode
sudo airmon-ng start wlan0
sudo airmon-ng start wlan0
Scan for networks
Scan for networks
sudo airodump-ng wlan0mon
sudo airodump-ng wlan0mon
Capture specific network
Capture specific network
sudo airodump-ng -c <channel> --bssid <target_bssid> -w capture wlan0mon
sudo airodump-ng -c <channel> --bssid <target_bssid> -w capture wlan0mon
Deauthentication attack
Deauthentication attack
sudo aireplay-ng -0 10 -a <bssid> wlan0mon
sudo aireplay-ng -0 10 -a <bssid> wlan0mon
Crack WPA handshake
Crack WPA handshake
aircrack-ng -w wordlist.txt -b <bssid> capture*.cap
aircrack-ng -w wordlist.txt -b <bssid> capture*.cap
aircrack-ng -b <bssid> capture*.cap
aircrack-ng -b <bssid> capture*.cap
Passive wireless detection:
Specify interface
Specify interface
Access web interface
Access web interface
Detect hidden networks
Detect hidden networks
Kismet passively collects all beacon frames
Kismet passively collects all beacon frames
including those from hidden SSIDs
including those from hidden SSIDs
Phase 5: Malware and Exploit Scanning
阶段5:恶意软件与漏洞利用扫描
Open-source antivirus scanning:
Update virus definitions
Update virus definitions
Scan directory
Scan directory
clamscan -r /path/to/scan
clamscan -r /path/to/scan
Scan with verbose output
Scan with verbose output
clamscan -r -v /path/to/scan
clamscan -r -v /path/to/scan
Move infected files
Move infected files
clamscan -r --move=/quarantine /path/to/scan
clamscan -r --move=/quarantine /path/to/scan
Remove infected files
Remove infected files
clamscan -r --remove /path/to/scan
clamscan -r --remove /path/to/scan
Scan specific file types
Scan specific file types
clamscan -r --include='.exe$|.dll$' /path/to/scan
clamscan -r --include='.exe$|.dll$' /path/to/scan
Output to log
Output to log
clamscan -r -l scan.log /path/to/scan
clamscan -r -l scan.log /path/to/scan
Metasploit Vulnerability Validation
Metasploit漏洞验证
Validate vulnerabilities with exploitation:
Start Metasploit
Start Metasploit
Database setup
Database setup
Import Nmap results
Import Nmap results
db_import /path/to/nmap_scan.xml
db_import /path/to/nmap_scan.xml
Vulnerability scanning
Vulnerability scanning
use auxiliary/scanner/smb/smb_ms17_010
set RHOSTS 192.168.1.0/24
run
use auxiliary/scanner/smb/smb_ms17_010
set RHOSTS 192.168.1.0/24
run
Auto exploitation
Auto exploitation
vulns # View vulnerabilities
analyze # Suggest exploits
vulns # View vulnerabilities
analyze # Suggest exploits
Phase 6: Cloud Security Scanning
阶段6:云安全扫描
Prowler (AWS)
Prowler(AWS)
Install Prowler
Install Prowler
Specific checks
Specific checks
prowler aws -c iam s3 ec2
prowler aws -c iam s3 ec2
Compliance framework
Compliance framework
prowler aws --compliance cis_aws
prowler aws --compliance cis_aws
Output formats
Output formats
prowler aws -M html json csv
prowler aws -M html json csv
Specific region
Specific region
prowler aws -R arn:aws:iam::123456789012:role/ProwlerRole
prowler aws -R arn:aws:iam::123456789012:role/ProwlerRole
ScoutSuite (Multi-cloud)
ScoutSuite(多云)
Multi-cloud security auditing:
Install ScoutSuite
Install ScoutSuite
Generate report
Generate report
scout aws --report-dir ./reports
scout aws --report-dir ./reports
Phase 7: Compliance Scanning
阶段7:合规扫描
Security auditing for Unix/Linux:
sudo lynis audit system --quick
sudo lynis audit system --quick
Specific profile
Specific profile
sudo lynis audit system --profile server
sudo lynis audit system --profile server
Output report
Output report
sudo lynis audit system --report-file /tmp/lynis-report.dat
sudo lynis audit system --report-file /tmp/lynis-report.dat
Check specific section
Check specific section
sudo lynis show profiles
sudo lynis audit system --tests-from-group malware
sudo lynis show profiles
sudo lynis audit system --tests-from-group malware
Security compliance scanning:
List available profiles
List available profiles
oscap info /usr/share/xml/scap/ssg/content/ssg-<distro>-ds.xml
oscap info /usr/share/xml/scap/ssg/content/ssg-<distro>-ds.xml
Run scan with profile
Run scan with profile
oscap xccdf eval --profile xccdf_org.ssgproject.content_profile_pci-dss
--report report.html
/usr/share/xml/scap/ssg/content/ssg-rhel8-ds.xml
oscap xccdf eval --profile xccdf_org.ssgproject.content_profile_pci-dss
--report report.html
/usr/share/xml/scap/ssg/content/ssg-rhel8-ds.xml
Generate fix script
Generate fix script
oscap xccdf generate fix
--profile xccdf_org.ssgproject.content_profile_pci-dss
--output remediation.sh
/usr/share/xml/scap/ssg/content/ssg-rhel8-ds.xml
oscap xccdf generate fix
--profile xccdf_org.ssgproject.content_profile_pci-dss
--output remediation.sh
/usr/share/xml/scap/ssg/content/ssg-rhel8-ds.xml
Phase 8: Scanning Methodology
阶段8:扫描方法论
Structured scanning approach:
-
Planning
- Define scope and objectives
- Obtain proper authorization
- Select appropriate tools
-
Discovery
- Host discovery (Nmap ping sweep)
- Port scanning
- Service enumeration
-
Vulnerability Assessment
- Automated scanning (Nessus/OpenVAS)
- Web application scanning (Burp/ZAP)
- Manual verification
-
Analysis
- Correlate findings
- Eliminate false positives
- Prioritize by severity
-
Reporting
- Document findings
- Provide remediation guidance
- Executive summary
结构化扫描方法:
-
规划
-
发现
- 主机发现(Nmap ping扫描)
- 端口扫描
- 服务枚举
-
漏洞评估
- 自动化扫描(Nessus/OpenVAS)
- Web应用扫描(Burp/ZAP)
- 手动验证
-
分析
-
报告
Phase 9: Tool Selection Guide
阶段9:工具选择指南
Choose the right tool for each scenario:
| Scenario | Recommended Tools |
|---|
| Network Discovery | Nmap, Masscan |
| Vulnerability Assessment | Nessus, OpenVAS |
| Web App Testing | Burp Suite, ZAP, Nikto |
| Wireless Security | Aircrack-ng, Kismet |
| Malware Detection | ClamAV, YARA |
| Cloud Security | Prowler, ScoutSuite |
| Compliance | Lynis, OpenSCAP |
| Protocol Analysis | Wireshark, tcpdump |
根据场景选择合适的工具:
| 场景 | 推荐工具 |
|---|
| 网络发现 | Nmap, Masscan |
| 漏洞评估 | Nessus, OpenVAS |
| Web应用测试 | Burp Suite, ZAP, Nikto |
| 无线安全 | Aircrack-ng, Kismet |
| 恶意软件检测 | ClamAV, YARA |
| 云安全 | Prowler, ScoutSuite |
| 合规性 | Lynis, OpenSCAP |
| 协议分析 | Wireshark, tcpdump |
Phase 10: Reporting and Documentation
阶段10:报告与文档
Generate professional reports:
Nmap XML to HTML
Nmap XML to HTML
xsltproc nmap-output.xml -o report.html
xsltproc nmap-output.xml -o report.html
OpenVAS report export
OpenVAS report export
gvm-cli socket --xml '<get_reports report_id="<id>" format_id="<pdf_format>"/>'
gvm-cli socket --xml '<get_reports report_id="<id>" format_id="<pdf_format>"/>'
Combine multiple scan results
Combine multiple scan results
Use tools like Faraday, Dradis, or custom scripts
Use tools like Faraday, Dradis, or custom scripts
Executive summary template:
Executive summary template:
1. Scope and methodology
1. Scope and methodology
2. Key findings summary
2. Key findings summary
3. Risk distribution chart
3. Risk distribution chart
4. Critical vulnerabilities
4. Critical vulnerabilities
5. Remediation recommendations
5. Remediation recommendations
6. Detailed technical findings
6. Detailed technical findings
| Scan Type | Command |
|---|
| Ping Scan | |
| Quick Scan | |
| Full Scan | |
| Service Scan | |
| OS Detection | |
| Aggressive | |
| Vuln Scripts | nmap --script=vuln <target>
|
| Stealth Scan | |
| 扫描类型 | 命令 |
|---|
| Ping扫描 | |
| 快速扫描 | |
| 全端口扫描 | |
| 服务扫描 | |
| 系统检测 | |
| 全面扫描 | |
| 漏洞脚本 | nmap --script=vuln <target>
|
| 隐蔽扫描 | |
Common Ports Reference
常见端口参考
| Port | Service |
|---|
| 21 | FTP |
| 22 | SSH |
| 23 | Telnet |
| 25 | SMTP |
| 53 | DNS |
| 80 | HTTP |
| 443 | HTTPS |
| 445 | SMB |
| 3306 | MySQL |
| 3389 | RDP |
| 端口 | 服务 |
|---|
| 21 | FTP |
| 22 | SSH |
| 23 | Telnet |
| 25 | SMTP |
| 53 | DNS |
| 80 | HTTP |
| 443 | HTTPS |
| 445 | SMB |
| 3306 | MySQL |
| 3389 | RDP |
Constraints and Limitations
约束与限制
- Always obtain written authorization
- Respect scope boundaries
- Follow responsible disclosure practices
- Comply with local laws and regulations
- 始终获取书面授权
- 遵守范围边界
- 遵循负责任的披露原则
- 符合当地法律法规
Technical Limitations
技术限制
- Some scans may trigger IDS/IPS alerts
- Heavy scanning can impact network performance
- False positives require manual verification
- Encrypted traffic may limit analysis
- 部分扫描可能触发IDS/IPS警报
- 高强度扫描可能影响网络性能
- 误报需要手动验证
- 加密流量可能限制分析
- Start with non-intrusive scans
- Gradually increase scan intensity
- Document all scanning activities
- Validate findings before reporting
- 从非侵入式扫描开始
- 逐步提高扫描强度
- 记录所有扫描活动
- 报告前验证检测结果
Scan Not Detecting Hosts
扫描无法检测到主机
Solutions:
- Try different discovery methods: or
- Check firewall rules blocking ICMP
- Use TCP SYN scan:
- Verify network connectivity
解决方案:
- 尝试不同的发现方法: 或
- 检查防火墙是否阻止ICMP
- 使用TCP SYN扫描:
- 验证网络连通性
Slow Scan Performance
扫描性能缓慢
Solutions:
- Increase timing: or
- Reduce port range:
- Use Masscan for initial discovery
- Disable DNS resolution:
解决方案:
- 提高扫描速度等级: 或
- 缩小端口范围:
- 使用Masscan进行初始发现
- 禁用DNS解析:
Web Scanner Missing Vulnerabilities
Web扫描工具遗漏漏洞
Solutions:
- Authenticate to access protected areas
- Increase crawl depth
- Add custom injection points
- Use multiple tools for coverage
- Perform manual testing
解决方案:
- 认证后访问受保护区域
- 提高爬取深度
- 添加自定义注入点
- 使用多种工具覆盖检测
- 执行手动测试
This skill is applicable to execute the workflow or actions described in the overview.
当需要执行概述中描述的工作流程或操作时,适用本技能。