Um, I don’t remember the last time I saw a site trying to log SQL injection attacks that I couldn’t infiltrate.
You do not need to worry about the weather when someone attacks the site, because at best it is subjective, because the weather is an attack or not. What if a base64 site encodes some values and decodes them before it uses it? Your IDS will not catch it. What if a user wants to publish a piece of code, it is detected as an exploit because it contains SQL? It's such a waste of time ... If you really need to know if someone has attacked you, just install some IDS on a separate machine with read-only access to incoming traffic. I am talking about a separate machine, because many IDS themselves are vulnerable, and only worsen the situation.
Use standard secure programming methodologies; use programmed SQL queries or ORM.
source share