参考原作者视频
https://www.bilibili.com/video/BV1Mq4y1v7WC?spm_id_from=333.999.0.0
前言:
Powershell在渗透当中或多或少都会使用,但杀软对于powershell看管的很严格
测试环境:物理机+最新版的360

首先我们假设已经拿到了webshell或者上线到CS,能够执行命令,执行PowerShell代码,如下所示

发现被360给拦截了 ,也就是正常的输出命令也被拦截,能说明跟代码没有任何的一个关系,就是禁止你调用PowerShell这个进程

绕过方法:
微软提供的一个dll
C:WindowsMicrosoft.NETassemblyGAC_MSILSystem.Management.Automationv4.0_3.0.0.0__31bf3856ad364e35

部分代码:
byte[] psshell = Convert.FromBase64String(ps);string decodedString = Encoding.UTF8.GetString(psshell);Runspace rs = RunspaceFactory.CreateRunspace();rs.Open();
把上线命令进行base64编码

成功上线

结果:360全程没有任何拦截

绕过并创建计划任务
用PowerShell创建计划任务

发现被拦截

把powershell进行base64编码

执行我们的powershell代码

