Fix cookie parsing, typo, and unused var

bug/bundler_fix
wchen-r7 2015-12-01 17:39:40 -06:00
parent 682a41af2e
commit 0e21265ecc
1 changed files with 2 additions and 11 deletions

View File

@ -78,14 +78,7 @@ class Metasploit3 < Msf::Exploit::Remote
#
# @return [Hash]
def get_cookie_as_hash(cookie)
new_cookie = {}
cookie.split(';').each do |c|
cookie_name, cookie_value = c.scan(/(.+)=(.+)/).flatten
new_cookie[cookie_name.strip] = cookie_value.strip
end
new_cookie
Hash[*cookie.scan(/\s?([^, ;]+?)=([^, ;]*?)[;,]/).flatten]
end
@ -252,7 +245,7 @@ class Metasploit3 < Msf::Exploit::Remote
'method' => 'POST',
'uri' => uri,
'headers' => { 'X-Requested-With' => 'XMLHttpRequest' },
'cooke' => "atlassian.xsrf.token=#{xsrf}; JSESSIONID=#{sid}",
'cookie' => "atlassian.xsrf.token=#{xsrf}; JSESSIONID=#{sid}",
'vars_post' => {
'os_username' => jira_username,
'os_password' => jira_password,
@ -291,8 +284,6 @@ class Metasploit3 < Msf::Exploit::Remote
#
# @return [Hash]
def get_login_prerequisites
prerequisites = {}
uri = normalize_uri(target_uri.path, 'secure', 'Dashboard.jspa')
res = send_request_cgi({ 'uri' => uri })