From 69ce7eed1ba26e8934994369e35d19371d46f682 Mon Sep 17 00:00:00 2001 From: HD Moore Date: Mon, 20 Sep 2010 04:58:25 +0000 Subject: [PATCH] Wrap the admin check in case the OS doesn't support this API (WinNT, Win2000) git-svn-id: file:///home/svn/framework3/trunk@10390 4d416f70-5f16-0410-b530-b9f4589650da --- lib/msf/base/sessions/meterpreter_options.rb | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/lib/msf/base/sessions/meterpreter_options.rb b/lib/msf/base/sessions/meterpreter_options.rb index d8b097a6bd..aaf9912614 100644 --- a/lib/msf/base/sessions/meterpreter_options.rb +++ b/lib/msf/base/sessions/meterpreter_options.rb @@ -36,18 +36,22 @@ module MeterpreterOptions session.init_ui(self.user_input, self.user_output) if (datastore['AutoLoadStdapi'] == true) + session.load_stdapi - mod = framework.modules.create(session.via_exploit) - + if datastore['AutoSystemInfo'] session.load_session_info end - if session.railgun and session.railgun.shell32.IsUserAnAdmin()["return"] == true - session.load_priv - session.info += " (ADMIN)" + begin + ::Timeout.timeout(10) do + if session.railgun and session.railgun.shell32.IsUserAnAdmin()["return"] == true + session.load_priv + session.info += " (ADMIN)" + end + end + rescue ::Exception end - end if (datastore['InitialAutoRunScript'].empty? == false)