Skip to content

WMI 操作

WMI 操作

WMI 查询与执行

通过WMI(Windows Management Instrumentation)接口与目标系统交互。

WMI 查询

Bash
wmi_query [flags]
在指定命名空间中执行WMI查询,获取系统信息。

选项:

  • --namespace string: WMI命名空间(如 root\cimv2)

  • --args strings: WMI查询参数

示例:

Bash
wmi_query --namespace root\\cimv2 --args "SELECT * FROM Win32_Process"

WMI 方法执行

Bash
wmi_execute [flags]
执行WMI类中的指定方法,实现系统操作。

选项:

  • --namespace string: WMI命名空间(如 root\cimv2)

  • --class_name string: WMI类名

  • --method_name string: WMI方法名

  • --params strings: WMI方法参数

示例:

Bash
# 执行WMI方法创建进程
wmi_execute --namespace root\\cimv2 --class_name Win32_Process --method_name Create --params CommandLine="notepad.exe"