Skip to content
Misconfiguration Write-up Intermediate

Ease Post Exploitation Getting Elevated Reverse Shell Using Dll Hijacking And Mock Directories

A Windows UAC bypass was demonstrated by placing a malicious DLL named after a legitimate one into a mock directory with a trailing space, then launching a trusted auto-elevating binary from that directory. This gave the attacker an administrative reverse shell without a UAC prompt.

Usman Sikander Follow

Published on systemweakness.com

This blog is about DLL Hijacking and Mock directories technique to bypass Windows UAC security feature and getting high-level privileged reverse shell. Security researchers identified this technique which uses a simplified process of DLL hijacking and mock folders to bypass UAC control.

Usman Sikander, on systemweakness.com

The full write-up lives on its author's site

It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.

Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.

How it worked

Root cause

Likely Windows resolves a trusted binary's DLL search path to a mock directory containing a trailing space, and the auto-elevation trust check does not account for that path difference.

Impact

An attacker who already has code execution as a local administrator could obtain a high-integrity shell without a UAC prompt, then dump credentials and move laterally; the author reports it worked on Windows 11 with Defender present.

What the attacker needed

Existing code execution as a local admin; Ability to write to a mock directory; Windows 10 or 11 target

The fix

UAC should be set to 'Always Notify' so that high-risk applications always prompt before elevation.

How it was found

  1. Create a malicious DLL containing shellcode and name it after a legitimate DLL loaded by the target binary.
  2. Create a mock directory with a trailing space in its name using cmd or PowerShell.
  3. Copy the legitimate target binary and the malicious DLL into the mock directory.
  4. Start a listener on the C2 server.
  5. Execute the batch script so the binary runs from the mock directory and loads the malicious DLL.
  6. Receive an administrative reverse shell and load Mimikatz to dump hashes.

Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.

Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.

Windows normally asks for permission before running programs with high privileges, through a prompt called UAC. This post shows that a trusted Windows program can be tricked into loading a malicious library file from a folder whose name looks almost identical to a real system folder, because the name has an extra space. The program then runs with high privileges without asking the user.

What is Misconfiguration?

Settings left unsafe: exposed panels, open storage buckets, debug modes, default credentials.

More by Usman Sikander

View all

1 more disclosed report, best first.

Similar reports

View all

Same bug class and techniques, clearest first.

Security misconfiguration

The lesson behind this report.

Settings left unsafe: exposed panels, open storage buckets, debug modes, default credentials.