Skip to content

Commit 8e626c1

Browse files
committed
Add rspec coverage for Msf::Auxiliary::DRDoS
1 parent d6198c7 commit 8e626c1

File tree

1 file changed

+38
-0
lines changed

1 file changed

+38
-0
lines changed
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
# -*- coding: binary -*-
2+
require 'spec_helper'
3+
4+
require 'msf/core/auxiliary/drdos'
5+
6+
describe Msf::Auxiliary::DRDoS do
7+
subject do
8+
mod = Module.new
9+
mod.extend described_class
10+
mod
11+
end
12+
13+
describe '#prove_drdos' do
14+
it 'should detect drdos when there is packet amplification only' do
15+
map = { 'foo' => [ 'a', 'b' ] }
16+
result, _ = subject.prove_drdos(map)
17+
result.should be true
18+
end
19+
20+
it 'should detect drdos when there is bandwidth amplification only' do
21+
map = { 'foo' => [ 'foofoo' ] }
22+
result, _ = subject.prove_drdos(map)
23+
result.should be true
24+
end
25+
26+
it 'should detect drdos when there is packet and bandwidth amplification' do
27+
map = { 'foo' => [ 'foofoo', 'a' ] }
28+
result, _ = subject.prove_drdos(map)
29+
result.should be true
30+
end
31+
32+
it 'should not detect drdos when there is no packet and no bandwidth amplification' do
33+
map = { 'foo' => [ 'foo' ] }
34+
result, _ = subject.prove_drdos(map)
35+
result.should be false
36+
end
37+
end
38+
end

0 commit comments

Comments
 (0)