Path: blob/master/modules/auxiliary/vsploit/malware/dns/dns_mariposa.rb
19758 views
##1# This module requires Metasploit: https://metasploit.com/download2# Current source: https://github.com/rapid7/metasploit-framework3##45class MetasploitModule < Msf::Auxiliary67def initialize8super(9'Name' => 'VSploit Mariposa DNS Query Module',10'Description' => 'This module queries known Mariposa Botnet DNS records.',11'Author' => 'MJC',12'License' => MSF_LICENSE,13'References' => [14[ 'URL', 'http://www.defintel.com/docs/Mariposa_Analysis.pdf']15],16'Notes' => {17'Stability' => [CRASH_SAFE],18'SideEffects' => [IOC_IN_LOGS],19'Reliability' => []20}21)22register_options(23[24OptString.new('DNS_SERVER', [false, 'Specifies a DNS server']),25OptInt.new('COUNT', [false, 'Number of intervals to loop', 1]),26OptInt.new('DELAY', [false, 'Delay in seconds between intervals', 3])27]28)29end3031def run32@res = Net::DNS::Resolver.new3334domain = [35'lalundelau.sinip.es', 'bf2back.sinip.es', 'thejacksonfive.mobi',36'thejacksonfive.us', 'thejacksonfive.biz', 'butterfly.BigMoney.biz',37'bfisback.sinip.es', 'bfisback.no-ip.org', 'qwertasdfg.sinip.es',38'shv4b.getmyip.com', 'shv4.no-ip.biz', 'butterfly.sinip.es',39'defintelsucks.sinip.es', 'defintelsucks.net', 'defintelsucks.com',40'gusanodeseda.sinip.es', 'gusanodeseda.net', 'legion.sinip.es',41'booster.estr.es', 'sexme.in', 'extraperlo.biz',42'legionarios.servecounterstrike.com', 'thesexydude.com',43'yougotissuez.com', 'gusanodeseda.mobi', 'tamiflux.org',44'tamiflux.net', 'binaryfeed.in', 'youare.sexidude.com',45'mierda.notengodominio.com',46]4748if datastore['DNS_SERVER']49@res.nameservers = datastore['DNS_SERVER']50end5152count = 05354while count < datastore['COUNT']5556domain.each do |name|57query = @res.query(name, 'A')58time = Time.new59time = time.strftime('%Y-%m-%d %H:%M:%S')60print_status("#{time} - DNS Query sent for => #{name}")61if query.answer.empty?62print_error("#{time} - #{name} => No Record Found")63else64a = query.answer[0].to_s.split(/[\s,]+/)65print_good("#{time} - #{name} => #{a[-1]}")66end67end68unless count == (datastore['COUNT'] - 1)69time = Time.new70time = time.strftime('%Y-%m-%d %H:%M:%S')71print_status("#{time} - Waiting #{datastore['DELAY']} seconds to query")72select(nil, nil, nil, datastore['DELAY'])73end74count += 175end76end77end787980