Skip to content

Commit

Permalink
while(true)->loop, use thread.join
Browse files Browse the repository at this point in the history
  • Loading branch information
HD Moore committed Mar 16, 2015
1 parent 1001061 commit 2ea9844
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 8 deletions.
4 changes: 2 additions & 2 deletions lib/msf/core/exploit/capture.rb
Original file line number Diff line number Diff line change
Expand Up @@ -313,7 +313,7 @@ def probe_gateway(addr)
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
Expand Down Expand Up @@ -349,7 +349,7 @@ def arp(target_ip=nil)
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
Expand Down
4 changes: 1 addition & 3 deletions modules/auxiliary/spoof/llmnr/llmnr_response.rb
Original file line number Diff line number Diff line change
Expand Up @@ -206,9 +206,7 @@ def run

add_socket(self.sock)

while thread.alive?
select(nil, nil, nil, 0.25)
end
self.thread.join
end

def cleanup
Expand Down
4 changes: 1 addition & 3 deletions modules/auxiliary/spoof/nbns/nbns_response.rb
Original file line number Diff line number Diff line change
Expand Up @@ -173,9 +173,7 @@ def run

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

Expand Down

0 comments on commit 2ea9844

Please sign in to comment.