Skip to content

Commit 2ea9844

Browse files
author
HD Moore
committed
while(true)->loop, use thread.join
1 parent 1001061 commit 2ea9844

File tree

3 files changed

+4
-8
lines changed

3 files changed

+4
-8
lines changed

lib/msf/core/exploit/capture.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -313,7 +313,7 @@ def probe_gateway(addr)
313313
begin
314314
to = ((datastore['TIMEOUT'] || 500).to_f * 8) / 1000.0
315315
::Timeout.timeout(to) do
316-
while true
316+
loop do
317317
my_packet = inject_reply(:udp, self.arp_capture)
318318
next unless my_packet
319319
next unless my_packet.payload == secret
@@ -349,7 +349,7 @@ def arp(target_ip=nil)
349349
begin
350350
to = ((datastore['TIMEOUT'] || 500).to_f * 8) / 1000.0
351351
::Timeout.timeout(to) do
352-
while true
352+
loop do
353353
my_packet = inject_reply(:arp, self.arp_capture)
354354
next unless my_packet
355355
next unless my_packet.arp_saddr_ip == target_ip

modules/auxiliary/spoof/llmnr/llmnr_response.rb

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -206,9 +206,7 @@ def run
206206

207207
add_socket(self.sock)
208208

209-
while thread.alive?
210-
select(nil, nil, nil, 0.25)
211-
end
209+
self.thread.join
212210
end
213211

214212
def cleanup

modules/auxiliary/spoof/nbns/nbns_response.rb

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -173,9 +173,7 @@ def run
173173

174174
print_status("NBNS Spoofer started. Listening for NBNS requests with REGEX \"#{datastore['REGEX']}\" ...")
175175

176-
while thread.alive?
177-
IO.select(nil, nil, nil, 0.25)
178-
end
176+
self.thread.join
179177
print_status("NBNS Monitor thread exited...")
180178
end
181179

0 commit comments

Comments
 (0)