2025-01-06 00:28:11 +00:00

17 lines
1.9 KiB
Plaintext

# Apache ModSecurity rules for LFI
SecRuleEngine On
SecRule REQUEST_URI "@lt 1" "id:1525,phase:1,deny,status:403,log,msg:'lfi attack detected'"
SecRule REQUEST_URI "@lt 1" "id:1526,phase:1,deny,status:403,log,msg:'lfi attack detected'"
SecRule REQUEST_URI "@rx (?i)(?:[/x5c]|%(?:2(?:f|5(?:2f|5c|c(?:1%259c|0%25af))|%46)|5c|c(?:0%(?:[2aq]f|5c|9v)|1%(?:[19p]c|8s|af))|(?:bg%q|(?:e|f(?:8%8)?0%8)0%80%a)f|u(?:221[5-6]|EFC8|F025|002f)|%3(?:2(?:%(?:%6|4)6|F)|5%%63)|1u)|0x(?:2f|5c))(?:.(?:%0[0-1]|?)?|?.?|%(?:2(?:(?:5(?:2|c0%25a))?e|%45)|c0(?:.|%[25-6ae-f]e)|u(?:(?:ff0|002)e|2024)|%32(?:%(?:%6|4)5|E)|(?:e|f(?:(?:8|c%80)%8)?0%8)0%80%ae)|0x2e){2,3}(?:[/x5c]|%(?:2(?:f|5(?:2f|5c|c(?:1%259c|0%25af))|%46)|5c|c(?:0%(?:[2aq]f|5c|9v)|1%(?:[19p]c|8s|af))|(?:bg%q|(?:e|f(?:8%8)?0%8)0%80%a)f|u(?:221[5-6]|EFC8|F025|002f)|%3(?:2(?:%(?:%6|4)6|F)|5%%63)|1u)|0x(?:2f|5c))" "id:1527,phase:1,deny,status:403,log,msg:'lfi attack detected'"
SecRule REQUEST_URI "@rx (?:(?:^|[x5c/;]).{2,3}[x5c/;]|[x5c/;].{2,3}(?:[x5c/;]|$))" "id:1528,phase:1,deny,status:403,log,msg:'lfi attack detected'"
SecRule REQUEST_URI "@pmFromFile lfi-os-files.data" "id:1529,phase:1,deny,status:403,log,msg:'lfi attack detected'"
SecRule REQUEST_URI "@pmFromFile restricted-files.data" "id:1530,phase:1,deny,status:403,log,msg:'lfi attack detected'"
SecRule REQUEST_URI "@lt 2" "id:1531,phase:1,deny,status:403,log,msg:'lfi attack detected'"
SecRule REQUEST_URI "@lt 2" "id:1532,phase:1,deny,status:403,log,msg:'lfi attack detected'"
SecRule REQUEST_URI "@pmFromFile lfi-os-files.data" "id:1533,phase:1,deny,status:403,log,msg:'lfi attack detected'"
SecRule REQUEST_URI "@lt 3" "id:1534,phase:1,deny,status:403,log,msg:'lfi attack detected'"
SecRule REQUEST_URI "@lt 3" "id:1535,phase:1,deny,status:403,log,msg:'lfi attack detected'"
SecRule REQUEST_URI "@lt 4" "id:1536,phase:1,deny,status:403,log,msg:'lfi attack detected'"
SecRule REQUEST_URI "@lt 4" "id:1537,phase:1,deny,status:403,log,msg:'lfi attack detected'"