Skip to content

Commit 5cdbae0

Browse files
authored
Merge pull request #2015 from HackTricks-wiki/update_RegPwn_BOF_20260317_020432
RegPwn BOF
2 parents ccde508 + 38c1f7f commit 5cdbae0

1 file changed

Lines changed: 34 additions & 0 deletions

File tree

  • src/windows-hardening/windows-local-privilege-escalation

src/windows-hardening/windows-local-privilege-escalation/README.md

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -652,6 +652,38 @@ To change the Path of the binary executed:
652652
reg add HKLM\SYSTEM\CurrentControlSet\services\<service_name> /v ImagePath /t REG_EXPAND_SZ /d C:\path\new\binary /f
653653
```
654654
655+
### Registry symlink race to arbitrary HKLM value write (ATConfig)
656+
657+
Some Windows Accessibility features create per-user **ATConfig** keys that are later copied by a **SYSTEM** process into an HKLM session key. A registry **symbolic link race** can redirect that privileged write into **any HKLM path**, giving an arbitrary HKLM **value write** primitive.
658+
659+
Key locations (example: On-Screen Keyboard `osk`):
660+
661+
- `HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Accessibility\ATs` lists installed accessibility features.
662+
- `HKCU\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Accessibility\ATConfig\<feature>` stores user-controlled configuration.
663+
- `HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Accessibility\Session<session id>\ATConfig\<feature>` is created during logon/secure-desktop transitions and is writable by the user.
664+
665+
Abuse flow (CVE-2026-24291 / ATConfig):
666+
667+
1. Populate the **HKCU ATConfig** value you want to be written by SYSTEM.
668+
2. Trigger the secure-desktop copy (e.g., **LockWorkstation**), which starts the AT broker flow.
669+
3. **Win the race** by placing an **oplock** on `C:\Program Files\Common Files\microsoft shared\ink\fsdefinitions\oskmenu.xml`; when the oplock fires, replace the **HKLM Session ATConfig** key with a **registry link** to a protected HKLM target.
670+
4. SYSTEM writes the attacker-chosen value to the redirected HKLM path.
671+
672+
Once you have arbitrary HKLM value write, pivot to LPE by overwriting service configuration values:
673+
674+
- `HKLM\SYSTEM\CurrentControlSet\Services\<svc>\ImagePath` (EXE/command line)
675+
- `HKLM\SYSTEM\CurrentControlSet\Services\<svc>\Parameters\ServiceDll` (DLL)
676+
677+
Pick a service that a normal user can start (e.g., **`msiserver`**) and trigger it after the write. **Note:** the public exploit implementation **locks the workstation** as part of the race.
678+
679+
Example tooling (RegPwn BOF / standalone):
680+
681+
```bash
682+
beacon> regpwn C:\payload.exe SYSTEM\CurrentControlSet\Services\msiserver ImagePath
683+
beacon> regpwn C:\evil.dll SYSTEM\CurrentControlSet\Services\SomeService\Parameters ServiceDll
684+
net start msiserver
685+
```
686+
655687
### Services registry AppendData/AddSubdirectory permissions
656688
657689
If you have this permission over a registry this means to **you can create sub registries from this one**. In case of Windows services this is **enough to execute arbitrary code:**
@@ -1981,5 +2013,7 @@ C:\Windows\microsoft.net\framework\v4.0.30319\MSBuild.exe -version #Compile the
19812013
- [Unit 42 – Privileged File System Vulnerability Present in a SCADA System](https://unit42.paloaltonetworks.com/iconics-suite-cve-2025-0921/)
19822014
- [Symbolic Link Testing Tools – CreateSymlink usage](https://github.com/googleprojectzero/symboliclink-testing-tools/blob/main/CreateSymlink/CreateSymlink_readme.txt)
19832015
- [A Link to the Past. Abusing Symbolic Links on Windows](https://infocon.org/cons/SyScan/SyScan%202015%20Singapore/SyScan%202015%20Singapore%20presentations/SyScan15%20James%20Forshaw%20-%20A%20Link%20to%20the%20Past.pdf)
2016+
- [RIP RegPwn – MDSec](https://www.mdsec.co.uk/2026/03/rip-regpwn/)
2017+
- [RegPwn BOF (Cobalt Strike BOF port)](https://github.com/Flangvik/RegPwnBOF)
19842018
19852019
{{#include ../../banners/hacktricks-training.md}}

0 commit comments

Comments
 (0)