Agent Skillsyaklang/hack-skills › insecure-source-code-management

insecure-source-code-management

GitHub

检测并恢复暴露的VCS元数据(Git/SVN/Hg)及备份文件,识别敏感配置泄露。仅限授权安全评估使用,提供探测路径、状态码分析及开源恢复工具指南。

skills/insecure-source-code-management/SKILL.md yaklang/hack-skills

Trigger Scenarios

发现.git/.svn等版本控制目录或文件 对隐藏目录返回403但特定文件可访问 扫描到.env等配置文件泄露

Install

npx skills add yaklang/hack-skills --skill insecure-source-code-management -g -y
More Options

Use without installing

npx skills use yaklang/hack-skills@insecure-source-code-management

指定 Agent (Claude Code)

npx skills add yaklang/hack-skills --skill insecure-source-code-management -a claude-code -g -y

安装 repo 全部 skill

npx skills add yaklang/hack-skills --all -g -y

预览 repo 内 skill

npx skills add yaklang/hack-skills --list

SKILL.md

Frontmatter
{
    "name": "insecure-source-code-management",
    "description": "Source control and artifact exposure (.git, .svn, .hg, backups, .env). Use when recon finds VCS paths, 403 on hidden dirs, or backup\/config leaks during authorized testing."
}

SKILL: Insecure Source Code Management

AI LOAD INSTRUCTION: This skill covers detection and recovery of exposed version-control metadata, common backup artifacts, and related misconfigurations. Use only in authorized assessments. Treat recovered credentials and URLs as sensitive; do not exfiltrate real data beyond scope. For broad discovery workflow, cross-load recon-for-sec and recon-and-methodology when those skills exist in the workspace.

0. QUICK START

High-value paths to probe first (GET or HEAD, respect rate limits):

/.git/HEAD
/.git/config
/.svn/entries
/.svn/wc.db
/.hg/requires
/.bzr/README
/.DS_Store
/.env

Routing note: quickly probe these paths first; for full recon workflow, load methodology from recon-for-sec and recon-and-methodology before deeper testing.


1. GIT EXPOSURE

Detection

  • /.git/HEAD — valid repo often returns plain text like:
ref: refs/heads/main
  • /.git/config — may expose remote.origin.url, user identity, or embedded credentials.
  • /.git/index, /.git/objects/ — partial object store access enables reconstruction with the right tools.

403 vs 404

  • 404 — path likely absent or fully blocked at the edge.
  • 403 on /.git/ — directory may exist but listing is denied; still try direct file URLs:
/.git/HEAD
/.git/config
/.git/logs/HEAD
/.git/refs/heads/main

A 403 on the directory plus 200 on HEAD strongly indicates exposure.

Recovery tools (open source)

  • arthaud/git-dumper — dumps reachable .git tree when individual files are fetchable.
  • internetwache/GitTools — Dumper, Extractor, Finder modules for partial/corrupt dumps.
  • WangYihang/GitHacker — alternative recovery when standard dumpers miss edge cases.

Key files to prioritize

Path Why it matters
.git/config Remotes, credentials, hooks paths
.git/logs/HEAD Commit history, reflog-style leakage
.git/refs/heads/* Branch tips, commit SHAs
.git/packed-refs Packed branch/tag refs
.git/objects/** Object blobs for reconstruction

2. SVN EXPOSURE

Detection

  • SVN before 1.7: /.svn/entries — XML or text metadata listing paths and revisions.
  • SVN ≥ 1.7: /.svn/wc.db — SQLite working copy database (PRAGMA table_info after download).

Example probe:

GET /.svn/entries HTTP/1.1
GET /.svn/wc.db HTTP/1.1

Recovery

  • anantshri/svn-extractor — automated extraction from exposed .svn.
  • Manual: download wc.db, query with sqlite3 for file paths and checksums, then request /.svn/pristine/ blobs if exposed.

3. MERCURIAL EXPOSURE

Detection

  • /.hg/requires — small text file listing repository features; confirms Mercurial metadata.
GET /.hg/requires HTTP/1.1
GET /.hg/store/ HTTP/1.1

Recovery

  • sahildhar/mercurial_source_code_dumper — dumps repository when store paths are reachable.

4. OTHER LEAKS

Bazaar (Bzr)

  • Probe /.bzr/README and /.bzr/branch-format for Bazaar metadata.

macOS .DS_Store

  • /.DS_Store can encode directory and filename listings.
  • Tools: gehaxelt/ds-store, lijiejie/ds_store_exp — parse .DS_Store offline.

Backup and config artifacts

Probe (adjust for app root and naming conventions):

/.env
/backup.zip
/backup.tar.gz
/wwwroot.rar
/backup.sql
/config.php.bak
/.config.php.swp

Web server misconfiguration signal (example: NGINX)

  • location /.git { deny all; } — may return 403 for /.git/ while still allowing or denying specific subpaths depending on rules.
  • 403 on a protected location can confirm the route exists; always distinguish from 404 on non-existent paths.

5. DECISION TREE

  1. Probe /.git/HEADref: refs/heads/ pattern? → run git-dumper / GitTools / GitHacker; review config and logs/HEAD for secrets.
  2. Else probe /.svn/wc.db or entries → success? → svn-extractor or manual wc.db + pristine recovery.
  3. Else probe /.hg/requires → success? → mercurial dumper.
  4. Else probe /.bzr/README → Bazaar tooling or manual path walk.
  5. Parallel: fetch /.DS_Store, /.env, common backup extensions on app root and parent paths.
  6. Interpret status codes: 403 on directory + 200 on specific files → treat as high priority for file-by-file extraction.

6. RELATED ROUTING

  • From recon-for-sec — scope-safe discovery, crawling, and fingerprinting before deep VCS tests.
  • From recon-and-methodology — structured methodology and evidence handling.

Note: coordinate with recon skills—set scope and request rate first, then run targeted VCS/backup validation.

Version History

  • c9a4b9e Current 2026-07-06 00:23

Same Skill Collection

skills/401-403-bypass-techniques/SKILL.md
skills/active-directory-acl-abuse/SKILL.md
skills/active-directory-certificate-services/SKILL.md
skills/active-directory-kerberos-attacks/SKILL.md
skills/ai-ml-security/SKILL.md
skills/android-pentesting-tricks/SKILL.md
skills/anti-debugging-techniques/SKILL.md
skills/api-auth-and-jwt-abuse/SKILL.md
skills/api-authorization-and-bola/SKILL.md
skills/api-recon-and-docs/SKILL.md
skills/api-sec/SKILL.md
skills/arbitrary-write-to-rce/SKILL.md
skills/auth-sec/SKILL.md
skills/authbypass-authentication-flaws/SKILL.md
skills/binary-protection-bypass/SKILL.md
skills/browser-exploitation-v8/SKILL.md
skills/business-logic-vuln/SKILL.md
skills/business-logic-vulnerabilities/SKILL.md
skills/classical-cipher-analysis/SKILL.md
skills/clickjacking/SKILL.md
skills/cmdi-command-injection/SKILL.md
skills/code-obfuscation-deobfuscation/SKILL.md
skills/container-escape-techniques/SKILL.md
skills/cors-cross-origin-misconfiguration/SKILL.md
skills/crlf-injection/SKILL.md
skills/csp-bypass-advanced/SKILL.md
skills/csrf-cross-site-request-forgery/SKILL.md
skills/csv-formula-injection/SKILL.md
skills/dangling-markup-injection/SKILL.md
skills/defi-attack-patterns/SKILL.md
skills/dependency-confusion/SKILL.md
skills/deserialization-insecure/SKILL.md
skills/dns-rebinding-attacks/SKILL.md
skills/email-header-injection/SKILL.md
skills/expression-language-injection/SKILL.md
skills/file-access-vuln/SKILL.md
skills/format-string-exploitation/SKILL.md
skills/graphql-and-hidden-parameters/SKILL.md
skills/hack/SKILL.md
skills/hash-attack-techniques/SKILL.md
skills/heap-exploitation/SKILL.md
skills/http-host-header-attacks/SKILL.md
skills/http-parameter-pollution/SKILL.md
skills/http2-specific-attacks/SKILL.md
skills/idor-broken-object-authorization/SKILL.md
skills/injection-checking/SKILL.md
skills/ios-pentesting-tricks/SKILL.md
skills/jndi-injection/SKILL.md
skills/jwt-oauth-token-attacks/SKILL.md

Metadata

Files
0
Version
c9a4b9e
Hash
7e033f79
Indexed
2026-07-06 00:23

Главная - Вики-сайт
Copyright © 2011-2026 iteam. Current version is 2.155.2. UTC+08:00, 2026-08-04 05:04
浙ICP备14020137号-1 $Гость$