[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

文章来自:http://www.cnblogs.com/natian-ws/p/7242477.html
© 2021 jiaocheng.bubufx.com  联系我们
ICP备案:鲁ICP备09046678号-3