转自:www.freebuf.com/sectool/131275.html
powershell绕过执行策略限制
本地权限绕过执行
![](https://img.haomeiwen.com/i5476033/ceb36500ca7cc2df.png)
本地隐藏权限绕过执行脚本
![](https://img.haomeiwen.com/i5476033/0514fabc2b19823a.png)
直接用IEX下载远程的PS1脚本回来权限绕过执行
![](https://img.haomeiwen.com/i5476033/29ed3115d32e4064.png)
powersploit
powersploit一款基于powershell的后渗透(Post-Exploitation)框架,集成大量渗透相关模块和功能。
github地址:https://github.com/mattifestation/PowerSploit
然后我们访问我们的127.0.0.1 保证我们可以访问的到
![](https://img.haomeiwen.com/i5476033/3b1842d19156dc07.png)
他的目录就跟metasploit一样,分工明确
CodeExecution 在目标主机执行代码
ScriptModification 在目标主机上创建或修改脚本
Persistence 后门脚本(持久性控制)
AntivirusBypass 发现杀软查杀特征
Exfiltration 目标主机上的信息搜集工具
Mayhem 蓝屏等破坏性脚本
Recon 以目标主机为跳板进行内网信息侦查
(1)Invoke-Shellcode
nvoke-Shellcode的作用:将shellcode插入选择的进程ID或本地PowerShell中。
![](https://img.haomeiwen.com/i5476033/d1e0ef50094b05ec.png)
在攻击机上生成payload木马,输出为powershell格式
![](https://img.haomeiwen.com/i5476033/037006394c472796.png)
然后在目标机运行
![](https://img.haomeiwen.com/i5476033/ac18fde8856db4ec.png)
同时监听
![](https://img.haomeiwen.com/i5476033/866562d8dc9e3e79.png)
在powershell下运行
Invoke-Shellcode -Shellcode ($buf)
若强制执行,则Invoke-Shellcode -Shellcode ($buf) -Force
(2)注入进程
我们可以把我们的马儿注入到一个进程里去,这个进程可以是现有的,也可以是我们重新启动一个
这里就重启一个进程,顺便说两条powershell命令
Get-Process:获取当前运行进程
启动一个进程,并设置为隐藏的
![](https://img.haomeiwen.com/i5476033/e91114de3f30cc3e.png)
记住进程号
![](https://img.haomeiwen.com/i5476033/5bf6afe452e266bb.png)
(3)dll注入
(4)端口扫描:Invoke-Portscan端口扫描
![](https://img.haomeiwen.com/i5476033/c9c5b1886f5a33cd.png)
![](https://img.haomeiwen.com/i5476033/dcbd064a08293294.png)
(5)Invoke-Mimikatz
![](https://img.haomeiwen.com/i5476033/6a382cbe16e9a0fc.png)
使用 Invoke-Mimikatz -DumpCreds
需要管理员权限
![](https://img.haomeiwen.com/i5476033/737e666df8741e0e.png)
网友评论