added spoofing capabilities to udp_scanner

bug/bundler_fix
Josh Abraham 2014-09-19 10:29:05 -04:00
parent 1faa816a8a
commit c216cf8c53
2 changed files with 31 additions and 0 deletions

View File

@ -8,6 +8,15 @@ module Msf
###
module Auxiliary::DRDoS
def initialize(info = {})
super
register_advanced_options(
[
OptAddress.new('SRCIP', [false, 'Use this source IP']),
OptInt.new('NUM_REQUESTS', [false, 'Number of requests to send', 1]),
], self.class)
end
def prove_amplification(response_map)
vulnerable = false
proofs = []
@ -43,5 +52,9 @@ module Auxiliary::DRDoS
[ vulnerable, proofs.join(', ') ]
end
def spoofed?
!datastore['SRCIP'].nil?
end
end
end

View File

@ -69,6 +69,24 @@ module Auxiliary::UDPScanner
scanner_postscan(batch)
end
# Send a spoofed packet to a given host and port
def scanner_spoof_send(data, ip, port, srcip, num_packets=1)
open_pcap
p = PacketFu::UDPPacket.new
p.ip_saddr = srcip
p.ip_daddr = ip
p.ip_ttl = 255
p.udp_src = (rand((2**16)-1024)+1024).to_i
p.udp_dst = port
p.payload = @probe
p.recalc
1.upto(num_packets) do |x|
print_status("Sending packet to #{ip} from #{srcip}")
capture_sendto(p, ip)
end
close_pcap
end
# Send a packet to a given host and port
def scanner_send(data, ip, port)