Skip to content

Reverse Engineering / Authorized Penetration Testing / Security Research Skill Router Pack AI-powered routing + On-demand toolchain bootstrapping + Self-evolving knowledge base Supports Claude Code, Kiro, Cursor, Cline, and other AI coding clients 逆向/渗透/安全技能路由包 - AI 自动路由 + 按需自举工具链 + 自动进化经验库 | 支持 Claude Code / Kiro / Cursor / Cline 等代码 AI 客户端

Shell

Merge pull request #123 from dex0shubham/fix/broken-doc-links

zhaoxuya52069e227084e08
diff --cc CHANGELOG.md
index 1770f21,7cb25da..9d6d251
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@@ -7,10 -7,10 +7,11 @@@ Versioning follows [Semantic Versioning
## [Unreleased]
### Added
-- **CI runs remaining unwired suites** — est-p0-friction.ps1 on the Windows leg of outing-tests (Windows PowerShell 5.1); case-review/tests/test_review_case.py in the Linux case-contract job. est-workflow-title-safety.ps1 was already wired.
+- **CI runs remaining unwired suites** — `test-p0-friction.ps1` on the Windows leg of `routing-tests` (Windows PowerShell 5.1); `case-review/tests/test_review_case.py` in the Linux `case-contract` job. `test-workflow-title-safety.ps1` was already wired.
### Fixed
-- **Broken internal doc link + guard** — removed a dangling `phishing-case-study.md` reference in `skills/reverse-engineering/field-notes.md` (the file was never created; the analysis is inline). Added `skills/scripts/verify-doc-links.py`, wired into the `case-contract` job, so CI fails on any internal Markdown link that does not resolve to a tracked file (fenced code, the generated `tool-index.md`, and the vendored `src-hunter` corpus are excluded).
+- **IDA MCP HTTP stall** — `run-supervisor.py` patches stock `idalib_supervisor` onto `ThreadingHTTPServer` and accepts Streamable HTTP GET `/mcp` (patch failure is skipped, supervisor still starts). Keep-alive deadlock is **time since last healthy `tools/list`**, not process `CreationDate`; `open.ps1` holds `opening.lock` so in-flight opens are never `-Force`d. New `recover.ps1` is an immediate `-Force` path. Never `taskkill`s `ida.exe`.
++- **Broken internal doc links + guard** — removed a dangling `phishing-case-study.md` reference and redirected the missing payloader `反弹shell.md` index entry to its tracked raw data. Added `skills/scripts/verify-doc-links.py`, wired into CI, so internal Markdown links are checked from Git index blobs even when Defender quarantines a working-tree payload file.
- **Windows PowerShell 5.1 encoding** — added a UTF-8 BOM to five non-ASCII `.ps1` scripts (`skills/scripts/verify-doc-facts.ps1`, `apk-reverse/scripts/frida-run.ps1`, `apk-reverse/scripts/rebuild-sign-install.ps1`, `ida-reverse/scripts/start.ps1`, `radare2/scripts/recon.ps1`). Without a BOM, PS 5.1 parses these files as the system ANSI codepage and garbles their Chinese / em-dash string literals; `verify-doc-facts.ps1` was failing four checks under 5.1 (CI only ran it under `pwsh`, which defaults to UTF-8). CI now guards every non-ASCII `.ps1` for a BOM.
### Changed
diff --cc skills/pentest-tools/src-hunter/references/payloader/index.md
index 5c7b686,5c7b686..7e4128b
--- a/skills/pentest-tools/src-hunter/references/payloader/index.md
+++ b/skills/pentest-tools/src-hunter/references/payloader/index.md
@@@ -56,7 -56,7 +56,7 @@@
| 信息收集 | 20 | [tools/信息收集.md](tools/信息收集.md) |
| 内网渗透 | 19 | [tools/内网渗透.md](tools/内网渗透.md) |
| Web渗透 | 16 | [tools/web渗透.md](tools/web渗透.md) |
--| 反弹Shell | 12 | [tools/反弹shell.md](tools/反弹shell.md) |
++| 反弹Shell | 12 | [raw/tools.json](raw/tools.json)(筛选 `category = 反弹Shell`) |
| 密码攻击 | 11 | [tools/密码攻击.md](tools/密码攻击.md) |
| 漏洞利用 | 11 | [tools/漏洞利用.md](tools/漏洞利用.md) |
| 系统命令 | 8 | [tools/系统命令.md](tools/系统命令.md) |
diff --cc skills/scripts/verify-doc-links.py
index 0000000,4f9d99d..f438d9d
mode 000000,100644..100644
--- a/skills/scripts/verify-doc-links.py
+++ b/skills/scripts/verify-doc-links.py
@@@ -1,0 -1,108 +1,105 @@@
+ #!/usr/bin/env python3
+ """Verify internal (relative) Markdown links resolve to tracked files.
+
+ Guard against broken cross-references in the repo's documentation. Only
+ *local* links are checked: `http(s)`, `mailto:`, `tel:`, protocol-relative,
+ and pure `#anchor` links are ignored, as are links inside fenced code blocks
+ (``` / ~~~) and the generated `tool-index.md`. Link targets are resolved
+ relative to the containing file and matched against the set of git-tracked
+ files and directories (UTF-8 paths, so CJK filenames compare correctly).
+
++Markdown is read from the Git index rather than the working tree. This keeps
++the check deterministic when antivirus software quarantines a research
++payload file after checkout, and it lets the vendored corpus participate in
++the same link-integrity check without opening it through the filesystem.
++
+ Exit 1 (with a report) if any internal link points at a path that is not
+ tracked. Run from the repo root: python3 skills/scripts/verify-doc-links.py
-
-The vendored `src-hunter` payload knowledge base is skipped: it is an
-imported corpus with its own index/accounting (and gets AV-quarantined on
-Windows clones), so its link completeness is maintained upstream, not here.
+ """
+ import os
+ import re
+ import subprocess
+ import sys
+
+ sys.stdout.reconfigure(encoding="utf-8")
+
+ LINK = re.compile(r"\[[^\]]*\]\(([^)]+)\)")
+ INLINE_CODE = re.compile(r"`[^`]*`")
+ FENCE = re.compile(r"^\s*(```|~~~)")
+ SKIP_PREFIX = ("http://", "https://", "mailto:", "tel:", "ftp:", "data:", "//", "#")
+ SKIP_CHARS = set("{}<>`$*|")
-# Vendored corpora excluded from link-hygiene (maintained upstream).
-EXCLUDE_DIRS = ("skills/pentest-tools/src-hunter/",)
+
+
+ def tracked_paths():
+ out = subprocess.run(
+ ["git", "-c", "core.quotePath=false", "ls-files", "-z"],
+ capture_output=True, check=True,
+ ).stdout.decode("utf-8")
+ files = {os.path.normpath(p).replace(os.sep, "/") for p in out.split("\0") if p}
+ dirs = set()
+ for f in files:
+ d = os.path.dirname(f)
+ while d and d not in dirs:
+ dirs.add(d)
+ d = os.path.dirname(d)
+ return files, dirs
+
+
+ def links_in(path):
+ """Yield (lineno, target) for local links outside fenced code blocks."""
+ in_fence = False
- try:
- fh = open(path, encoding="utf-8")
- except OSError:
- return # unreadable tracked file (e.g. quarantined locally); nothing to scan
- with fh:
- for lineno, line in enumerate(fh, 1):
- if FENCE.match(line):
- in_fence = not in_fence
++ result = subprocess.run(
++ ["git", "show", f":{path}"], capture_output=True, check=False
++ )
++ if result.returncode != 0:
++ raise RuntimeError(f"cannot read tracked Markdown blob: {path}")
++ text = result.stdout.decode("utf-8-sig")
++ for lineno, line in enumerate(text.splitlines(), 1):
++ if FENCE.match(line):
++ in_fence = not in_fence
++ continue
++ if in_fence:
++ continue
++ for m in LINK.finditer(INLINE_CODE.sub("", line)):
++ raw = m.group(1).strip().strip("<>")
++ if not raw:
+ continue
- if in_fence:
++ target = raw.split()[0].split("#")[0].split("?")[0]
++ if not target:
+ continue
- for m in LINK.finditer(INLINE_CODE.sub("", line)):
- raw = m.group(1).strip().strip("<>")
- if not raw:
- continue
- target = raw.split()[0].split("#")[0].split("?")[0]
- if not target:
- continue
- if target.lower().startswith(SKIP_PREFIX):
- continue
- if "tool-index" in target or SKIP_CHARS & set(target):
- continue
- yield lineno, target
++ if target.lower().startswith(SKIP_PREFIX):
++ continue
++ if "tool-index" in target or SKIP_CHARS & set(target):
++ continue
++ yield lineno, target
+
+
+ def resolve(md, target):
+ if target.startswith("/"):
+ base = target.lstrip("/")
+ else:
+ base = os.path.join(os.path.dirname(md), target)
+ return os.path.normpath(base).replace(os.sep, "/")
+
+
+ def main():
+ files, dirs = tracked_paths()
+ broken = []
- mds = sorted(
- p for p in files
- if p.endswith(".md") and not p.startswith(EXCLUDE_DIRS)
- )
++ mds = sorted(p for p in files if p.endswith(".md"))
+ for md in mds:
+ for lineno, target in links_in(md):
+ p = resolve(md, target)
+ if p not in files and p not in dirs:
+ broken.append((md, lineno, target))
+
+ if broken:
+ print(f"FAIL verify-doc-links: {len(broken)} broken internal link(s)")
+ for md, lineno, target in broken:
+ print(f" {md}:{lineno} -> {target}")
+ return 1
+ print("OK verify-doc-links: all internal Markdown links resolve")
+ return 0
+
+
+ if __name__ == "__main__":
+ sys.exit(main())