Skip to content

Commit d7e3c5c

Browse files
author
Tod Beardsley
committed
Rspec: Ensure PacketFu is actually still available
PacketFu should be required from the gem, not from the shipped msf library. Several modules depend on it being available, so this rspec test mostly just ensures that Msf::Exploit::Capture mixin is still around.
1 parent 9a08090 commit d7e3c5c

File tree

1 file changed

+53
-0
lines changed

1 file changed

+53
-0
lines changed
Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
# -*- coding:binary -*-
2+
require 'spec_helper'
3+
4+
require 'msf/core'
5+
require 'msf/core/module'
6+
require 'msf/core/exploit/capture'
7+
8+
describe Msf::Exploit::Capture do
9+
10+
subject do
11+
mod = Msf::Module.new
12+
mod.extend described_class
13+
mod
14+
end
15+
16+
it 'should be a kind of Msf::Exploit::Capture' do
17+
subject.should be_a_kind_of Msf::Exploit::Capture
18+
end
19+
20+
context '#stats_*' do
21+
22+
it 'should show received packets' do
23+
subject.stats_recv.should == 0
24+
end
25+
26+
it 'should show dropped packets' do
27+
subject.stats_drop.should == 0
28+
end
29+
30+
it 'should show interface-dropped packets' do
31+
subject.stats_ifdrop.should == 0
32+
end
33+
34+
end
35+
36+
it 'should respond to open_pcap' do
37+
subject.should respond_to :open_pcap
38+
end
39+
40+
it 'should confirm that pcaprub is available', :pending => "Need to test this without stubbing check_pcaprub_loaded" do
41+
end
42+
43+
it 'should open a pcap file', :pending => "Provde a sample pcap file to read" do
44+
end
45+
46+
it 'should capture from an iface', :pending => "Mock this? Tends to need root" do
47+
end
48+
49+
it 'should inject packets to an ifrace', :pending => "Mock this? Tends to need root" do
50+
end
51+
52+
end
53+

0 commit comments

Comments
 (0)