mcpField
C
cms-detection

cms-detection

github.com/uphiago安全1.3k45 次安装8 周前更新
代码仓库

关于 cms-detection

cms-detection 是用于侦察的技能,可识别存活主机上的 CMS、Web 框架、服务器软件及版本。它结合技术指纹与版本线索检查,辅助开展针对性安全评估。

主要功能

  1. 01识别 CMS 和框架
  2. 02检测服务器软件
  3. 03检查平台版本
  4. 04交叉核验检测证据
  5. 05将版本关联至已知 CVE

适用场景

  1. 01按技术栈分类存活主机
  2. 02识别版本以研究 CVE
  3. 03选择平台专属安全测试

安装

复制下面的命令,在终端中运行。

$npx skills add https://github.com/uphiago/recon-skills --skill cms-detection

安装后在 Claude Code 中输入/cms-detection确认已加载。

详细介绍

CMS 检测

识别每个在线主机使用的内容管理系统、Web 框架、服务器软件和技术栈。攻击前先了解目标使用的技术栈——WordPress 站点需要与 Laravel API 或 Spring Boot 微服务不同的测试。多 CMS 检测涵盖 WordPress、Drupal、Joomla、Magento、Shopify、Wix、Squarespace、Laravel、Django、Express、Spring Boot 等。

使用场景

  • 你有一份在线主机列表,需要按技术栈分类。
  • 针对 WordPress 的测试出现误报(实际站点使用 Drupal)。
  • 需要识别正在运行的 CMS 版本,以便与已知 CVE 匹配。
  • 某主机对所有路径都返回通用的 200 响应——技术检测能告诉你它实际运行的是什么。
  • 想找出运行着热门 CMS 平台过时版本的站点。

前置条件

  • terminal,并安装 httpx、whatweb、wappalyzer 和 curl。
  • 来自 skill_view(name='visual-recon') 或 skill_view(name='subdomain-enumeration') 的在线子域名列表。

快速检测

# Fastest: httpx with built-in tech detection
cat alive_subs.txt | httpx -silent -tech-detect -o tech_detect.txt

# Deep: whatweb with aggressive checks
whatweb -i alive_subs.txt -a 3 -t 50 --log-brief=cms_results.txt

操作步骤

阶段 1 — 批量技术指纹识别
# httpx — fast tech detection using Wappalyzer signatures
cat alive_subs.txt | httpx -silent -tech-detect -o tech_httpx.txt

# Parse results: extract unique technologies with counts
cat tech_httpx.txt | awk -F' [' '{print $2}' | tr -d ']' | tr ',' '\n' \
  | sed 's/^ *//' | sort | uniq -c | sort -rn > tech_summary.txt

# whatweb — deeper, identifies specific CMS versions
whatweb -i alive_subs.txt -a 3 -t 50 \
  --log-brief=cms_results.txt \
  --log-json=cms_results.json

# Parse whatweb JSON for versioned findings
cat cms_results.json | jq -r '.[] | select(.version != null) | "\(.target): \(.plugin) \(.version)"' \
  | sort -u > versioned_cms.txt
阶段 2 — CMS 专项版本检测
WordPress
# Generator meta tag
curl --max-time 30 --connect-timeout 10 -sk "https://target.com" | grep -Eo '<meta name="generator"[^>]*content="WordPress [^"]+' | head -1

# RSS feed
curl --max-time 30 --connect-timeout 10 -sk "https://target.com/feed/" | grep -Eo '<generator>https://wordpress.org/\?v=[^<]+' | head -1

# readme.html (often left accessible)
curl --max-time 30 --connect-timeout 10 -sk "https://target.com/readme.html" | grep -Eo "Version [0-9.]+" | head -1

# wp-json namespace
curl --max-time 30 --connect-timeout 10 -sk "https://target.com/wp-json/" | jq -r '.namespaces[]' 2>/dev/null
Drupal
# CHANGELOG.txt (Drupal's canonical version leak)
curl --max-time 30 --connect-timeout 10 -sk "https://target.com/CHANGELOG.txt" | head -5

# Drupal specific paths
curl --max-time 30 --connect-timeout 10 -skI "https://target.com/user/login" | grep -i "drupal\|x-generator"
curl --max-time 30 --connect-timeout 10 -skI "https://target.com/node/1"
Joomla
# Joomla version files
curl --max-time 30 --connect-timeout 10 -sk "https://target.com/administrator/manifests/files/joomla.xml" | grep -Eo '<version>[^<]+' | head -1
curl --max-time 30 --connect-timeout 10 -sk "https://target.com/language/en-GB/en-GB.xml" | grep -Eo '<version>[^<]+'

# Meta tag
curl --max-time 30 --connect-timeout 10 -sk "https://target.com" | grep -Eo '<meta name="generator"[^>]*content="Joomla[^"]+' | head -1
Magento
# Magento version file
curl --max-time 30 --connect-timeout 10 -sk "https://target.com/magento_version" | head -1
# Composer lock
curl --max-time 30 --connect-timeout 10 -sk "https://target.com/composer.lock" | jq -r '.packages[] | select(.name=="magento/magento2-base") | .version' 2>/dev/null
Laravel
# Laravel debug info
curl --max-time 30 --connect-timeout 10 -sk "https://target.com" | grep -Eo 'Laravel v[0-9.]+'
# Composer lock
curl --max-time 30 --connect-timeout 10 -sk "https://target.com/composer.lock" | jq -r '.packages[] | select(.name=="laravel/framework") | .version' 2>/dev/null
阶段 3 — 服务器与框架检测
# Server header — often removed but check anyway
for host in $(cat alive_subs.txt); do
  echo -n "$host: "
  curl --max-time 30 --connect-timeout 10 -skI "https://$host" | grep -i "server:\|x-powered-by:" | tr '\n' ' '
  echo
  sleep 0.3
done > server_headers.txt

# Common server signatures and what they mean
# nginx → likely PHP-FPM or Node.js proxy
# Apache → shared hosting, cPanel
# IIS → Windows, ASP.NET
# LiteSpeed → shared hosting, WordPress optimized
# cloudflare → CDN/WAF in front, need origin-ip-discovery
# Microsoft-IIS/10.0 → Windows Server 2016+

# Framework detection via specific paths
# Django admin: /admin/ → redirect to /admin/login/
# Rails: /assets/application-*.js pattern
# Express: X-Powered-By: Express
# Spring Boot: /actuator/health returns {"status":"UP"}
# Next.js: /_next/static/ chunks
阶段 4 — 技术栈分类
# Categorize hosts by CMS for targeted testing
echo "=== WORDPRESS ==="
grep -i "wordpress" tech_detect.txt

echo "=== DRUPAL ==="
grep -i "drupal" tech_detect.txt

echo "=== OTHER CMS ==="
grep -iE "joomla|magento|shopify|wix|squarespace|ghost" tech_detect.txt

echo "=== FRAMEWORKS ==="
grep -iE "laravel|django|rails|express|spring|next\.js|nuxt" tech_detect.txt

echo "=== E-COMMERCE ==="
grep -iE "woocommerce|magento|shopify|prestashop|opencart" tech_detect.txt

echo "=== NO CMS (Static/Custom) ==="
cat alive_subs.txt | httpx -silent -td \
  | grep -v -iE "wordpress|drupal|joomla|magento|laravel|django|rails"
阶段 5 — 版本 → CVE 映射
# Map detected versions to known CVEs
# WordPress: check https://wpscan.com/wordpress-security/vulnerability-database/
# Drupal: check https://www.drupal.org/security
# Magento: check https://magento.com/security/patches

# searchsploit — local ExploitDB search
searchsploit wordpress 6.5
searchsploit drupal 10.2
searchsploit joomla 5.1

# nuclei — automated CVE detection on detected CMS
nuclei -l wordpress_sites.txt -t nuclei-templates/http/cves/2024/

注意事项

  • Generator meta 标签可能被伪造。 站点声称使用“WordPress 7.0”,实际运行的可能是 6.5。请通过 readme.html 或 RSS feed 交叉验证。
  • 技术检测基于特征签名。 自定义主题可能会移除或修改这些签名。
  • CDN 缓存可能提供过时的版本信息。 添加随机查询参数以绕过缓存。
  • whatweb 在激进扫描时可能触发 WAF 拦截。 对受保护的目标使用 -a 2(降低扫描强度)。
  • 无头 CMS(Strapi、Contentful)没有版本文件。 请改为查找 API 端点。

验证

  1. 至少两种独立方法确认相同的 CMS/版本(meta 标签 + readme + wp-json)。
  2. 版本专属路径存在(例如,WordPress 的 /wp-admin/,Drupal 的 /user/login)。
  3. 框架专属端点响应正常(例如,Spring Boot 的 /actuator/health)。
  4. 记录:主机名、CMS、版本、检测方法,以及该版本是否存在已知 CVE。

相关技能

  • web-enumeration — 识别 CMS 后,枚举其专属路径和端点。
  • wordpress-plugin-hunt — 深入检测 WordPress 目标的插件版本。
  • wp-mass-recon — 批量扫描 WordPress 漏洞。
  • visual-recon — 通过视觉截图验证确认 CMS 检测结果。
  • deep-invade — 针对检测到的版本运行 nuclei CVE 扫描。

评论

支持 Markdown