Catch possible exception if WTSGetActiveConsoleSessionId isn't available on the target machine

unstable
sinn3r 2011-12-04 14:48:45 -06:00
parent 3cd2caca1a
commit e07868d613
1 changed files with 6 additions and 1 deletions

View File

@ -46,7 +46,12 @@ class Metasploit3 < Msf::Post
uac = is_uac_enabled? ? 'True' : 'False' uac = is_uac_enabled? ? 'True' : 'False'
admin = is_admin? ? 'True' : 'False' admin = is_admin? ? 'True' : 'False'
uid = client.sys.config.getuid.inspect uid = client.sys.config.getuid.inspect
fid = client.railgun.kernel32.WTSGetActiveConsoleSessionId["return"] begin
# Older OS might not have this (min supported is XP)
fid = client.railgun.kernel32.WTSGetActiveConsoleSessionId["return"]
rescue
fid = 'N/A'
end
privs = client.sys.config.getprivs privs = client.sys.config.getprivs
# Store in tables # Store in tables