Clean up module

bug/bundler_fix
William Vu 2015-12-17 23:25:15 -06:00
parent 2c29298485
commit 06a2bb53bd
1 changed files with 17 additions and 21 deletions

View File

@ -3,36 +3,31 @@
# Current source: https://github.com/rapid7/metasploit-framework
##
require 'msf/core'
require 'msf/core/post/windows/priv'
require 'msf/core/post/common'
require 'msf/core/post/windows/registry'
class Metasploit4 < Msf::Post
class Metasploit3 < Msf::Post
include Msf::Post::Windows::Priv
include Msf::Post::Common
include Msf::Post::File
include Msf::Post::Windows::Registry
def initialize(info = {})
super(update_info(info,
'Name' => "NTDS.DIT Location Module",
'Description' => %q{
This module will find the location of the NTDS.DIT file (from the registry), check that it exists
and display it on the screen. Useful if you wish to manually acquire the file using ntdsutil or vss.
},
'License' => MSF_LICENSE,
'Platform' => ['win'],
'SessionTypes' => ['meterpreter'],
'Author' => ['Stuart Morgan <stuart.morgan[at]mwrinfosecurity.com>']
))
'Name' => 'Post Windows Gather NTDS.DIT Location',
'Description' => %q{
This module will find the location of the NTDS.DIT file (from the Registry),
check that it exists, and display its location on the screen, which is useful
if you wish to manually acquire the file using ntdsutil or vss.
},
'Author' => ['Stuart Morgan <stuart.morgan[at]mwrinfosecurity.com>'],
'License' => MSF_LICENSE,
'Platform' => ['win'],
'SessionTypes' => ['meterpreter']
))
end
def run
# Find the NTDS.DIT location in the registry
ntds = registry_getvaldata("HKLM\\SYSTEM\\CurrentControlSet\\Services\\NTDS\\Parameters", "DSA Database file").to_s
# Find the location of NTDS.DIT in the Registry
ntds = registry_getvaldata('HKLM\\SYSTEM\\CurrentControlSet\\Services\\NTDS\\Parameters', 'DSA Database file')
unless ntds
print_error("Unable to find the NTDS.DIT location.")
print_error('Unable to find the location of NTDS.DIT')
return
end
@ -44,7 +39,8 @@ class Metasploit3 < Msf::Post
print_line(" Modified: #{f.mtime.to_s}")
print_line(" Accessed: #{f.atime.to_s}")
else
print_error("NTDS.DIT is reportedly located at '#{ntds}' but the file does not appear to exist")
print_error("NTDS.DIT is reportedly located at #{ntds}, but the file does not appear to exist")
end
end
end