2025. 5. 21. 18:40 IT인터넷
modsecurity request_cookies 차단되는 경우
728x90
반응형
아래와 같이 request_cookies를 SQL INJECTION으로 차단하는 경우
/var/log/httpd/ssl_error_log:[Tue May 20 00:05:24 2025] [error] [client 164.55.242.106] ModSecurity: Access denied with code 403 (phase 2). Pattern match "(?i:(?:\\A|[^\\d])0x[a-f\\d]{3,}[a-f\\d]*)+" at REQUEST_COOKIES:PHPSESSID. [file "/etc/httpd/modsecurity.d/activated_rules/modsecurity_crs_41_sql_injection_attacks.conf"] [line "55"] [id "981260"] [rev "2"] [msg "SQL Hex Encoding Identified"] [data "Matched Data: J0Xb29 found within REQUEST_COOKIES:PHPSESSID: fUF8YhjYwrF-tvI-11zCMJ0Xb29"] [severity "CRITICAL"] [ver "OWASP_CRS/2.2.6"] [maturity "8"] [accuracy "8"] [tag "OWASP_CRS/WEB_ATTACK/SQL_INJECTION"] [tag "WASCTC/WASC-19"] [tag "OWASP_TOP_10/A1"] [tag "OWASP_AppSensor/CIE1"] [tag "PCI/6.5.2"] [hostname "www.d.com"] [uri "/document/korean/css/font.css"] [unique_id "aCtItNMglaEAAGHcczAAAAAN"] |
해당 접속건은 정상적인 것으로 판단되며 제외 설정 하면 된다.
# Rule 제거, ID사이 공백 구분 #modsecurity_crs_20_protocol_violations.conf SecRuleRemoveById 950xxx 950xxx 958xxx <--- 탐지에서 제외되는 룰 ..... #modsecurity_crs_41_sql_injection_attacks.conf # 제외시킬 룰이 여러개일 경우 " - "로 여러개를 지정 SecRuleRemoveById 950xxx 959xxx "981242 - 981248" 981257 # 룰을 제거하지 않고 특정 요청에 대해서만 제외 #SecRuleUpdateTargetById RuleID !REQUEST_COOKIES,!REQUEST_COOKIES_NAMES SecRuleUpdateTargetById 950xxx !ARGS:title,!REQUEST_COOKIES SecRuleUpdateTargetById 950xxx !ARGS:url SecRuleUpdateTargetById 973xxx!ARGS:title,!ARGS:cId,!REQUEST_COOKIES SecRuleUpdateTargetById 950xxx !REQUEST_COOKIES,!REQUEST_COOKIES_NAMES,!ARGS_NAMES:object_type SecRuleUpdateTargetById 981xxx !REQUEST_COOKIES,!REQUEST_COOKIES_NAMES |
참고: https://blog.naver.com/kf80s/220763330824 |
728x90
SMALL
'IT인터넷' 카테고리의 다른 글
HP서버(Array P440ar)에서 RAID-1 디스크 교체 (300G -> 600G)후 온라인에서 용량을 늘릴 수 있을까요? (0) | 2025.04.08 |
---|---|
[스크랩] HPE 서버에 장착된 HDD 교체 및 용량 확장 방법 (리눅스/윈도우) (0) | 2025.04.08 |
시스코 스위치 기술지원 (0) | 2025.02.03 |
보안이슈 - 체납세액 징수 관련 정부 사칭 피싱(스미싱, 피싱메일) 주의 권고 (0) | 2024.11.25 |
짜증 유발 쿠키 팝업 차단 방법 (2) | 2024.07.20 |