From d9e68141e051476a117c4061152da46b112b04da Mon Sep 17 00:00:00 2001 From: amaloteaux <> Date: Thu, 14 Apr 2011 16:29:56 +0000 Subject: [PATCH] arp sweep: correct a bug on the timeout to better detect the latest reply git-svn-id: file:///home/svn/framework3/trunk@12316 4d416f70-5f16-0410-b530-b9f4589650da --- modules/auxiliary/scanner/discovery/arp_sweep.rb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/modules/auxiliary/scanner/discovery/arp_sweep.rb b/modules/auxiliary/scanner/discovery/arp_sweep.rb index 17c22615fb..6493053328 100644 --- a/modules/auxiliary/scanner/discovery/arp_sweep.rb +++ b/modules/auxiliary/scanner/discovery/arp_sweep.rb @@ -32,6 +32,8 @@ class Metasploit3 < Msf::Auxiliary register_options([ OptString.new('SHOST', [true, "Source IP Address"]), OptString.new('SMAC', [true, "Source MAC Address"]), + # one re-register TIMEOUT here with a lower value, cause 5 seconds will be enough in most of the case + OptInt.new('TIMEOUT', [true, 'The number of seconds to wait for new data', 5]), ], self.class) deregister_options('SNAPLEN', 'FILTER') @@ -62,7 +64,7 @@ class Metasploit3 < Msf::Auxiliary end end - etime = Time.now.to_f + (hosts.length * 0.05) + etime = Time.now.to_f + datastore['TIMEOUT'] while (Time.now.to_f < etime) while(reply = getreply()) next if not reply[:arp]