wgpsec/aboutsecurity/database-lateral-pivot
Claude Code and agent skill by wgpsec/aboutsecurity
- community
Checking that the SKILL.md file is still in the repository.
数据库横向移动与跨库攻击。当已获取一个数据库权限(PostgreSQL/MySQL/MSSQL)需要横向到其他数据库或内网服务时使用。覆盖 PostgreSQL dblink 跨库连接、MSSQL Linked Server 横向、MySQL 联邦引擎跨库、数据库→SSRF→内网探测。当目标网络隔离但数据库可通信时(数据库通常有比应用服务器更宽松的网络策略),这是突破隔离的关键路径。发现任何数据库间通信需求、内网数据库横向、跨库查询场景都应使用此技能
Install
npx vskill@latest install wgpsec/aboutsecurity/database-lateral-pivotSKILL.md
The same SKILL.md was published earlier as wgpsec/aboutsecurity/database-lateral-pivot.
数据库横向移动方法论
数据库是内网中天然的跳板——它们通常比应用服务器有更宽松的网络访问策略(需要连接多个服务),而且 PostgreSQL 的 dblink、MSSQL 的 Linked Server、MySQL 的 FEDERATED 引擎都提供了原生的跨主机查询能力。当应用层网络隔离严格时,通过数据库进行横向移动往往是唯一路径。
⛔ 深入参考(必读)
- dblink 连接、Linked Server 利用、SSRF 探测的完整命令和场景 → references/dblink-lateral.md
Phase 1: 评估横向条件
在当前数据库中收集信息,判断横向移动的可能性:
横向条件清单:
- 当前是 superuser/sa/root 吗?(非特权用户通常无法创建 dblink)
- 数据库配置中有没有其他主机的连接信息?
- 环境变量/配置文件中有没有其他数据库的凭据?
Phase 2: 内网信息收集(通过数据库)
数据库本身就是信息金矿:
Phase 3: 横向攻击决策树
→ 各数据库横向的完整命令 → references/dblink-lateral.md
Phase 4: 横向后利用
成功连接到新数据库后:
- 提取数据 — 用户表、配置表、flag
- 获取 RCE — COPY FROM PROGRAM / xp_cmdshell / UDF
- 继续横向 — 新数据库可能连接更多内网资源
- 持久化 — 创建后门账号、触发器
注意事项
- dblink/Linked Server 查询产生的流量来自数据库服务器 IP,不是你的攻击机 IP
- 利用这一特性可以绕过基于 IP 的网络 ACL
- 数据库间通信通常是明文的,注意凭据安全
- 大量跨库查询会产生日志,注意操作节制
Security
- Security scanPassed, 100 of 100Pattern checks on the skill's files.
- Model reviewNot runA model review is scheduled for the next rescan.
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingskills/lateral/database-lateral-pivot/SKILL.md
Popularity
- Repository stars
- 1,557
- Repository forks
- 228
- 7-day trend score
- 37
Stars and forks are for the whole GitHub repository, not this skill alone. Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/wgpsec/aboutsecurity/database-lateral-pivot)