Last updated at Wed, 26 Jul 2017 17:44:37 GMT
A few weeks ago I committed the initial version of a new console command used to communicate with a host: connect. Since then I've slowly added a few more features.
If you've ever used Netcat (all of you I'm sure), you'll feel right at home. If not, connect is quite simple to use and you should pick up on it quickly given the text below.
msf > connect -h
Usage: connect [options] <host> <port>
Communicate with a host, similar to interacting via netcat.
-C Try to use CRLF for EOL sequence.
-S <opt> Specify source address.
-c <opt> Specify which Comm to use.
-i <opt> Send the contents of a file.
-p <opt> List of proxies to use.
-s Connect with SSL.
-w <opt> Specify connect timeout.
As you can see, connect has many options to choose from. One very cool one is the -c option which allows you to, for example, route through a Meterpreter session. I show this below.
I've blocked HTTP access for this computer at the router:
msf > connect metasploit.com 80
[-] Unable to connect: The connection timed out (metasploit.com:80).
But let's see if we can re-route this through another computer and get it working anyway:
msf > sessions -l
Id Description Tunnel
-- ----------- ------
1 Meterpreter 192.168.10.3:44692 -> 192.168.10.7:4444
msf > connect -c 1 metasploit.com 80
[*] Connected to metasploit.com:80
HEAD / HTTP/1.0
HTTP/1.1 200 OK
Date: Sun, 18 Jan 2009 15:01:22 GMT
Of course that was just one contrived example, but having a built-in netcat-like command should open up some doors for fun and profit.