Relaying Hashes from Responder
In this lab, I captured a hash using Responder, and then relayed it back to the same machine to open a shell. This shell was then upgraded and via pivoting a new machine was exploited.
To start with, I did a scan to find open ports on the target machine. Next, I did a more thorough scan of the discovered open ports. I found that the remote machine was using netbios and running Windows 7.
The remote machine was running x86 architecture (32 bit) so I had to remove the original x86-64 (64 bit) files from the relay tool before compiling 32 bit versions.
I then turned the responder http and smb servers off as I wanted to relay the captured hashes. This was achieved by editing the file found @ /etc/responder/Responder.conf
I then started the Responder and Multirelay tools. An ntlmv2 hash was captured and relayed to open an interactive shell. From this shell, I was able to ascertain that the remote machine was connected to a second subnet (10.100.40.0/24)
In order to upgrade this shell to a meterpreter session, I generated a 32 bit payload using msfvenom, uploaded it to the remote machine, started a multi/handler in msfconsole and then executed the uploaded malware.
Another way to achieve this upgrade would be to use the web_delivery module in msfconsole.
Either way, once the meterpreter session had been established, my next job was to pivot to the other subnet and scan it for live hosts. I used a slightly long-winded command to set up the route, but there is a faster way to do it, too.
The meterpreter arp-scanner showed me that there was a host @ 10.100.40.107 and the msfconsole port scanner showed me that this host had several open ports, including port 80.
I wanted to know more about the service running on port 80, so I forwarded that port to my local port of 1234 and then did an nmap scan against it. This revealed that there was a BadBlue was running. A quick look on searchsploit revealed that the 2.7 version of BadBlue is vulnerable to a buffer overflow attack and msfconsole has a module developed to exploit it.
It was now just a matter of using the module to exploit the machine @ 10.100.40.107 In order to do this, the LHOST had to be set to the exploited machine I was pivoting through (172.16.5.10) rather than my own attacking machine. I also needed to use a windows/meterpreter/bind_tcp shell instead of a reverse_tcp shell. This worked and a meterpreter session was established on the second machine.