Skip to content

Commit 4cf7b94

Browse files
Merge pull request #4 from Rev3rseSecurity/v1.1/dev
v1.1
2 parents a44d185 + 4db2d1a commit 4cf7b94

File tree

5 files changed

+78
-0
lines changed

5 files changed

+78
-0
lines changed

01-SETUP.conf

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,3 +101,15 @@
101101
# default: 1
102102
#
103103
#SecAction "id:22000030,phase:1,nolog,pass,t:none,setvar:tx.wprs_allow_user_enumeration=1"
104+
105+
106+
# -=[ Rule 22000035: DoS Attack ]=-
107+
# This rule enable or disable protection against DoS attacks.
108+
# For example prevent CVE-2018-6389.
109+
#
110+
# setvar:tx.wprs_check_dos=1 = enable DoS protection
111+
# setvar:tx.wprs_check_dos=0 = disable DoS protection
112+
#
113+
# default: 1
114+
#
115+
#SecAction "id:22000035,phase:1,nolog,pass,t:none,setvar:tx.wprs_check_dos=1"

02-INITIALIZATION.conf

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,13 @@ SecRule &tx:wprs_allow_user_enumeration "@eq 0" \
5454
nolog,\
5555
setvar:tx.wprs_allow_user_enumeration=1"
5656

57+
SecRule &tx:wprs_check_dos "@eq 0" \
58+
"phase:1,\
59+
id:22000108,\
60+
pass,\
61+
nolog,\
62+
setvar:tx.wprs_check_dos=1"
63+
5764
SecAction \
5865
"id:22000199,\
5966
phase:1,\

03-BRUTEFORCE.conf

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,20 @@ SecRule tx:wprs_check_bruteforce "@eq 0" \
99
nolog,\
1010
skipAfter:END_WPRS_BRUTEFORCE"
1111

12+
SecRule tx:wprs_check_bruteforce "@eq 0" \
13+
"phase:2,\
14+
id:22100002,\
15+
pass,\
16+
nolog,\
17+
skipAfter:END_WPRS_BRUTEFORCE"
18+
19+
SecRule tx:wprs_check_bruteforce "@eq 0" \
20+
"phase:3,\
21+
id:22100003,\
22+
pass,\
23+
nolog,\
24+
skipAfter:END_WPRS_BRUTEFORCE"
25+
1226
SecMarker BEGIN_WPRS_BRUTEFORCE
1327

1428
SecAction "phase:1,id:22100011,nolog,pass,initcol:ip=%{tx.wprs_client_ip}"

04-EVENTS.conf

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,4 +40,22 @@ SecRule RESPONSE_STATUS "@eq 302" "phase:3,id:22110013,nolog,chain,pass"
4040
tag:'logout',\
4141
msg:'WordPress: User logged out'"
4242

43+
SecRule &RESPONSE_HEADERS:Set-Cookie "@eq 1" "phase:3,id:22110014,nolog,chain,pass"
44+
SecRule &RESPONSE_HEADERS:Location "@eq 0" "id:22110014,nolog,chain"
45+
SecRule REQUEST_METHOD "^POST$" "id:22110014,t:uppercase,nolog,chain"
46+
SecRule &ARGS_POST_NAMES:log "@ge 1" "id:22110014,t:lowercase,nolog,chain"
47+
SecRule &ARGS_POST_NAMES:pwd "@ge 1" "id:22110014,t:lowercase,nolog,chain"
48+
SecRule REQUEST_FILENAME "^/wp\-login\.php" "id:22110014,t:lowercase,\
49+
log,\
50+
rev:'1',\
51+
severity:'6',\
52+
maturity:'9',\
53+
accuracy:'9',\
54+
ver:'%{tx.wprs_version}',\
55+
tag:'wordpress',\
56+
tag:'login',\
57+
tag:'failed',\
58+
logdata:'Login failed with username: %{ARGS_POST:log}',\
59+
msg:'WordPress: Login failed'"
60+
4361
SecMarker END_WPRS_LOG_AUTH

05-HARDENING.conf

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,3 +94,30 @@ SecRule REQUEST_FILENAME "^(/wp\-json/wp/v[0-9]+/users)" "phase:1,id:22200033,\
9494
msg:'WordPress: User enumeration'"
9595

9696
SecMarker END_WPRS_USER_ENUMERATION
97+
98+
SecRule tx:wprs_check_dos "@eq 0" \
99+
"phase:1,\
100+
id:22200036,\
101+
pass,\
102+
nolog,\
103+
skipAfter:END_WPRS_DOS"
104+
105+
SecMarker BEGIN_WPRS_DOS
106+
107+
SecRule REQUEST_URI "@rx ^/wp\-admin/(load\-styles|load\-scripts)\.php.*load\[\]\=([^&,]*,){20,}" "phase:1,id:22200039,\
108+
t:lowercase,t:urlDecode,t:trim,t:normalizePath,t:removeWhitespace,\
109+
block,\
110+
log,\
111+
rev:'1',\
112+
severity:'6',\
113+
maturity:'9',\
114+
accuracy:'9',\
115+
capture,\
116+
ver:'%{tx.wprs_version}',\
117+
tag:'wordpress',\
118+
tag:'dos',\
119+
tag:'cve-2018-6389',\
120+
logdata:'Detected on script: %{TX:1}.php',\
121+
msg:'WordPress: DoS Attack Attempt'"
122+
123+
SecMarker END_WPRS_DOS

0 commit comments

Comments
 (0)