Remove loopback restriction

It's occasionally useful, and we already warn when setting it.
GSoC/Meterpreter_Web_Console
William Vu 2018-05-24 15:44:32 -05:00
parent a370270e19
commit 6f1e75e097
2 changed files with 3 additions and 6 deletions

View File

@ -2161,8 +2161,7 @@ class Core
# XXX: We repurpose OptAddressLocal#interfaces, so we can't put this in Rex
def tab_complete_source_interface(o)
return [] unless o.is_a?(Msf::OptAddressLocal)
# Exclude loopback generically
o.interfaces - %w{lo lo0}
o.interfaces
end
#

View File

@ -290,10 +290,8 @@ module DispatcherShell
addresses = [Rex::Socket.source_address]
# getifaddrs was introduced in 2.1.2
if ::Socket.respond_to?(:getifaddrs)
ifaddrs = ::Socket.getifaddrs.find_all do |ifaddr|
((ifaddr.flags & ::Socket::IFF_LOOPBACK) == 0) &&
ifaddr.addr &&
ifaddr.addr.ip?
ifaddrs = ::Socket.getifaddrs.select do |ifaddr|
ifaddr.addr && ifaddr.addr.ip?
end
addresses += ifaddrs.map { |ifaddr| ifaddr.addr.ip_address }
end