Forum Thread: What Does "LHost" and "RHost" Do?

I've seen this in a lot of threads,
I know that they set the Local and Remote host, but what would happen if you didn't set them up?

(I'm guessing for RHost, if its not set, then there is no "address" then Msf doesn't know where to sent it.; But for LHost, what happens if you don't set it?)

Join the Next Reality AR Community

Get the latest in AR — delivered straight to your inbox.

9 Responses

He is right, LHOST is also used to start a listener on a specific interface on your machine. For example:

  • use multi/handler
  • set payload windows/meterpreter/reverse-tcp
  • set lhost
  • set lport XXX

Start a listener on ALL your interfaces on port XXX.

_When I type "ifconfig" I got two different ips._THEY are in two paragraphs.1st start with eth0 and second start with lo.Also when i search on google what is my ip I got an entirely different one.Which one to use in the place of LHOST?

It depends what you are doing for your attack. If you are attacking something outside of your network, you will need to use the one on Google. This is your public IP, and it is what everyone sees when you do anything online. You will use this and port forwarding for an attack outside of your network. The ones from the terminal are your private IP's. Judging from the output, you are using ethernet to connect your computer, not WiFi. Eth0 is your ethernet connection. You will use this for your attack if you are on the same network. The other one, the lo, is your loopback IP; I don't think you'll ever use this.

Long story short, use the Eth0 for your LHOST.

For more information on IP addresses:

Use the eth0 IP address.

Is the LPORT default if not how to find it?

U can see which ip is using which port using lsof -i in linux

type ifconfig on your terminal there you find your ip(which is LPORT)

Share Your Thoughts

  • Hot
  • Active