1. 程式人生 > 其它 >CTF.show:web11

CTF.show:web11

技術標籤:CTF_Web_WriteupCTF.show

程式碼審計

<?php
        function replaceSpecialChar($strParam){
             $regex = "/(select|from|where|join|sleep|and|\s|union|,)/i";
             return preg_replace($regex,"",$strParam);
        }
        if(strlen($password)!=strlen(replaceSpecialChar
($password))){ die("sql inject error"); } if($password==$_SESSION['password']){ echo $flag; }else{ echo "error"; } ?>

要求我們password的值等於session的值
F12找到session的值,直接刪掉。
在這裡插入圖片描述

輸入空口令,得到flag
在這裡插入圖片描述