Support

Admin Tools

#13046 File Change scanner - making it more useful

Posted in ‘Admin Tools for Joomla! 4 & 5’
This is a public ticket

Everybody will be able to see its contents. Do not include usernames, passwords or any other sensitive information.

Environment Information

Joomla! version
n/a
PHP version
n/a
Admin Tools version
n/a

Latest post by on Tuesday, 28 August 2012 18:00 CDT

lausianne
Admin Tools 2.2.10


Hello Nicholas,

recently some of my sites were hacked, so I have become a bit more sensitive to the issue. I noticed the hacks very quickly, because on one of my sites (not Joomla) I have a scanner running, that notifies me by email whenever any file on the system is changed.

Admin Tools has the handy PHP File Change Scanner. It only scans php files, whis is probably ok, because most hackers will not change js or html files only. (In my case php, js, and html files were changed.)

What I am more concerned about is, that your scanner is only useful when actively checked.

(I read your article about cron jobs for scanning. I have no access to cron jobs on any of my hostings, but my hosters can set it up for me. But why is it necessary at all? What if the scanner simply ran once a day, triggered by a site access?)

Still, there is the active checking issue. I'm surely not going to look at scanning results every day on every site. I.e. email notification would be super cool, so I can notice a threat before the client or Google does.

Am I missing a point here, or would this be a point you could look into someday?

Thank you!

Best regards,
Ralf.


EDIT: After reading a bit more, I realized that scanning can be a resource intensive process. So if I could choose a few files that I'd like to be checked often and notified about changes (such as the main index.php), that would be nice ...

nicholas
Akeeba Staff
Manager
Hi Ralf,

What if the scanner simply ran once a day, triggered by a site access?

The scan is exactly like the backup. It cannot run triggered by site access. Remember, I've tried that with backup and the problems were so many that I had to kill that feature. It's the only case of removing a feature from my software, ever.

After reading a bit more, I realized that scanning can be a resource intensive process. So if I could choose a few files that I'd like to be checked often and notified about changes (such as the main index.php), that would be nice ...

This gives a false sense of security. If I were to hack your site here's what I'd do:
- Find a way to upload arbitrary files to your site
- Upload a malicious file (e.g. a C99 variant) with an inconspicuous name like README.php deep inside your site's directory structure
- Wait for one to two months. This makes sure that all your backups and your host's backups include my malicious file.
- Hack your site and remove my malicious file.
Up next, you figure out you're hacked. You run the file scan and you see that only a few files have been modified, none was added. Cool, you think, all you have to do is restore a backup. My monitoring CRON job, running over a botnet or Tor so that you don't track me down, tells me you did so. Ha ha! I just relaunch my attack. Hacked again. Repeat as often as you want until I am bored.

Am I missing a point here, or would this be a point you could look into someday?


You are missing something. In my real world scenario above a file scan checking only specific files gives you a false sense of security. By the time these files are modified the damage is long and deeply done. Not to mention that checking even a dozen files has an adverse hit on your server's performance.

I have no access to cron jobs on any of my hostings

CRON jobs is to a hosting plan what water supply is to a condo. Would you ever buy a condo without water supply? I mean, yeah, you can probably survive but it will be a smelly, inconvenient mess. Go to a real host which supports CRON jobs.

Nicholas K. Dionysopoulos

Lead Developer and Director

πŸ‡¬πŸ‡·Greek: native πŸ‡¬πŸ‡§English: excellent πŸ‡«πŸ‡·French: basic β€’ πŸ• My time zone is Europe / Athens
Please keep in mind my timezone and cultural differences when reading my replies. Thank you!

lausianne
Hi Nicholas,

ok, drop the site access idea.

> So if I could choose a few files that I'd like to be checked often and notified about changes (such as the main index.php), that would be nice ...

This gives a false sense of security.

I prefer a false sense of security to a true sense of insecurity any time, when there's nothing reasonable I can do to improve security ... Anyway, this was not meant to replace a complete scan, but to complement it. Because a single file could be scanned quickly many times a day, while you can hardly do a full scan many times a day.
> I have no access to cron jobs on any of my hostings

CRON jobs is to a hosting plan what water supply is to a condo. Would you ever buy a condo without water supply? I mean, yeah, you can probably survive but it will be a smelly, inconvenient mess. Go to a real host which supports CRON jobs.

Well, it's not exactly the same, I don't need to set up a cron job every day, but I'm glad I have water every day. My hosters do set up cron jobs for me, only I cannot do it myself. I understand that, since too much could go wrong there.

The real big point for me is that I definitely need some notification (preferably email) when something happens to my files, because I cannot check all sites manually every day, not even weekly. Even checking once per month gets boring soon, and is not enough. I wonder how other users of your scanner do that.

This week I subscribed to a scanning service, binarycanary.com, which has various nice options for scanning and doesn't cost much. Only I have not been able to get it to work properly and the support is not super-responsive. And I still believe your scanner is a better solution, at least if it had a notification. The only disadvantage is that your scanner could be manipulated by a hacker, binarycanary (or similar) not so much.

nicholas
Akeeba Staff
Manager
Hello Ralf,

I disagree about the false of security being useful. I could give you a garbage bag and ask you to wear it as a vest, telling you that it'll protect you from bullets, then send you to fight in the war. This is what false sense of security means, Would like me to do that? I would consider myself a big SOB if I would ever do that. Don't ask me to send you to get killed, I won't do it, sorry.

Regarding the automatic emails, yes, that's missing. It's already on my to-do list for the next version. I had to complete some work on the Akeeba Engine (the engine which powers both Akeeba Backup and Admin Tools' file scanner) to allow that. The changes are complete and tested. Now I can add the email feature :)

Regarding the scanner being manipulated by a hacker, yes, that's a real concern. It would require an elaborate hacker but it's possible. There is an alternative. Take daily backuos of your site and compare them with SiteDiff, or use a third party service. In fact, I don't consider Admin Tools' file scanner to be a panacea. It's supposed to be part of your overall security strategy. Ideally you should be using AT along with a third party service and log inspection to have a real sense of security.

Nicholas K. Dionysopoulos

Lead Developer and Director

πŸ‡¬πŸ‡·Greek: native πŸ‡¬πŸ‡§English: excellent πŸ‡«πŸ‡·French: basic β€’ πŸ• My time zone is Europe / Athens
Please keep in mind my timezone and cultural differences when reading my replies. Thank you!

lausianne
I disagree about the false of security being useful.

I totally agree that it's not useful, but it feels better, if I can't do anything anyway. Your vest example is perfect.

Great, that you're already about to work on the email feature. Daily backup is a bit of an overkill for any of my sites. But I have used mySQLdumper in the past, to save the DB at least, because files don't change that often.

To avoid scanner manipulation, maybe you should not make the scanner too good, otherwise it becomes too popular and too interesting as a target for hackers ...


nicholas
Akeeba Staff
Manager
Your vest example is perfect.

That's something which has nearly happened to me. When I was serving in the military (it's mandatory for all Greeks, I'm not a big fan of aggression as a means of dispute resolution) I had to stand guard at the back entrance of the camp. We were given a bulletproof vest because half a mile to the north there was a gypsy camp and these guys, when drunk, would sometime end up shooting towards our camp with shotguns. I thought the vest was a good idea, it made me feel secure. Little did I know that they forgot to give me the part of the vest which actually blocks the bullets: the steel plates. So I was a sitting duck for four hours, all the while thinking I'm (relatively) bullet-proof. Oops! Luckily for me that day the gypsies didn't get drunk or were out of ammo. So, yeah, I've been in the position of wearing a non-bulletproof "bulletproof" vest and I did not enjoy it at all. I'll be damned if I willingly put anyone in that spot – or its Internet equivalent.

To avoid scanner manipulation, maybe you should not make the scanner too good, otherwise it becomes too popular and too interesting as a target for hackers ...

Anything which runs on a server can be a potential target for abuse or manipulation ;)

Nicholas K. Dionysopoulos

Lead Developer and Director

πŸ‡¬πŸ‡·Greek: native πŸ‡¬πŸ‡§English: excellent πŸ‡«πŸ‡·French: basic β€’ πŸ• My time zone is Europe / Athens
Please keep in mind my timezone and cultural differences when reading my replies. Thank you!

lausianne
Problem solved, I guess:
http://www.jmonitoring.com/en/news/27-akeeba-backup-integre-un-plugin-jmonitoring.html

I also found a monitoring app for my Android:
https://play.google.com/store/apps/details?id=com.gabrouze.monitoring&hl=en

nicholas
Akeeba Staff
Manager
For what is worth, I finished writing the email feature for the PHP file scanner yesterday. I plan on releasing a new version of Admin Tools this week :)

Nicholas K. Dionysopoulos

Lead Developer and Director

πŸ‡¬πŸ‡·Greek: native πŸ‡¬πŸ‡§English: excellent πŸ‡«πŸ‡·French: basic β€’ πŸ• My time zone is Europe / Athens
Please keep in mind my timezone and cultural differences when reading my replies. Thank you!

System Task
system
This ticket has been automatically closed. All tickets which have been inactive for a long time are automatically closed. If you believe that this ticket was closed in error, please contact us.

Support Information

Working hours: We are open Monday to Friday, 9am to 7pm Cyprus timezone (EET / EEST). Support is provided by the same developers writing the software, all of which live in Europe. You can still file tickets outside of our working hours, but we cannot respond to them until we're back at the office.

Support policy: We would like to kindly inform you that when using our support you have already agreed to the Support Policy which is part of our Terms of Service. Thank you for your understanding and for helping us help you!