@abtnode/router-provider 1.16.38-beta-20250115-235439-bb5a1c1b → 1.16.38-beta-20250118-033334-2da05ae8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (51) hide show
  1. package/lib/nginx/includes/security/crs4/rules/REQUEST-900-EXCLUSION-RULES-BEFORE-CRS.conf.example +200 -0
  2. package/lib/nginx/includes/security/crs4/rules/REQUEST-901-INITIALIZATION.conf +470 -0
  3. package/lib/nginx/includes/security/crs4/rules/REQUEST-905-COMMON-EXCEPTIONS.conf +57 -0
  4. package/lib/nginx/includes/security/crs4/rules/REQUEST-911-METHOD-ENFORCEMENT.conf +76 -0
  5. package/lib/nginx/includes/security/crs4/rules/REQUEST-913-SCANNER-DETECTION.conf +86 -0
  6. package/lib/nginx/includes/security/crs4/rules/REQUEST-920-PROTOCOL-ENFORCEMENT.conf +1915 -0
  7. package/lib/nginx/includes/security/crs4/rules/REQUEST-921-PROTOCOL-ATTACK.conf +558 -0
  8. package/lib/nginx/includes/security/crs4/rules/REQUEST-922-MULTIPART-ATTACK.conf +120 -0
  9. package/lib/nginx/includes/security/crs4/rules/REQUEST-930-APPLICATION-ATTACK-LFI.conf +203 -0
  10. package/lib/nginx/includes/security/crs4/rules/REQUEST-931-APPLICATION-ATTACK-RFI.conf +189 -0
  11. package/lib/nginx/includes/security/crs4/rules/REQUEST-932-APPLICATION-ATTACK-RCE.conf +1875 -0
  12. package/lib/nginx/includes/security/crs4/rules/REQUEST-933-APPLICATION-ATTACK-PHP.conf +774 -0
  13. package/lib/nginx/includes/security/crs4/rules/REQUEST-934-APPLICATION-ATTACK-GENERIC.conf +366 -0
  14. package/lib/nginx/includes/security/crs4/rules/REQUEST-941-APPLICATION-ATTACK-XSS.conf +1071 -0
  15. package/lib/nginx/includes/security/crs4/rules/REQUEST-942-APPLICATION-ATTACK-SQLI.conf +1978 -0
  16. package/lib/nginx/includes/security/crs4/rules/REQUEST-943-APPLICATION-ATTACK-SESSION-FIXATION.conf +132 -0
  17. package/lib/nginx/includes/security/crs4/rules/REQUEST-944-APPLICATION-ATTACK-JAVA.conf +463 -0
  18. package/lib/nginx/includes/security/crs4/rules/REQUEST-949-BLOCKING-EVALUATION.conf +270 -0
  19. package/lib/nginx/includes/security/crs4/rules/RESPONSE-950-DATA-LEAKAGES.conf +156 -0
  20. package/lib/nginx/includes/security/crs4/rules/RESPONSE-951-DATA-LEAKAGES-SQL.conf +417 -0
  21. package/lib/nginx/includes/security/crs4/rules/RESPONSE-952-DATA-LEAKAGES-JAVA.conf +108 -0
  22. package/lib/nginx/includes/security/crs4/rules/RESPONSE-953-DATA-LEAKAGES-PHP.conf +158 -0
  23. package/lib/nginx/includes/security/crs4/rules/RESPONSE-954-DATA-LEAKAGES-IIS.conf +152 -0
  24. package/lib/nginx/includes/security/crs4/rules/RESPONSE-955-WEB-SHELLS.conf +558 -0
  25. package/lib/nginx/includes/security/crs4/rules/RESPONSE-959-BLOCKING-EVALUATION.conf +280 -0
  26. package/lib/nginx/includes/security/crs4/rules/RESPONSE-980-CORRELATION.conf +138 -0
  27. package/lib/nginx/includes/security/crs4/rules/RESPONSE-999-EXCLUSION-RULES-AFTER-CRS.conf.example +76 -0
  28. package/lib/nginx/includes/security/crs4/rules/iis-errors.data +59 -0
  29. package/lib/nginx/includes/security/crs4/rules/java-classes.data +64 -0
  30. package/lib/nginx/includes/security/crs4/rules/java-code-leakages.data +17 -0
  31. package/lib/nginx/includes/security/crs4/rules/java-errors.data +10 -0
  32. package/lib/nginx/includes/security/crs4/rules/lfi-os-files.data +722 -0
  33. package/lib/nginx/includes/security/crs4/rules/php-config-directives.data +571 -0
  34. package/lib/nginx/includes/security/crs4/rules/php-errors-pl2.data +7 -0
  35. package/lib/nginx/includes/security/crs4/rules/php-errors.data +2147 -0
  36. package/lib/nginx/includes/security/crs4/rules/php-function-names-933150.data +245 -0
  37. package/lib/nginx/includes/security/crs4/rules/php-function-names-933151.data +2201 -0
  38. package/lib/nginx/includes/security/crs4/rules/php-variables.data +30 -0
  39. package/lib/nginx/includes/security/crs4/rules/restricted-files.data +284 -0
  40. package/lib/nginx/includes/security/crs4/rules/restricted-upload.data +177 -0
  41. package/lib/nginx/includes/security/crs4/rules/scanners-user-agents.data +119 -0
  42. package/lib/nginx/includes/security/crs4/rules/sql-errors.data +172 -0
  43. package/lib/nginx/includes/security/crs4/rules/ssrf.data +177 -0
  44. package/lib/nginx/includes/security/crs4/rules/unix-shell.data +670 -0
  45. package/lib/nginx/includes/security/crs4/rules/web-shells-php.data +167 -0
  46. package/lib/nginx/includes/security/crs4/rules/windows-powershell-commands.data +425 -0
  47. package/lib/nginx/includes/security/unicode.mapping +96 -0
  48. package/lib/nginx/index.js +50 -3
  49. package/lib/nginx/templates/security/crs4/crs-setup.conf.js +857 -0
  50. package/lib/nginx/templates/security/modsecurity.conf.js +244 -0
  51. package/package.json +7 -6
@@ -0,0 +1,203 @@
1
+ # ------------------------------------------------------------------------
2
+ # OWASP CRS ver.4.9.0
3
+ # Copyright (c) 2006-2020 Trustwave and contributors. All rights reserved.
4
+ # Copyright (c) 2021-2024 CRS project. All rights reserved.
5
+ #
6
+ # The OWASP CRS is distributed under
7
+ # Apache Software License (ASL) version 2
8
+ # Please see the enclosed LICENSE file for full details.
9
+ # ------------------------------------------------------------------------
10
+
11
+ #
12
+ # -= Paranoia Level 0 (empty) =- (apply unconditionally)
13
+ #
14
+
15
+
16
+
17
+ SecRule TX:DETECTION_PARANOIA_LEVEL "@lt 1" "id:930011,phase:1,pass,nolog,tag:'OWASP_CRS',ver:'OWASP_CRS/4.9.0',skipAfter:END-REQUEST-930-APPLICATION-ATTACK-LFI"
18
+ SecRule TX:DETECTION_PARANOIA_LEVEL "@lt 1" "id:930012,phase:2,pass,nolog,tag:'OWASP_CRS',ver:'OWASP_CRS/4.9.0',skipAfter:END-REQUEST-930-APPLICATION-ATTACK-LFI"
19
+ #
20
+ # -= Paranoia Level 1 (default) =- (apply only when tx.detection_paranoia_level is sufficiently high: 1 or higher)
21
+ #
22
+
23
+ #
24
+ # -=[ Directory Traversal Attacks ]=-
25
+ #
26
+ # Ref: https://github.com/wireghoul/dotdotpwn
27
+ #
28
+ # [ Encoded /../ Payloads ]
29
+ #
30
+ # Regular expression generated from regex-assembly/930100.ra.
31
+ # To update the regular expression run the following shell script
32
+ # (consult https://coreruleset.org/docs/development/regex_assembly/ for details):
33
+ # crs-toolchain regex update 930100
34
+ #
35
+ 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))" \
36
+ "id:930100,\
37
+ phase:2,\
38
+ block,\
39
+ capture,\
40
+ t:none,\
41
+ msg:'Path Traversal Attack (/../) or (/.../)',\
42
+ logdata:'Matched Data: %{TX.0} found within %{MATCHED_VAR_NAME}: %{MATCHED_VAR}',\
43
+ tag:'application-multi',\
44
+ tag:'language-multi',\
45
+ tag:'platform-multi',\
46
+ tag:'attack-lfi',\
47
+ tag:'paranoia-level/1',\
48
+ tag:'OWASP_CRS',\
49
+ tag:'capec/1000/255/153/126',\
50
+ ver:'OWASP_CRS/4.9.0',\
51
+ severity:'CRITICAL',\
52
+ setvar:'tx.inbound_anomaly_score_pl1=+%{tx.critical_anomaly_score}',\
53
+ setvar:'tx.lfi_score=+%{tx.critical_anomaly_score}'"
54
+
55
+ #
56
+ # [ Decoded /../ or /..;/ Payloads ]
57
+ #
58
+ # To prevent '..' from triggering, the regexp is split into two parts:
59
+ # - ../
60
+ # - /..
61
+ # OR
62
+ # - .../
63
+ # - /...
64
+ #
65
+ # Semicolon added to prevent path traversal via reverse proxy mapping '/..;/' (Tomcat)
66
+ #
67
+ SecRule REQUEST_URI|ARGS|REQUEST_HEADERS|!REQUEST_HEADERS:Referer|FILES|XML:/* "@rx (?:(?:^|[\x5c/;])\.{2,3}[\x5c/;]|[\x5c/;]\.{2,3}(?:[\x5c/;]|$))" \
68
+ "id:930110,\
69
+ phase:2,\
70
+ block,\
71
+ capture,\
72
+ t:none,t:utf8toUnicode,t:urlDecodeUni,t:removeNulls,t:cmdLine,\
73
+ msg:'Path Traversal Attack (/../) or (/.../)',\
74
+ logdata:'Matched Data: %{TX.0} found within %{MATCHED_VAR_NAME}: %{MATCHED_VAR}',\
75
+ tag:'application-multi',\
76
+ tag:'language-multi',\
77
+ tag:'platform-multi',\
78
+ tag:'attack-lfi',\
79
+ tag:'paranoia-level/1',\
80
+ tag:'OWASP_CRS',\
81
+ tag:'capec/1000/255/153/126',\
82
+ ver:'OWASP_CRS/4.9.0',\
83
+ severity:'CRITICAL',\
84
+ multiMatch,\
85
+ setvar:'tx.inbound_anomaly_score_pl1=+%{tx.critical_anomaly_score}',\
86
+ setvar:'tx.lfi_score=+%{tx.critical_anomaly_score}'"
87
+
88
+ #
89
+ # -=[ OS File Access ]=-
90
+ #
91
+ # We check for OS file access with the help of a local file with OS files data.
92
+ #
93
+ # Ref: https://github.com/lightos/Panoptic/blob/master/cases.xml
94
+ #
95
+ # If you wonder where support for Google OAuth2 has gone, see:
96
+ # https://github.com/coreruleset/google-oauth2-plugin
97
+ SecRule REQUEST_COOKIES|!REQUEST_COOKIES:/__utm/|REQUEST_COOKIES_NAMES|ARGS_NAMES|ARGS|XML:/* "@pmFromFile lfi-os-files.data" \
98
+ "id:930120,\
99
+ phase:2,\
100
+ block,\
101
+ capture,\
102
+ t:none,t:utf8toUnicode,t:urlDecodeUni,t:normalizePathWin,\
103
+ msg:'OS File Access Attempt',\
104
+ logdata:'Matched Data: %{TX.0} found within %{MATCHED_VAR_NAME}: %{MATCHED_VAR}',\
105
+ tag:'application-multi',\
106
+ tag:'language-multi',\
107
+ tag:'platform-multi',\
108
+ tag:'attack-lfi',\
109
+ tag:'paranoia-level/1',\
110
+ tag:'OWASP_CRS',\
111
+ tag:'capec/1000/255/153/126',\
112
+ tag:'PCI/6.5.4',\
113
+ ver:'OWASP_CRS/4.9.0',\
114
+ severity:'CRITICAL',\
115
+ setvar:'tx.lfi_score=+%{tx.critical_anomaly_score}',\
116
+ setvar:'tx.inbound_anomaly_score_pl1=+%{tx.critical_anomaly_score}'"
117
+
118
+ #
119
+ # -=[ Restricted File Access ]=-
120
+ #
121
+ # Detects attempts to retrieve application source code, metadata,
122
+ # credentials and version control history possibly reachable in a web root.
123
+ #
124
+ SecRule REQUEST_FILENAME "@pmFromFile restricted-files.data" \
125
+ "id:930130,\
126
+ phase:1,\
127
+ block,\
128
+ capture,\
129
+ t:none,t:utf8toUnicode,t:urlDecodeUni,t:normalizePathWin,\
130
+ msg:'Restricted File Access Attempt',\
131
+ logdata:'Matched Data: %{TX.0} found within %{MATCHED_VAR_NAME}: %{MATCHED_VAR}',\
132
+ tag:'application-multi',\
133
+ tag:'language-multi',\
134
+ tag:'platform-multi',\
135
+ tag:'attack-lfi',\
136
+ tag:'paranoia-level/1',\
137
+ tag:'OWASP_CRS',\
138
+ tag:'capec/1000/255/153/126',\
139
+ tag:'PCI/6.5.4',\
140
+ ver:'OWASP_CRS/4.9.0',\
141
+ severity:'CRITICAL',\
142
+ setvar:'tx.lfi_score=+%{tx.critical_anomaly_score}',\
143
+ setvar:'tx.inbound_anomaly_score_pl1=+%{tx.critical_anomaly_score}'"
144
+
145
+
146
+
147
+ SecRule TX:DETECTION_PARANOIA_LEVEL "@lt 2" "id:930013,phase:1,pass,nolog,tag:'OWASP_CRS',ver:'OWASP_CRS/4.9.0',skipAfter:END-REQUEST-930-APPLICATION-ATTACK-LFI"
148
+ SecRule TX:DETECTION_PARANOIA_LEVEL "@lt 2" "id:930014,phase:2,pass,nolog,tag:'OWASP_CRS',ver:'OWASP_CRS/4.9.0',skipAfter:END-REQUEST-930-APPLICATION-ATTACK-LFI"
149
+ #
150
+ # -= Paranoia Level 2 =- (apply only when tx.detection_paranoia_level is sufficiently high: 2 or higher)
151
+ #
152
+
153
+ #
154
+ # -=[ OS File Access ]=-
155
+ #
156
+ # This is a stricter sibling of rule 930120.
157
+ # This stricter sibling checks for OS file data in request headers referer and user-agent.
158
+ # We check for OS file access with the help of a local file with OS files data.
159
+ #
160
+ # Ref: https://github.com/lightos/Panoptic/blob/master/cases.xml
161
+ #
162
+ SecRule REQUEST_HEADERS:Referer|REQUEST_HEADERS:User-Agent "@pmFromFile lfi-os-files.data" \
163
+ "id:930121,\
164
+ phase:1,\
165
+ block,\
166
+ capture,\
167
+ t:none,t:utf8toUnicode,t:urlDecodeUni,t:normalizePathWin,\
168
+ msg:'OS File Access Attempt in REQUEST_HEADERS',\
169
+ logdata:'Matched Data: %{TX.0} found within %{MATCHED_VAR_NAME}: %{MATCHED_VAR}',\
170
+ tag:'application-multi',\
171
+ tag:'language-multi',\
172
+ tag:'platform-multi',\
173
+ tag:'attack-lfi',\
174
+ tag:'paranoia-level/2',\
175
+ tag:'OWASP_CRS',\
176
+ tag:'capec/1000/255/153/126',\
177
+ tag:'PCI/6.5.4',\
178
+ ver:'OWASP_CRS/4.9.0',\
179
+ severity:'CRITICAL',\
180
+ setvar:'tx.lfi_score=+%{tx.critical_anomaly_score}',\
181
+ setvar:'tx.inbound_anomaly_score_pl2=+%{tx.critical_anomaly_score}'"
182
+
183
+
184
+ SecRule TX:DETECTION_PARANOIA_LEVEL "@lt 3" "id:930015,phase:1,pass,nolog,tag:'OWASP_CRS',ver:'OWASP_CRS/4.9.0',skipAfter:END-REQUEST-930-APPLICATION-ATTACK-LFI"
185
+ SecRule TX:DETECTION_PARANOIA_LEVEL "@lt 3" "id:930016,phase:2,pass,nolog,tag:'OWASP_CRS',ver:'OWASP_CRS/4.9.0',skipAfter:END-REQUEST-930-APPLICATION-ATTACK-LFI"
186
+ #
187
+ # -= Paranoia Level 3 =- (apply only when tx.detection_paranoia_level is sufficiently high: 3 or higher)
188
+ #
189
+
190
+
191
+
192
+ SecRule TX:DETECTION_PARANOIA_LEVEL "@lt 4" "id:930017,phase:1,pass,nolog,tag:'OWASP_CRS',ver:'OWASP_CRS/4.9.0',skipAfter:END-REQUEST-930-APPLICATION-ATTACK-LFI"
193
+ SecRule TX:DETECTION_PARANOIA_LEVEL "@lt 4" "id:930018,phase:2,pass,nolog,tag:'OWASP_CRS',ver:'OWASP_CRS/4.9.0',skipAfter:END-REQUEST-930-APPLICATION-ATTACK-LFI"
194
+ #
195
+ # -= Paranoia Level 4 =- (apply only when tx.detection_paranoia_level is sufficiently high: 4 or higher)
196
+ #
197
+
198
+
199
+
200
+ #
201
+ # -= Paranoia Levels Finished =-
202
+ #
203
+ SecMarker "END-REQUEST-930-APPLICATION-ATTACK-LFI"
@@ -0,0 +1,189 @@
1
+ # ------------------------------------------------------------------------
2
+ # OWASP CRS ver.4.9.0
3
+ # Copyright (c) 2006-2020 Trustwave and contributors. All rights reserved.
4
+ # Copyright (c) 2021-2024 CRS project. All rights reserved.
5
+ #
6
+ # The OWASP CRS is distributed under
7
+ # Apache Software License (ASL) version 2
8
+ # Please see the enclosed LICENSE file for full details.
9
+ # ------------------------------------------------------------------------
10
+ #
11
+ # RFI Attacks
12
+ #
13
+
14
+ #
15
+ # -= Paranoia Level 0 (empty) =- (apply unconditionally)
16
+ #
17
+
18
+
19
+
20
+ SecRule TX:DETECTION_PARANOIA_LEVEL "@lt 1" "id:931011,phase:1,pass,nolog,tag:'OWASP_CRS',ver:'OWASP_CRS/4.9.0',skipAfter:END-REQUEST-931-APPLICATION-ATTACK-RFI"
21
+ SecRule TX:DETECTION_PARANOIA_LEVEL "@lt 1" "id:931012,phase:2,pass,nolog,tag:'OWASP_CRS',ver:'OWASP_CRS/4.9.0',skipAfter:END-REQUEST-931-APPLICATION-ATTACK-RFI"
22
+ #
23
+ # -= Paranoia Level 1 (default) =- (apply only when tx.detection_paranoia_level is sufficiently high: 1 or higher)
24
+ #
25
+
26
+ # -=[ Rule Logic ]=-
27
+ # These rules look for common types of Remote File Inclusion (RFI) attack methods.
28
+ # - URL Contains an IP Address
29
+ # - The PHP "include()" Function
30
+ # - RFI Data Ends with Question Mark(s) (?)
31
+ # - RFI Host Doesn't Match Local Host
32
+ #
33
+ # -=[ References ]=-
34
+ # http://projects.webappsec.org/Remote-File-Inclusion
35
+ # http://tacticalwebappsec.blogspot.com/2009/06/generic-remote-file-inclusion-attack.html
36
+ #
37
+ SecRule ARGS "@rx ^(?i:file|ftps?|https?)://(?:\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3})" \
38
+ "id:931100,\
39
+ phase:2,\
40
+ block,\
41
+ capture,\
42
+ t:none,\
43
+ msg:'Possible Remote File Inclusion (RFI) Attack: URL Parameter using IP Address',\
44
+ logdata:'Matched Data: %{TX.0} found within %{MATCHED_VAR_NAME}: %{MATCHED_VAR}',\
45
+ tag:'application-multi',\
46
+ tag:'language-multi',\
47
+ tag:'platform-multi',\
48
+ tag:'attack-rfi',\
49
+ tag:'paranoia-level/1',\
50
+ tag:'OWASP_CRS',\
51
+ tag:'capec/1000/152/175/253',\
52
+ ver:'OWASP_CRS/4.9.0',\
53
+ severity:'CRITICAL',\
54
+ setvar:'tx.rfi_score=+%{tx.critical_anomaly_score}',\
55
+ setvar:'tx.inbound_anomaly_score_pl1=+%{tx.critical_anomaly_score}'"
56
+
57
+ SecRule QUERY_STRING|REQUEST_BODY "@rx (?i)(?:\binclude\s*\([^)]*|mosConfig_absolute_path|_CONF\[path\]|_SERVER\[DOCUMENT_ROOT\]|GALLERY_BASEDIR|path\[docroot\]|appserv_root|config\[root_dir\])=(?:file|ftps?|https?)://" \
58
+ "id:931110,\
59
+ phase:2,\
60
+ block,\
61
+ capture,\
62
+ t:none,t:urlDecodeUni,\
63
+ msg:'Possible Remote File Inclusion (RFI) Attack: Common RFI Vulnerable Parameter Name used w/URL Payload',\
64
+ logdata:'Matched Data: %{TX.0} found within %{MATCHED_VAR_NAME}: %{MATCHED_VAR}',\
65
+ tag:'application-multi',\
66
+ tag:'language-multi',\
67
+ tag:'platform-multi',\
68
+ tag:'attack-rfi',\
69
+ tag:'paranoia-level/1',\
70
+ tag:'OWASP_CRS',\
71
+ tag:'capec/1000/152/175/253',\
72
+ ver:'OWASP_CRS/4.9.0',\
73
+ severity:'CRITICAL',\
74
+ setvar:'tx.rfi_score=+%{tx.critical_anomaly_score}',\
75
+ setvar:'tx.inbound_anomaly_score_pl1=+%{tx.critical_anomaly_score}'"
76
+
77
+ SecRule ARGS "@rx ^(?i:file|ftps?|https?).*?\?+$" \
78
+ "id:931120,\
79
+ phase:2,\
80
+ block,\
81
+ capture,\
82
+ t:none,\
83
+ msg:'Possible Remote File Inclusion (RFI) Attack: URL Payload Used w/Trailing Question Mark Character (?)',\
84
+ logdata:'Matched Data: %{TX.0} found within %{MATCHED_VAR_NAME}: %{MATCHED_VAR}',\
85
+ tag:'application-multi',\
86
+ tag:'language-multi',\
87
+ tag:'platform-multi',\
88
+ tag:'attack-rfi',\
89
+ tag:'paranoia-level/1',\
90
+ tag:'OWASP_CRS',\
91
+ tag:'capec/1000/152/175/253',\
92
+ ver:'OWASP_CRS/4.9.0',\
93
+ severity:'CRITICAL',\
94
+ setvar:'tx.rfi_score=+%{tx.critical_anomaly_score}',\
95
+ setvar:'tx.inbound_anomaly_score_pl1=+%{tx.critical_anomaly_score}'"
96
+
97
+
98
+
99
+ SecRule TX:DETECTION_PARANOIA_LEVEL "@lt 2" "id:931013,phase:1,pass,nolog,tag:'OWASP_CRS',ver:'OWASP_CRS/4.9.0',skipAfter:END-REQUEST-931-APPLICATION-ATTACK-RFI"
100
+ SecRule TX:DETECTION_PARANOIA_LEVEL "@lt 2" "id:931014,phase:2,pass,nolog,tag:'OWASP_CRS',ver:'OWASP_CRS/4.9.0',skipAfter:END-REQUEST-931-APPLICATION-ATTACK-RFI"
101
+ #
102
+ # -= Paranoia Level 2 =- (apply only when tx.detection_paranoia_level is sufficiently high: 2 or higher)
103
+ #
104
+
105
+ # url:file:// can be used by Java applications using
106
+ # org.apache.commons.io.IOUtils to access internal files, so this has been added
107
+ #
108
+ # This rule has one (stricter) sibling: 931131.
109
+ # That rule applies the same regular expression to the request filename in phase 1.
110
+ #
111
+ # Regular expression generated from regex-assembly/931130.ra.
112
+ # To update the regular expression run the following shell script
113
+ # (consult https://coreruleset.org/docs/development/regex_assembly/ for details):
114
+ # crs-toolchain regex update 931130
115
+ #
116
+ SecRule ARGS "@rx (?i)(?:(?:url|jar):)?(?:a(?:cap|f[ps]|ttachment)|b(?:eshare|itcoin|lob)|c(?:a(?:llto|p)|id|vs|ompress.(?:zlib|bzip2))|d(?:a(?:v|ta)|ict|n(?:s|tp))|e(?:d2k|xpect)|f(?:(?:ee)?d|i(?:le|nger|sh)|tps?)|g(?:it|o(?:pher)?|lob)|h(?:323|ttps?)|i(?:ax|cap|(?:ma|p)ps?|rc[6s]?)|ja(?:bbe)?r|l(?:dap[is]?|ocal_file)|m(?:a(?:ilto|ven)|ms|umble)|n(?:e(?:tdoc|ws)|fs|ntps?)|ogg|p(?:aparazzi|h(?:ar|p)|op(?:2|3s?)|r(?:es|oxy)|syc)|r(?:mi|sync|tm(?:f?p)?|ar)|s(?:3|ftp|ips?|m(?:[bs]|tps?)|n(?:ews|mp)|sh(?:2(?:.(?:s(?:hell|(?:ft|c)p)|exec|tunnel))?)?|vn(?:\+ssh)?)|t(?:e(?:amspeak|lnet)|ftp|urns?)|u(?:dp|nreal|t2004)|v(?:entrilo|iew-source|nc)|w(?:ebcal|ss?)|x(?:mpp|ri)|zip)://(?:[^@]+@)?([^/]*)" \
117
+ "id:931130,\
118
+ phase:2,\
119
+ block,\
120
+ capture,\
121
+ t:none,\
122
+ msg:'Possible Remote File Inclusion (RFI) Attack: Off-Domain Reference/Link',\
123
+ logdata:'Matched Data: %{TX.0} found within %{MATCHED_VAR_NAME}: %{MATCHED_VAR}',\
124
+ tag:'application-multi',\
125
+ tag:'language-multi',\
126
+ tag:'platform-multi',\
127
+ tag:'attack-rfi',\
128
+ tag:'paranoia-level/2',\
129
+ tag:'OWASP_CRS',\
130
+ tag:'capec/1000/152/175/253',\
131
+ ver:'OWASP_CRS/4.9.0',\
132
+ severity:'CRITICAL',\
133
+ setvar:'tx.rfi_parameter_%{MATCHED_VAR_NAME}=.%{tx.1}',\
134
+ chain"
135
+ SecRule TX:/rfi_parameter_.*/ "!@endsWith .%{request_headers.host}" \
136
+ "setvar:'tx.rfi_score=+%{tx.critical_anomaly_score}',\
137
+ setvar:'tx.inbound_anomaly_score_pl2=+%{tx.critical_anomaly_score}'"
138
+
139
+ # This is a (stricter) sibling of 931130.
140
+ #
141
+ # Regular expression generated from regex-assembly/931131.ra.
142
+ # To update the regular expression run the following shell script
143
+ # (consult https://coreruleset.org/docs/development/regex_assembly/ for details):
144
+ # crs-toolchain regex update 931131
145
+ #
146
+ SecRule REQUEST_FILENAME "@rx (?i)(?:(?:url|jar):)?(?:a(?:cap|f[ps]|ttachment)|b(?:eshare|itcoin|lob)|c(?:a(?:llto|p)|id|vs|ompress.(?:zlib|bzip2))|d(?:a(?:v|ta)|ict|n(?:s|tp))|e(?:d2k|xpect)|f(?:(?:ee)?d|i(?:le|nger|sh)|tps?)|g(?:it|o(?:pher)?|lob)|h(?:323|ttps?)|i(?:ax|cap|(?:ma|p)ps?|rc[6s]?)|ja(?:bbe)?r|l(?:dap[is]?|ocal_file)|m(?:a(?:ilto|ven)|ms|umble)|n(?:e(?:tdoc|ws)|fs|ntps?)|ogg|p(?:aparazzi|h(?:ar|p)|op(?:2|3s?)|r(?:es|oxy)|syc)|r(?:mi|sync|tm(?:f?p)?|ar)|s(?:3|ftp|ips?|m(?:[bs]|tps?)|n(?:ews|mp)|sh(?:2(?:.(?:s(?:hell|(?:ft|c)p)|exec|tunnel))?)?|vn(?:\+ssh)?)|t(?:e(?:amspeak|lnet)|ftp|urns?)|u(?:dp|nreal|t2004)|v(?:entrilo|iew-source|nc)|w(?:ebcal|ss?)|x(?:mpp|ri)|zip)://(?:[^@]+@)?([^/]*)" \
147
+ "id:931131,\
148
+ phase:1,\
149
+ block,\
150
+ capture,\
151
+ t:none,t:urlDecodeUni,\
152
+ msg:'Possible Remote File Inclusion (RFI) Attack: Off-Domain Reference/Link',\
153
+ logdata:'Matched Data: %{TX.0} found within %{MATCHED_VAR_NAME}: %{MATCHED_VAR}',\
154
+ tag:'application-multi',\
155
+ tag:'language-multi',\
156
+ tag:'platform-multi',\
157
+ tag:'attack-rfi',\
158
+ tag:'paranoia-level/2',\
159
+ tag:'OWASP_CRS',\
160
+ tag:'capec/1000/152/175/253',\
161
+ ver:'OWASP_CRS/4.9.0',\
162
+ severity:'CRITICAL',\
163
+ setvar:'tx.rfi_parameter_%{MATCHED_VAR_NAME}=.%{tx.1}',\
164
+ chain"
165
+ SecRule TX:/rfi_parameter_.*/ "!@endsWith .%{request_headers.host}" \
166
+ "setvar:'tx.rfi_score=+%{tx.critical_anomaly_score}',\
167
+ setvar:'tx.inbound_anomaly_score_pl2=+%{tx.critical_anomaly_score}'"
168
+
169
+
170
+ SecRule TX:DETECTION_PARANOIA_LEVEL "@lt 3" "id:931015,phase:1,pass,nolog,tag:'OWASP_CRS',ver:'OWASP_CRS/4.9.0',skipAfter:END-REQUEST-931-APPLICATION-ATTACK-RFI"
171
+ SecRule TX:DETECTION_PARANOIA_LEVEL "@lt 3" "id:931016,phase:2,pass,nolog,tag:'OWASP_CRS',ver:'OWASP_CRS/4.9.0',skipAfter:END-REQUEST-931-APPLICATION-ATTACK-RFI"
172
+ #
173
+ # -= Paranoia Level 3 =- (apply only when tx.detection_paranoia_level is sufficiently high: 3 or higher)
174
+ #
175
+
176
+
177
+
178
+ SecRule TX:DETECTION_PARANOIA_LEVEL "@lt 4" "id:931017,phase:1,pass,nolog,tag:'OWASP_CRS',ver:'OWASP_CRS/4.9.0',skipAfter:END-REQUEST-931-APPLICATION-ATTACK-RFI"
179
+ SecRule TX:DETECTION_PARANOIA_LEVEL "@lt 4" "id:931018,phase:2,pass,nolog,tag:'OWASP_CRS',ver:'OWASP_CRS/4.9.0',skipAfter:END-REQUEST-931-APPLICATION-ATTACK-RFI"
180
+ #
181
+ # -= Paranoia Level 4 =- (apply only when tx.detection_paranoia_level is sufficiently high: 4 or higher)
182
+ #
183
+
184
+
185
+
186
+ #
187
+ # -= Paranoia Levels Finished =-
188
+ #
189
+ SecMarker "END-REQUEST-931-APPLICATION-ATTACK-RFI"