@@ -71,11 +71,14 @@ SecRule REQUEST_FILENAME "^/xmlrpc\.php" \
71
71
"id:9522102,\
72
72
phase:2,\
73
73
t:lowercase,t:normalizePath,t:trim,\
74
- block,\
75
- capture,\
76
- severity:'CRITICAL',\
77
74
tag:'wordpress',\
78
75
tag:'xmlrpc',\
76
+ accuracy:'9',\
77
+ maturity:'1',\
78
+ severity:'NOTICE',\
79
+ ver:'WPHARD/1.0.0',\
80
+ block,\
81
+ capture,\
79
82
logdata:'Request Filename %{REQUEST_FILENAME}',\
80
83
msg:'Wordpress hardening: xmlrpc.php access attempt',\
81
84
setvar:'tx.inbound_anomaly_score_pl1=+%{tx.critical_anomaly_score}'"
@@ -96,11 +99,15 @@ SecMarker "BEGIN_WPHARD_USER_ENUMERATION"
96
99
SecRule REQUEST_URI "@rx (author\=[0-9]+)|(wp/v2/users)" \
97
100
"id:9522104,\
98
101
phase:2,\
99
- block,\
100
102
t:lowercase,t:normalizePath,t:trim,\
101
- severity:'CRITICAL',\
102
103
tag:'wordpress',\
103
104
tag:'enumeration',\
105
+ accuracy:'9',\
106
+ maturity:'1',\
107
+ severity:'NOTICE',\
108
+ ver:'WPHARD/1.0.0',\
109
+ block,\
110
+ capture,\
104
111
logdata:'Request URI %{REQUEST_URI}',\
105
112
msg:'Wordpress hardening: user enumeration detected',\
106
113
setvar:'tx.inbound_anomaly_score_pl1=+%{tx.critical_anomaly_score}'"
@@ -122,11 +129,15 @@ SecRule REQUEST_FILENAME "@rx ^/wp-json/.+" \
122
129
"id:9522107,\
123
130
phase:2,\
124
131
t:lowercase,t:normalizePath,\
125
- block,\
126
- severity:'CRITICAL',\
127
132
tag:'wordpress',\
128
133
tag:'rest-api',\
129
134
tag:'wp-json',\
135
+ accuracy:'9',\
136
+ maturity:'1',\
137
+ severity:'NOTICE',\
138
+ ver:'WPHARD/1.0.0',\
139
+ block,\
140
+ capture,\
130
141
logdata:'Request FILENAME %{REQUEST_FILENAME}',\
131
142
msg:'Wordpress hardening: /wp-json rest api access detected',\
132
143
setvar:'tx.inbound_anomaly_score_pl1=+%{tx.critical_anomaly_score}'"
@@ -148,10 +159,14 @@ SecRule REQUEST_URI "@beginsWith /wp-login.php" \
148
159
"id:9522109,\
149
160
phase:2,\
150
161
t:lowercase,t:normalizePath,t:trim,\
151
- block,\
152
- severity:'CRITICAL',\
153
162
tag:'wordpress',\
154
163
tag:'admin-login',\
164
+ accuracy:'9',\
165
+ maturity:'1',\
166
+ severity:'WARNING',\
167
+ ver:'WPHARD/1.0.0',\
168
+ block,\
169
+ capture,\
155
170
logdata:'detected admin login',\
156
171
msg:'Wordpress hardening: admin login attempt detected',\
157
172
chain"
@@ -175,59 +190,52 @@ SecRule REQUEST_FILENAME "^/wp-cron\.php" \
175
190
"id:9522111,\
176
191
phase:2,\
177
192
t:lowercase,t:normalizePath,t:trim,\
178
- block,\
179
- capture,\
180
- severity:'CRITICAL',\
181
193
tag:'wordpress',\
182
194
tag:'wpcron',\
195
+ accuracy:'9',\
196
+ maturity:'1',\
197
+ severity:'NOTICE',\
198
+ ver:'WPHARD/1.0.0',\
199
+ block,\
200
+ capture,\
183
201
logdata:'Request Filename %{REQUEST_FILENAME}',\
184
202
msg:'Wordpress hardening: /wp-cron.php access attempt',\
185
203
setvar:'tx.inbound_anomaly_score_pl1=+%{tx.critical_anomaly_score}'"
186
204
187
205
SecMarker "END_WPHARD_WPCRON"
188
206
189
- # No direct access to .php files or directory listings. (PL1)
190
- SecRule REQUEST_FILENAME "@rx ^/wp-(content|includes)/([^/]*/)*[^/.]+(\.php)?$" \
207
+ # No direct access to .php files except index.php/wp-admin/xmlrpc/wpcron
208
+ # (regression test)
209
+ SecRule REQUEST_FILENAME "@rx ^(?!.*(?:\/wp-admin\/|(?:^|\/)(index|xmlrpc|wp-cron|wp-login)\.php$)).*\.php$" \
191
210
"id:9522200,\
192
211
phase:2,\
193
212
t:lowercase,t:normalizePath,t:trim,\
194
- block,\
195
- capture,\
196
- severity:'CRITICAL',\
197
213
tag:'wordpress',\
198
- logdata:'Request Filename %{REQUEST_FILENAME}',\
199
- msg:'Wordpress hardening: Direct access to phpfiles or directory listings in wp-content or wp-includes not allowed',\
200
- setvar:'tx.inbound_anomaly_score_pl1=+%{tx.critical_anomaly_score}'"
201
-
202
- # Check for inclusion attacks on index.php (PL2)
203
- # (no regression test yet)
204
- SecRule REQUEST_FILENAME "@endsWith /index.php" \
205
- "id:9522201,\
206
- phase:2,\
207
- t:lowercase,t:normalizePath,t:trim,\
214
+ tag:'direct-access',\
215
+ accuracy:'9',\
216
+ maturity:'1',\
217
+ severity:'NOTICE',\
218
+ ver:'WPHARD/1.0.0',\
208
219
block,\
209
220
capture,\
210
- severity:'CRITICAL',\
211
- tag:'wordpress',\
212
- tag:'inclusion-attack',\
213
- msg:'Inclusion attack detected on index.php',\
214
221
logdata:'Request Filename %{REQUEST_FILENAME}',\
215
- chain"
216
- SecRule ARGS_GET "@contains %2F" \
217
- "setvar:'tx.inbound_anomaly_score_pl2=+%{tx.critical_anomaly_score}',\
218
- chain"
219
- SecRule ARGS_POST "@contains %2F" \
220
- "setvar:'tx.inbound_anomaly_score_pl2=+%{tx.critical_anomaly_score}'"
222
+ msg:'Wordpress hardening: attempt to access php files other than index.php',\
223
+ setvar:'tx.inbound_anomaly_score_pl1=+%{tx.critical_anomaly_score}'"
221
224
222
225
# No direct access to these files (PL1)
223
226
# (regression test)
224
227
SecRule REQUEST_FILENAME "@pmFromFile wordpress-hardening-files.data" \
225
228
"id:9522202,\
226
229
phase:2,\
227
230
t:lowercase,t:normalizePath,t:trim,\
228
- block,\
229
- severity:'CRITICAL',\
230
231
tag:'wordpress',\
232
+ tag:'direct-access',\
233
+ accuracy:'9',\
234
+ maturity:'1',\
235
+ severity:'NOTICE',\
236
+ ver:'WPHARD/1.0.0',\
237
+ block,\
238
+ capture,\
231
239
logdata:'Request Filename %{REQUEST_FILENAME}',\
232
240
msg:'Wordpress hardening: direct file access attempt on files that dont need that',\
233
241
setvar:'tx.inbound_anomaly_score_pl1=+%{tx.critical_anomaly_score}'"
@@ -238,10 +246,14 @@ SecRule REQUEST_FILENAME "@rx .(pl|cgi|py|sh|lua|asp)$" \
238
246
"id:9522203,\
239
247
phase:2,\
240
248
t:lowercase,t:normalizePath,t:trim,\
241
- block,\
242
- severity:'CRITICAL',\
243
249
tag:'wordpress',\
244
250
tag:'only-allow-php-extension',\
251
+ accuracy:'9',\
252
+ maturity:'1',\
253
+ severity:'NOTICE',\
254
+ ver:'WPHARD/1.0.0',\
255
+ block,\
256
+ capture,\
245
257
logdata:'Request Filename %{REQUEST_FILENAME}',\
246
258
msg:'Wordpress hardening: trying another interpreter',\
247
259
setvar:'tx.inbound_anomaly_score_pl2=+%{tx.critical_anomaly_score}'"
@@ -252,24 +264,32 @@ SecRule REQUEST_FILENAME "@rx ^/wp-content/uploads/.*\.(?:s?html?|js|swf|lua)$"
252
264
"id:9522205,\
253
265
phase:2,\
254
266
t:lowercase,t:normalizePath,t:trim,\
255
- block,\
256
- severity:'CRITICAL',\
257
267
tag:'wordpress',\
258
268
tag:'uploads',\
269
+ accuracy:'9',\
270
+ maturity:'1',\
271
+ severity:'NOTICE',\
272
+ ver:'WPHARD/1.0.0',\
273
+ block,\
274
+ capture,\
259
275
logdata:'Request Filename %{REQUEST_FILENAME}',\
260
276
msg:'Wordpress hardening: attempt to access wp-content/uploads nasty stuff',\
261
277
setvar:'tx.inbound_anomaly_score_pl1=+%{tx.critical_anomaly_score}'"
262
278
263
279
# Deny access to sensitive files (Pl1)
264
280
# (regression test)
265
- SecRule REQUEST_FILENAME "@rx \.(conf|htaccess|htpass|sql|orig|bak|db|ini|md|log|git|github|swp$ |DS_STORE$ )($|/)?" \
281
+ SecRule REQUEST_FILENAME "@rx \.(conf|htaccess|htpass|sql|orig|bak|db|ini|md|log|git|github|swp|DS_STORE)($|/)?" \
266
282
"id:9522206,\
267
283
phase:2,\
268
284
t:lowercase,t:normalizePath,t:trim,\
269
- block,\
270
- severity:'CRITICAL',\
271
285
tag:'wordpress',\
272
286
tag:'sensitive-files',\
287
+ accuracy:'9',\
288
+ maturity:'1',\
289
+ severity:'NOTICE',\
290
+ ver:'WPHARD/1.0.0',\
291
+ block,\
292
+ capture,\
273
293
logdata:'Request Filename %{REQUEST_FILENAME}',\
274
294
msg:'Wordpress hardening: denied access to sensitive files',\
275
295
setvar:'tx.inbound_anomaly_score_pl1=+%{tx.critical_anomaly_score}'"
@@ -280,11 +300,15 @@ SecRule REQUEST_FILENAME "@rx ^/wp-json/?$" \
280
300
"id:9522207,\
281
301
phase:2,\
282
302
t:lowercase,t:normalizePath,t:trim,\
283
- block,\
284
- severity:'CRITICAL',\
285
303
tag:'wordpress',\
286
304
tag:'sensitive-files',\
287
305
tag:'wp-json',\
306
+ accuracy:'9',\
307
+ maturity:'1',\
308
+ severity:'NOTICE',\
309
+ ver:'WPHARD/1.0.0',\
310
+ block,\
311
+ capture,\
288
312
logdata:'Request Filename %{REQUEST_FILENAME}',\
289
313
msg:'Wordpress hardening: denied access to ^/wp-json$',\
290
314
setvar:'tx.inbound_anomaly_score_pl1=+%{tx.critical_anomaly_score}'"
0 commit comments