performing-authenticated-vulnerability-scan
认证(凭据)漏洞扫描使用有效的系统凭据登录目标主机,对已安装软件、补丁、配置和安全设置进行深度检查,相比未认证扫描可发现 45-60% 更多漏洞。
Best use case
performing-authenticated-vulnerability-scan is best used when you need a repeatable AI agent workflow instead of a one-off prompt.
认证(凭据)漏洞扫描使用有效的系统凭据登录目标主机,对已安装软件、补丁、配置和安全设置进行深度检查,相比未认证扫描可发现 45-60% 更多漏洞。
Teams using performing-authenticated-vulnerability-scan should expect a more consistent output, faster repeated execution, less prompt rewriting.
When to use this skill
- You want a reusable workflow that can be run more than once with consistent structure.
When not to use this skill
- You only need a quick one-off answer and do not need a reusable workflow.
- You cannot install or maintain the underlying files, dependencies, or repository context.
Installation
Claude Code / Cursor / Codex
Manual Installation
- Download SKILL.md from GitHub
- Place it in
.claude/skills/performing-authenticated-vulnerability-scan/SKILL.mdinside your project - Restart your AI agent — it will auto-discover the skill
How performing-authenticated-vulnerability-scan Compares
| Feature / Agent | performing-authenticated-vulnerability-scan | Standard Approach |
|---|---|---|
| Platform Support | Not specified | Limited / Varies |
| Context Awareness | High | Baseline |
| Installation Complexity | Unknown | N/A |
Frequently Asked Questions
What does this skill do?
认证(凭据)漏洞扫描使用有效的系统凭据登录目标主机,对已安装软件、补丁、配置和安全设置进行深度检查,相比未认证扫描可发现 45-60% 更多漏洞。
Where can I find the source code?
You can find the source code on GitHub using the link provided at the top of the page.
SKILL.md Source
# 执行认证漏洞扫描
## 概述
认证(凭据)漏洞扫描(Authenticated Vulnerability Scan)使用有效的系统凭据登录目标主机,对已安装软件、补丁、配置和安全设置进行深度检查。与未认证扫描相比,凭据扫描能检测到多 45-60% 的漏洞,且误报率显著更低,因为可以直接查询已安装软件包、注册表项和文件系统内容。
## 前置条件
- 漏洞扫描器(Nessus、Qualys、OpenVAS、Rapid7 InsightVM)
- 在目标系统上具有适当权限的服务账户
- 安全凭据存储(优先集成密钥管理库)
- 扫描器到目标管理端口的网络访问权限
- 系统负责人的书面授权
## 核心概念
### 为何使用认证扫描
未认证扫描只能评估外部可见的服务和 Banner,常导致:
- 遗漏本地已安装软件中的漏洞
- 因 Banner 变更导致版本检测不准确
- 无法检查补丁级别、配置或本地策略
- 基于推断的检测方式导致误报率偏高
认证扫描通过直接查询目标操作系统来解决上述问题。
### 各平台凭据类型
#### Linux/Unix 系统
- **SSH 密钥认证**:RSA/Ed25519 密钥对(推荐)
- **SSH 用户名/密码**:无密钥认证系统的备选方案
- **Sudo/Su 提权**:具有 sudo 权限的非 root 用户
- **基于证书的 SSH**:企业环境的 X.509 证书
#### Windows 系统
- **SMB(Windows)**:域管理员或本地管理员凭据
- **WMI**:Windows Management Instrumentation(Windows 管理规范)查询
- **WinRM**:Windows Remote Management(Windows 远程管理,优先使用 HTTPS)
- **Kerberos**:带服务票据的域认证
#### 网络设备
- **SNMP v3**:带认证和加密的 USM(AES-256)
- **SSH**:用于 Cisco IOS、Juniper JunOS、Palo Alto PAN-OS
- **API 令牌**:现代网络平台的 REST API
#### 数据库
- **Oracle**:SYS/SYSDBA 凭据或 TNS 连接
- **Microsoft SQL Server**:Windows 认证或 SQL 认证
- **PostgreSQL**:基于角色的认证
- **MySQL**:具有 SELECT 权限的用户名/密码
## 实施步骤
### 步骤 1:创建专用服务账户
```bash
# Linux:创建扫描服务账户
sudo useradd -m -s /bin/bash -c "Vulnerability Scanner Service Account" nessus_svc
sudo usermod -aG sudo nessus_svc
# 配置特定命令的免密 sudo
echo 'nessus_svc ALL=(ALL) NOPASSWD: /usr/bin/dpkg -l, /usr/bin/rpm -qa, \
/bin/cat /etc/shadow, /usr/sbin/dmidecode, /usr/bin/find' | sudo tee /etc/sudoers.d/nessus_svc
# 生成 SSH 密钥对
sudo -u nessus_svc ssh-keygen -t ed25519 -f /home/nessus_svc/.ssh/id_ed25519 -N ""
# 将公钥分发到目标主机
for host in $(cat target_hosts.txt); do
ssh-copy-id -i /home/nessus_svc/.ssh/id_ed25519.pub nessus_svc@$host
done
```
```powershell
# Windows:通过 PowerShell 创建扫描服务账户
New-ADUser -Name "SVC_VulnScan" `
-SamAccountName "SVC_VulnScan" `
-UserPrincipalName "SVC_VulnScan@domain.local" `
-Description "Vulnerability Scanner Service Account" `
-PasswordNeverExpires $true `
-CannotChangePassword $true `
-Enabled $true `
-AccountPassword (Read-Host -AsSecureString "Enter Password")
# 通过 GPO 将账户添加到目标主机的本地管理员组:
Add-ADGroupMember -Identity "Domain Admins" -Members "SVC_VulnScan"
# 建议使用专用 GPO 授予本地管理员权限,以实现最小权限原则
# 在目标主机上启用 WinRM
Enable-PSRemoting -Force
Set-Item WSMan:\localhost\Service\AllowRemote -Value $true
winrm set winrm/config/service '@{AllowUnencrypted="false"}'
```
### 步骤 2:配置扫描器凭据
#### Nessus 配置
```json
{
"credentials": {
"add": {
"Host": {
"SSH": [{
"auth_method": "public key",
"username": "nessus_svc",
"private_key": "/path/to/id_ed25519",
"elevate_privileges_with": "sudo",
"escalation_account": "root"
}],
"Windows": [{
"auth_method": "Password",
"username": "DOMAIN\\SVC_VulnScan",
"password": "stored_in_vault",
"domain": "domain.local"
}],
"SNMPv3": [{
"username": "nessus_snmpv3",
"security_level": "authPriv",
"auth_algorithm": "SHA-256",
"auth_password": "stored_in_vault",
"priv_algorithm": "AES-256",
"priv_password": "stored_in_vault"
}]
}
}
}
}
```
### 步骤 3:验证凭据访问
```bash
# 测试 SSH 连通性
ssh -i /path/to/key -o ConnectTimeout=10 nessus_svc@target_host "uname -a && sudo dpkg -l | head -5"
# 测试 WinRM 连通性
python3 -c "
import winrm
s = winrm.Session('target_host', auth=('DOMAIN\\\\SVC_VulnScan', 'password'), transport='ntlm')
r = s.run_cmd('systeminfo')
print(r.std_out.decode())
"
# 测试 SNMP v3 连通性
snmpwalk -v3 -u nessus_snmpv3 -l authPriv -a SHA-256 -A authpass -x AES-256 -X privpass target_host sysDescr.0
```
### 步骤 4:执行认证扫描
使用 Nessus API 配置并启动扫描:
```bash
# 创建带凭据的扫描任务
curl -k -X POST https://nessus:8834/scans \
-H "X-Cookie: token=$TOKEN" \
-H "Content-Type: application/json" \
-d '{
"uuid": "'$TEMPLATE_UUID'",
"settings": {
"name": "Authenticated Scan - Production",
"text_targets": "192.168.1.0/24",
"launch": "ON_DEMAND"
},
"credentials": {
"add": {
"Host": {
"SSH": [{"auth_method": "public key", "username": "nessus_svc", "private_key": "/keys/id_ed25519"}],
"Windows": [{"auth_method": "Password", "username": "DOMAIN\\SVC_VulnScan", "password": "vault_ref"}]
}
}
}
}'
```
### 步骤 5:验证凭据成功
扫描完成后,检查凭据验证结果:
- **插件 19506**(Nessus 扫描信息):显示凭据状态
- **插件 21745**(操作系统安全补丁评估):确认本地检查
- **插件 117887**(本地安全检查):凭据验证
- **插件 110385**(Nessus 凭据检查):目标级别认证状态
## 凭据安全最佳实践
1. **使用密钥管理库**(HashiCorp Vault、CyberArk、AWS Secrets Manager)存储凭据
2. **每 90 天或人员变动后轮换凭据**
3. **最小权限原则** — 仅授予最低必要权限
4. **审计凭据使用情况** — 监控服务账户登录事件
5. **传输加密** — 优先使用 SSH 密钥而非密码,优先使用 HTTPS 的 WinRM
6. **每个扫描器使用独立账户** — 切勿跨工具共享凭据
7. **尽可能禁用扫描服务账户的交互式登录**
8. **在 SIEM 中记录所有认证事件**用于扫描账户审计
## 常见陷阱
- 使用域管理员账户而非最小权限服务账户
- 以明文形式在扫描配置中存储凭据
- 扫描启动前未测试凭据(导致扫描窗口浪费)
- 未为 Linux 目标配置 sudo/提权
- Windows UAC 阻断远程凭据检查
- 防火墙规则阻断扫描器与目标之间的 WMI/WinRM/SSH
- 多次认证失败触发凭据锁定
## 相关技能
- scanning-infrastructure-with-nessus
- performing-network-vulnerability-assessment
- implementing-continuous-vulnerability-monitoringRelated Skills
testing-api-for-mass-assignment-vulnerability
测试 API 是否存在批量赋值(mass assignment,自动绑定)漏洞——攻击者可在 API 请求中附加额外参数,从而修改本不应被访问的对象属性。测试人员识别可写端点,向请求体注入未公开字段(role、isAdmin、price、balance),验证服务器是否在未过滤的情况下将这些字段绑定到数据模型。属于 OWASP API3:2023 Broken Object Property Level Authorization 范畴。适用于批量赋值测试、参数绑定滥用、自动绑定漏洞或 API 过度发布(over-posting)相关请求。
scanning-network-with-nmap-advanced
使用 Nmap 的脚本引擎、时序控制、规避技术和输出解析,对授权目标网络执行高级网络侦察, 发现主机、枚举服务、检测漏洞并识别操作系统。
scanning-kubernetes-manifests-with-kubesec
使用 Kubesec 对 Kubernetes 资源清单执行安全风险分析,识别错误配置、权限提升风险以及与安全最佳实践的偏差。
scanning-infrastructure-with-nessus
Tenable Nessus 是业界领先的漏洞扫描器,用于识别网络基础设施(包括服务器、工作站、网络设备和操作系统)中的安全弱点。
scanning-docker-images-with-trivy
Trivy 是 Aqua Security 开源的综合性漏洞扫描器,用于检测容器镜像中操作系统软件包、语言特定依赖项的漏洞、错误配置、密钥和许可证违规,并集成到 CI/CD 流水线,支持 SARIF、CycloneDX 和 SPDX 等多种输出格式。
scanning-containers-with-trivy-in-cicd
本技能涵盖将 Aqua Security 的 Trivy 扫描器集成到 CI/CD 流水线中,用于全面的容器镜像漏洞检测。包括扫描 Docker 镜像中的操作系统包和应用依赖 CVE、检测 Dockerfile 中的错误配置、扫描文件系统和 Git 仓库,以及建立基于严重性的质量门禁以阻止有漏洞的镜像部署。
scanning-container-images-with-grype
使用 Anchore Grype 扫描容器镜像的已知漏洞(Vulnerability),支持基于 SBOM 的匹配和可配置的严重性阈值。
performing-yara-rule-development-for-detection
通过识别可执行文件中的唯一字节模式、字符串和行为指标,开发精准的 YARA 恶意软件检测规则,同时将误报率降至最低。
performing-wireless-security-assessment-with-kismet
使用 Kismet 通过被动射频监控进行无线网络安全评估,检测流氓接入点(Rogue AP)、隐藏 SSID、弱加密和未授权客户端。
performing-wireless-network-penetration-test
执行无线网络渗透测试,通过捕获握手包、破解 WPA2/WPA3 密钥、检测流氓接入点以及使用 Aircrack-ng 和相关工具测试无线网络分段,评估 WiFi 安全性。
performing-windows-artifact-analysis-with-eric-zimmerman-tools
使用 Eric Zimmerman 的开源 EZ Tools 套件(包括 KAPE、MFTECmd、PECmd、LECmd、JLECmd 和 Timeline Explorer)执行全面的 Windows 取证制品分析,解析注册表 hive、预取文件、事件日志和文件系统元数据。
performing-wifi-password-cracking-with-aircrack
在授权无线安全评估中捕获 WPA/WPA2 握手包,并使用 aircrack-ng、hashcat 和字典攻击进行离线密码破解, 以评估密码短语强度和无线网络安全状况。