[php代码审计] php://filter

 

筛选过滤应用: 

1、 字符串过滤器:

  • string.rot13 对字符串执行ROT13转换
  • string.toupper转换为大写
  • string.tolower 转换为小写
  • string.strip_tags去除html和php标记

2、 转换过滤器:

  • convert.base64-encode & convert.base64-decode base64编码/解码
  • convert.quoted-printable-encode & convert.quoted-printable-decode将 quoted-printable 字符串转换为 8-bit 字符串

3、 压缩过滤器:

  • zlib.deflate zlib.inflate
  • bzip2.compress bzip2.decompress

4、 加密过滤器:

  •  mcrypt.tripledes和mdecrypt.tripledes等
readfile("php://filter/read=string.toupper/resource=http://www.example.com");//将www.example.com中的内容转换为大写后输出

file_put_contents("php://filter/write=string.rot13/resource=example.txt","Hello World");//将字符串”hello world”经过rot13编码后写入example.txt

 

例子:

url:

/index.php?a=php://filter/read=convert.base64-encode/resource=index2.php

index.php:

<?php
include($_GET['a']);
?>

结果如图:

 https://www.leavesongs.com/PENETRATION/php-filter-magic.html

posted @   S3c0ldW4ng  阅读(1988)  评论(0编辑  收藏  举报
编辑推荐:
· 基于Microsoft.Extensions.AI核心库实现RAG应用
· Linux系列:如何用heaptrack跟踪.NET程序的非托管内存泄露
· 开发者必知的日志记录最佳实践
· SQL Server 2025 AI相关能力初探
· Linux系列:如何用 C#调用 C方法造成内存泄露
阅读排行:
· 无需6万激活码!GitHub神秘组织3小时极速复刻Manus,手把手教你使用OpenManus搭建本
· Manus爆火,是硬核还是营销?
· 终于写完轮子一部分:tcp代理 了,记录一下
· 别再用vector<bool>了!Google高级工程师:这可能是STL最大的设计失误
· 单元测试从入门到精通
点击右上角即可分享
微信分享提示