Security Scanning Tools by automindtechnologie-jpg/ultimate-skill.md
npx skills add https://github.com/automindtechnologie-jpg/ultimate-skill.md --skill 'Security Scanning Tools'掌握用于网络发现、漏洞评估、Web 应用程序测试、无线安全和合规性验证的基本安全扫描工具。此技能涵盖不同扫描类别中的工具选择、配置和实际使用。
用于网络发现和安全审计的主要工具:
# 主机发现
nmap -sn 192.168.1.0/24 # Ping 扫描(无端口扫描)
nmap -sL 192.168.1.0/24 # 列表扫描(DNS 解析)
nmap -Pn 192.168.1.100 # 跳过主机发现
# 端口扫描技术
nmap -sS 192.168.1.100 # TCP SYN 扫描(隐蔽)
nmap -sT 192.168.1.100 # TCP 连接扫描
nmap -sU 192.168.1.100 # UDP 扫描
nmap -sA 192.168.1.100 # ACK 扫描(防火墙检测)
# 端口指定
nmap -p 80,443 192.168.1.100 # 特定端口
nmap -p- 192.168.1.100 # 所有 65535 个端口
nmap -p 1-1000 192.168.1.100 # 端口范围
nmap --top-ports 100 192.168.1.100 # 前 100 个常见端口
# 服务和操作系统检测
nmap -sV 192.168.1.100 # 服务版本检测
nmap -O 192.168.1.100 # 操作系统检测
nmap -A 192.168.1.100 # 激进模式(操作系统、版本、脚本)
# 定时和性能
nmap -T0 192.168.1.100 # 偏执(最慢,IDS 规避)
nmap -T4 192.168.1.100 # 激进(更快)
nmap -T5 192.168.1.100 # 疯狂(最快)
# NSE 脚本
nmap --script=vuln 192.168.1.100 # 漏洞脚本
nmap --script=http-enum 192.168.1.100 # Web 枚举
nmap --script=smb-vuln* 192.168.1.100 # SMB 漏洞
nmap --script=default 192.168.1.100 # 默认脚本集
# 输出格式
nmap -oN scan.txt 192.168.1.100 # 正常输出
nmap -oX scan.xml 192.168.1.100 # XML 输出
nmap -oG scan.gnmap 192.168.1.100 # 可 grep 输出
nmap -oA scan 192.168.1.100 # 所有格式
用于大型网络的高速端口扫描:
# 基本扫描
masscan -p80 192.168.1.0/24 --rate=1000
masscan -p80,443,8080 192.168.1.0/24 --rate=10000
# 全端口范围
masscan -p0-65535 192.168.1.0/24 --rate=5000
# 大规模扫描
masscan 0.0.0.0/0 -p443 --rate=100000 --excludefile exclude.txt
# 输出格式
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 --banners
企业级漏洞评估:
# 启动 Nessus 服务
sudo systemctl start nessusd
# 访问 Web 界面
# https://localhost:8834
# 命令行(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>
关键 Nessus 功能:
开源漏洞扫描:
# 安装 OpenVAS
sudo apt install openvas
sudo gvm-setup
# 启动服务
sudo gvm-start
# 访问 Web 界面(Greenbone Security Assistant)
# https://localhost:9392
# 命令行操作
gvm-cli socket --xml "<get_version/>"
gvm-cli socket --xml "<get_tasks/>"
# 创建并运行扫描
gvm-cli socket --xml '
<create_target>
<name>Test Target</name>
<hosts>192.168.1.0/24</hosts>
</create_target>'
全面的 Web 应用程序测试:
# 代理配置
1. 将浏览器代理设置为 127.0.0.1:8080
2. 导入 Burp CA 证书以支持 HTTPS
3. 将目标添加到范围
# 关键模块:
- Proxy:拦截和修改请求
- Spider:爬取 Web 应用程序
- Scanner:自动化漏洞检测
- Intruder:自动化攻击(模糊测试、暴力破解)
- Repeater:手动请求操作
- Decoder:编码/解码数据
- Comparer:比较响应
核心测试工作流程:
开源 Web 应用程序扫描器:
# 启动 ZAP
zaproxy
# 从 CLI 进行自动化扫描
zap-cli quick-scan https://target.com
# 完整扫描
zap-cli spider https://target.com
zap-cli active-scan https://target.com
# 生成报告
zap-cli report -o report.html -f html
# API 模式
zap.sh -daemon -port 8080 -config api.key=<your_key>
ZAP 自动化:
# 基于 Docker 的扫描
docker run -t owasp/zap2docker-stable zap-full-scan.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 服务器漏洞扫描器:
# 基本扫描
nikto -h https://target.com
# 扫描特定端口
nikto -h target.com -p 8080
# 使用 SSL 扫描
nikto -h target.com -ssl
# 多个目标
nikto -h targets.txt
# 输出格式
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 -Tuning 123456789 # 所有测试
nikto -h target.com -Tuning x # 排除特定测试
无线网络渗透测试:
# 检查无线接口
airmon-ng
# 启用监控模式
sudo airmon-ng start wlan0
# 扫描网络
sudo airodump-ng wlan0mon
# 捕获特定网络
sudo airodump-ng -c <channel> --bssid <target_bssid> -w capture wlan0mon
# 解除认证攻击
sudo aireplay-ng -0 10 -a <bssid> wlan0mon
# 破解 WPA 握手包
aircrack-ng -w wordlist.txt -b <bssid> capture*.cap
# 破解 WEP
aircrack-ng -b <bssid> capture*.cap
被动无线检测:
# 启动 Kismet
kismet
# 指定接口
kismet -c wlan0
# 访问 Web 界面
# http://localhost:2501
# 检测隐藏网络
# Kismet 被动收集所有信标帧
# 包括来自隐藏 SSID 的信标帧
开源防病毒扫描:
# 更新病毒定义
sudo freshclam
# 扫描目录
clamscan -r /path/to/scan
# 扫描并显示详细输出
clamscan -r -v /path/to/scan
# 移动受感染文件
clamscan -r --move=/quarantine /path/to/scan
# 删除受感染文件
clamscan -r --remove /path/to/scan
# 扫描特定文件类型
clamscan -r --include='\.exe$|\.dll$' /path/to/scan
# 输出到日志
clamscan -r -l scan.log /path/to/scan
通过漏洞利用验证漏洞:
# 启动 Metasploit
msfconsole
# 数据库设置
msfdb init
db_status
# 导入 Nmap 结果
db_import /path/to/nmap_scan.xml
# 漏洞扫描
use auxiliary/scanner/smb/smb_ms17_010
set RHOSTS 192.168.1.0/24
run
# 自动漏洞利用
vulns # 查看漏洞
analyze # 建议漏洞利用
AWS 安全评估:
# 安装 Prowler
pip install prowler
# 基本扫描
prowler aws
# 特定检查
prowler aws -c iam s3 ec2
# 合规性框架
prowler aws --compliance cis_aws
# 输出格式
prowler aws -M html json csv
# 特定区域
prowler aws -f us-east-1
# 承担角色
prowler aws -R arn:aws:iam::123456789012:role/ProwlerRole
多云安全审计:
# 安装 ScoutSuite
pip install scoutsuite
# AWS 扫描
scout aws
# Azure 扫描
scout azure --cli
# GCP 扫描
scout gcp --user-account
# 生成报告
scout aws --report-dir ./reports
Unix/Linux 安全审计:
# 运行审计
sudo lynis audit system
# 快速扫描
sudo lynis audit system --quick
# 特定配置文件
sudo lynis audit system --profile server
# 输出报告
sudo lynis audit system --report-file /tmp/lynis-report.dat
# 检查特定部分
sudo lynis show profiles
sudo lynis audit system --tests-from-group malware
安全合规性扫描:
# 列出可用配置文件
oscap info /usr/share/xml/scap/ssg/content/ssg-<distro>-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
# 生成修复脚本
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
结构化扫描方法:
规划
发现
漏洞评估
分析
报告
为每种场景选择合适的工具:
| 场景 | 推荐工具 |
|---|---|
| 网络发现 | Nmap, Masscan |
| 漏洞评估 | Nessus, OpenVAS |
| Web 应用测试 | Burp Suite, ZAP, Nikto |
| 无线安全 | Aircrack-ng, Kismet |
| 恶意软件检测 | ClamAV, YARA |
| 云安全 | Prowler, ScoutSuite |
| 合规性 | Lynis, OpenSCAP |
| 协议分析 | Wireshark, tcpdump |
生成专业报告:
# Nmap XML 转 HTML
xsltproc nmap-output.xml -o report.html
# OpenVAS 报告导出
gvm-cli socket --xml '<get_reports report_id="<id>" format_id="<pdf_format>"/>'
# 合并多个扫描结果
# 使用 Faraday、Dradis 或自定义脚本等工具
# 执行摘要模板:
# 1. 范围和方法论
# 2. 关键发现摘要
# 3. 风险分布图
# 4. 关键漏洞
# 5. 修复建议
# 6. 详细技术发现
| 扫描类型 | 命令 |
|---|---|
| Ping 扫描 | nmap -sn <target> |
| 快速扫描 | nmap -T4 -F <target> |
| 完整扫描 | nmap -p- <target> |
| 服务扫描 | nmap -sV <target> |
| 操作系统检测 | nmap -O <target> |
| 激进模式 | nmap -A <target> |
| 漏洞脚本 |
| 端口 | 服务 |
|---|---|
| 21 | FTP |
| 22 | SSH |
| 23 | Telnet |
| 25 | SMTP |
| 53 | DNS |
| 80 | HTTP |
| 443 | HTTPS |
| 445 | SMB |
| 3306 | MySQL |
| 3389 | RDP |
解决方案:
nmap -Pn 或 nmap -sn -PS/PA/PUnmap -PS22,80,443解决方案:
nmap -T4 或 -T5--top-ports 100-n解决方案:
每周安装数
0
仓库
首次出现
1970年1月1日
安全审计
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.
Primary tool for network discovery and security auditing:
# 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
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
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
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
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)
# NSE Scripts
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
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
广告位招租
在这里展示您的产品或服务
触达数万 AI 开发者,精准高效
nmap --script=vuln <target> |
| 隐蔽扫描 | nmap -sS -T2 <target> |
High-speed port scanning for large networks:
# Basic scanning
masscan -p80 192.168.1.0/24 --rate=1000
masscan -p80,443,8080 192.168.1.0/24 --rate=10000
# Full port range
masscan -p0-65535 192.168.1.0/24 --rate=5000
# Large-scale scanning
masscan 0.0.0.0/0 -p443 --rate=100000 --excludefile exclude.txt
# 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
# Banner grabbing
masscan -p80 192.168.1.0/24 --banners
Enterprise-grade vulnerability assessment:
# Start Nessus service
sudo systemctl start nessusd
# Access web interface
# https://localhost:8834
# 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:
Open-source vulnerability scanning:
# Install OpenVAS
sudo apt install openvas
sudo gvm-setup
# Start services
sudo gvm-start
# Access web interface (Greenbone Security Assistant)
# https://localhost:9392
# Command-line operations
gvm-cli socket --xml "<get_version/>"
gvm-cli socket --xml "<get_tasks/>"
# Create and run scan
gvm-cli socket --xml '
<create_target>
<name>Test Target</name>
<hosts>192.168.1.0/24</hosts>
</create_target>'
Comprehensive web application testing:
# Proxy configuration
1. Set browser proxy to 127.0.0.1:8080
2. Import Burp CA certificate for HTTPS
3. Add target to scope
# Key modules:
- 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:
Open-source web application scanner:
# Start ZAP
zaproxy
# Automated scan from CLI
zap-cli quick-scan https://target.com
# Full scan
zap-cli spider https://target.com
zap-cli active-scan https://target.com
# Generate report
zap-cli report -o report.html -f html
# API mode
zap.sh -daemon -port 8080 -config api.key=<your_key>
ZAP automation:
# Docker-based scanning
docker run -t owasp/zap2docker-stable zap-full-scan.py \
-t https://target.com -r report.html
# Baseline scan (passive only)
docker run -t owasp/zap2docker-stable zap-baseline.py \
-t https://target.com -r report.html
Web server vulnerability scanner:
# Basic scan
nikto -h https://target.com
# Scan specific port
nikto -h target.com -p 8080
# Scan with SSL
nikto -h target.com -ssl
# Multiple targets
nikto -h targets.txt
# 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
# Tuning options
nikto -h target.com -Tuning 123456789 # All tests
nikto -h target.com -Tuning x # Exclude specific tests
Wireless network penetration testing:
# Check wireless interface
airmon-ng
# Enable monitor mode
sudo airmon-ng start wlan0
# Scan for networks
sudo airodump-ng wlan0mon
# Capture specific network
sudo airodump-ng -c <channel> --bssid <target_bssid> -w capture wlan0mon
# Deauthentication attack
sudo aireplay-ng -0 10 -a <bssid> wlan0mon
# Crack WPA handshake
aircrack-ng -w wordlist.txt -b <bssid> capture*.cap
# Crack WEP
aircrack-ng -b <bssid> capture*.cap
Passive wireless detection:
# Start Kismet
kismet
# Specify interface
kismet -c wlan0
# Access web interface
# http://localhost:2501
# Detect hidden networks
# Kismet passively collects all beacon frames
# including those from hidden SSIDs
Open-source antivirus scanning:
# Update virus definitions
sudo freshclam
# Scan directory
clamscan -r /path/to/scan
# Scan with verbose output
clamscan -r -v /path/to/scan
# Move infected files
clamscan -r --move=/quarantine /path/to/scan
# Remove infected files
clamscan -r --remove /path/to/scan
# Scan specific file types
clamscan -r --include='\.exe$|\.dll$' /path/to/scan
# Output to log
clamscan -r -l scan.log /path/to/scan
Validate vulnerabilities with exploitation:
# Start Metasploit
msfconsole
# Database setup
msfdb init
db_status
# Import Nmap results
db_import /path/to/nmap_scan.xml
# Vulnerability scanning
use auxiliary/scanner/smb/smb_ms17_010
set RHOSTS 192.168.1.0/24
run
# Auto exploitation
vulns # View vulnerabilities
analyze # Suggest exploits
AWS security assessment:
# Install Prowler
pip install prowler
# Basic scan
prowler aws
# Specific checks
prowler aws -c iam s3 ec2
# Compliance framework
prowler aws --compliance cis_aws
# Output formats
prowler aws -M html json csv
# Specific region
prowler aws -f us-east-1
# Assume role
prowler aws -R arn:aws:iam::123456789012:role/ProwlerRole
Multi-cloud security auditing:
# Install ScoutSuite
pip install scoutsuite
# AWS scan
scout aws
# Azure scan
scout azure --cli
# GCP scan
scout gcp --user-account
# Generate report
scout aws --report-dir ./reports
Security auditing for Unix/Linux:
# Run audit
sudo lynis audit system
# Quick scan
sudo lynis audit system --quick
# Specific profile
sudo lynis audit system --profile server
# Output report
sudo lynis audit system --report-file /tmp/lynis-report.dat
# Check specific section
sudo lynis show profiles
sudo lynis audit system --tests-from-group malware
Security compliance scanning:
# List available profiles
oscap info /usr/share/xml/scap/ssg/content/ssg-<distro>-ds.xml
# 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
# 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
Structured scanning approach:
Planning
Discovery
Vulnerability Assessment
Analysis
Reporting
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 |
Generate professional reports:
# Nmap XML to HTML
xsltproc nmap-output.xml -o report.html
# OpenVAS report export
gvm-cli socket --xml '<get_reports report_id="<id>" format_id="<pdf_format>"/>'
# Combine multiple scan results
# Use tools like Faraday, Dradis, or custom scripts
# Executive summary template:
# 1. Scope and methodology
# 2. Key findings summary
# 3. Risk distribution chart
# 4. Critical vulnerabilities
# 5. Remediation recommendations
# 6. Detailed technical findings
| Scan Type | Command |
|---|---|
| Ping Scan | nmap -sn <target> |
| Quick Scan | nmap -T4 -F <target> |
| Full Scan | nmap -p- <target> |
| Service Scan | nmap -sV <target> |
| OS Detection | nmap -O <target> |
| Aggressive | nmap -A <target> |
| Vuln Scripts | nmap --script=vuln <target> |
| Stealth Scan | nmap -sS -T2 <target> |
| Port | Service |
|---|---|
| 21 | FTP |
| 22 | SSH |
| 23 | Telnet |
| 25 | SMTP |
| 53 | DNS |
| 80 | HTTP |
| 443 | HTTPS |
| 445 | SMB |
| 3306 | MySQL |
| 3389 | RDP |
Solutions:
nmap -Pn or nmap -sn -PS/PA/PUnmap -PS22,80,443Solutions:
nmap -T4 or -T5--top-ports 100-nSolutions:
Weekly Installs
0
Repository
First Seen
Jan 1, 1970
Security Audits
通过 LiteLLM 代理让 Claude Code 对接 GitHub Copilot 运行 | 高级变通方案指南
22,200 周安装