CTFshow php特性 web101
生活随笔
收集整理的這篇文章主要介紹了
CTFshow php特性 web101
小編覺得挺不錯(cuò)的,現(xiàn)在分享給大家,幫大家做個(gè)參考.
目錄
- 源碼
- 思路
- 題解
- 總結(jié)
源碼
<?php/* # -*- coding: utf-8 -*- # @Author: h1xa # @Date: 2020-09-16 11:25:09 # @Last Modified by: h1xa # @Last Modified time: 2020-09-22 00:26:48 # @link: https://ctfer.com*/highlight_file(__FILE__); include("ctfshow.php"); //flag in class ctfshow; $ctfshow = new ctfshow(); $v1=$_GET['v1']; $v2=$_GET['v2']; $v3=$_GET['v3']; $v0=is_numeric($v1) and is_numeric($v2) and is_numeric($v3); if($v0){if(!preg_match("/\\\\|\/|\~|\`|\!|\@|\#|\\$|\%|\^|\*|\)|\-|\_|\+|\=|\{|\[|\"|\'|\,|\.|\;|\?|[0-9]/", $v2)){if(!preg_match("/\\\\|\/|\~|\`|\!|\@|\#|\\$|\%|\^|\*|\(|\-|\_|\+|\=|\{|\[|\"|\'|\,|\.|\?|[0-9]/", $v3)){eval("$v2('ctfshow')$v3");}}}?>Notice: Undefined index: v1 in /var/www/html/index.php on line 17Notice: Undefined index: v2 in /var/www/html/index.php on line 18Notice: Undefined index: v3 in /var/www/html/index.php on line 19思路
過濾的有點(diǎn)多,雖然我們可以閉合v2在v3寫入shell,但是找不到突破口
v2=echo&v3=;[shell];
我們還可以讀取類
$a=class kradress{public var flag;}var_dump($a);//object(kradress)#1 (1) { ["flag"]=> int(1) }echo "<br>";echo(new Reflectionclass('kradress'));//Class [ class kradress ] { @@ D:\phpstudy_pro\WWW\cmd.php 4-6 - Constants [0] { } - Static properties [0] { } - Static methods [0] { } - Properties [1] { Property [ public $flag ] } - Methods [0] { } }題解
拿到$flag_ccb7b6fb0x2d3e2a0x2d4a980x2d85fe0x2d711a1e1d5ec
把0x2d替換成 -發(fā)現(xiàn)不成功,數(shù)了一下發(fā)現(xiàn)是35位,而flag一般是uuid,uuid是36位的,我們在末尾隨機(jī)添加一個(gè)字符,成功拿到flag
總結(jié)
水題
總結(jié)
以上是生活随笔為你收集整理的CTFshow php特性 web101的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: CTFshow php特性 web100
- 下一篇: CTFshow php特性 web102