Files
metasploit-gs/lib/msf/scripts/meterpreter/common.rb
T
HD Moore 7631b193fd Glue to tie Metasploit mixins into Rex::Script::Meterpreter
git-svn-id: file:///home/svn/framework3/trunk@9193 4d416f70-5f16-0410-b530-b9f4589650da
2010-05-02 00:09:01 +00:00

43 lines
897 B
Ruby

module Msf
module Scripts
module Meterpreter
module Common
#
# Commonly used methods and techniques for Meterpreter scripts
#
#
# These methods should only print output in the case of an error. All code should be tab indented
# All methods should follow the naming coventions below (separate words with "_", end queries with a ?, etc)
#
def is_uac_enabled?
uac = false
winversion = client.sys.config.sysinfo
if winversion['OS']=~ /Windows Vista/ or winversion['OS']=~ /Windows 7/
if client.sys.config.getuid != "NT AUTHORITY\\SYSTEM"
begin
key = client.sys.registry.open_key(HKEY_LOCAL_MACHINE, 'HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System')
if key.query_value('Identifier') == 1
uac = true
end
key.close
rescue::Exception => e
print_error("Error Checking UAC: #{e.class} #{e}")
end
end
end
return uac
end
end
end
end
end