Skip to content

Commit c83474e

Browse files
author
Brian Patterson
committed
Land rapid7#7488 Allows DRDoS mixin to handle empty responses
2 parents fd7b14e + 12508f7 commit c83474e

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

lib/msf/core/auxiliary/drdos.rb

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,11 @@ def prove_amplification(response_map)
4646
bandwidth_amplification = total_size - request.size
4747
if bandwidth_amplification > 0
4848
vulnerable = true
49-
multiplier = total_size / request.size
49+
if request.size == 0
50+
multiplier = total_size
51+
else
52+
multiplier = total_size / request.size
53+
end
5054
this_proof += "a #{multiplier}x, #{bandwidth_amplification}-byte bandwidth amplification"
5155
else
5256
this_proof += 'no bandwidth amplification'

spec/lib/msf/core/auxiliary/drdos_spec.rb

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,5 +34,11 @@
3434
result, _ = subject.prove_amplification(map)
3535
expect(result).to be false
3636
end
37+
38+
it 'should handle empty responses' do
39+
map = { '' => [ 'foo' ] }
40+
result, _ = subject.prove_amplification(map)
41+
expect(result).to be true
42+
end
3743
end
3844
end

0 commit comments

Comments
 (0)