Skip to content

Commit c216cf8

Browse files
committed
added spoofing capabilities to udp_scanner
1 parent 1faa816 commit c216cf8

File tree

2 files changed

+31
-0
lines changed

2 files changed

+31
-0
lines changed

lib/msf/core/auxiliary/drdos.rb

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,15 @@ module Msf
88
###
99
module Auxiliary::DRDoS
1010

11+
def initialize(info = {})
12+
super
13+
register_advanced_options(
14+
[
15+
OptAddress.new('SRCIP', [false, 'Use this source IP']),
16+
OptInt.new('NUM_REQUESTS', [false, 'Number of requests to send', 1]),
17+
], self.class)
18+
end
19+
1120
def prove_amplification(response_map)
1221
vulnerable = false
1322
proofs = []
@@ -43,5 +52,9 @@ def prove_amplification(response_map)
4352
[ vulnerable, proofs.join(', ') ]
4453
end
4554

55+
def spoofed?
56+
!datastore['SRCIP'].nil?
57+
end
58+
4659
end
4760
end

lib/msf/core/auxiliary/udp_scanner.rb

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,24 @@ def run_batch(batch)
6969
scanner_postscan(batch)
7070
end
7171

72+
# Send a spoofed packet to a given host and port
73+
def scanner_spoof_send(data, ip, port, srcip, num_packets=1)
74+
open_pcap
75+
p = PacketFu::UDPPacket.new
76+
p.ip_saddr = srcip
77+
p.ip_daddr = ip
78+
p.ip_ttl = 255
79+
p.udp_src = (rand((2**16)-1024)+1024).to_i
80+
p.udp_dst = port
81+
p.payload = @probe
82+
p.recalc
83+
1.upto(num_packets) do |x|
84+
print_status("Sending packet to #{ip} from #{srcip}")
85+
capture_sendto(p, ip)
86+
end
87+
close_pcap
88+
end
89+
7290
# Send a packet to a given host and port
7391
def scanner_send(data, ip, port)
7492

0 commit comments

Comments
 (0)