diff --git a/lib/msf/ui/console/command_dispatcher/core.rb b/lib/msf/ui/console/command_dispatcher/core.rb index fd29458592..94d66cb2b3 100644 --- a/lib/msf/ui/console/command_dispatcher/core.rb +++ b/lib/msf/ui/console/command_dispatcher/core.rb @@ -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 # diff --git a/lib/rex/ui/text/dispatcher_shell.rb b/lib/rex/ui/text/dispatcher_shell.rb index bb4d5ac8c7..207bb35630 100644 --- a/lib/rex/ui/text/dispatcher_shell.rb +++ b/lib/rex/ui/text/dispatcher_shell.rb @@ -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