# --------------------------------------------------------------- # Comodo ModSecurity Rules # Copyright (C) 2022 Comodo Security solutions All rights reserved. # # The COMODO SECURITY SOLUTIONS Mod Security Rule Set is distributed under # THE COMODO SECURITY SOLUTIONS END USER LICENSE AGREEMENT, # Please see the enclosed LICENCE file for full details. # --------------------------------------------------------------- # This is a FILE CONTAINING CHANGED or MODIFIED RULES FROM THE: # OWASP ModSecurity Core Rule Set (CRS) # --------------------------------------------------------------- SecRule REQUEST_FILENAME "@pm /wp- /node /admin" \ "id:211350,chain,msg:'COMODO WAF: IGNORE_CRS||%{tx.domain}|%{tx.mode}|2',phase:2,pass,nolog,t:none,t:urlDecodeUni,t:normalisePath,skipAfter:'IGNORE_CRS_Generic',rev:1,severity:2,tag:'CWAF',tag:'Generic'" SecRule MATCHED_VARS "@rx (?:\/wp-admin\/[a-z\-\_]+?\.php)|(?:\/wp-comments-post\.php)|(?:\/node\/\d+\/edit$)|(?:\/administrator\/(index\d?|options|postarticles|contactus|homepagecontent|functions\/update_article)\.php)|(?:\/admin\w*?\/)" \ "setvar:'TX.CWAF_modsec=1',t:none,t:urlDecodeUni,t:normalisePath,t:lowercase" SecRule ARGS|ARGS_NAMES|REQUEST_COOKIES|REQUEST_COOKIES_NAMES|XML:/*|!ARGS:/body/|!ARGS:/content/|!ARGS:/description/|!ARGS:/message/|!ARGS:Post|!ARGS:desc|!ARGS:text|!REQUEST_COOKIES:/__utm/|!REQUEST_COOKIES:/_pk_ref/ "@pm cmd echo exec include printenv" \ "id:211040,chain,msg:'COMODO WAF: SSI injection Attack||%{tx.domain}|%{tx.mode}|2',phase:2,block,setvar:'tx.matched_var_name=%{MATCHED_VAR_NAME}',logdata:'Matched Data: %{TX.0} found within %{tx.matched_var_name}: %{MATCHED_VAR}',ctl:auditLogParts=+E,t:none,rev:3,severity:2,tag:'CWAF',tag:'Generic'" SecRule MATCHED_VAR "@rx <\!--[^a-zA-Z0-9_]{0,}?#[^a-zA-Z0-9_]{0,}?(?:cmd|e(?:cho|xec)|include|printenv)" \ "capture,setvar:'tx.points=+%{tx.points_limit4}',t:none,t:urlDecodeUni,t:htmlEntityDecode,t:lowercase" SecRule QUERY_STRING|REQUEST_BODY "@pm =http =ftp" \ "id:211110,chain,msg:'Possible Remote File Inclusion (RFI) Attack: Common RFI Vulnerable Parameter Name used w/URL Payload||%{tx.domain}|%{tx.mode}|2',phase:2,capture,block,setvar:'tx.matched_var_name=%{MATCHED_VAR_NAME}',logdata:'Matched Data: %{TX.0} found within %{tx.matched_var_name}: %{MATCHED_VAR}',ctl:auditLogParts=+E,t:none,rev:4,severity:2,tag:'CWAF',tag:'Generic'" SecRule MATCHED_VAR "@rx (?i:(\binclude\s*\([^)]*|mosConfig_absolute_path|_CONF\[path\]|_SERVER\[DOCUMENT_ROOT\]|GALLERY_BASEDIR|path\[docroot\]|appserv_root|config\[root_dir\])=(ht|f)tps?:\/\/)" \ "setvar:'tx.points=+%{tx.points_limit4}',t:none,t:urlDecodeUni" SecRule ARGS|!ARGS_POST:jform[params][yt_link] "@rx ^(?i)(?:ft|htt)ps?(.{0,399}?)\?+$" \ "id:211120,chain,msg:'COMODO WAF: Remote File Inclusion Attack||%{tx.domain}|%{tx.mode}|2',phase:2,capture,block,logdata:'Matched Data: %{TX.0} found within %{MATCHED_VAR_NAME}: %{MATCHED_VAR}',ctl:auditLogParts=+E,t:none,t:lowercase,t:urlDecodeUni,rev:12,severity:2,tag:'CWAF',tag:'Generic'" SecRule REQUEST_FILENAME "!@endsWith /modules/paypal/express_checkout/payment.php" \ "setvar:'tx.points=+%{tx.points_limit4}',t:none,t:lowercase,t:urlDecodeUni,t:normalizePath" SecRule ARGS|ARGS_NAMES|REQUEST_COOKIES|REQUEST_COOKIES_NAMES|XML:/*|!ARGS:/body/|!ARGS:/content/|!ARGS:/description/|!ARGS:/message/|!ARGS:Post|!ARGS:desc|!ARGS:text|!REQUEST_COOKIES:/__utm/|!REQUEST_COOKIES:/_pk_ref/ "@pmFromFile bl_input" \ "id:211140,phase:2,pass,setvar:'tx.pm_points=+1',nolog,t:none,t:htmlEntityDecode,t:compressWhiteSpace,t:lowercase,rev:1,severity:2,tag:'CWAF',tag:'Generic'" SecRule TX:PM_POINTS "@eq 0" \ "id:211150,phase:2,pass,nolog,t:none,skipAfter:'SECMARKER_211040',rev:1,severity:2,tag:'CWAF',tag:'Generic'" SecRule ARGS|ARGS_NAMES|REQUEST_COOKIES|REQUEST_COOKIES_NAMES|XML:/*|!ARGS:/body/|!ARGS:/content/|!ARGS:/description/|!ARGS:/message/|!ARGS:Post|!ARGS:desc|!ARGS:text|!REQUEST_COOKIES:/__utm/|!REQUEST_COOKIES:/_pk_ref/ "@pm expires domain set-cookie" \ "id:211160,chain,msg:'COMODO WAF: Session Fixation Attack||%{tx.domain}|%{tx.mode}|2',phase:2,block,setvar:'tx.matched_var_name=%{MATCHED_VAR_NAME}',logdata:'Matched Data: %{TX.0} found within %{tx.matched_var_name}: %{MATCHED_VAR}',ctl:auditLogParts=+E,t:none,t:lowercase,rev:4,severity:2,tag:'CWAF',tag:'Generic'" SecRule MATCHED_VAR "@rx (?i)(?:\.cookie\b.{0,399}?;\W*?(?:expires|domain)\W*?=|\bhttp-equiv\W+set-cookie\b)" \ "capture,setvar:'tx.points=+%{tx.points_limit4}',t:none,t:urlDecodeUni" SecRule ARGS_NAMES "@pm jsessionid aspsessionid asp.net_sessionid phpsession phpsessid weblogicsession cfid cftoken cfsid jservsession jwsession" \ "id:211170,chain,msg:'COMODO WAF: Session Fixation: SessionID Parameter Name with Off-Domain Referer||%{tx.domain}|%{tx.mode}|2',phase:2,block,setvar:'tx.matched_var_name=%{MATCHED_VAR_NAME}',logdata:'Matched Data: %{TX.0} found within %{tx.matched_var_name}: %{MATCHED_VAR}',ctl:auditLogParts=+E,t:none,t:lowercase,rev:6,severity:2,tag:'CWAF',tag:'Generic'" SecRule REQUEST_HEADERS:Referer "!@contains %{SERVER_NAME}" \ "capture" SecRule ARGS_NAMES "@pm jsession jsessionid aspsessionid asp.net_sessionid phpsession phpsessid weblogicsession session_id session-id cfid cftoken cfsid jservsession jwsession" \ "id:211180,chain,msg:'COMODO WAF: Session Fixation: SessionID Parameter Name with No Referer||%{tx.domain}|%{tx.mode}|2',phase:2,capture,block,logdata:'Matched Data: %{TX.0} found within %{MATCHED_VAR_NAME}: %{MATCHED_VAR}',ctl:auditLogParts=+E,t:none,t:lowercase,rev:3,severity:2,tag:'CWAF',tag:'Generic'" SecRule &REQUEST_HEADERS:Referer "@eq 0" \ "setvar:'tx.points=+%{tx.points_limit4}',t:none" SecRule ARGS|ARGS_NAMES|REQUEST_COOKIES|REQUEST_COOKIES_NAMES|XML:/*|!ARGS:/body/|!ARGS:code|!ARGS:/content/|!ARGS:/description/|!ARGS:/install\[values\]\[\w+\]\[fileDenyPattern\]/|!ARGS:/message/|!ARGS:Post|!ARGS:desc|!ARGS:text|!REQUEST_COOKIES:/__utm/|!REQUEST_COOKIES:/_pk_ref/|!ARGS:wpTextbox1 "(?:(?