wargulek
07-09-2017, 18:21
Witam przy wyłączonym mod security co jakiś czas powstaje skrypt na koncie w różnych miejscach wysyłający spam. Następnie włącza się automatycznie zabezpieczenie serwera i powstaje blokada na wysyłkę maili. Włączenie mod_security powoduje pewien hamulec jednak wtedy nie działają komentarze na stronie. W logach jest coś takiego (ip wykomentowano):
2017-09-07 15:28:43.324 [NOTICE] [xxx.xxx.xx.xxx:53961:HTTP2-15] mod_security rule [Id '211540'] triggered!
[Thu Sep 7 15:28:43 2017] [error] [client [xxx.xxx.xx.xxx] ModSecurity: Access denied with code 406, [Rule: 'ARGS|ARGS_NAMES|REQUEST_COOKIES|REQUEST_COOKIES_N AMES|XML:/*|!ARGS:/body/|!ARGS:/content/|!ARGS:customized|!ARGS:/description/|!ARGS:/message/|!ARGS:/password/|!ARGS:Post|!ARGS:desc|!ARGS:text|!REQUEST_COOKIES :/__utm/|!REQUEST_COOKIES:/_pk_ref/|!ARGS:sql_query' '(?i:\b(?:t(?:able_name\b|extpos[^a-zA-Z0-9_]{1,}\()|(?:a(?:ll_objects|tt(?:rel|typ)id)|column_ (?:id|name)|mb_users|object_(?:id|(?:nam|typ)e)|pg _(?:attribute|class)|rownum|s(?:ubstr(?:ing){0,1}| ys(?:c(?:at|o(?:lumn|nstraint)s)|dba|ibm|(?:filegr oup|object|(?:process|tabl)e)s))|user_(?:group|pas sword|(?:ind_column|tab(?:_column|le)|user|(?:cons train|objec)t)s)|xtype[^a-zA-Z0-9_]{1,}\bchar)\b)|(?:\b(?:(?:instr|locate)[^a-zA-Z0-9_]{1,}\(|(?:attnotnull|c(?:harindex|onstraint_type)| m(?:sys(?:column|object|relationship|(?:ac|queri)e )s|ysql\.(db|user))|s(?:elect\b.{0,40}\b(?:ascii|s ubstring|users{0,1})|ys\.(?:all_tables|tab|user_(? :c(?:atalog|onstraints)|(?:object|t(?:ab(?:_column |le)|rigger)|view)s)))|waitfor\b[^a-zA-Z0-9_]{0,}?\bdelay)\b)|@@spid\b))'] [id "211540"] [msg "COMODO WAF: Blind SQL Injection Attack"]
2017-09-07 15:28:43.324 [NOTICE] [[xxx.xxx.xx.xxx:53961:HTTP2-15] Content len: 99, Request line: 'POST /component/jcomments/ HTTP/1.1' Ustawienie SecRuleRemoveById 211540 w htaccess daje efekt jak na początku przy wyłączonym mod_security, więc problem jest to co w logu.
Co to jest i jak się ustrzec, dziura w jcomments? Zainstalowana najnowsza dostępna wersja tego dodatku 3.0.5
Blokada na ip pomoże rozwiązać problem tylko częściowo.
2017-09-07 15:28:43.324 [NOTICE] [xxx.xxx.xx.xxx:53961:HTTP2-15] mod_security rule [Id '211540'] triggered!
[Thu Sep 7 15:28:43 2017] [error] [client [xxx.xxx.xx.xxx] ModSecurity: Access denied with code 406, [Rule: 'ARGS|ARGS_NAMES|REQUEST_COOKIES|REQUEST_COOKIES_N AMES|XML:/*|!ARGS:/body/|!ARGS:/content/|!ARGS:customized|!ARGS:/description/|!ARGS:/message/|!ARGS:/password/|!ARGS:Post|!ARGS:desc|!ARGS:text|!REQUEST_COOKIES :/__utm/|!REQUEST_COOKIES:/_pk_ref/|!ARGS:sql_query' '(?i:\b(?:t(?:able_name\b|extpos[^a-zA-Z0-9_]{1,}\()|(?:a(?:ll_objects|tt(?:rel|typ)id)|column_ (?:id|name)|mb_users|object_(?:id|(?:nam|typ)e)|pg _(?:attribute|class)|rownum|s(?:ubstr(?:ing){0,1}| ys(?:c(?:at|o(?:lumn|nstraint)s)|dba|ibm|(?:filegr oup|object|(?:process|tabl)e)s))|user_(?:group|pas sword|(?:ind_column|tab(?:_column|le)|user|(?:cons train|objec)t)s)|xtype[^a-zA-Z0-9_]{1,}\bchar)\b)|(?:\b(?:(?:instr|locate)[^a-zA-Z0-9_]{1,}\(|(?:attnotnull|c(?:harindex|onstraint_type)| m(?:sys(?:column|object|relationship|(?:ac|queri)e )s|ysql\.(db|user))|s(?:elect\b.{0,40}\b(?:ascii|s ubstring|users{0,1})|ys\.(?:all_tables|tab|user_(? :c(?:atalog|onstraints)|(?:object|t(?:ab(?:_column |le)|rigger)|view)s)))|waitfor\b[^a-zA-Z0-9_]{0,}?\bdelay)\b)|@@spid\b))'] [id "211540"] [msg "COMODO WAF: Blind SQL Injection Attack"]
2017-09-07 15:28:43.324 [NOTICE] [[xxx.xxx.xx.xxx:53961:HTTP2-15] Content len: 99, Request line: 'POST /component/jcomments/ HTTP/1.1' Ustawienie SecRuleRemoveById 211540 w htaccess daje efekt jak na początku przy wyłączonym mod_security, więc problem jest to co w logu.
Co to jest i jak się ustrzec, dziura w jcomments? Zainstalowana najnowsza dostępna wersja tego dodatku 3.0.5
Blokada na ip pomoże rozwiązać problem tylko częściowo.