cleans up a bunch of spec msftidy issues

bug/bundler_fix
Joshua Smith 2014-08-26 15:24:08 -05:00
parent 41420a97d5
commit 1fa26e2afb
49 changed files with 96 additions and 95 deletions

View File

@ -11,4 +11,4 @@ FactoryGirl.define do
sequence :mdm_web_vuln_description do |n| sequence :mdm_web_vuln_description do |n|
"Mdm::WebVuln#description #{n}" "Mdm::WebVuln#description #{n}"
end end
end end

View File

@ -6,4 +6,4 @@ FactoryGirl.modify do
} }
end end
end end
end end

View File

@ -245,4 +245,4 @@ describe Metasploit::Framework::JtR::Cracker do
end end
end end
end end
end end

View File

@ -35,4 +35,4 @@ describe Metasploit::Framework::JtR::InvalidWordlist do
end end
end end
end end

View File

@ -135,4 +135,4 @@ describe Metasploit::Framework::JtR::Wordlist do
end end
end end
end end

View File

@ -41,4 +41,4 @@ describe Metasploit::Framework::LoginScanner::DB2 do
end end
end end
end end

View File

@ -131,4 +131,4 @@ describe Metasploit::Framework::LoginScanner::FTP do
end end
end end
end end

View File

@ -90,4 +90,4 @@ describe Metasploit::Framework::LoginScanner::MSSQL do
end end
end end
end end

View File

@ -105,4 +105,4 @@ describe Metasploit::Framework::LoginScanner::MySQL do
end end
end end
end end

View File

@ -8,7 +8,7 @@ describe Metasploit::Framework::LoginScanner::POP3 do
it_behaves_like 'Metasploit::Framework::LoginScanner::RexSocket' it_behaves_like 'Metasploit::Framework::LoginScanner::RexSocket'
context "#attempt_login" do context "#attempt_login" do
let(:pub_blank) do let(:pub_blank) do
Metasploit::Framework::Credential.new( Metasploit::Framework::Credential.new(
paired: true, paired: true,
@ -41,10 +41,10 @@ describe Metasploit::Framework::LoginScanner::POP3 do
expect(result.status).to eq(Metasploit::Model::Login::Status::UNABLE_TO_CONNECT) expect(result.status).to eq(Metasploit::Model::Login::Status::UNABLE_TO_CONNECT)
end end
end end
context "Open Connection" do context "Open Connection" do
let(:sock) {double('socket')} let(:sock) {double('socket')}
before(:each) do before(:each) do
sock.stub(:shutdown) sock.stub(:shutdown)
sock.stub(:close) sock.stub(:close)
@ -53,30 +53,30 @@ describe Metasploit::Framework::LoginScanner::POP3 do
scanner.stub(:sock).and_return(sock) scanner.stub(:sock).and_return(sock)
scanner.should_receive(:select).with([sock],nil,nil,0.4) scanner.should_receive(:select).with([sock],nil,nil,0.4)
end end
it "Server returns +OK" do it "Server returns +OK" do
expect(sock).to receive(:get_once).exactly(3).times.and_return("+OK") expect(sock).to receive(:get_once).exactly(3).times.and_return("+OK")
expect(sock).to receive(:put).with("USER public\r\n").once.ordered expect(sock).to receive(:put).with("USER public\r\n").once.ordered
expect(sock).to receive(:put).with("PASS \r\n").once.ordered expect(sock).to receive(:put).with("PASS \r\n").once.ordered
result = scanner.attempt_login(pub_blank) result = scanner.attempt_login(pub_blank)
expect(result).to be_kind_of(Metasploit::Framework::LoginScanner::Result) expect(result).to be_kind_of(Metasploit::Framework::LoginScanner::Result)
expect(result.status).to eq(Metasploit::Model::Login::Status::SUCCESSFUL) expect(result.status).to eq(Metasploit::Model::Login::Status::SUCCESSFUL)
end end
it "Server Returns Something Else" do it "Server Returns Something Else" do
sock.stub(:get_once).and_return("+ERROR") sock.stub(:get_once).and_return("+ERROR")
result = scanner.attempt_login(pub_blank) result = scanner.attempt_login(pub_blank)
expect(result).to be_kind_of(Metasploit::Framework::LoginScanner::Result) expect(result).to be_kind_of(Metasploit::Framework::LoginScanner::Result)
expect(result.status).to eq(Metasploit::Model::Login::Status::INCORRECT) expect(result.status).to eq(Metasploit::Model::Login::Status::INCORRECT)
expect(result.proof).to eq("+ERROR") expect(result.proof).to eq("+ERROR")
end end
end end
end end
end end

View File

@ -72,4 +72,4 @@ describe Metasploit::Framework::LoginScanner::Postgres do
end end
end end
end end

View File

@ -42,4 +42,4 @@ describe Metasploit::Framework::LoginScanner::Result do
end end
end end

View File

@ -53,4 +53,4 @@ describe Metasploit::Framework::LoginScanner::SNMP do
end end
end end

View File

@ -75,4 +75,4 @@ describe Metasploit::Framework::LoginScanner::Telnet do
end end
end end
end end

View File

@ -81,4 +81,4 @@ describe Metasploit::Framework::LoginScanner::VNC do
end end
end end

View File

@ -8,4 +8,4 @@ describe Msf::Simple::Framework do
end end
it_should_behave_like 'Msf::Simple::Framework::ModulePaths' it_should_behave_like 'Msf::Simple::Framework::ModulePaths'
end end

View File

@ -292,4 +292,4 @@ describe Msf::Exploit::Remote::BrowserExploitServer do
end end
end end
end end

View File

@ -86,4 +86,4 @@ describe Msf::Handler::ReverseHttp::UriChecksum do
end end
end end
end end

View File

@ -20,4 +20,4 @@ describe Msf::OptEnum do
subject.valid?('Bar').should == true subject.valid?('Bar').should == true
end end
end end
end end

View File

@ -12,4 +12,4 @@ describe Msf::OptRaw do
invalid_values = [] invalid_values = []
it_behaves_like "an option", valid_values, invalid_values, 'raw' it_behaves_like "an option", valid_values, invalid_values, 'raw'
end end

View File

@ -14,4 +14,4 @@ describe Msf::OptRegexp do
] ]
it_behaves_like "an option", valid_values, invalid_values, 'regexp' it_behaves_like "an option", valid_values, invalid_values, 'regexp'
end end

View File

@ -530,4 +530,4 @@ describe Msf::PayloadGenerator do
end end
end end
end end

View File

@ -105,4 +105,4 @@ describe Msf::DBManager::Export do
end end
end end
end end
end end

View File

@ -1775,7 +1775,7 @@ describe Msf::DBManager do
# @todo determine how to load a single payload to test payload type outside of msfconsole # @todo determine how to load a single payload to test payload type outside of msfconsole
it_should_behave_like 'Msf::DBManager#update_module_details with module', it_should_behave_like 'Msf::DBManager#update_module_details with module',
:reference_name => 'windows/escalate/screen_unlock', :reference_name => 'windows/escalate/screen_unlock',
:type => 'post' :type => 'post'
end end

View File

@ -27,4 +27,4 @@ describe Rex::Exploitation::Js::Detect do
end end
end end

View File

@ -27,4 +27,4 @@ describe Rex::Exploitation::Js::Memory do
end end
end end

View File

@ -13,4 +13,4 @@ describe Rex::Exploitation::Js::Utils do
end end
end end

View File

@ -27,7 +27,7 @@ lots \t of whitespace
# single_line_comment1 # single_line_comment1
# single_line_comment2 # single_line_comment2
# #
# single_line_comment3 # single_line_comment3
if (-not ($NewLogonAccountDomain -cmatch \"NT\\sAUTHORITY\" -or $NewLogonAccountDomain -cmatch \"Window\\sManager\")) if (-not ($NewLogonAccountDomain -cmatch \"NT\\sAUTHORITY\" -or $NewLogonAccountDomain -cmatch \"Window\\sManager\"))
{ {
$Key = $AccountName + $AccountDomain + $NewLogonAccountName + $NewLogonAccountDomain + $LogonType + $WorkstationName + $SourceNetworkAddress + $SourcePort $Key = $AccountName + $AccountDomain + $NewLogonAccountName + $NewLogonAccountDomain + $LogonType + $WorkstationName + $SourceNetworkAddress + $SourcePort
@ -84,7 +84,7 @@ lots \t of whitespace
# single_line_comment1 # single_line_comment1
# single_line_comment2 # single_line_comment2
# #
# single_line_comment3 # single_line_comment3
$some_literal = @\" $some_literal = @\"
using System; using System;
using System.Runtime.InteropServices; using System.Runtime.InteropServices;

View File

@ -82,4 +82,4 @@ describe Rex::Exploitation::RopDb do
end end
end end
end end

View File

@ -33,43 +33,43 @@ xml_serv = '
xml_ms = ' xml_ms = '
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<Groups clsid="{3125E937-EB16-4b4c-9934-544FC6D24D26}" <Groups clsid="{3125E937-EB16-4b4c-9934-544FC6D24D26}"
disabled="1"> disabled="1">
<User clsid="{DF5F1855-51E5-4d24-8B1A-D9BDE98BA1D1}" <User clsid="{DF5F1855-51E5-4d24-8B1A-D9BDE98BA1D1}"
name="DbAdmin" name="DbAdmin"
image="2" image="2"
changed="2007-07-06 20:45:20" changed="2007-07-06 20:45:20"
uid="{253F4D90-150A-4EFB-BCC8-6E894A9105F7}"> uid="{253F4D90-150A-4EFB-BCC8-6E894A9105F7}">
<Properties <Properties
action="U" action="U"
newName="" newName=""
fullName="Database Admin" fullName="Database Admin"
description="Local Database Admin" description="Local Database Admin"
cpassword="demo" cpassword="demo"
changeLogon="0" changeLogon="0"
noChange="0" noChange="0"
neverExpires="0" neverExpires="0"
acctDisabled="1" acctDisabled="1"
userName="DbAdmin"/> userName="DbAdmin"/>
</User> </User>
<Group clsid="{6D4A79E4-529C-4481-ABD0-F5BD7EA93BA7}" <Group clsid="{6D4A79E4-529C-4481-ABD0-F5BD7EA93BA7}"
name="Database Admins" name="Database Admins"
image="2" image="2"
changed="2007-07-06 20:46:21" changed="2007-07-06 20:46:21"
uid="{C5FB3901-508A-4A9E-9171-60D4FC2B404B}"> uid="{C5FB3901-508A-4A9E-9171-60D4FC2B404B}">
<Properties <Properties
action="U" action="U"
newName="" newName=""
description="Local Database Admins" description="Local Database Admins"
userAction="REMOVE" userAction="REMOVE"
deleteAllUsers="1" deleteAllUsers="1"
deleteAllGroups="1" deleteAllGroups="1"
removeAccounts="0" removeAccounts="0"
groupName="Database Admins"> groupName="Database Admins">
<Members> <Members>
<Member <Member
name="domain\sampleuser" name="domain\sampleuser"
action="ADD" action="ADD"
sid=""/> sid=""/>
</Members> </Members>
</Properties> </Properties>
@ -89,12 +89,12 @@ cpassword_bad = "blah"
describe Rex::Parser::GPP do describe Rex::Parser::GPP do
GPP = Rex::Parser::GPP GPP = Rex::Parser::GPP
## ##
# Decrypt # Decrypt
## ##
it "Decrypt returns Local*P4ssword! for normal cpassword" do it "Decrypt returns Local*P4ssword! for normal cpassword" do
result = GPP.decrypt(cpassword_normal) result = GPP.decrypt(cpassword_normal)
result.should eq("Local*P4ssword!") result.should eq("Local*P4ssword!")
end end
@ -102,7 +102,7 @@ describe Rex::Parser::GPP do
result = GPP.decrypt(cpassword_bad) result = GPP.decrypt(cpassword_bad)
result.should eq("") result.should eq("")
end end
it "Decrypt returns blank for nil cpassword" do it "Decrypt returns blank for nil cpassword" do
result = GPP.decrypt(nil) result = GPP.decrypt(nil)
result.should eq("") result.should eq("")

View File

@ -16,7 +16,7 @@ comb = REXML::Document.new('<unattend xmlns="urn:schemas-microsoft-com:unattend"
describe Rex::Parser::Unattend do describe Rex::Parser::Unattend do
context "#parse" do context "#parse" do
it "returns passwords for b64" do it "returns passwords for b64" do
results = described_class.parse(b64) results = described_class.parse(b64)
results.length.should eq(2) results.length.should eq(2)
results[0]['password'].should eq(Rex::Text.to_unicode('Temp123')) results[0]['password'].should eq(Rex::Text.to_unicode('Temp123'))

View File

@ -49,5 +49,5 @@ describe Rex::Post::Meterpreter::ClientCore do
end end
end end

View File

@ -44,7 +44,7 @@ describe Rex::Proto::PJL::Client do
expect { cli.info(nil) }.to raise_error(ArgumentError) expect { cli.info(nil) }.to raise_error(ArgumentError)
end end
it "should receive a response for an INFO request" do it "should receive a response for an INFO request" do
cli.info(:id).should eq(default_response) cli.info(:id).should eq(default_response)
end end
end end

View File

@ -2,4 +2,4 @@ require 'spec_helper'
describe Metasploit::Credential::Core do describe Metasploit::Credential::Core do
it_should_behave_like 'Metasploit::Credential::Core::ToCredential' it_should_behave_like 'Metasploit::Credential::Core::ToCredential'
end end

View File

@ -72,7 +72,7 @@ describe Msfcli do
it "should see a help menu" do it "should see a help menu" do
out = get_stdout { out = get_stdout {
cli = Msfcli.new([]) cli = Msfcli.new([])
cli.usage cli.usage
} }
out.should =~ /Usage/ out.should =~ /Usage/
end end

View File

@ -14,4 +14,4 @@ shared_context 'Msf::DBManager' do
framework.db.workspace = framework.db.default_workspace framework.db.workspace = framework.db.default_workspace
db_manager.stub(:active => active) db_manager.stub(:active => active)
end end
end end

View File

@ -3,19 +3,19 @@ require 'metasploit/framework/credential'
shared_examples_for 'Metasploit::Credential::Core::ToCredential' do shared_examples_for 'Metasploit::Credential::Core::ToCredential' do
context "methods" do context "methods" do
context ".to_credential" do context ".to_credential" do
subject(:crednetial_core) do subject(:crednetial_core) do
FactoryGirl.create(:metasploit_credential_core) FactoryGirl.create(:metasploit_credential_core)
end end
it { should respond_to :to_credential } it { should respond_to :to_credential }
it "should return a Metasploit::Framework::Credential" do it "should return a Metasploit::Framework::Credential" do
expect( expect(
crednetial_core.to_credential crednetial_core.to_credential
).to be_a Metasploit::Framework::Credential ).to be_a Metasploit::Framework::Credential
end end
it "should set the parent to the credential object" do it "should set the parent to the credential object" do
expect( expect(
crednetial_core.to_credential.parent crednetial_core.to_credential.parent
@ -23,4 +23,4 @@ shared_examples_for 'Metasploit::Credential::Core::ToCredential' do
end end
end end
end end
end end

View File

@ -20,4 +20,4 @@ shared_examples_for 'Msf::DBManager::Export#extract_module_detail_info module_de
child_node.content.should == attribute.to_s child_node.content.should == attribute.to_s
end end
end end
end end

View File

@ -134,4 +134,4 @@ shared_examples_for 'Msf::DBManager::Migration' do
reset_column_information reset_column_information
end end
end end
end end

View File

@ -31,7 +31,7 @@ shared_examples_for 'Msf::DBManager#search_modules Mdm::Module::Platform#name or
context 'with Mdm::Module::Target#name' do context 'with Mdm::Module::Target#name' do
let(:name) do let(:name) do
# use inspect to quote spaces in string # use inspect to quote spaces in string
module_target.name.inspect module_target.name.inspect
end end
@ -46,4 +46,4 @@ shared_examples_for 'Msf::DBManager#search_modules Mdm::Module::Platform#name or
end end
end end
end end
end end

View File

@ -41,4 +41,4 @@ shared_examples_for 'Msf::DBManager#search_modules Mdm::Module::Ref#name keyword
end end
end end
end end
end end

View File

@ -57,4 +57,4 @@ shared_examples_for 'Msf::DBManager#update_all_module_details refresh' do
update_all_module_details update_all_module_details
end end
end end
end end

View File

@ -23,4 +23,4 @@ shared_examples_for 'Msf::DBManager#update_module_details with module' do |optio
}.to_not raise_error }.to_not raise_error
end end
end end
end end

View File

@ -456,4 +456,4 @@ shared_examples_for 'Msf::ModuleManager::Cache' do
end end
end end
end end
end end

View File

@ -159,4 +159,4 @@ shared_examples_for 'Msf::ModuleManager::Loading' do
on_module_load on_module_load
end end
end end
end end

View File

@ -74,4 +74,4 @@ shared_examples_for 'Msf::ModuleManager::ModulePaths' do
end end
end end
end end
end end

View File

@ -92,4 +92,4 @@ shared_examples_for 'Msf::Simple::Framework::ModulePaths' do
end end
end end
end end
end end

View File

@ -28,4 +28,4 @@ describe CPassword do
end end
end end
end end
end end