In the Metasploit Framework, LHOST stands forLocal Host. This is a critical configuration variable that specifies the IP address of the attacker's (tester's) machine. When an ethical hacker deploys an exploit—particularly one that utilizes areverse shell—the LHOST tells the victim's machine exactly where to send the connection back to.
Setting the LHOST correctly is vital for the success of an exploitation attempt. In most network environments, especially those involving NAT (Network Address Translation) or VPNs, the tester must ensure they use the IP address that is reachable by the target system. For instance, if the tester is on a local network, they would use their internal IP; however, if they are testing over a wider network or the internet, they must ensure the LHOST points to a public IP or a listener configured to handle the traffic.
Along with LPORT (Local Port), LHOST defines the listener on the attacker's machine. When the exploit executes on the target (RHOST), the payload initiates a connection back to the address defined in LHOST. If this variable is misconfigured, the exploit might successfully run on the victim's end, but the tester will never receive the shell, resulting in a failed attempt. For an ethical hacker, double-checking the LHOST and LPORT settings is a standard "best practice" before launching any module to ensure a stable and reliable connection is established.