andygb — 2013-01-25T12:21:53-05:00 — #1
My website has a search feature which is powered by PHP and MySQL, all searches are then recorded in a text file for analysis. I found that there was a lot of SQL Injection attacks within my log files. I can't actually see any damage to my website or database, but I can't be 100% sure. I was wondering if there are any tools, ideally free ones, which I can use to check the integrity of my files and/or database.
wwb_99 — 2013-01-26T09:50:53-05:00 — #2
There isn't anything I'm aware of that can suit everyone's custom app -- how would it know what should be in the database and what should not be in the database.
That said, you have a vector to walk down -- check out the injections and figure out what they would be doing to your table and then you can probably narrow it down to a small enough sample to be manageable.
andygb — 2013-01-26T14:11:20-05:00 — #3
Well the file structure doesn't change, so it would be possible to hash all the files and monitor for changes, I'm just wondering if there are any tools already made for this purpose? As for the database, I will have to have a re-think.
dklynn — 2013-01-27T03:24:41-05:00 — #4
I just answered something like this yesterday and responded with a file_hash() and recording all executable scripts to a database to check the hashes daily (via CRON). You can write your own script very easily (it has been some time but I believe it took me about a half hour with testing) and then generate the CRON to run your script (preferably from a non-webspace location) frequently (and with a last run field so you know noone else has hacked into your system and run the "update the hash" script to hide their mucking about.
BTW, files don't have to be added or deleted; they can easily be modified by a hacker to include (Java)scripts to perform their malevolence. That's why I said executable files, e.g., php, html and js come immediately to mind.