apache 当发布以问号结尾的URL时,网站返回403

qlckcl4x  于 2023-05-23  发布在  Apache
关注(0)|答案(1)|浏览(197)

我一直有一个独特的问题,每当我发布一个以?结尾的URL时,页面都会返回403错误。
下面是我的示例代码:

page.php:

<?php
print_r($_POST);
?>

POST to page.php:

  • https://google.com/?ref=123返回200 Array([url] => https://google.com/?ref=123)
  • https://google.com/?ref=123?返回403
  • http ? abc返回200 Array([url] => http ? abc)
  • http ?返回403
  • abcd ?返回200 Array([url] => abcd ?)

为什么如果我的URL包含http并以问号结尾,它会抛出403错误?
我正在运行CentOS Linux V7、PHP v7.2.10和Apache V2.4.6

iswrvxsc

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中,我注解掉了匹配行

相关问题