Add delay/jitter to xmas scan
parent
0cb18004ec
commit
12561e5cf9
|
@ -27,6 +27,8 @@ class Metasploit3 < Msf::Auxiliary
|
||||||
OptString.new('PORTS', [true, "Ports to scan (e.g. 22-25,80,110-900)", "1-10000"]),
|
OptString.new('PORTS', [true, "Ports to scan (e.g. 22-25,80,110-900)", "1-10000"]),
|
||||||
OptInt.new('TIMEOUT', [true, "The reply read timeout in milliseconds", 500]),
|
OptInt.new('TIMEOUT', [true, "The reply read timeout in milliseconds", 500]),
|
||||||
OptInt.new('BATCHSIZE', [true, "The number of hosts to scan per set", 256]),
|
OptInt.new('BATCHSIZE', [true, "The number of hosts to scan per set", 256]),
|
||||||
|
OptInt.new('DELAY', [true, "The delay between connections, per thread, in milliseconds", 0]),
|
||||||
|
OptInt.new('JITTER', [true, "The delay jitter factor (maximum value by which to +/- DELAY) in milliseconds.", 0]),
|
||||||
OptString.new('INTERFACE', [false, 'The name of the interface'])
|
OptString.new('INTERFACE', [false, 'The name of the interface'])
|
||||||
], self.class)
|
], self.class)
|
||||||
|
|
||||||
|
@ -48,11 +50,20 @@ class Metasploit3 < Msf::Auxiliary
|
||||||
pcap = self.capture
|
pcap = self.capture
|
||||||
|
|
||||||
ports = Rex::Socket.portspec_crack(datastore['PORTS'])
|
ports = Rex::Socket.portspec_crack(datastore['PORTS'])
|
||||||
|
|
||||||
if ports.empty?
|
if ports.empty?
|
||||||
raise Msf::OptionValidateError.new(['PORTS'])
|
raise Msf::OptionValidateError.new(['PORTS'])
|
||||||
end
|
end
|
||||||
|
|
||||||
|
jitter_value = datastore['JITTER'].to_i
|
||||||
|
if jitter_value < 0
|
||||||
|
raise Msf::OptionValidateError.new(['JITTER'])
|
||||||
|
end
|
||||||
|
|
||||||
|
delay_value = datastore['DELAY'].to_i
|
||||||
|
if delay_value < 0
|
||||||
|
raise Msf::OptionValidateError.new(['DELAY'])
|
||||||
|
end
|
||||||
|
|
||||||
to = (datastore['TIMEOUT'] || 500).to_f / 1000.0
|
to = (datastore['TIMEOUT'] || 500).to_f / 1000.0
|
||||||
|
|
||||||
# we copy the hosts because some may not be reachable and need to be ejected
|
# we copy the hosts because some may not be reachable and need to be ejected
|
||||||
|
@ -67,6 +78,9 @@ class Metasploit3 < Msf::Auxiliary
|
||||||
begin
|
begin
|
||||||
probe = buildprobe(shost, sport, dhost, dport)
|
probe = buildprobe(shost, sport, dhost, dport)
|
||||||
|
|
||||||
|
# Add the delay based on JITTER and DELAY if needs be
|
||||||
|
add_delay_jitter(delay_value,jitter_value)
|
||||||
|
|
||||||
unless capture_sendto(probe, dhost)
|
unless capture_sendto(probe, dhost)
|
||||||
host_queue.delete(dhost)
|
host_queue.delete(dhost)
|
||||||
next
|
next
|
||||||
|
|
Loading…
Reference in New Issue