while(true)->loop, use thread.join

This commit is contained in:
HD Moore 2015-03-16 14:08:01 -05:00
parent 1001061a96
commit 2ea984423b
3 changed files with 4 additions and 8 deletions

View File

@ -313,7 +313,7 @@ module Msf
begin
to = ((datastore['TIMEOUT'] || 500).to_f * 8) / 1000.0
::Timeout.timeout(to) do
while true
loop do
my_packet = inject_reply(:udp, self.arp_capture)
next unless my_packet
next unless my_packet.payload == secret
@ -349,7 +349,7 @@ module Msf
begin
to = ((datastore['TIMEOUT'] || 500).to_f * 8) / 1000.0
::Timeout.timeout(to) do
while true
loop do
my_packet = inject_reply(:arp, self.arp_capture)
next unless my_packet
next unless my_packet.arp_saddr_ip == target_ip

View File

@ -206,9 +206,7 @@ attr_accessor :sock, :thread
add_socket(self.sock)
while thread.alive?
select(nil, nil, nil, 0.25)
end
self.thread.join
end
def cleanup

View File

@ -173,9 +173,7 @@ class Metasploit3 < Msf::Auxiliary
print_status("NBNS Spoofer started. Listening for NBNS requests with REGEX \"#{datastore['REGEX']}\" ...")
while thread.alive?
IO.select(nil, nil, nil, 0.25)
end
self.thread.join
print_status("NBNS Monitor thread exited...")
end