Skip to content

Commit 209fd78

Browse files
author
Brent Cook
committed
Land rapid7#6065, add SRVHOST tab completion
2 parents 47cd215 + 8670224 commit 209fd78

File tree

1 file changed

+3
-3
lines changed
  • lib/msf/ui/console/command_dispatcher

1 file changed

+3
-3
lines changed

lib/msf/ui/console/command_dispatcher/core.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2989,17 +2989,17 @@ def option_values_dispatch(o, str, words)
29892989
option_values_target_addrs().each do |addr|
29902990
res << addr
29912991
end
2992-
when 'LHOST'
2992+
when 'LHOST', 'SRVHOST'
29932993
rh = self.active_module.datastore['RHOST'] || framework.datastore['RHOST']
29942994
if rh and not rh.empty?
29952995
res << Rex::Socket.source_address(rh)
29962996
else
29972997
res << Rex::Socket.source_address
29982998
# getifaddrs was introduced in 2.1.2
29992999
if Socket.respond_to?(:getifaddrs)
3000-
ifaddrs = Socket.getifaddrs.find_all { |ifaddr|
3000+
ifaddrs = Socket.getifaddrs.find_all do |ifaddr|
30013001
((ifaddr.flags & Socket::IFF_LOOPBACK) == 0) && ifaddr.addr.ip?
3002-
}
3002+
end
30033003
res += ifaddrs.map { |ifaddr| ifaddr.addr.ip_address }
30043004
end
30053005
end

0 commit comments

Comments
 (0)