diff --git a/lib/msf/ui/console/command_dispatcher/exploit.rb b/lib/msf/ui/console/command_dispatcher/exploit.rb index 6cbe9a8eeee1..12d2547851ef 100644 --- a/lib/msf/ui/console/command_dispatcher/exploit.rb +++ b/lib/msf/ui/console/command_dispatcher/exploit.rb @@ -276,8 +276,8 @@ def self.choose_payload(mod) excluded_platforms: ['Multi'] # We don't want to select a multi payload ).map(&:first) - # XXX: Determine LHOST based on RHOST or an arbitrary internet address - lhost = Rex::Socket.source_address(mod.datastore['RHOST'] || '50.50.50.50') + # XXX: Determine LHOST based on global LHOST, RHOST or an arbitrary internet address + lhost = mod.datastore['LHOST'] || Rex::Socket.source_address(mod.datastore['RHOST'] || '50.50.50.50') configure_payload = lambda do |payload| if mod.datastore.is_a?(Msf::DataStoreWithFallbacks)