doucuodan0897 2013-12-06 15:05
浏览 126
已采纳

使用disable_functions和disable_classes极大地限制函数和类的成本和好处是什么?

I have performed some research and began building a complete list of PHP 5's builtin functions as documented on the project site.

What is the performance cost of leveraging disable_functions and/or disable_classes?

How do these global settings work?

Note that I came across a very valuable list of exploitable functions and the RIPS scanner.

However, it does seem more complete to actually block all functions and classes that aren't used in the PHP code.

  • 写回答

1条回答 默认 最新

  • dongqi8863 2014-08-20 17:50
    关注

    disable_functions removes function handlers (pointers to actual function implementations) from a PHP function list and replaces it with a handler to a dummy function which shows the warning instead:

    Warning: system() has been disabled for security reasons in Command line code on line 1
    

    It is just a processing time for PHP (every time it is invoked - a script is accessed) to do this replacement.

    I'm not quite sure about disable_classes as I've never used it.

    However, please DO NOT consider this a security feature - check this out for more info.

    Any bug in PHP (overflows, use-after-free and similar) will allow a potential attacker to tamper with the process memory and fix the function handlers to point to the correct function handlers which are still in memory - this results into re-enabling the disabled functions.

    Always separate in shared hosting environments. See my answer to another similar question.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥20 Cotex M3的调试和程序执行方式是什么样的?
  • ¥15 用matlab 设计一个不动点迭代法求解非线性方程组的代码
  • ¥15 牛顿斯科特系数表表示
  • ¥15 arduino 步进电机
  • ¥20 程序进入HardFault_Handler
  • ¥15 oracle集群安装出bug
  • ¥15 关于#python#的问题:自动化测试
  • ¥20 问题请教!vue项目关于Nginx配置nonce安全策略的问题
  • ¥15 教务系统账号被盗号如何追溯设备
  • ¥20 delta降尺度方法,未来数据怎么降尺度