File tree Expand file tree Collapse file tree 2 files changed +0
-43
lines changed
lib/metasploit/framework/login_scanner
spec/lib/metasploit/framework/login_scanner Expand file tree Collapse file tree 2 files changed +0
-43
lines changed Original file line number Diff line number Diff line change @@ -27,41 +27,6 @@ def check_setup
27
27
end
28
28
29
29
30
- # Sends a HTTP request with Rex
31
- #
32
- # @param (see Rex::Proto::Http::Request#request_raw)
33
- # @raise [Rex::ConnectionError] Something has gone wrong while sending the HTTP request
34
- # @return [Rex::Proto::Http::Response] The HTTP response
35
- def send_request ( opts )
36
- res = nil
37
- cli = Rex ::Proto ::Http ::Client . new ( host , port ,
38
- {
39
- 'Msf' => framework ,
40
- 'MsfExploit' => framework_module
41
- } ,
42
- ssl ,
43
- ssl_version ,
44
- proxies
45
- )
46
- configure_http_client ( cli )
47
- begin
48
- cli . connect
49
- req = cli . request_cgi ( opts )
50
- res = cli . send_recv ( req )
51
- rescue ::Errno ::EPIPE , ::Timeout ::Error => e
52
- # We are trying to mimic the same type of exception rescuing in
53
- # Msf::Exploit::Remote::HttpClient. But instead of returning nil, we'll consistently
54
- # raise Rex::ConnectionError so the #attempt_login can return the error message back
55
- # to the login module.
56
- raise Rex ::ConnectionError , e . message
57
- ensure
58
- cli . close
59
- end
60
-
61
- res
62
- end
63
-
64
-
65
30
# Returns the latest sid from Symantec Web Gateway.
66
31
#
67
32
# @returns [String] The PHP Session ID for Symantec Web Gateway login
Original file line number Diff line number Diff line change 72
72
end
73
73
end
74
74
75
- describe '#send_request' do
76
- context 'when a valid request is sent' do
77
- it 'returns a response object' do
78
- expect ( subject . send_request ( { 'uri' => '/' } ) ) . to be_kind_of ( Rex ::Proto ::Http ::Response )
79
- end
80
- end
81
- end
82
-
83
75
describe '#get_last_sid' do
84
76
let ( :response ) do
85
77
res = Rex ::Proto ::Http ::Response . new ( 200 , 'OK' )
You can’t perform that action at this time.
0 commit comments