我一直有一个独特的问题,每当我发布一个以?
结尾的URL时,页面都会返回403错误。
下面是我的示例代码:
page.php:
<?php
print_r($_POST);
?>
POST to page.php:
https://google.com/?ref=123
返回200Array([url] => https://google.com/?ref=123)
https://google.com/?ref=123?
返回403http ? abc
返回200Array([url] => http ? abc)
http ?
返回403abcd ?
返回200Array([url] => abcd ?)
为什么如果我的URL包含http
并以问号结尾,它会抛出403错误?
我正在运行CentOS Linux V7、PHP v7.2.10和Apache V2.4.6
1条答案
按热度按时间iswrvxsc1#
发现了我的问题:
在
/usr/local/apache/domlogs/example.com.error.log
中,有几行这样说:[Mon May 22 17:42:53.522519 2023] [:error] [pid 886:tid 140380883953###] [client IP:15555] [client IP] ModSecurity:访问被拒绝,代码为403(第2阶段)。“endsWith/modules/paypal/express_checkout/payment.php”与“REQUEST_FILENAME”的匹配是必需的。[file“/usr/local/apache/modsecurity-cwaf/rules/02_Global_Generic.conf”] [line“29”] [id“211120”] [rev“12”] [msg“COMODO WAF:远程文件包含攻击||example.com| F| 2”] [data“匹配数据:https?在REQUEST_FILENAME中找到:/path/to/file.php”] [severity“CRITICAL”] [tag“CWAF”] [tag“Generic”] [hostname“example.com“] [uri“/path/to/file.php”] [unique_id“ZGvh3ZWCyBfOi8SV7cODxwAAAAI”],referer:https://example.com/path/to/file.php
在
/usr/local/apache/modsecurity-cwaf/rules/02_Global_Generic.conf
中,我注解掉了匹配行