<?phpnamespaceapp\index\controller;classIndex{publicfunctionindex($run=[]){highlight_file(__FILE__);echo'<h1>Welcome to CTFSHOW</h1></br>';echo'Powered by PHPthink5.0.2</br>';echodirname(__FILE__);if(!empty($run[2])){echo'ZmxhZyBpcyBub3QgaGVyZSBidXQgaXQgaXMgaW4gZmxhZy50eHQ=';}if(!empty($run[1])){unserialize($run[1]);}}// hint:/index/index/backdoor
publicfunctionbackdoor(){if(!file_exists(dirname(__FILE__).'/../../'."install.lock")){echo"Try to post CMD arguments".'<br/>';$data=input('post.');if(!preg_match('/flag/i',$data['cmd'])){$cmd=escapeshellarg($data['cmd']);$cmd='cat '.$cmd;echo$cmd;system($cmd);}else{echo"No No No";}}else{echodirname(__FILE__).'/../../'."install.lock has not been deleted";}}}WelcometoCTFSHOWPoweredbyPHPthink5.0.2/var/www/html/application/index/controller
首先解码base64知道
1
2
3
ZmxhZyBpcyBub3QgaGVyZSBidXQgaXQgaXMgaW4gZmxhZy50eHQ=
flag is not here but it is in flag.txt