diff --git a/lib/msf/core/exploit/capture.rb b/lib/msf/core/exploit/capture.rb index 23d5d4399b..7490d116f5 100644 --- a/lib/msf/core/exploit/capture.rb +++ b/lib/msf/core/exploit/capture.rb @@ -376,15 +376,19 @@ module Exploit::Capture if not @pcaprub_loaded print_status("The Pcaprub module is not available: #{@pcaprub_error}") raise RuntimeError, "Pcaprub not available" - #Those methods have been added later - elsif (not Pcap.respond_to? "lookupaddrs") - print_status("The Pcaprub module is not up-to-date") - raise RuntimeError, "The Pcaprub module is missing some functions" else true end end + # lookupaddr is not available in pcaprub 0.9.2 and prior, + # which is going to be installed in a lot of places. Modules + # which want it should check explicitly for it. TODO: Bug upstream + # to release it for real in 0.9.3 + def lookupaddr_implemented? + @pcaprub_loaded and Pcap.respond_to?(:lookupaddrs) + end + def lookupnet check_pcaprub_loaded dev = datastore['INTERFACE'] || ::Pcap.lookupdev diff --git a/modules/auxiliary/spoof/arp/arp_poisoning.rb b/modules/auxiliary/spoof/arp/arp_poisoning.rb index 1c353aa82e..82ce9e53f7 100644 --- a/modules/auxiliary/spoof/arp/arp_poisoning.rb +++ b/modules/auxiliary/spoof/arp/arp_poisoning.rb @@ -109,7 +109,10 @@ class Metasploit3 < Msf::Auxiliary lsmac = datastore['LOCALSMAC'] || @smac raise RuntimeError ,'Local Source Mac is not in correct format' unless is_mac?(lsmac) - sip = datastore['LOCALSIP'] || Pcap.lookupaddrs(@interface)[0] + sip = datastore['LOCALSIP'] + if lookupaddr_implemented? + sip ||= Pcap.lookupaddrs(@interface)[0] + end raise "LOCALIP is not an ipv4 address" unless is_ipv4? sip dhosts_range = Rex::Socket::RangeWalker.new(datastore['DHOSTS'])