diff --git a/lib/msf/core/exploit/capture.rb b/lib/msf/core/exploit/capture.rb index 44501ff227..f080fc2ba2 100644 --- a/lib/msf/core/exploit/capture.rb +++ b/lib/msf/core/exploit/capture.rb @@ -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 diff --git a/modules/auxiliary/spoof/llmnr/llmnr_response.rb b/modules/auxiliary/spoof/llmnr/llmnr_response.rb index 9261a606bd..c1cef329e9 100644 --- a/modules/auxiliary/spoof/llmnr/llmnr_response.rb +++ b/modules/auxiliary/spoof/llmnr/llmnr_response.rb @@ -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 diff --git a/modules/auxiliary/spoof/nbns/nbns_response.rb b/modules/auxiliary/spoof/nbns/nbns_response.rb index a50cb1bd7a..7d9216a443 100644 --- a/modules/auxiliary/spoof/nbns/nbns_response.rb +++ b/modules/auxiliary/spoof/nbns/nbns_response.rb @@ -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