|
We think we have had some sql injection attacks on our debian server and it has caused serious performance decreases, load averages of 35 are not strange since this has happened.
Talking to the dev, he found one candidate script, but it only is accessed 10 times in a timeframe when the SQL is exectued 2,334 times?!? Maybe the attackers managing to repaet the SQL statement?
Anyway now we know what area the the problem is, we want to log the apache requests (get, post, i.p, URL) with the triggered mysql queries, including postdata (as a temporary measure of course) if possible, I thought there would be a module for PHP or cakephp (which the app is made with) or apache but I can't find anything which can link the http info with the mysql info automatically and log it, I want to save our development team from having to update all the code to log the info.
Just thinking out loud I thought a PHP module could intercept the request and script, monitor the scripts thread and see what mysql or other perconfigured database module or connection and just grab the query and log it all together somewhere, sounds simple, not sure the best way to implement it without knowing php_mysql and apache mod_php or php_cgi architecture.
Any help appreciated.
Thanks, George.
|