参考原作者视频
https://www.bilibili.com/video/BV1Mq4y1v7WC?spm_id_from=333.999.0.0
前言:
Powershell在渗透当中或多或少都会使用,但杀软对于powershell看管的很严格
测试环境:物理机+最新版的360
![绕过数字杀软的PowerShell调用并Bypass计划任务](https://www.fxe.cc/wp-content/uploads/2023/03/2023032722242872.png.webp)
首先我们假设已经拿到了webshell或者上线到CS,能够执行命令,执行PowerShell代码,如下所示
![绕过数字杀软的PowerShell调用并Bypass计划任务](https://www.fxe.cc/wp-content/uploads/2023/03/2023032722245179.png.webp)
发现被360给拦截了 ,也就是正常的输出命令也被拦截,能说明跟代码没有任何的一个关系,就是禁止你调用PowerShell这个进程
![绕过数字杀软的PowerShell调用并Bypass计划任务](https://www.fxe.cc/wp-content/uploads/2023/03/2023032722250629.png.webp)
绕过方法:
微软提供的一个dll
C:WindowsMicrosoft.NETassemblyGAC_MSILSystem.Management.Automationv4.0_3.0.0.0__31bf3856ad364e35
![绕过数字杀软的PowerShell调用并Bypass计划任务](https://www.fxe.cc/wp-content/uploads/2023/03/2023032722255115.png.webp)
部分代码:
byte[] psshell = Convert.FromBase64String(ps);string decodedString = Encoding.UTF8.GetString(psshell);Runspace rs = RunspaceFactory.CreateRunspace();rs.Open();
把上线命令进行base64编码
![绕过数字杀软的PowerShell调用并Bypass计划任务](https://www.fxe.cc/wp-content/uploads/2023/03/2023032722260754.png.webp)
成功上线
![绕过数字杀软的PowerShell调用并Bypass计划任务](https://www.fxe.cc/wp-content/uploads/2023/03/2023032722262133.png.webp)
结果:360全程没有任何拦截
![绕过数字杀软的PowerShell调用并Bypass计划任务](https://www.fxe.cc/wp-content/uploads/2023/03/2023032722263622.png.webp)
绕过并创建计划任务
用PowerShell创建计划任务
![绕过数字杀软的PowerShell调用并Bypass计划任务](https://www.fxe.cc/wp-content/uploads/2023/03/2023032722265430.png.webp)
发现被拦截
![绕过数字杀软的PowerShell调用并Bypass计划任务](https://www.fxe.cc/wp-content/uploads/2023/03/2023032722271146.png.webp)
把powershell进行base64编码
![绕过数字杀软的PowerShell调用并Bypass计划任务](https://www.fxe.cc/wp-content/uploads/2023/03/202303272227294.png.webp)
执行我们的powershell代码
![绕过数字杀软的PowerShell调用并Bypass计划任务](https://www.fxe.cc/wp-content/uploads/2023/03/2023032722273873.png.webp)
![绕过数字杀软的PowerShell调用并Bypass计划任务](https://www.fxe.cc/wp-content/uploads/2023/04/2023042100064918.webp)