Skip to content

Commit 9e21cc8

Browse files
committed
Add specs for invalid IPBoard application
1 parent 917a7ff commit 9e21cc8

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

spec/lib/metasploit/framework/login_scanner/ipboard_spec.rb

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,23 @@
5252
end
5353
end
5454

55+
context "when invalid IPBoard application" do
56+
let(:not_found_warning) { 'Server nonce not present, potentially not an IP Board install or bad URI.' }
57+
before :each do
58+
allow_any_instance_of(Rex::Proto::Http::Client).to receive(:send_recv) do |cli, req|
59+
Rex::Proto::Http::Response.new(200)
60+
end
61+
end
62+
63+
it 'returns status Metasploit::Model::Login::Status::UNABLE_TO_CONNECT' do
64+
expect(subject.attempt_login(creds).status).to eq(Metasploit::Model::Login::Status::UNABLE_TO_CONNECT)
65+
end
66+
67+
it 'returns proof warning about nonce not found' do
68+
expect(subject.attempt_login(creds).proof).to eq(not_found_warning)
69+
end
70+
end
71+
5572
context "when valid IPBoard application" do
5673
before :each do
5774
allow_any_instance_of(Rex::Proto::Http::Client).to receive(:send_recv) do |cli, req|

0 commit comments

Comments
 (0)