Skip to content

Commit ddcaa11

Browse files
committed
Add new mixin for helping to detect DRDoS vulns
1 parent c48cf48 commit ddcaa11

File tree

2 files changed

+48
-0
lines changed

2 files changed

+48
-0
lines changed

lib/msf/core/auxiliary/drdos.rb

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
# -*- coding: binary -*-
2+
module Msf
3+
4+
###
5+
#
6+
# This module provides methods for Distributed Reflective Denial of Service (DRDoS) attacks
7+
#
8+
###
9+
10+
module Auxiliary::DRDoS
11+
12+
def prove_drdos(response_map)
13+
vulnerable = false
14+
proofs = []
15+
response_map.each do |request, responses|
16+
responses ||= []
17+
this_proof = ''
18+
19+
# compute packet amplification
20+
if responses.size > 1
21+
vulnerable = true
22+
this_proof += "#{responses.size}x packet amplification"
23+
else
24+
this_proof += 'No packet amplification'
25+
end
26+
27+
this_proof += ' and '
28+
29+
# compute bandwidth amplification
30+
total_size = responses.map(&:size).reduce(:+)
31+
bandwidth_amplification = total_size - request.size
32+
if bandwidth_amplification > 0
33+
vulnerable = true
34+
this_proof += "a #{bandwidth_amplification}-byte bandwidth amplification"
35+
else
36+
this_proof += 'no bandwidth amplification'
37+
end
38+
39+
# TODO (maybe): show the request and responses in more detail?
40+
proofs << this_proof
41+
end
42+
43+
[ vulnerable, proofs.join(', ') ]
44+
end
45+
46+
end
47+
end

lib/msf/core/auxiliary/mixins.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
#
66
require 'msf/core/auxiliary/auth_brute'
77
require 'msf/core/auxiliary/dos'
8+
require 'msf/core/auxiliary/drdos'
89
require 'msf/core/auxiliary/fuzzer'
910
require 'msf/core/auxiliary/report'
1011
require 'msf/core/auxiliary/scanner'

0 commit comments

Comments
 (0)