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?)

7 Responses

Remote Host, or RHost for that matter, is the parameter that defines the remote address, a.k.a the target.

Local Host, or LHost for that matter, is the parameter that defines the connect-back address in reverse payloads, a.k.a your IP address. Reverse payloads need this piece of info because they need to be able to connect back to you once they are deployed on the remote system.

-Phoenix750

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 0.0.0.0
  • set lport XXX

Start a listener on ALL your interfaces on port XXX.

I forgot that, thanks for pointing that out.

-Phoenix750

You're welcome, for that we are!

_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: http://computer.howstuffworks.com/internet/basics/question549.htm

Share Your Thoughts

  • Hot
  • Active