Skip to content

Commit 3c4da5c

Browse files
committed
Update BES rspec
1 parent db243a8 commit 3c4da5c

File tree

2 files changed

+19
-4
lines changed

2 files changed

+19
-4
lines changed

lib/msf/core/exploit/remote/browser_exploit_server.rb

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,6 @@ def try_set_target(profile)
200200
# "{CLSID}=>Method=>Boolean;"
201201
# @return [Boolean] True if there's a bad ActiveX, otherwise false
202202
def has_bad_activex?(ax)
203-
print_debug(ax)
204203
ax.split(';').each do |a|
205204
bool = a.split('=>')[2]
206205
if bool == 'false'

spec/lib/msf/core/exploit/remote/browser_exploit_server_spec.rb

Lines changed: 19 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,9 +41,9 @@
4141
:ua_ver =>'8.0',
4242
:arch =>'x86',
4343
:office =>'null',
44-
:activex =>'true',
45-
:proxy =>false,
46-
:language =>'en-us',
44+
:activex => [ {:clsid=>'{D27CDB6E-AE6D-11cf-96B8-444553540000}', :method => 'LoadMovie'} ],
45+
:proxy => false,
46+
:language => 'en-us',
4747
:tried => true
4848
}
4949
end
@@ -65,6 +65,22 @@
6565
end
6666
end
6767

68+
describe '#has_bad_activex?' do
69+
context 'when there is a bad activex' do
70+
let(:js_ax_value) { "#{expected_profile[:activex][0][:clsid]}=>#{expected_profile[:activex][0][:method]}=>false" }
71+
it 'returns false' do
72+
expect(server.has_bad_activex?(js_ax_value)).to be_truthy
73+
end
74+
end
75+
76+
context 'when there is no bad activex' do
77+
let(:js_ax_value) { "#{expected_profile[:activex][0][:clsid]}=>#{expected_profile[:activex][0][:method]}=>true" }
78+
it 'returns true' do
79+
expect(server.has_bad_activex?(js_ax_value)).to be_falsey
80+
end
81+
end
82+
end
83+
6884
describe "#get_bad_requirements" do
6985
let(:rejected_requirements) do
7086
server.get_bad_requirements(fake_profile)

0 commit comments

Comments
 (0)