php://stdin php://stdout php://sterr php://input php://output php://filter
php://stdin
从控制台读取输入
<?php
$f = fopen('php://stdin','r');
while(!feof($f)){
echo 'output:'.fgets($f);
}
?>
php://stdout
输出 类似于 echo
<?php
$f = fopen('php://stdout','w');
fwrite($f,'test');
fclose($f);
?>
php://stderr
和 php://stdout 一样
php://input
读取 POST 数据 作为 php 代码执行
<?php
echo file_get_contents('php://input');
?>
php://output
输出
<?php
$f = fopen('php://output','w');
fwrite($f,'test');
fclose($f)
?>
php://filter
php 元封装器 类似于 readfile() file_get_contents()
读取文件内容
这个在 ctf 中用的比较多
常用过滤器
string.rot13
string.toupper
string.tolower
string.strip_tags
convert.base64-encode
convert.base64-decode
convert.quoted-printable-encode
convert.quoted-printable-decode
代码
<?php
echo file_get_contents($_GET['file']);
?>
base64 encode
tolower
- By:X1r0z[exp10it.cn]
免责声明:文章中涉及的程序(方法)可能带有攻击性,仅供安全研究与教学之用,读者将其信息做其他用途,由读者承担全部法律及连带责任,本站不承担任何法律及连带责任;如有问题可邮件联系(建议使用企业邮箱或有效邮箱,避免邮件被拦截,联系方式见首页),望知悉。
- 左青龙
- 微信扫一扫
-
- 右白虎
- 微信扫一扫
-
评论