[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 @ 2017-07-26 22:57  那天ws  阅读(1918)  评论(0编辑  收藏  举报