Post-Exploitation Modules
Pivoting and loot.
Post-Exploitation Modules is a free Ethical Hacking Academy lesson on CoddyKit — lesson 4 of 4. You can read the complete lesson below for free — then practise it hands-on in the browser with a built-in code editor and a 24/7 AI tutor. It is part of the Ethical Hacking Academy learning path, one of 4 lessons in the course, and your progress syncs across the web and the CoddyKit app.
After the Foothold
Gaining a session is only the beginning. Post-exploitation is everything you do afterward to demonstrate impact: gathering evidence, escalating, and reaching deeper into the network.
Metasploit's post modules automate these tasks against an existing session, all within the authorized scope of the engagement.
Running Post Modules
Post modules act on a session you already have. You load one, point it at the session, and run it. The path structure tells you the platform and purpose.
use post/windows/gather/enum_logged_on_users
set SESSION 1
runLocal Enumeration
First, learn the host thoroughly. Gather modules collect:
- Logged-on users and local accounts.
- Installed software and patch level.
- Network configuration and routes.
- Antivirus and security products present.
This intelligence shapes your next moves and the client report.
run post/windows/gather/enum_applications
run post/multi/gather/envLooting Credentials
Loot is valuable data: password hashes, cached credentials, browser-stored passwords, SSH keys, and config files.
Recovered credentials are gold because they often unlock other systems. Metasploit stores them in its database for reuse and reporting.
run post/windows/gather/credentials/credential_collector
creds # view stored credentialsPersistence (Within Scope)
Persistence means maintaining access across reboots. In red-team engagements this proves real-world risk, but it must be explicitly authorized and carefully cleaned up afterward.
Always document any persistence mechanism you install so the client can verify removal. Unauthorized persistence is both unethical and illegal.
Understanding Pivoting
Pivoting uses a compromised host as a stepping stone to reach networks you cannot touch directly. The first host often has access to an internal subnet hidden from you.
By routing traffic through that host, you extend your reach deeper into the environment, mirroring how real attackers move laterally.
Adding a Route
The autoroute post module (or the route command) tells Metasploit to send traffic for an internal subnet through your existing session.
After adding a route, other Metasploit modules can scan and attack hosts on that hidden network as if you were local.
run post/multi/manage/autoroute SUBNET=192.168.50.0
# Now: use auxiliary/scanner/portscan/tcp on 192.168.50.xPort Forwarding and SOCKS
To use tools outside Metasploit through the pivot, set up forwarding:
- portfwd: forwards a single remote port to your local machine.
- socks_proxy auxiliary module: exposes the whole pivot as a SOCKS proxy you can run with proxychains.
portfwd add -l 3389 -p 3389 -r 192.168.50.10
use auxiliary/server/socks_proxyLateral Movement
With looted credentials and a pivot route, you move laterally to other internal hosts. Techniques include reusing password hashes (pass-the-hash) and authenticating to additional services.
Each new host can yield more credentials, creating a chain that demonstrates how far an attacker could reach. Document the full path for the report.
Cleanup and Reporting
Professional engagements end with cleanup: remove uploaded files, persistence, and added routes, then restore the environment.
Your final deliverable is a clear report mapping each foothold, escalation, pivot, and looted credential to a business risk and a remediation recommendation. The goal is to help the client improve, not just to break in.
Session Management at Scale
Large engagements produce many sessions. Stay organized:
sessions -llists all active sessions.sessions -i Ninteracts with one.sessions -u Nupgrades a basic shell to Meterpreter.sessions -Kkills all sessions during cleanup.
Naming and tracking sessions keeps a complex pivot from descending into chaos.
sessions -l
sessions -u 2 # upgrade shell to meterpreterQuick Check
Identify the technique being described.
Recap
You completed post-exploitation:
- Post modules run against an existing session to enumerate, loot, and act.
- Loot (hashes, keys, configs) often unlocks more systems.
- Persistence only with explicit authorization and documented cleanup.
- Pivoting via autoroute, plus portfwd/SOCKS, enables lateral movement into hidden networks.
- End with thorough cleanup and reporting.
This completes Metasploit Framework Mastery. Next module: Nmap Deep Dive.
Frequently asked questions
Is the “Post-Exploitation Modules” lesson free?
Yes — the full text of “Post-Exploitation Modules” is free to read here on the web, and the Ethical Hacking Academy course includes 4 lessons in total. To practise it interactively (a built-in code editor and a 24/7 AI tutor) and unlock the rest of the Ethical Hacking Academy course, upgrade to CoddyKit PRO.
What will I learn in “Post-Exploitation Modules”?
Pivoting and loot. You practise Ethical Hacking Academy with hands-on code you run directly in the browser, and a 24/7 AI tutor answers your questions as you work through the lesson.
Do I need any experience to start Ethical Hacking Academy?
No prior experience is required. Ethical Hacking Academy on CoddyKit is structured for beginners through advanced learners; this is — lesson 4 of 4, so you can start here or from the beginning and move at your own pace.
How long does the “Post-Exploitation Modules” lesson take?
Most CoddyKit lessons take about 5–10 minutes. Each one is bite-sized and interactive, so you make steady progress and pick up exactly where you left off across the web and the app.
Can I write and run code in this Ethical Hacking Academy lesson?
Yes. Every Ethical Hacking Academy lesson includes a built-in code editor, so you write and run real code right in your browser and get instant AI feedback — no local setup required.
All lessons in this course
- Metasploit Architecture
- Searching and Using Exploits
- Payloads and Meterpreter
- Post-Exploitation Modules