πŸ› οΈ Meterpreter

πŸ’» How Meterpreter Works

Upon successful exploit:

  1. Stager executed (e.g., bind, reverse TCP).

  2. Reflective DLL loading (injects Meterpreter DLL).

  3. AES-encrypted communication established.

  4. Extensions loaded (e.g., stdapi, priv).

πŸ“Œ Common Commands

meterpreter > help
Command
Description

background / bg

Background current session

migrate

Migrate to another process

getuid

Show user identity

ps

List processes

steal_token

Impersonate another user

hashdump

Extract password hashes

lsa_dump_sam

Dump SAM database

lsa_dump_secrets

Extract LSA secrets

pivot

Manage pivot listeners

load

Load meterpreter extensions

resource

Execute commands from file

sleep

Pause and resume connection quietly

secure

Renegotiate encryption


πŸ”Ž Meterpreter Practical Example

Start the MSFDB

Refer back to πŸ—„οΈ Database to see how to setup

Step-by-step Exploitation Process

1️⃣ Reconnaissance with Nmap

Identifies:

  • Port 80: Microsoft IIS httpd 6.0

  • Possible WebDAV vulnerabilities.

2️⃣ Searching and Using Exploit

Set target options:

3️⃣ Gaining Meterpreter Shell

  • Successful exploit gives Meterpreter shell.

  • Files may remain on the victim (cleanup attempt may fail).

4️⃣ Initial Privilege Check

If privileges insufficient, attempt token stealing:

5️⃣ Local Privilege Escalation

If necessary, use the local exploit suggester:

Exploit suggested vulnerabilities:

6️⃣ Achieving SYSTEM Privileges

Check final privileges:


πŸ“‚ Post-Exploitation Activities

With SYSTEM-level access, further activities include:

  • Extracting hashes:

  • Dumping LSA secrets:

  • Pivoting within the network, impersonating users, and accessing internal resources.


πŸ›‘οΈ Defense Tips (For Admins)

  • Monitor filesystem for suspicious files (e.g., .asp, .tmp files).

  • Use regex signatures to detect Meterpreter artifacts.

  • Implement robust security measures (IDS/IPS) to detect exploitation attempts early.

Last updated