Catching SQL Injection and other Malicious Web Requests

后端 未结 8 1321
灰色年华
灰色年华 2020-12-18 18:18

I am looking for a tool that can detect malicious requests (such as obvious SQL injection gets or posts) and will immediately ban the IP address of the requester/add to a bl

8条回答
  •  余生分开走
    2020-12-18 18:35

    One method that might work for some cases would be to take the sql string that would run if you naively used the form data and pass it to some code that counts the number of statements that would actually be executed. If it is greater than the number expected, then there is a decent chance that an injection was attempted, especially for fields that are unlikely to include control characters such as username.

    Something like a normal text box would be a bit harder since this method would be a lot more likely to return false positives, but this would be a start, at least.

提交回复
热议问题