欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页  >  后端开发

php中allow_url_include的应用分析

程序员文章站 2022-04-28 15:00:52
...
  1. // Insecure Include

  2. // The following Include statement will
  3. // include and execute everything POSTed
  4. // to the server
  5. include "php://input";

  6. ?>
复制代码

例2: Use data: to Include arbitrary code

  1. // Insecure Include

  2. // The following Include statement will
  3. // include and execute the base64 encoded
  4. // payload. Here this is just phpinfo()
  5. include "data:;base64,PD9waHAgcGhwaW5mbygpOz8+";

  6. ?>
复制代码

把这些放到运算里将会发现既不是url_allow_fopen也不是url_allor_include 被保障。 只是因为过滤器很少对矢量进行过滤。如果要完全解决这个URL include vulnerabilities的方法则需要应用Suhosin扩展。