跳到正文
Skillpedia
安全6.5k · #14155

web-discovery

它能做什么

它介绍如何扫描网站的目录和文件、检查备用主机名,以及读取 JavaScript 中的链接。适用于审查自己管理或获准测试的网站的开发者和测试人员。

适用场景

  • ✓当开发者想找出网站上遗忘的页面或备份文件时。
  • ✓当测试人员需要找出同一服务器上托管的其他网站时。
  • ✓当有人想列出网站 JavaScript 代码调用的网址时。

技能链接

https://github.com/BitterSecurity/Decepticon/blob/main/packages/decepticon/decepticon/skills/standard/recon/web-recon/discovery/SKILL.md

复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。

使用方法

最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。

可直接粘贴的消息

请用这个技能帮我:https://github.com/BitterSecurity/Decepticon/blob/main/packages/decepticon/decepticon/skills/standard/recon/web-recon/discovery/SKILL.md 阅读该链接中的 SKILL.md 文件,并在我的任务中按照它的说明来做。
想让你的 AI 自己找到这样的技能吗?安装免费的 Skillpedia MCP:只需一行,每次任务前它都会在 15,000+ 个技能中搜索。1 分钟完成安装 →

可以这样问 AI

“请找出我们网站上遗留的任何被遗忘或敏感的文件。”

每周 5 个新技能,1 分钟读完。

工作原理

该技能提供尝试常见文件和文件夹名称、检查备用主机名以及读取网站脚本的步骤。AI 会将发现的内容分类,以便审查。

技术内容(原始 SKILL.md)

作者在 GitHub 上的英文原文。

Web Discovery — Directories, vHosts, JavaScript

Surface the application's path tree, alternate virtual hosts, and JS-embedded endpoints/secrets. This is the first pass of web recon — feeds every later sub-skill.

1. Directory & File Discovery

ffuf (Recommended — Fast, Flexible)

# Basic directory fuzzing
ffuf -u https://<target>/FUZZ -w /usr/share/wordlists/dirb/common.txt -mc 200,301,302,403

# With file extensions
ffuf -u https://<target>/FUZZ -w /usr/share/wordlists/dirb/common.txt \
    -e .php,.asp,.aspx,.jsp,.html,.js,.json,.xml,.txt,.bak,.old,.sql,.zip,.tar.gz

# Filter by response size (exclude default pages)
ffuf -u https://<target>/FUZZ -w wordlist.txt -fs <default_size>

# Recursive scanning (depth 2)
ffuf -u https://<target>/FUZZ -w wordlist.txt -recursion -recursion-depth 2

# Throttled for stealth
ffuf -u https://<target>/FUZZ -w wordlist.txt -rate 10 -mc 200,301,302,403

Sensitive Files to Check

# Common sensitive paths
for path in .env .git/config .htaccess robots.txt sitemap.xml \
    wp-config.php web.config server-status .DS_Store \
    backup.sql dump.sql database.sql .svn/entries \
    crossdomain.xml clientaccesspolicy.xml; do
    code=$(curl -s -o /dev/null -w "%{http_code}" "https://<target>/$path")
    echo "$code $path"
done

2. Virtual Host (vHost) Discovery

# vHost fuzzing via Host header
ffuf -u https://<target_ip>/ -H "Host: FUZZ.<target>" \
    -w /usr/share/wordlists/subdomains.txt -fs <default_size>

# With TLS SNI
ffuf -u https://FUZZ.<target>/ -w /usr/share/wordlists/subdomains.txt \
    -mc 200,301,302,403 -fs <default_size>

Why vHost discovery matters:

  • Multiple applications may share one IP but respond differently based on Host header
  • Internal/staging apps often hidden behind non-public vhost names

3. Nginx/Apache Alias Off-By-One Probe

When a server uses alias /var/www/static/ for /static, an off-by-one allows reading parent directory:

  • Configured: location /static { alias /var/www/static/; } → /static../ becomes /var/www/static/../ → escapes to /var/www/
  • Vulnerable to: /static../<file> requests reading outside the alias root
# Probe common alias-bound paths for off-by-one
# Get homepage size baseline first
curl -sk "https://<TARGET>/" -o /tmp/baseline.html
BASELINE=$(wc -c < /tmp/baseline.html)

for prefix in static images img assets files uploads media public; do
    for suffix in '..' '..%2f' '%2e%2e' '%2e%2e%2f'; do
        URL="https://<TARGET>/${prefix}${suffix}/"
        CODE=$(curl -sk -o /tmp/probe.html -w "%{http_code}" "$URL")
        SIZE=$(wc -c < /tmp/probe.html)
        # Only flag if 200 AND size differs from homepage (not a fallback)
        [ "$CODE" = "200" ] && [ "$SIZE" != "$BASELINE" ] && echo "CANDIDATE $CODE $SIZE $URL"
    done
done

# If any candidate found, confirm with a known-content control file:
# curl -s "https://<TARGET>/static../etc/hostname"
# AND verify body content (see lfi.md "Response Body Verification" section)

Why this is in recon, not exploit: Discovering the alias misconfig is a recon task; exploiting it via path traversal is the exploit phase. Recon should surface alias-prefix candidates to the exploit agent.

Anti-pattern: Skipping the alias-prefix probe and going straight to parameter fuzzing on view.php (or similar) wastes the dispatch when the off-by-one alias misconfig is the actual vector. Including this probe in standard recon discovery flags the misconfig immediately.

4. JavaScript Analysis

Endpoint Extraction from JS

# Download all JS files
curl -s https://<target> | grep -oP 'src="[^"]*\.js"' | cut -d'"' -f2 | while read js; do
    [[ "$js" == http* ]] || js="https://<target>$js"
    echo "=== $js ==="
    curl -s "$js" | grep -oP '["'"'"'](/[a-zA-Z0-9_/\-\.]+)["'"'"']' | sort -u
done

# Look for API keys, secrets, endpoints in JS
curl -s "https://<target>/main.js" | grep -oiE '(api[_-]?key|secret|token|password|auth)["\s]*[:=]["\s]*[a-zA-Z0-9+/=_\-]{8,}'

Source Map Detection

# Check for exposed source maps
curl -sI "https://<target>/main.js" | grep -i sourcemap
curl -s "https://<target>/main.js.map" | head -c 100
常见问题

它会查找哪些类型的文件?

它检查常见的配置文件、备份文件和版本控制文件及文件夹。

它只看一个页面吗?

不是。它会扫描整个目录树,也会读取链接的脚本。

它面向谁?

面向获准扫描该网站的站长和测试人员。

详情

作者的原始描述

Web app discovery — directory/file fuzzing, vhost discovery, JavaScript endpoint extraction.

repo: BitterSecurity/Decepticon

热度

GitHub 星标
6.5k
排名
#14155
许可证
Apache-2.0
更新时间
2026/11/1

这个技能有用吗?

0

登录 后即可投票。

评论

  • …

同一仓库的更多技能

相似技能