@abtnode/router-provider 1.16.38-beta-20250116-083413-dbd33222 → 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.
- package/lib/nginx/includes/security/crs4/rules/REQUEST-900-EXCLUSION-RULES-BEFORE-CRS.conf.example +200 -0
- package/lib/nginx/includes/security/crs4/rules/REQUEST-901-INITIALIZATION.conf +470 -0
- package/lib/nginx/includes/security/crs4/rules/REQUEST-905-COMMON-EXCEPTIONS.conf +57 -0
- package/lib/nginx/includes/security/crs4/rules/REQUEST-911-METHOD-ENFORCEMENT.conf +76 -0
- package/lib/nginx/includes/security/crs4/rules/REQUEST-913-SCANNER-DETECTION.conf +86 -0
- package/lib/nginx/includes/security/crs4/rules/REQUEST-920-PROTOCOL-ENFORCEMENT.conf +1915 -0
- package/lib/nginx/includes/security/crs4/rules/REQUEST-921-PROTOCOL-ATTACK.conf +558 -0
- package/lib/nginx/includes/security/crs4/rules/REQUEST-922-MULTIPART-ATTACK.conf +120 -0
- package/lib/nginx/includes/security/crs4/rules/REQUEST-930-APPLICATION-ATTACK-LFI.conf +203 -0
- package/lib/nginx/includes/security/crs4/rules/REQUEST-931-APPLICATION-ATTACK-RFI.conf +189 -0
- package/lib/nginx/includes/security/crs4/rules/REQUEST-932-APPLICATION-ATTACK-RCE.conf +1875 -0
- package/lib/nginx/includes/security/crs4/rules/REQUEST-933-APPLICATION-ATTACK-PHP.conf +774 -0
- package/lib/nginx/includes/security/crs4/rules/REQUEST-934-APPLICATION-ATTACK-GENERIC.conf +366 -0
- package/lib/nginx/includes/security/crs4/rules/REQUEST-941-APPLICATION-ATTACK-XSS.conf +1071 -0
- package/lib/nginx/includes/security/crs4/rules/REQUEST-942-APPLICATION-ATTACK-SQLI.conf +1978 -0
- package/lib/nginx/includes/security/crs4/rules/REQUEST-943-APPLICATION-ATTACK-SESSION-FIXATION.conf +132 -0
- package/lib/nginx/includes/security/crs4/rules/REQUEST-944-APPLICATION-ATTACK-JAVA.conf +463 -0
- package/lib/nginx/includes/security/crs4/rules/REQUEST-949-BLOCKING-EVALUATION.conf +270 -0
- package/lib/nginx/includes/security/crs4/rules/RESPONSE-950-DATA-LEAKAGES.conf +156 -0
- package/lib/nginx/includes/security/crs4/rules/RESPONSE-951-DATA-LEAKAGES-SQL.conf +417 -0
- package/lib/nginx/includes/security/crs4/rules/RESPONSE-952-DATA-LEAKAGES-JAVA.conf +108 -0
- package/lib/nginx/includes/security/crs4/rules/RESPONSE-953-DATA-LEAKAGES-PHP.conf +158 -0
- package/lib/nginx/includes/security/crs4/rules/RESPONSE-954-DATA-LEAKAGES-IIS.conf +152 -0
- package/lib/nginx/includes/security/crs4/rules/RESPONSE-955-WEB-SHELLS.conf +558 -0
- package/lib/nginx/includes/security/crs4/rules/RESPONSE-959-BLOCKING-EVALUATION.conf +280 -0
- package/lib/nginx/includes/security/crs4/rules/RESPONSE-980-CORRELATION.conf +138 -0
- package/lib/nginx/includes/security/crs4/rules/RESPONSE-999-EXCLUSION-RULES-AFTER-CRS.conf.example +76 -0
- package/lib/nginx/includes/security/crs4/rules/iis-errors.data +59 -0
- package/lib/nginx/includes/security/crs4/rules/java-classes.data +64 -0
- package/lib/nginx/includes/security/crs4/rules/java-code-leakages.data +17 -0
- package/lib/nginx/includes/security/crs4/rules/java-errors.data +10 -0
- package/lib/nginx/includes/security/crs4/rules/lfi-os-files.data +722 -0
- package/lib/nginx/includes/security/crs4/rules/php-config-directives.data +571 -0
- package/lib/nginx/includes/security/crs4/rules/php-errors-pl2.data +7 -0
- package/lib/nginx/includes/security/crs4/rules/php-errors.data +2147 -0
- package/lib/nginx/includes/security/crs4/rules/php-function-names-933150.data +245 -0
- package/lib/nginx/includes/security/crs4/rules/php-function-names-933151.data +2201 -0
- package/lib/nginx/includes/security/crs4/rules/php-variables.data +30 -0
- package/lib/nginx/includes/security/crs4/rules/restricted-files.data +284 -0
- package/lib/nginx/includes/security/crs4/rules/restricted-upload.data +177 -0
- package/lib/nginx/includes/security/crs4/rules/scanners-user-agents.data +119 -0
- package/lib/nginx/includes/security/crs4/rules/sql-errors.data +172 -0
- package/lib/nginx/includes/security/crs4/rules/ssrf.data +177 -0
- package/lib/nginx/includes/security/crs4/rules/unix-shell.data +670 -0
- package/lib/nginx/includes/security/crs4/rules/web-shells-php.data +167 -0
- package/lib/nginx/includes/security/crs4/rules/windows-powershell-commands.data +425 -0
- package/lib/nginx/includes/security/unicode.mapping +96 -0
- package/lib/nginx/index.js +50 -3
- package/lib/nginx/templates/security/crs4/crs-setup.conf.js +857 -0
- package/lib/nginx/templates/security/modsecurity.conf.js +244 -0
- package/package.json +7 -6
|
@@ -0,0 +1,366 @@
|
|
|
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:934011,phase:1,pass,nolog,tag:'OWASP_CRS',ver:'OWASP_CRS/4.9.0',skipAfter:END-REQUEST-934-APPLICATION-ATTACK-GENERIC"
|
|
18
|
+
SecRule TX:DETECTION_PARANOIA_LEVEL "@lt 1" "id:934012,phase:2,pass,nolog,tag:'OWASP_CRS',ver:'OWASP_CRS/4.9.0',skipAfter:END-REQUEST-934-APPLICATION-ATTACK-GENERIC"
|
|
19
|
+
#
|
|
20
|
+
# -= Paranoia Level 1 (default) =- (apply only when tx.detection_paranoia_level is sufficiently high: 1 or higher)
|
|
21
|
+
#
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
# [ NodeJS Insecure unserialization / generic RCE signatures ]
|
|
25
|
+
#
|
|
26
|
+
# Libraries performing insecure unserialization:
|
|
27
|
+
# - node-serialize: _$$ND_FUNC$$_ (CVE-2017-5941)
|
|
28
|
+
# - funcster: __js_function
|
|
29
|
+
#
|
|
30
|
+
# See:
|
|
31
|
+
# https://opsecx.com/index.php/2017/02/08/exploiting-node-js-deserialization-bug-for-remote-code-execution/
|
|
32
|
+
# https://www.acunetix.com/blog/web-security-zone/deserialization-vulnerabilities-attacking-deserialization-in-js/
|
|
33
|
+
#
|
|
34
|
+
# Some generic snippets used:
|
|
35
|
+
# - function() {
|
|
36
|
+
# - new Function(
|
|
37
|
+
# - eval(
|
|
38
|
+
# - String.fromCharCode(
|
|
39
|
+
#
|
|
40
|
+
# Last two are used by nodejsshell.py,
|
|
41
|
+
# https://github.com/ajinabraham/Node.Js-Security-Course/blob/master/nodejsshell.py
|
|
42
|
+
#
|
|
43
|
+
# As base64 is sometimes (but not always) used to encode serialized values,
|
|
44
|
+
# use multiMatch and t:base64decode.
|
|
45
|
+
#
|
|
46
|
+
# Regular expression generated from regex-assembly/934100.ra.
|
|
47
|
+
# To update the regular expression run the following shell script
|
|
48
|
+
# (consult https://coreruleset.org/docs/development/regex_assembly/ for details):
|
|
49
|
+
# crs-toolchain regex update 934100
|
|
50
|
+
#
|
|
51
|
+
# Stricter sibling: 934101
|
|
52
|
+
SecRule REQUEST_FILENAME|REQUEST_COOKIES|!REQUEST_COOKIES:/__utm/|REQUEST_COOKIES_NAMES|ARGS_NAMES|ARGS|XML:/* "@rx _(?:\$\$ND_FUNC\$\$_|_js_function)|(?:\beval|new[\s\x0b]+Function[\s\x0b]*)\(|String\.fromCharCode|function\(\)\{|this\.constructor|module\.exports=|\([\s\x0b]*[^0-9A-Z_a-z]child_process[^0-9A-Z_a-z][\s\x0b]*\)|process(?:\.(?:(?:a(?:ccess|ppendfile|rgv|vailability)|c(?:aveats|h(?:mod|own)|(?:los|opyfil)e|p|reate(?:read|write)stream)|ex(?:ec(?:file)?|ists)|f(?:ch(?:mod|own)|data(?:sync)?|s(?:tat|ync)|utimes)|inodes|l(?:chmod|ink|stat|utimes)|mkd(?:ir|temp)|open(?:dir)?|r(?:e(?:ad(?:dir|file|link|v)?|name)|m)|s(?:pawn(?:file)?|tat|ymlink)|truncate|u(?:n(?:link|watchfile)|times)|w(?:atchfile|rite(?:file|v)?))(?:sync)?(?:\.call)?\(|binding|constructor|env|global|main(?:Module)?|process|require)|\[[\"'`](?:(?:a(?:ccess|ppendfile|rgv|vailability)|c(?:aveats|h(?:mod|own)|(?:los|opyfil)e|p|reate(?:read|write)stream)|ex(?:ec(?:file)?|ists)|f(?:ch(?:mod|own)|data(?:sync)?|s(?:tat|ync)|utimes)|inodes|l(?:chmod|ink|stat|utimes)|mkd(?:ir|temp)|open(?:dir)?|r(?:e(?:ad(?:dir|file|link|v)?|name)|m)|s(?:pawn(?:file)?|tat|ymlink)|truncate|u(?:n(?:link|watchfile)|times)|w(?:atchfile|rite(?:file|v)?))(?:sync)?|binding|constructor|env|global|main(?:Module)?|process|require)[\"'`]\])|(?:binding|constructor|env|global|main(?:Module)?|process|require)\[|console(?:\.(?:debug|error|info|trace|warn)(?:\.call)?\(|\[[\"'`](?:debug|error|info|trace|warn)[\"'`]\])|require(?:\.(?:resolve(?:\.call)?\(|main|extensions|cache)|\[[\"'`](?:(?:resolv|cach)e|main|extensions)[\"'`]\])" \
|
|
53
|
+
"id:934100,\
|
|
54
|
+
phase:2,\
|
|
55
|
+
block,\
|
|
56
|
+
capture,\
|
|
57
|
+
t:none,t:urlDecodeUni,t:jsDecode,t:removeWhitespace,t:base64Decode,t:urlDecodeUni,t:jsDecode,t:removeWhitespace,\
|
|
58
|
+
msg:'Node.js Injection Attack 1/2',\
|
|
59
|
+
logdata:'Matched Data: %{TX.0} found within %{MATCHED_VAR_NAME}: %{MATCHED_VAR}',\
|
|
60
|
+
tag:'application-multi',\
|
|
61
|
+
tag:'language-javascript',\
|
|
62
|
+
tag:'platform-multi',\
|
|
63
|
+
tag:'attack-rce',\
|
|
64
|
+
tag:'attack-injection-generic',\
|
|
65
|
+
tag:'paranoia-level/1',\
|
|
66
|
+
tag:'OWASP_CRS',\
|
|
67
|
+
tag:'capec/1000/152/242',\
|
|
68
|
+
ver:'OWASP_CRS/4.9.0',\
|
|
69
|
+
severity:'CRITICAL',\
|
|
70
|
+
multiMatch,\
|
|
71
|
+
setvar:'tx.rce_score=+%{tx.critical_anomaly_score}',\
|
|
72
|
+
setvar:'tx.inbound_anomaly_score_pl1=+%{tx.critical_anomaly_score}'"
|
|
73
|
+
|
|
74
|
+
# -=[ SSRF Attacks ]=-
|
|
75
|
+
#
|
|
76
|
+
# We provide only partial protection to SSRF. DNS Rebinding attacks needs
|
|
77
|
+
# to be handled at application level, and even those might be difficult to catch.
|
|
78
|
+
#
|
|
79
|
+
# PL1 rules are based on common attacks on cloud providers, based on well-known URLs.
|
|
80
|
+
#
|
|
81
|
+
# -=[ References ]=-
|
|
82
|
+
# https://highon.coffee/blog/ssrf-cheat-sheet/
|
|
83
|
+
# https://cwe.mitre.org/data/definitions/918.html
|
|
84
|
+
# https://capec.mitre.org/data/definitions/664.html)
|
|
85
|
+
#
|
|
86
|
+
# Preventing: https://cheatsheetseries.owasp.org/cheatsheets/Server_Side_Request_Forgery_Prevention_Cheat_Sheet.html
|
|
87
|
+
|
|
88
|
+
SecRule REQUEST_COOKIES|!REQUEST_COOKIES:/__utm/|REQUEST_COOKIES_NAMES|REQUEST_FILENAME|ARGS_NAMES|ARGS|XML:/* "@pmFromFile ssrf.data" \
|
|
89
|
+
"id:934110,\
|
|
90
|
+
phase:2,\
|
|
91
|
+
block,\
|
|
92
|
+
capture,\
|
|
93
|
+
t:none,\
|
|
94
|
+
msg:'Possible Server Side Request Forgery (SSRF) Attack: Cloud provider metadata URL in Parameter',\
|
|
95
|
+
logdata:'Matched Data: %{TX.0} found within %{MATCHED_VAR_NAME}: %{MATCHED_VAR}',\
|
|
96
|
+
tag:'application-multi',\
|
|
97
|
+
tag:'language-multi',\
|
|
98
|
+
tag:'platform-multi',\
|
|
99
|
+
tag:'attack-ssrf',\
|
|
100
|
+
tag:'paranoia-level/1',\
|
|
101
|
+
tag:'OWASP_CRS',\
|
|
102
|
+
tag:'capec/1000/225/664',\
|
|
103
|
+
ver:'OWASP_CRS/4.9.0',\
|
|
104
|
+
severity:'CRITICAL',\
|
|
105
|
+
setvar:'tx.rce_score=+%{tx.critical_anomaly_score}',\
|
|
106
|
+
setvar:'tx.inbound_anomaly_score_pl1=+%{tx.critical_anomaly_score}'"
|
|
107
|
+
|
|
108
|
+
# JavaScript prototype pollution injection attempts
|
|
109
|
+
#
|
|
110
|
+
# Example from https://hackerone.com/reports/869574 critical
|
|
111
|
+
# vulnerability in the TypeORM library:
|
|
112
|
+
# {"text":"a","title":{"__proto__":{"where":{"name":"sqlinjection","where":null}}}}
|
|
113
|
+
#
|
|
114
|
+
# Test cases are based on this list of payloads:
|
|
115
|
+
# https://github.com/BlackFan/client-side-prototype-pollution/blob/master/README.md
|
|
116
|
+
#
|
|
117
|
+
# See also: https://cwe.mitre.org/data/definitions/1321.html
|
|
118
|
+
#
|
|
119
|
+
# Note: only server-based (not DOM-based) attacks are covered here.
|
|
120
|
+
# Stricter sibling: 934131
|
|
121
|
+
|
|
122
|
+
SecRule REQUEST_COOKIES|!REQUEST_COOKIES:/__utm/|REQUEST_COOKIES_NAMES|ARGS_NAMES|ARGS|XML:/* "@rx (?:__proto__|constructor\s*(?:\.|\[)\s*prototype)" \
|
|
123
|
+
"id:934130,\
|
|
124
|
+
phase:2,\
|
|
125
|
+
block,\
|
|
126
|
+
capture,\
|
|
127
|
+
t:none,t:urlDecodeUni,t:jsDecode,\
|
|
128
|
+
msg:'JavaScript Prototype Pollution',\
|
|
129
|
+
logdata:'Matched Data: %{TX.0} found within %{MATCHED_VAR_NAME}: %{MATCHED_VAR}',\
|
|
130
|
+
tag:'application-multi',\
|
|
131
|
+
tag:'language-javascript',\
|
|
132
|
+
tag:'platform-multi',\
|
|
133
|
+
tag:'attack-rce',\
|
|
134
|
+
tag:'attack-injection-generic',\
|
|
135
|
+
tag:'paranoia-level/1',\
|
|
136
|
+
tag:'OWASP_CRS',\
|
|
137
|
+
tag:'capec/1/180/77',\
|
|
138
|
+
ver:'OWASP_CRS/4.9.0',\
|
|
139
|
+
severity:'CRITICAL',\
|
|
140
|
+
multiMatch,\
|
|
141
|
+
setvar:'tx.rce_score=+%{tx.critical_anomaly_score}',\
|
|
142
|
+
setvar:'tx.inbound_anomaly_score_pl1=+%{tx.critical_anomaly_score}'"
|
|
143
|
+
|
|
144
|
+
# [ Ruby generic RCE signatures ]
|
|
145
|
+
#
|
|
146
|
+
# Detects Ruby-based injection attacks.
|
|
147
|
+
# Example: Process.spawn("id")
|
|
148
|
+
#
|
|
149
|
+
# Regular expression generated from regex-assembly/934150.ra.
|
|
150
|
+
# To update the regular expression run the following shell script
|
|
151
|
+
# (consult https://coreruleset.org/docs/development/regex_assembly/ for details):
|
|
152
|
+
# crs-toolchain regex update 934150
|
|
153
|
+
#
|
|
154
|
+
SecRule REQUEST_COOKIES|!REQUEST_COOKIES:/__utm/|REQUEST_COOKIES_NAMES|ARGS_NAMES|ARGS|XML:/* "@rx Process[\s\x0b]*\.[\s\x0b]*spawn[\s\x0b]*\(" \
|
|
155
|
+
"id:934150,\
|
|
156
|
+
phase:2,\
|
|
157
|
+
block,\
|
|
158
|
+
capture,\
|
|
159
|
+
t:none,\
|
|
160
|
+
msg:'Ruby Injection Attack',\
|
|
161
|
+
logdata:'Matched Data: %{TX.0} found within %{MATCHED_VAR_NAME}: %{MATCHED_VAR}',\
|
|
162
|
+
tag:'application-multi',\
|
|
163
|
+
tag:'language-ruby',\
|
|
164
|
+
tag:'platform-multi',\
|
|
165
|
+
tag:'attack-rce',\
|
|
166
|
+
tag:'attack-injection-generic',\
|
|
167
|
+
tag:'paranoia-level/1',\
|
|
168
|
+
tag:'OWASP_CRS',\
|
|
169
|
+
tag:'capec/1000/152/242',\
|
|
170
|
+
ver:'OWASP_CRS/4.9.0',\
|
|
171
|
+
severity:'CRITICAL',\
|
|
172
|
+
setvar:'tx.rce_score=+%{tx.critical_anomaly_score}',\
|
|
173
|
+
setvar:'tx.inbound_anomaly_score_pl1=+%{tx.critical_anomaly_score}'"
|
|
174
|
+
|
|
175
|
+
# [ NodeJS DoS signatures ]
|
|
176
|
+
#
|
|
177
|
+
# NodeJS runs in a single thread, so any evaluated payloads that block execution can cause an easy DoS.
|
|
178
|
+
# This rule attempts to block e.g. while(true).
|
|
179
|
+
#
|
|
180
|
+
# Regular expression generated from regex-assembly/934160.ra.
|
|
181
|
+
# To update the regular expression run the following shell script
|
|
182
|
+
# (consult https://coreruleset.org/docs/development/regex_assembly/ for details):
|
|
183
|
+
# crs-toolchain regex update 934160
|
|
184
|
+
#
|
|
185
|
+
SecRule REQUEST_FILENAME|REQUEST_COOKIES|!REQUEST_COOKIES:/__utm/|REQUEST_COOKIES_NAMES|ARGS_NAMES|ARGS|XML:/* "@rx while[\s\x0b]*\([\s\x0b\(]*(?:!+(?:false|null|undefined|NaN|[\+\-]?0|\"{2}|'{2}|`{2})|(?:!!)*(?:(?:t(?:rue|his)|[\+\-]?(?:Infinity|[1-9][0-9]*)|new [A-Za-z][0-9A-Z_a-z]*|window|String|(?:Boolea|Functio)n|Object|Array)\b|\{.*\}|\[.*\]|\"[^\"]+\"|'[^']+'|`[^`]+`)).*\)" \
|
|
186
|
+
"id:934160,\
|
|
187
|
+
phase:2,\
|
|
188
|
+
block,\
|
|
189
|
+
capture,\
|
|
190
|
+
t:none,t:urlDecodeUni,t:jsDecode,t:base64Decode,t:urlDecodeUni,t:jsDecode,t:replaceComments,\
|
|
191
|
+
msg:'Node.js DoS attack',\
|
|
192
|
+
logdata:'Matched Data: %{TX.0} found within %{MATCHED_VAR_NAME}: %{MATCHED_VAR}',\
|
|
193
|
+
tag:'application-multi',\
|
|
194
|
+
tag:'language-javascript',\
|
|
195
|
+
tag:'platform-multi',\
|
|
196
|
+
tag:'attack-rce',\
|
|
197
|
+
tag:'attack-injection-generic',\
|
|
198
|
+
tag:'paranoia-level/1',\
|
|
199
|
+
tag:'OWASP_CRS',\
|
|
200
|
+
tag:'capec/1000/152/242',\
|
|
201
|
+
ver:'OWASP_CRS/4.9.0',\
|
|
202
|
+
severity:'CRITICAL',\
|
|
203
|
+
multiMatch,\
|
|
204
|
+
setvar:'tx.rce_score=+%{tx.critical_anomaly_score}',\
|
|
205
|
+
setvar:'tx.inbound_anomaly_score_pl1=+%{tx.critical_anomaly_score}'"
|
|
206
|
+
|
|
207
|
+
# [ PHP data: scheme ]
|
|
208
|
+
#
|
|
209
|
+
# PHP supports the `data:` scheme without using `//` before the content-type.
|
|
210
|
+
#
|
|
211
|
+
# Regular expression generated from regex-assembly/934170.ra.
|
|
212
|
+
# To update the regular expression run the following shell script
|
|
213
|
+
# (consult https://coreruleset.org/docs/development/regex_assembly/ for details):
|
|
214
|
+
# crs-toolchain regex update 934170
|
|
215
|
+
#
|
|
216
|
+
SecRule REQUEST_FILENAME|REQUEST_COOKIES|!REQUEST_COOKIES:/__utm/|REQUEST_COOKIES_NAMES|ARGS_NAMES|ARGS|XML:/* "@rx ^data:(?:(?:\*|[^!\"\(\),/:-\?\[-\]\{\}]+)/(?:\*|[^!\"\(\),/:-\?\[-\]\{\}]+)|\*)(?:[\s\x0b]*;[\s\x0b]*(?:charset[\s\x0b]*=[\s\x0b]*\"?(?:iso-8859-15?|utf-8|windows-1252)\b\"?|(?:[^\s\x0b-\"\(\),/:-\?\[-\]c\{\}]|c(?:[^!\"\(\),/:-\?\[-\]h\{\}]|h(?:[^!\"\(\),/:-\?\[-\]a\{\}]|a(?:[^!\"\(\),/:-\?\[-\]r\{\}]|r(?:[^!\"\(\),/:-\?\[-\]s\{\}]|s(?:[^!\"\(\),/:-\?\[-\]e\{\}]|e[^!\"\(\),/:-\?\[-\]t\{\}]))))))[^!\"\(\),/:-\?\[-\]\{\}]*[\s\x0b]*=[\s\x0b]*[^!\(\),/:-\?\[-\]\{\}]+);?)*(?:[\s\x0b]*,[\s\x0b]*(?:(?:\*|[^!\"\(\),/:-\?\[-\]\{\}]+)/(?:\*|[^!\"\(\),/:-\?\[-\]\{\}]+)|\*)(?:[\s\x0b]*;[\s\x0b]*(?:charset[\s\x0b]*=[\s\x0b]*\"?(?:iso-8859-15?|utf-8|windows-1252)\b\"?|(?:[^\s\x0b-\"\(\),/:-\?\[-\]c\{\}]|c(?:[^!\"\(\),/:-\?\[-\]h\{\}]|h(?:[^!\"\(\),/:-\?\[-\]a\{\}]|a(?:[^!\"\(\),/:-\?\[-\]r\{\}]|r(?:[^!\"\(\),/:-\?\[-\]s\{\}]|s(?:[^!\"\(\),/:-\?\[-\]e\{\}]|e[^!\"\(\),/:-\?\[-\]t\{\}]))))))[^!\"\(\),/:-\?\[-\]\{\}]*[\s\x0b]*=[\s\x0b]*[^!\(\),/:-\?\[-\]\{\}]+);?)*)*" \
|
|
217
|
+
"id:934170,\
|
|
218
|
+
phase:2,\
|
|
219
|
+
block,\
|
|
220
|
+
capture,\
|
|
221
|
+
t:none,t:urlDecodeUni,\
|
|
222
|
+
msg:'PHP data scheme attack',\
|
|
223
|
+
logdata:'Matched Data: %{TX.0} found within %{MATCHED_VAR_NAME}: %{MATCHED_VAR}',\
|
|
224
|
+
tag:'application-multi',\
|
|
225
|
+
tag:'language-php',\
|
|
226
|
+
tag:'platform-multi',\
|
|
227
|
+
tag:'attack-ssrf',\
|
|
228
|
+
tag:'paranoia-level/1',\
|
|
229
|
+
tag:'OWASP_CRS',\
|
|
230
|
+
tag:'capec/1000/152/242',\
|
|
231
|
+
ver:'OWASP_CRS/4.9.0',\
|
|
232
|
+
severity:'CRITICAL',\
|
|
233
|
+
setvar:'tx.rce_score=+%{tx.critical_anomaly_score}',\
|
|
234
|
+
setvar:'tx.inbound_anomaly_score_pl1=+%{tx.critical_anomaly_score}'"
|
|
235
|
+
|
|
236
|
+
SecRule TX:DETECTION_PARANOIA_LEVEL "@lt 2" "id:934013,phase:1,pass,nolog,tag:'OWASP_CRS',ver:'OWASP_CRS/4.9.0',skipAfter:END-REQUEST-934-APPLICATION-ATTACK-GENERIC"
|
|
237
|
+
SecRule TX:DETECTION_PARANOIA_LEVEL "@lt 2" "id:934014,phase:2,pass,nolog,tag:'OWASP_CRS',ver:'OWASP_CRS/4.9.0',skipAfter:END-REQUEST-934-APPLICATION-ATTACK-GENERIC"
|
|
238
|
+
#
|
|
239
|
+
# -= Paranoia Level 2 =- (apply only when tx.detection_paranoia_level is sufficiently high: 2 or higher)
|
|
240
|
+
#
|
|
241
|
+
|
|
242
|
+
# This rule is a stricter sibling of 934100.
|
|
243
|
+
SecRule REQUEST_FILENAME|REQUEST_COOKIES|!REQUEST_COOKIES:/__utm/|REQUEST_COOKIES_NAMES|ARGS_NAMES|ARGS|XML:/* "@rx (?:close|exists|fork|(?:ope|spaw)n|re(?:ad|quire)|w(?:atch|rite))[\s\x0b]*\(" \
|
|
244
|
+
"id:934101,\
|
|
245
|
+
phase:2,\
|
|
246
|
+
block,\
|
|
247
|
+
capture,\
|
|
248
|
+
t:none,t:urlDecodeUni,t:jsDecode,t:base64Decode,t:urlDecodeUni,t:jsDecode,\
|
|
249
|
+
msg:'Node.js Injection Attack 2/2',\
|
|
250
|
+
logdata:'Matched Data: %{TX.0} found within %{MATCHED_VAR_NAME}: %{MATCHED_VAR}',\
|
|
251
|
+
tag:'application-multi',\
|
|
252
|
+
tag:'language-javascript',\
|
|
253
|
+
tag:'platform-multi',\
|
|
254
|
+
tag:'attack-rce',\
|
|
255
|
+
tag:'attack-injection-generic',\
|
|
256
|
+
tag:'paranoia-level/2',\
|
|
257
|
+
tag:'OWASP_CRS',\
|
|
258
|
+
tag:'capec/1000/152/242',\
|
|
259
|
+
ver:'OWASP_CRS/4.9.0',\
|
|
260
|
+
severity:'CRITICAL',\
|
|
261
|
+
multiMatch,\
|
|
262
|
+
setvar:'tx.rce_score=+%{tx.critical_anomaly_score}',\
|
|
263
|
+
setvar:'tx.inbound_anomaly_score_pl2=+%{tx.critical_anomaly_score}'"
|
|
264
|
+
|
|
265
|
+
# -=[ SSRF Attacks ]=-
|
|
266
|
+
#
|
|
267
|
+
# PL2 rules adds SSRF capture for common evasion techniques.
|
|
268
|
+
#
|
|
269
|
+
# We add captures for these evasion techniques: (see source in util/regexp-assemble/data/regexp-934120.data)
|
|
270
|
+
# http://425.510.425.510/ Dotted decimal with overflow (already covered by RFI rule 931100)
|
|
271
|
+
# http://2852039166/ Dotless decimal - \d{10}
|
|
272
|
+
# http://7147006462/ Dotless decimal with overflow - \d{10}
|
|
273
|
+
# http://0xA9.0xFE.0xA9.0xFE/ Dotted hexadecimal - (?:0x[a-f0-9]{2}\.){3}0x[a-f0-9]{2}
|
|
274
|
+
# http://0xA9FEA9FE/ Dotless hexadecimal - 0x[a-f0-9]{8}
|
|
275
|
+
# http://0x41414141A9FEA9FE/ Dotless hexadecimal with overflow - 0x[a-f0-9]{16}
|
|
276
|
+
# http://0251.0376.0251.0376/ Dotted octal - Covered by the same below
|
|
277
|
+
# http://0251.00376.000251.0000376/ Dotted octal with padding - (?:0{1,4}\d{3}\.){3}0{1,4}\d{3})
|
|
278
|
+
# http://169.254.43518/ - (?:\d{1,3}\.){2}\.\d{5}
|
|
279
|
+
# http://169.16689662/ - \d{1,3}\.\d{8}
|
|
280
|
+
# http://[::ffff:a9fe:a9fe] IPV6 Compressed - IPv6 regex from https://ihateregex.io/expr/ipv6/, with [0-9] converted to \d and with non-capturing groups (below)
|
|
281
|
+
# http://[0:0:0:0:0:ffff:a9fe:a9fe] IPV6 Expanded - (?:(?:[0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|(?:[0-9a-fA-F]{1,4}:){1,7}:|(?:[0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|(?:[0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|(?:[0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|(?:[0-9a-fA-F]{1,4}:){1,3}(?::[0-9a-fA-F]{1,4}){1,4}|(?:[0-9a-fA-F]{1,4}:){1,2}(?::[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:(?:(?::[0-9a-fA-F]{1,4}){1,6})|:(?:(?::[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(?::[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(?::0{1,4}){0,1}:){0,1}(?:(?:25[0-5]|(?:2[0-4]|1{0,1}\d){0,1}\d)\.){3,3}(?:25[0-5]|(?:2[0-4]|1{0,1}\d){0,1}\d)|(?:[0-9a-fA-F]{1,4}:){1,4}:(?:(?:25[0-5]|(2[0-4]|1{0,1}\d){0,1}\d)\.){3,3}(?:25[0-5]|(?:2[0-4]|1{0,1}\d){0,1}\d))
|
|
282
|
+
# http://[0:0:0:0:0:ffff:169.254.169.254] IPV6/IPV4 - ((?:[0-9a-fA-F]{1,4}:){6}(?:(25[0-5]|(?:2[0-4]|1{0,1}\d){0,1}\d)\.){3,3}(?:25[0-5]|(?:2[0-4]|1{0,1}\d){0,1}\d))
|
|
283
|
+
# http://[::]
|
|
284
|
+
# http://127.88.23.245:22/+&@google.com:80#+@google.com:80/ (already covered by RFI rule 931100)
|
|
285
|
+
# http://127.88.23.245:22/?@google.com:80/ (already covered by RFI rule 931100)
|
|
286
|
+
# http://127.88.23.245:22/#@www.google.com:80/ (already covered by RFI rule 931100)
|
|
287
|
+
# http://google.com:80\\@127.88.23.245:22/ (already covered by RFI rule 931100)
|
|
288
|
+
# http://google.com:80+&@127.88.23.245:22/#+@google.com:80/
|
|
289
|
+
# http://google.com:80+&@google.com:80#+@127.88.23.245:22/
|
|
290
|
+
#
|
|
291
|
+
# Regular expression generated from regex-assembly/934120.ra.
|
|
292
|
+
# To update the regular expression run the following shell script
|
|
293
|
+
# (consult https://coreruleset.org/docs/development/regex_assembly/ for details):
|
|
294
|
+
# crs-toolchain regex update 934120
|
|
295
|
+
#
|
|
296
|
+
SecRule REQUEST_COOKIES|!REQUEST_COOKIES:/__utm/|REQUEST_COOKIES_NAMES|REQUEST_FILENAME|ARGS_NAMES|ARGS|XML:/* "@rx (?i)(?: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)://(?:[0-9]{10}|(?:0x[0-9a-f]{2}\.){3}0x[0-9a-f]{2}|0x(?:[0-9a-f]{8}|[0-9a-f]{16})|(?:0{1,4}[0-9]{1,3}\.){3}0{1,4}[0-9]{1,3}|[0-9]{1,3}\.(?:[0-9]{1,3}\.[0-9]{5}|[0-9]{8})|(?:\x5c\x5c[\-0-9a-z]\.?_?)+|\[[0-:a-f]+(?:[\.0-9]+|%[0-9A-Z_a-z]+)?\]|[a-z][\-\.0-9A-Z_a-z]{1,255}:[0-9]{1,5}(?:#?[\s\x0b]*&?@(?:(?:[0-9]{1,3}\.){3}[0-9]{1,3}|[a-z][\-\.0-9A-Z_a-z]{1,255}):[0-9]{1,5}/?)+|[\.0-9]{0,11}(?:\xe2(?:\x91[\xa0-\xbf]|\x92[\x80-\xbf]|\x93[\x80-\xa9\xab-\xbf])|\xe3\x80\x82)+)" \
|
|
297
|
+
"id:934120,\
|
|
298
|
+
phase:2,\
|
|
299
|
+
block,\
|
|
300
|
+
capture,\
|
|
301
|
+
t:none,\
|
|
302
|
+
msg:'Possible Server Side Request Forgery (SSRF) Attack: URL Parameter using IP Address',\
|
|
303
|
+
logdata:'Matched Data: %{TX.0} found within %{MATCHED_VAR_NAME}: %{MATCHED_VAR}',\
|
|
304
|
+
tag:'application-multi',\
|
|
305
|
+
tag:'language-multi',\
|
|
306
|
+
tag:'platform-multi',\
|
|
307
|
+
tag:'attack-ssrf',\
|
|
308
|
+
tag:'paranoia-level/2',\
|
|
309
|
+
tag:'OWASP_CRS',\
|
|
310
|
+
tag:'capec/1000/225/664',\
|
|
311
|
+
ver:'OWASP_CRS/4.9.0',\
|
|
312
|
+
severity:'CRITICAL',\
|
|
313
|
+
setvar:'tx.rce_score=+%{tx.critical_anomaly_score}',\
|
|
314
|
+
setvar:'tx.inbound_anomaly_score_pl2=+%{tx.critical_anomaly_score}'"
|
|
315
|
+
|
|
316
|
+
|
|
317
|
+
# [ Perl generic RCE signatures ]
|
|
318
|
+
#
|
|
319
|
+
# Detects Perl-based injection attacks.
|
|
320
|
+
# Example: @{[system whoami]}
|
|
321
|
+
#
|
|
322
|
+
# Regular expression generated from regex-assembly/934140.ra.
|
|
323
|
+
# To update the regular expression run the following shell script
|
|
324
|
+
# (consult https://coreruleset.org/docs/development/regex_assembly/ for details):
|
|
325
|
+
# crs-toolchain regex update 934140
|
|
326
|
+
#
|
|
327
|
+
SecRule REQUEST_COOKIES|!REQUEST_COOKIES:/__utm/|REQUEST_COOKIES_NAMES|ARGS_NAMES|ARGS|XML:/* "@rx ^(?:[^@]|@[^\{])*@+\{.*\}" \
|
|
328
|
+
"id:934140,\
|
|
329
|
+
phase:2,\
|
|
330
|
+
block,\
|
|
331
|
+
capture,\
|
|
332
|
+
t:none,\
|
|
333
|
+
msg:'Perl Injection Attack',\
|
|
334
|
+
logdata:'Matched Data: %{TX.0} found within %{MATCHED_VAR_NAME}: %{MATCHED_VAR}',\
|
|
335
|
+
tag:'application-multi',\
|
|
336
|
+
tag:'language-perl',\
|
|
337
|
+
tag:'platform-multi',\
|
|
338
|
+
tag:'attack-rce',\
|
|
339
|
+
tag:'attack-injection-generic',\
|
|
340
|
+
tag:'paranoia-level/2',\
|
|
341
|
+
tag:'OWASP_CRS',\
|
|
342
|
+
tag:'capec/1000/152/242',\
|
|
343
|
+
ver:'OWASP_CRS/4.9.0',\
|
|
344
|
+
severity:'CRITICAL',\
|
|
345
|
+
setvar:'tx.rce_score=+%{tx.critical_anomaly_score}',\
|
|
346
|
+
setvar:'tx.inbound_anomaly_score_pl2=+%{tx.critical_anomaly_score}'"
|
|
347
|
+
|
|
348
|
+
|
|
349
|
+
SecRule TX:DETECTION_PARANOIA_LEVEL "@lt 3" "id:934015,phase:1,pass,nolog,tag:'OWASP_CRS',ver:'OWASP_CRS/4.9.0',skipAfter:END-REQUEST-934-APPLICATION-ATTACK-GENERIC"
|
|
350
|
+
SecRule TX:DETECTION_PARANOIA_LEVEL "@lt 3" "id:934016,phase:2,pass,nolog,tag:'OWASP_CRS',ver:'OWASP_CRS/4.9.0',skipAfter:END-REQUEST-934-APPLICATION-ATTACK-GENERIC"
|
|
351
|
+
#
|
|
352
|
+
# -= Paranoia Level 3 =- (apply only when tx.detection_paranoia_level is sufficiently high: 3 or higher)
|
|
353
|
+
#
|
|
354
|
+
|
|
355
|
+
SecRule TX:DETECTION_PARANOIA_LEVEL "@lt 4" "id:934017,phase:1,pass,nolog,tag:'OWASP_CRS',ver:'OWASP_CRS/4.9.0',skipAfter:END-REQUEST-934-APPLICATION-ATTACK-GENERIC"
|
|
356
|
+
SecRule TX:DETECTION_PARANOIA_LEVEL "@lt 4" "id:934018,phase:2,pass,nolog,tag:'OWASP_CRS',ver:'OWASP_CRS/4.9.0',skipAfter:END-REQUEST-934-APPLICATION-ATTACK-GENERIC"
|
|
357
|
+
#
|
|
358
|
+
# -= Paranoia Level 4 =- (apply only when tx.detection_paranoia_level is sufficiently high: 4 or higher)
|
|
359
|
+
#
|
|
360
|
+
|
|
361
|
+
|
|
362
|
+
|
|
363
|
+
#
|
|
364
|
+
# -= Paranoia Levels Finished =-
|
|
365
|
+
#
|
|
366
|
+
SecMarker "END-REQUEST-934-APPLICATION-ATTACK-GENERIC"
|