X-NUCA 2019 Ezphp题目writeup
0x00 关于这道题 这道题出现在2019年X-NUCA CTF中,是最简单的web题,也是我唯一能做的web题。不过这个简单是相对的简单,实际上真还算挺难的了,里面的姿势在实际渗透测试中也可能用到,所以写篇文章记下也不算亏 0x01 题面 <?php $files = scandir ( './' ); foreach( $files as $file ) { if( is_file ( $file )){ if ( $file !== "index.php" ) { unlink ( $file ); } } } include_once( "fl3g.php" ); if(!isset( $_GET [ 'content' ]) || !isset( $_GET [ 'filename' ])) { highlight_file ( __FILE__ ); die(); } $content = $_GET [ 'content' ]; if( stristr ( $content , 'on' ) || stristr ( $content , 'html' ) || stristr ( $content , 'type' ) || stristr ( $content , 'flag' ) || stristr ( $content , 'upload' ) || stristr ( $content , 'file' )) { echo "Hacker" ; die(); } $filename = $_GET [ 'filename' ]; if( preg_match ( &