Bloqueando varreduras no xmlrpc.php pelo ModSecurity

De Wiki Integrator do Brasil
Ir para: navegação, pesquisa

Em máquinas virtuais cloud ou máquinas dedicadas, faça os seguintes passos:

1. Logue-se como root no WHM.
2. Adicione uma nova regra no ModSecurity como ensinamos em Adicionando novas regras no ModSecurity.
3. Coloque as seguintes informações:

#would work for posts with the proper content type specified but may break legit apps :/
SecRule REQUEST_HEADERS:Content-Type "^text/xml$" "phase:1,t:lowercase,nolog,pass,ctl:requestBodyProcessor=XML,id:3997"
SecRule REQBODY_PROCESSOR "!^XML$" "nolog,pass,skip:1,id:3998"
SecRule REQUEST_URI "xmlrpc.php" "t:lowercase,id:3999,deny,status:500,chain"
SecRule XML:/methodCall/methodName/text() system.multicall

#testing this because some POSTs are coming in as "application/x-www-form-urlencoded" not "text/XML"
SecRule REQUEST_URI "xmlrpc.php" "deny,id:4000,chain"
SecRule REQUEST_BODY "system.multicall" "chain"
SecRule REQUEST_BODY "wp\.(getCategories|getUsersBlogs)"