This technique leverages a local exploit module in Metasploit to inject shellcode into a privileged process, effectively bypassing UAC and maintaining higher-level access on the compromised system. By migrating to a high-integrity process such as lsass.exe, the attacker gains SYSTEM privileges, allowing unrestricted command execution.
Steps to Perform UAC Bypass via Memory Injection
1. Load the Exploit Module
In Metasploit, use the bypassuac_injection exploit module:
migrate 484 β Moves the Meterpreter session to process ID 484 (or the correct PID for lsass.exe).
This attack takes advantage of DLL injection and process migration to run with elevated privileges. Since lsass.exe is a critical system process, migrating to it ensures persistence and full control over the compromised machine.
Mitigation Measures
To protect against UAC bypass attacks:
Enable UAC in Always Notify mode to prevent automatic privilege escalation.
Use Windows Defender Credential Guard to protect lsass.exe from process injection.
Apply Application Whitelisting to restrict execution of unauthorized scripts and exploits.
Monitor event logs (Event ID 4688) for suspicious process migrations.