博客
关于我
Bugku CTF-web8 文件包含
阅读量:669 次
发布时间:2019-03-15

本文共 509 字,大约阅读时间需要 1 分钟。

为了可以轻松找到flag,我需要分析CTF问题中的文件包含漏洞,并理解如何通过特定的文件路径或参数来触发flag的加载。

首先,文件包含漏洞在PHP中通常是通过include或require函数来触发的。我需要查看站点的src文件夹,找到其中的PHP源码,尤其是处理文件包含的相关部分。

接下来,确认代码中是否存在类似以下代码的脚本:

如果找到类似的代码,可以通过修改$filename的值来指定要加载的文件。例如,将$filename设为'flag.php',就可以让服务器加载这个文件。

另外,根据问题提示,可以通过在URL后添加参数来触发文件包含。例如:

http://target-site.com/?hello=file('flag.php')

这种方法可能直接将flag.php的内容输出到网页上,或者作为hello变量返回。

在实际操作中,我需要确保输入的URL正确无误,并且编码是否正确。如果遇到权限问题,可能需要检查服务器-side的设置,比如是否启用了执行脚本功能。

综上所述,首先仔细查看源代码,找到文件包含的调用点,第二步通过修改文件路径或参数来触发flag的加载,从而解锁CTF的目标。

转载地址:http://gahmz.baihongyu.com/

你可能感兴趣的文章
no connection could be made because the target machine actively refused it.问题解决
查看>>
No Datastore Session bound to thread, and configuration does not allow creation of non-transactional
查看>>
No fallbackFactory instance of type class com.ruoyi---SpringCloud Alibaba_若依微服务框架改造---工作笔记005
查看>>
No Feign Client for loadBalancing defined. Did you forget to include spring-cloud-starter-loadbalanc
查看>>
No mapping found for HTTP request with URI [/...] in DispatcherServlet with name ...的解决方法
查看>>
No mapping found for HTTP request with URI [/logout.do] in DispatcherServlet with name 'springmvc'
查看>>
No module named 'crispy_forms'等使用pycharm开发
查看>>
No module named cv2
查看>>
No module named tensorboard.main在安装tensorboardX的时候遇到的问题
查看>>
No module named ‘MySQLdb‘错误解决No module named ‘MySQLdb‘错误解决
查看>>
No new migrations found. Your system is up-to-date.
查看>>
No qualifying bean of type XXX found for dependency XXX.
查看>>
No resource identifier found for attribute 'srcCompat' in package的解决办法
查看>>
no session found for current thread
查看>>
No toolchains found in the NDK toolchains folder for ABI with prefix: mips64el-linux-android
查看>>
NO.23 ZenTaoPHP目录结构
查看>>
NO32 网络层次及OSI7层模型--TCP三次握手四次断开--子网划分
查看>>
NoClassDefFoundError: org/springframework/boot/context/properties/ConfigurationBeanFactoryMetadata
查看>>
Node JS: < 一> 初识Node JS
查看>>
Node-RED中使用JSON数据建立web网站
查看>>