Phpnuke module.php 存在跨脚本执行漏洞发布时间:2001-12-18 更新时间:2001-12-18 严重程度:中 威胁程度:欺骗 错误类型:输入验证错误 利用方式:服务器模式 受影响系统 Phpnuke module.php详细描述 由于在module.php中缺少对用户的检查,和PHP没有在错误报告中很好的处理脚本 可以导致跨脚本漏洞发生。 测试代码 http://host.com/modules.php?op=modload&name=XForum&file=[hostile javascript]&fid=2 这里的Hostile 脚本可以是: {script}alert(document.cookie);{/script} 注意防止执行把"<>"换成了"{}". php错误报告就会报告如下: ---php error report--- Warning: Failed opening 'modules/XForum/.php' for inclusion (include_path='') in /home/foo/htdocs/modules.php on line 27 ---php error report--- 当显示出错信息的时候,它也处理了Hostile脚本。 解决方案 临时方法: 修改module.php: error_reporting(0); //增加这行,关闭error_reporting //original file switch($op) { case "modload":/ if (!isset($mainfile)) { include("mainfile.php"); } if (ereg("\.\.",$name) || ereg("\.\.",$file)) { echo "You are so cool"; break; } else { include("modules/$name/$file.php"); } break; default: die ("Sorry, you can't access this file directly..."); break; } ---end of module.php--- 相关信息 |