phpinfo 页面信息利用
参考:https://www.secpulse.com/archives/117762.html
- system
获取操作系统具体版本,提权

- Server API
依稀记得做题用到这个条件限制,记不太清楚了…
- Registered PHP Streams
已注册的 PHP 流
可以利用 php 伪协议

- Registered Stream Filters
可使用的过滤器

- 伪协议利用条件
allow_url_fopen
allow_url_include
- extension_dir
php 扩展的路径
- disable_functions
禁用函数列表
- open_basedir
将用户可操作的文件限制在某目录下
php 读取文件函数
参考:http://t.csdn.cn/ZPksp
1 2 3 4 5 6 7 8 9
| file_get_contents // * fread fgets fgetss file parse_ini_file readfile // * highlight_file // * show_source // *
|
- file_get_contents
1
| echo file_get_contents('flag.txt');
|
- fread
1 2 3
| $file = fopen("flag.txt","rb"); echo fread($file,1024); // 参数为 resource 类型 fclose($file);
|
- fgets
1 2 3
| $file = fopen("flag.txt","rb"); echo fread($file,1024); // 参数为 resource 类型 fclose($file);
|
- fgetss
1 2 3
| $file = fopen("flag.txt","r"); echo fgetss($file, 4096); // 过滤掉了 HTML 和 PHP 标签 fclose($file);
|
- file
1
| print_r(file('flag.txt'));
|
- parse_ini_file
1
| echo parse_ini_file("flag.txt");
|
- readfile
1
| echo readfile("flag.txt");
|
- highlight_file
1
| highlight_file('flag.txt');
|
- show_source
1
| show_source('flag.txt');
|