PATH:
opt
/
bitninja-waf3
/
coreruleset
/
rules
# ------------------------------------------------------------------------ # OWASP CRS ver.4.1.0 # Copyright (c) 2006-2020 Trustwave and contributors. All rights reserved. # Copyright (c) 2021-2024 CRS project. All rights reserved. # # The OWASP CRS is distributed under # Apache Software License (ASL) version 2 # Please see the enclosed LICENSE file for full details. # ------------------------------------------------------------------------ # # -= Paranoia Level 0 (empty) =- (apply unconditionally) # SecRule TX:DETECTION_PARANOIA_LEVEL "@lt 1" "id:930011,phase:1,pass,nolog,tag:'OWASP_CRS',ver:'OWASP_CRS/4.1.0',skipAfter:END-REQUEST-930-APPLICATION-ATTACK-LFI" SecRule TX:DETECTION_PARANOIA_LEVEL "@lt 1" "id:930012,phase:2,pass,nolog,tag:'OWASP_CRS',ver:'OWASP_CRS/4.1.0',skipAfter:END-REQUEST-930-APPLICATION-ATTACK-LFI" # # -= Paranoia Level 1 (default) =- (apply only when tx.detection_paranoia_level is sufficiently high: 1 or higher) # # # -=[ Directory Traversal Attacks ]=- # # Ref: https://github.com/wireghoul/dotdotpwn # # [ Encoded /../ Payloads ] # # Regular expression generated from regex-assembly/930100.ra. # To update the regular expression run the following shell script # (consult https://coreruleset.org/docs/development/regex_assembly/ for details): # crs-toolchain regex update 930100 # SecRule REQUEST_URI_RAW|ARGS|REQUEST_HEADERS|!REQUEST_HEADERS:Referer|FILES|XML:/* "@rx (?i)(?:[/\x5c]|%(?:2(?:f|5(?:2f|5c|c(?:1%259c|0%25af))|%46)|5c|c(?:0%(?:[2aq]f|5c|9v)|1%(?:[19p]c|8s|af))|(?:bg%q|(?:e|f(?:8%8)?0%8)0%80%a)f|u(?:221[56]|EFC8|F025|002f)|%3(?:2(?:%(?:%6|4)6|F)|5%%63)|1u)|0x(?:2f|5c))(?:\.(?:%0[01]|\?)?|\?\.?|%(?:2(?:(?:5(?:2|c0%25a))?e|%45)|c0(?:\.|%[256aef]e)|u(?:(?:ff0|002)e|2024)|%32(?:%(?:%6|4)5|E)|(?:e|f(?:(?:8|c%80)%8)?0%8)0%80%ae)|0x2e){2,3}(?:[/\x5c]|%(?:2(?:f|5(?:2f|5c|c(?:1%259c|0%25af))|%46)|5c|c(?:0%(?:[2aq]f|5c|9v)|1%(?:[19p]c|8s|af))|(?:bg%q|(?:e|f(?:8%8)?0%8)0%80%a)f|u(?:221[56]|EFC8|F025|002f)|%3(?:2(?:%(?:%6|4)6|F)|5%%63)|1u)|0x(?:2f|5c))" \ "id:930100,\ phase:2,\ block,\ capture,\ t:none,\ msg:'Path Traversal Attack (/../) or (/.../)',\ logdata:'Matched Data: %{TX.0} found within %{MATCHED_VAR_NAME}: %{MATCHED_VAR}',\ tag:'application-multi',\ tag:'language-multi',\ tag:'platform-multi',\ tag:'attack-lfi',\ tag:'paranoia-level/1',\ tag:'OWASP_CRS',\ tag:'capec/1000/255/153/126',\ ver:'OWASP_CRS/4.1.0',\ severity:'CRITICAL',\ setvar:'tx.inbound_anomaly_score_pl1=+%{tx.critical_anomaly_score}',\ setvar:'tx.lfi_score=+%{tx.critical_anomaly_score}'" # # [ Decoded /../ or /..;/ Payloads ] # # To prevent '..' from triggering, the regexp is split into two parts: # - ../ # - /.. # OR # - .../ # - /... # # Semicolon added to prevent path traversal via reverse proxy mapping '/..;/' (Tomcat) # SecRule REQUEST_URI|ARGS|REQUEST_HEADERS|!REQUEST_HEADERS:Referer|FILES|XML:/* "@rx (?:(?:^|[\x5c/;])\.{2,3}[\x5c/;]|[\x5c/;]\.{2,3}(?:[\x5c/;]|$))" \ "id:930110,\ phase:2,\ block,\ capture,\ t:none,t:utf8toUnicode,t:urlDecodeUni,t:removeNulls,t:cmdLine,\ msg:'Path Traversal Attack (/../) or (/.../)',\ logdata:'Matched Data: %{TX.0} found within %{MATCHED_VAR_NAME}: %{MATCHED_VAR}',\ tag:'application-multi',\ tag:'language-multi',\ tag:'platform-multi',\ tag:'attack-lfi',\ tag:'paranoia-level/1',\ tag:'OWASP_CRS',\ tag:'capec/1000/255/153/126',\ ver:'OWASP_CRS/4.1.0',\ severity:'CRITICAL',\ multiMatch,\ setvar:'tx.inbound_anomaly_score_pl1=+%{tx.critical_anomaly_score}',\ setvar:'tx.lfi_score=+%{tx.critical_anomaly_score}'" # # -=[ OS File Access ]=- # # We check for OS file access with the help of a local file with OS files data. # # Ref: https://github.com/lightos/Panoptic/blob/master/cases.xml # # If you wonder where support for Google OAuth2 has gone, see: # https://github.com/coreruleset/google-oauth2-plugin SecRule REQUEST_COOKIES|!REQUEST_COOKIES:/__utm/|REQUEST_COOKIES_NAMES|ARGS_NAMES|ARGS|XML:/* "@pmFromFile lfi-os-files.data" \ "id:930120,\ phase:2,\ block,\ capture,\ t:none,t:utf8toUnicode,t:urlDecodeUni,t:normalizePathWin,\ msg:'OS File Access Attempt',\ logdata:'Matched Data: %{TX.0} found within %{MATCHED_VAR_NAME}: %{MATCHED_VAR}',\ tag:'application-multi',\ tag:'language-multi',\ tag:'platform-multi',\ tag:'attack-lfi',\ tag:'paranoia-level/1',\ tag:'OWASP_CRS',\ tag:'capec/1000/255/153/126',\ tag:'PCI/6.5.4',\ ver:'OWASP_CRS/4.1.0',\ severity:'CRITICAL', chain" SecRule &TX:wp_admin_in "@eq 0" "chain,t:none" SecRule &TX:BN_CPANEL_CALL "@eq 0" \ "setvar:'tx.lfi_score=+%{tx.critical_anomaly_score}',\ setvar:'tx.inbound_anomaly_score_pl1=+%{tx.critical_anomaly_score}'" # # -=[ Restricted File Access ]=- # # Detects attempts to retrieve application source code, metadata, # credentials and version control history possibly reachable in a web root. # SecRule REQUEST_FILENAME "@pmFromFile restricted-files.data" \ "id:930130,\ phase:1,\ block,\ capture,\ t:none,t:utf8toUnicode,t:urlDecodeUni,t:normalizePathWin,\ msg:'Restricted File Access Attempt',\ logdata:'Matched Data: %{TX.0} found within %{MATCHED_VAR_NAME}: %{MATCHED_VAR}',\ tag:'application-multi',\ tag:'language-multi',\ tag:'platform-multi',\ tag:'attack-lfi',\ tag:'paranoia-level/1',\ tag:'OWASP_CRS',\ tag:'capec/1000/255/153/126',\ tag:'PCI/6.5.4',\ ver:'OWASP_CRS/4.1.0',\ severity:'CRITICAL',\ setvar:'tx.lfi_score=+%{tx.critical_anomaly_score}',\ setvar:'tx.inbound_anomaly_score_pl1=+%{tx.critical_anomaly_score}'" SecRule TX:DETECTION_PARANOIA_LEVEL "@lt 2" "id:930013,phase:1,pass,nolog,tag:'OWASP_CRS',ver:'OWASP_CRS/4.1.0',skipAfter:END-REQUEST-930-APPLICATION-ATTACK-LFI" SecRule TX:DETECTION_PARANOIA_LEVEL "@lt 2" "id:930014,phase:2,pass,nolog,tag:'OWASP_CRS',ver:'OWASP_CRS/4.1.0',skipAfter:END-REQUEST-930-APPLICATION-ATTACK-LFI" # # -= Paranoia Level 2 =- (apply only when tx.detection_paranoia_level is sufficiently high: 2 or higher) # # # -=[ OS File Access ]=- # # This is a stricter sibling of rule 930120. # This stricter sibling checks for OS file data in request headers referer and user-agent. # We check for OS file access with the help of a local file with OS files data. # # Ref: https://github.com/lightos/Panoptic/blob/master/cases.xml # SecRule REQUEST_HEADERS:Referer|REQUEST_HEADERS:User-Agent "@pmFromFile lfi-os-files.data" \ "id:930121,\ phase:1,\ block,\ capture,\ t:none,t:utf8toUnicode,t:urlDecodeUni,t:normalizePathWin,\ msg:'OS File Access Attempt in REQUEST_HEADERS',\ logdata:'Matched Data: %{TX.0} found within %{MATCHED_VAR_NAME}: %{MATCHED_VAR}',\ tag:'application-multi',\ tag:'language-multi',\ tag:'platform-multi',\ tag:'attack-lfi',\ tag:'paranoia-level/2',\ tag:'OWASP_CRS',\ tag:'capec/1000/255/153/126',\ tag:'PCI/6.5.4',\ ver:'OWASP_CRS/4.1.0',\ severity:'CRITICAL',\ setvar:'tx.lfi_score=+%{tx.critical_anomaly_score}',\ setvar:'tx.inbound_anomaly_score_pl2=+%{tx.critical_anomaly_score}'" SecRule TX:DETECTION_PARANOIA_LEVEL "@lt 3" "id:930015,phase:1,pass,nolog,tag:'OWASP_CRS',ver:'OWASP_CRS/4.1.0',skipAfter:END-REQUEST-930-APPLICATION-ATTACK-LFI" SecRule TX:DETECTION_PARANOIA_LEVEL "@lt 3" "id:930016,phase:2,pass,nolog,tag:'OWASP_CRS',ver:'OWASP_CRS/4.1.0',skipAfter:END-REQUEST-930-APPLICATION-ATTACK-LFI" # # -= Paranoia Level 3 =- (apply only when tx.detection_paranoia_level is sufficiently high: 3 or higher) # SecRule TX:DETECTION_PARANOIA_LEVEL "@lt 4" "id:930017,phase:1,pass,nolog,tag:'OWASP_CRS',ver:'OWASP_CRS/4.1.0',skipAfter:END-REQUEST-930-APPLICATION-ATTACK-LFI" SecRule TX:DETECTION_PARANOIA_LEVEL "@lt 4" "id:930018,phase:2,pass,nolog,tag:'OWASP_CRS',ver:'OWASP_CRS/4.1.0',skipAfter:END-REQUEST-930-APPLICATION-ATTACK-LFI" # # -= Paranoia Level 4 =- (apply only when tx.detection_paranoia_level is sufficiently high: 4 or higher) # # # -= Paranoia Levels Finished =- # SecMarker "END-REQUEST-930-APPLICATION-ATTACK-LFI"
[-] REQUEST-932-APPLICATION-ATTACK-RCE.conf
[edit]
[-] REQUEST-943-APPLICATION-ATTACK-SESSION-FIXATION.conf
[edit]
[-] ssrf.data
[edit]
[-] REQUEST-931-APPLICATION-ATTACK-RFI.conf
[edit]
[+]
..
[-] REQUEST-941-APPLICATION-ATTACK-XSS.conf
[edit]
[-] REQUEST-920-PROTOCOL-ENFORCEMENT.conf
[edit]
[-] REQUEST-949-BLOCKING-EVALUATION.conf
[edit]
[-] RESPONSE-999-EXCLUSION-RULES-AFTER-CRS.conf.example
[edit]
[-] REQUEST-922-MULTIPART-ATTACK.conf
[edit]
[-] web-shells-php.data
[edit]
[-] REQUEST-933-APPLICATION-ATTACK-PHP.conf
[edit]
[-] RESPONSE-953-DATA-LEAKAGES-PHP.conf
[edit]
[-] RESPONSE-950-DATA-LEAKAGES.conf
[edit]
[-] REQUEST-900-EXCLUSION-RULES-BEFORE-CRS.conf.example
[edit]
[-] sql-errors.data
[edit]
[-] restricted-files.data
[edit]
[-] restricted-upload.data
[edit]
[-] REQUEST-921-PROTOCOL-ATTACK.conf
[edit]
[-] REQUEST-913-SCANNER-DETECTION.conf
[edit]
[-] php-config-directives.data
[edit]
[-] RESPONSE-951-DATA-LEAKAGES-SQL.conf
[edit]
[-] php-variables.data
[edit]
[-] RESPONSE-954-DATA-LEAKAGES-IIS.conf
[edit]
[-] unix-shell.data
[edit]
[-] REQUEST-901-INITIALIZATION.conf
[edit]
[-] php-function-names-933151.data
[edit]
[-] iis-errors.data
[edit]
[-] REQUEST-911-METHOD-ENFORCEMENT.conf
[edit]
[-] RESPONSE-952-DATA-LEAKAGES-JAVA.conf
[edit]
[-] scanners-user-agents.data
[edit]
[-] RESPONSE-980-CORRELATION.conf
[edit]
[-] php-function-names-933150.data
[edit]
[-] REQUEST-944-APPLICATION-ATTACK-JAVA.conf
[edit]
[-] java-errors.data
[edit]
[-] windows-powershell-commands.data
[edit]
[-] REQUEST-942-APPLICATION-ATTACK-SQLI.conf
[edit]
[-] java-classes.data
[edit]
[-] php-errors-pl2.data
[edit]
[-] php-errors.data
[edit]
[-] REQUEST-905-COMMON-EXCEPTIONS.conf
[edit]
[-] RESPONSE-959-BLOCKING-EVALUATION.conf
[edit]
[-] REQUEST-930-APPLICATION-ATTACK-LFI.conf
[edit]
[-] RESPONSE-955-WEB-SHELLS.conf
[edit]
[-] java-code-leakages.data
[edit]
[-] REQUEST-934-APPLICATION-ATTACK-GENERIC.conf
[edit]
[-] lfi-os-files.data
[edit]