CIMplant - 图1

WMImplant的C#端口,它使用CIM或WMI查询远程系统。它可以使用提供的凭据或当前用户的会话。

注意:某些命令将结合使用PowerShell和WMI,在--show-commands命令中以**表示。

介绍

CIMplant是一个C#重写和扩展上@christruncerWMImplant。它使您可以收集有关远程系统的数据,执行命令,提取数据等。该工具允许使用Windows Management Instrumentation WMI或通用接口模型CIM进行连接;Windows Management Infrastructure MI更准确。CIMplant需要目标系统上的本地管理员权限。

设置:

使用“发行版”下的内置版本可能是最简单的,只需注意它是在“调试”模式下编译的。如果要自己构建解决方案,请按照以下步骤操作。

  1. 将CIMplant.sln加载到Visual Studio中
  2. 如果不需要修改,请转到顶部的“生成”,然后转到“生成解决方案”

用法

  1. CIMplant.exe --help
  2. CIMplant.exe --show-commands
  3. CIMplant.exe --show-examples
  4. CIMplant.exe -s [remote IP address] -c cat -f c:\users\user\desktop\file.txt
  5. CIMplant.exe -s [remote IP address] -u [username] -d [domain] -p [password] -c cat -f c:\users\test\desktop\file.txt
  6. CIMplant.exe -s [remote IP address] -u [username] -d [domain] -p [password] -c command_exec --execute "dir c:\\"

一些有用的命令

CIMplant - 图2

一些示例用法命令

CIMplant - 图3

钴击执行装配

我想对CIMplant进行编码,以允许通过execute-assembly进行使用,以便将所有内容打包到一个可执行文件中并进行反射式加载。您应该能够通过信标运行所有命令而不会出现问题。享受!

CIMplant - 图4

重要档案

  1. Program.cs

这是操作的大脑,是程序的驱动程序。

  1. Connector.cs

这是建立初始CIM / WMI连接并将其传递到应用程序其余部分的地方

  1. ExecuteWMI.cs

WMI命令的所有功能代码

  1. ExecuteCIM.cs

CIM(MI)命令的所有功能代码

侦查

Of course, the first thing we’ll want to be aware of is the initial WMI or CIM connection. In general, WMI uses DCOM as a communication protocol whereas CIM uses WSMan (or, WinRM). This can be modified for CIM, and is in CIMplant, but let’s just go over the default values for now. For DCOM, the first thing we can do is look for initial TCP connections over port 135. The connecting and receiving systems will then decide on a new, very high port to use so that will vary drastically. For WSMan, the initial TCP connection is over port 5985.

接下来,您将要在事件查看器中查看Microsoft-Windows-WMI-Activity / Trace事件日志。搜索事件ID 11,并在可能的情况下对IsLocal属性进行过滤。您也可以在Microsoft-Windows-WinRM / Analytics日志中查找事件ID 1295

最后,您将需要使用Win32_OSRecoveryConfiguration类查找对DebugFilePath属性的任何修改。有关检测的更多详细信息,请参见我们的博客系列的第1部分CIMplant第1部分:检测WMImplant的C#实现