[羊城杯2020]easyphp
# [羊城杯 2020] easyphp
和 [XNUCA2019Qualifier] EasyPHP 基本一样,唯一的区别就是少了 include_once 导致没办法通过 error_log 来做,预期解应该就是那道题的非预期。
<?php $files = scandir('./'); foreach($files as $file) { if(is_file($file)){ if ($file !== "index.php") { unlink($file); }...
more...
[BSidesCF2019]SVGMagic
# [BSidesCF 2019]SVGMagic
标题说把 SVG 转为 PNG
SVG 是一种用 XML 定义的语言,SVG 图形是可交互的和动态的,可以在 SVG 文件中嵌入动画元素或通过脚本来定义动画。
也就是说这里的 SVG 是个 XML, 并且存在可控的内容,那么自然就会想到 XXE。
究极详细讲解:https://www.freebuf.com/vuls/175451.html
我的理解是:
首先我们要知道,XML 被设计用来传输和存储数据。
然后这个漏洞就是利用了,应用程序在解析XML输入时,没有禁止外部实体的加载。
就拿下面的这个来说<!ENTITY file...
more...
[极客大挑战2020]Greatphp
# [极客大挑战 2020] Greatphp
源码:
<?phperror_reporting(0);class SYCLOVER { public $syc; public $lover; public function __wakeup(){ if( ($this->syc != $this->lover) && (md5($this->syc) === md5($this->lover)) && (sha1($this->syc)===...
more...
easybypass
# easybypass
源码:
<?php
highlight_file(__FILE__);
$comm1 = $_GET['comm1'];
$comm2 =...
more...
[CSAWQual2019]Web_Unagi
# [CSAWQual2019]Web_Unagi
提示需要上传 xml 文件,flag 在 /flag 中。很容易联想到 XXE 漏洞来读取。
<?xml version='1.0'?>
<!DOCTYPE users [
<!ENTITY xxe SYSTEM "file:///flag"...
more...
[MRCTF2020]Ezaudit
# [MRCTF2020]Ezaudit
打开题目是个漂亮的前端,扫一下发现 www.zip 文件泄露,下载审计
<?php
header('Content-type:text/html; charset=utf-8');
error_reporting(0);
if(isset($_POST['login'])){
$username = $_POST['username'];
$password = $_POST['password'];
$Private_key =...
more...
[WMCTF2020]Make PHP Great Again
# [WMCTF2020]Make PHP Great Again
前言:
关键字:[require_once|proc | 文件包含 | session|session.upload_progress]
<?phphighlight_file(__FILE__);require_once 'flag.php';if(isset($_GET['file'])) { require_once $_GET['file'];}# 题解
绕过不能重复包含文件的限制
# 解法 1
PHP 最新版的小...
more...