Don't bomb out if there are no wireless interfaces

bug/bundler_fix
James Lee 2013-04-08 14:19:35 -05:00
parent 225342ce8f
commit 14c1f58afb
1 changed files with 6 additions and 0 deletions

View File

@ -42,6 +42,11 @@ class Metasploit3 < Msf::Post
end end
wlan_iflist = enum_interfaces(wlan_handle) wlan_iflist = enum_interfaces(wlan_handle)
if wlan_iflist.empty?
print_status("No wireless interfaces")
return
end
#Take each enumerated interface and gets the profile information available on each one #Take each enumerated interface and gets the profile information available on each one
wlan_iflist.each do |interface| wlan_iflist.each do |interface|
wlan_profiles = enum_profiles(wlan_handle, interface['guid']) wlan_profiles = enum_profiles(wlan_handle, interface['guid'])
@ -85,6 +90,7 @@ class Metasploit3 < Msf::Post
numifs = @host_process.memory.read(pointer,4) numifs = @host_process.memory.read(pointer,4)
numifs = numifs.unpack("V")[0] numifs = numifs.unpack("V")[0]
interfaces = [] interfaces = []
return [] if numifs.nil?
#Set the pointer ahead to the first element in the array #Set the pointer ahead to the first element in the array
pointer = (pointer + 8) pointer = (pointer + 8)