File tree Expand file tree Collapse file tree 1 file changed +9
-1
lines changed
spec/lib/metasploit/framework/login_scanner Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Original file line number Diff line number Diff line change 4
4
5
5
describe Metasploit ::Framework ::LoginScanner ::Glassfish do
6
6
7
+ subject ( :http_scanner ) { described_class . new }
8
+
7
9
it_behaves_like 'Metasploit::Framework::LoginScanner::Base' , has_realm_key : true , has_default_realm : false
8
10
it_behaves_like 'Metasploit::Framework::LoginScanner::RexSocket'
9
11
10
- subject ( :http_scanner ) { described_class . new }
11
12
12
13
let ( :good_version ) do
13
14
'4.0'
50
51
allow_any_instance_of ( Rex ::Proto ::Http ::Client ) . to receive ( :send_recv ) . and_return ( Rex ::Proto ::Http ::Response . new ( res_code ) )
51
52
expect ( http_scanner . send_request ( req_opts ) ) . to be_kind_of ( Rex ::Proto ::Http ::Response )
52
53
end
54
+
55
+ it 'parses JSESSIONID session cookies' do
56
+ allow_any_instance_of ( Rex ::Proto ::Http ::Client ) . to receive ( :send_recv ) . and_return ( Rex ::Proto ::Http ::Response . new ( res_code ) )
57
+ allow_any_instance_of ( Rex ::Proto ::Http ::Response ) . to receive ( :get_cookies ) . and_return ( "JSESSIONID=JSESSIONID_MAGIC_VALUE;" )
58
+ http_scanner . send_request ( req_opts )
59
+ expect ( http_scanner . jsession ) . to eq ( "JSESSIONID_MAGIC_VALUE" )
60
+ end
53
61
end
54
62
55
63
context '#is_secure_admin_disabled?' do
You can’t perform that action at this time.
0 commit comments