php - Apache2 ModSecurity2 does not work (Ubuntu 14.04)

441

Solution:

The rules at modsecurity_crs_43_csrf_protection.conf is looking a CSRF attack, however, the one you are trying to execute is not CSRF.

You could try this,

  1. Remove Include/usr/share/modsecurity-crs/base_rules/*.conf andInclude /usr/share/modsecurity-crs/optional_rules/*.conf from your/etc/apache2/mods-enabled/security2.conf (I guess you are using Ubuntu).
  2. Create a ruleset in/etc/modsecurity/modsecurity_crs_15_customrules.conf
  3. Include this rule in that fileSecRule REQUEST_URI "secret" "phase:1,t:none,log,deny,id:'9000070001',msg:'Malicious content blocked'"
  4. Runsudo service apache2 restart

Try to hit the same URL from your browser, watch the /var/log/apache2/modsec_audit.log and let me know how it goes.

Thanks,

Daniel

People are also looking for solutions to the problem: php - Merge rows between two arrays of objects based on column value

Source

Didn't find the answer?

Our community is visited by hundreds of web development professionals every day. Ask your question and get a quick answer for free.

Ask a Question

Write quick answer

Do you know the answer to this question? Write a quick response to it. With your help, we will make our community stronger.

Similar questions

Find the answer in similar questions on our website.