Course contentsShow
← Security
Lesson 2199 of 3,05243. Offensive Security ToolingFree lesson

Meterpreter Deep Dive

Mastering Meterpreter: commands, migration, pivoting, port forwarding, and advanced session manipulation techniques.

Meterpreter Deep Dive

What you'll learn: How to fully leverage Meterpreter's powerful interactive shell for advanced post-exploitation tasks, including process migration, pivoting, and sophisticated session management.

Core Concept

Meterpreter isn't just a shell—it's a dynamic, in-memory payload that gives you surgical control over compromised systems. Think of it as your Swiss Army knife that operates entirely in RAM, leaving minimal forensic traces while offering commands far beyond a standard shell.

Essential Commands

Once you've established a Meterpreter session, you're handed a treasure trove of capabilities:

  • sysinfo reveals system details
  • getuid shows your current privilege level
  • ps lists running processes
  • screenshot captures the victim's screen
  • keyscan_start/dump logs keystrokes
  • hashdump extracts password hashes

Process Migration

Running Meterpreter in the initial exploited process is risky—if that process dies, you lose access. Use migrate <PID> to jump into a stable, long-running process like explorer.exe or svchost.exe. This is like moving from a sinking ship to an aircraft carrier.

Pivoting and Port Forwarding

Meterpreter excels at turning compromised hosts into launching pads:

  • route add configures routing through the session to reach internal networks
  • portfwd add -l 8080 -p 80 -r 192.168.1.10 forwards traffic, allowing you to access internal services from your attack machine

Advanced Session Control

Manage multiple sessions with background, switch between them with sessions -i <ID>, and upgrade shells to Meterpreter using post/multi/manage/shell_to_meterpreter.

Key Takeaway: Meterpreter transforms basic exploitation into sophisticated, stealthy post-exploitation through process migration for stability, pivoting for network expansion, and rich built-in commands that operate entirely in memory.