diff --git a/lib/msf/core/auxiliary/drdos.rb b/lib/msf/core/auxiliary/drdos.rb index ddf1ca8fdf..af5510c5bf 100644 --- a/lib/msf/core/auxiliary/drdos.rb +++ b/lib/msf/core/auxiliary/drdos.rb @@ -46,7 +46,11 @@ module Auxiliary::DRDoS bandwidth_amplification = total_size - request.size if bandwidth_amplification > 0 vulnerable = true - multiplier = total_size / request.size + if request.size == 0 + multiplier = total_size + else + multiplier = total_size / request.size + end this_proof += "a #{multiplier}x, #{bandwidth_amplification}-byte bandwidth amplification" else this_proof += 'no bandwidth amplification' diff --git a/spec/lib/msf/core/auxiliary/drdos_spec.rb b/spec/lib/msf/core/auxiliary/drdos_spec.rb index e91d084990..f1187370a7 100644 --- a/spec/lib/msf/core/auxiliary/drdos_spec.rb +++ b/spec/lib/msf/core/auxiliary/drdos_spec.rb @@ -34,5 +34,11 @@ RSpec.describe Msf::Auxiliary::DRDoS do result, _ = subject.prove_amplification(map) expect(result).to be false end + + it 'should handle empty responses' do + map = { '' => [ 'foo' ] } + result, _ = subject.prove_amplification(map) + expect(result).to be true + end end end