metasploit-framework/modules/post/windows/gather/forensics/duqu_check.rb

76 lines
2.4 KiB
Ruby
Raw Normal View History

2011-11-10 21:20:48 +00:00
##
2013-10-15 19:52:12 +00:00
# This module requires Metasploit: http//metasploit.com/download
# Current source: https://github.com/rapid7/metasploit-framework
2011-11-10 21:20:48 +00:00
##
require 'msf/core'
2012-10-23 18:24:05 +00:00
require 'msf/core/auxiliary/report'
2011-11-10 21:20:48 +00:00
class Metasploit3 < Msf::Post
2013-09-05 18:41:25 +00:00
include Msf::Post::Windows::Registry
include Msf::Auxiliary::Report
2011-11-10 21:20:48 +00:00
2013-08-30 21:28:54 +00:00
def initialize(info={})
super( update_info( info,
'Name' => 'Windows Gather Forensics Duqu Registry Check',
'Description' => %q{ This module searches for CVE-2011-3402 (Duqu) related registry artifacts.},
'License' => MSF_LICENSE,
'Author' => [ 'Marcus J. Carey <mjc[at]threatagent.com>'],
'Platform' => [ 'win' ],
'SessionTypes' => [ 'meterpreter' ],
'References' =>
[
[ 'CVE', '2011-3402' ],
[ 'URL', 'http://r-7.co/w5h7fY' ]
]
))
end
2011-11-10 21:20:48 +00:00
2013-08-30 21:28:54 +00:00
def run
# Registry artifacts sourced from Symantec report
artifacts =
[
'HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Internet Settings\Zones\4\"CFID"',
'HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Internet Settings\Zones\4\CFID',
'HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\JmiNET3',
'HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\JmiNET3\FILTER'
]
match = 0
2013-08-30 21:28:54 +00:00
print_status("Searching registry on #{sysinfo['Computer']} for CVE-2011-3402 exploitation [Duqu] artifacts.")
2013-08-30 21:28:54 +00:00
begin
artifacts.each do |artifact|
(path, query) = parse_path(artifact)
has_key = registry_enumkeys(path)
has_val = registry_enumvals(path)
2011-11-10 21:20:48 +00:00
2013-08-30 21:28:54 +00:00
if has_key.include?(query) or has_val.include?(query)
print_good("#{sysinfo['Computer']}: #{path}\\#{query} found in registry.")
match += 1
report_vuln(
:host => session.session_host,
:name => self.name,
:info => "Module #{self.fullname} detected #{path}\\#{query} - possible CVE-2011-3402 exploitation [Duqu] artifact.",
:refs => self.references,
:exploited_at => Time.now.utc
)
end
end
rescue # Probably should do something here...
end
2013-08-30 21:28:54 +00:00
print_status("#{sysinfo['Computer']}: #{match.to_s} artifact(s) found in registry.")
2011-11-10 21:20:48 +00:00
2013-08-30 21:28:54 +00:00
end
2011-11-10 21:20:48 +00:00
2013-08-30 21:28:54 +00:00
def parse_path(artifact)
parts = artifact.split("\\")
query = parts[-1]
parts.pop
path = parts.join("\\")
return path, query
end
2011-11-11 15:44:18 +00:00
end