<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>leinadium &#187; joomla</title>
	<atom:link href="http://www.leinadium.com/tag/joomla/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.leinadium.com</link>
	<description>Techhead. Codewarrior. Legalnerd.</description>
	<lastBuildDate>Fri, 02 Sep 2011 20:09:28 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>php joomla exploit</title>
		<link>http://www.leinadium.com/security/php-joomla-exploit/</link>
		<comments>http://www.leinadium.com/security/php-joomla-exploit/#comments</comments>
		<pubDate>Fri, 23 Jan 2009 10:50:32 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[security]]></category>
		<category><![CDATA[com_article]]></category>
		<category><![CDATA[exploit]]></category>
		<category><![CDATA[hack]]></category>
		<category><![CDATA[joomla]]></category>
		<category><![CDATA[php]]></category>

		<guid isPermaLink="false">http://217.11.59.22/leinadium/?p=17</guid>
		<description><![CDATA[Here&#8217;s the forensic story of one of our joomlaboxes getting hacked, courtesy of Alex: It seems the &#8220;attack&#8221; was coordinated from a single ip, 195.5.117.252. The reverse dns for this IP points to c31.esthost.eu, and there are a lot of services open on that system. I&#8217;ve done a short scan of the host and the [...]]]></description>
			<content:encoded><![CDATA[<p>Here&#8217;s the forensic story of one of our joomlaboxes getting hacked, courtesy of Alex:</p>
<p>It seems the &#8220;attack&#8221; was coordinated from a single ip, 195.5.117.252. The<br />
reverse dns for this IP points to c31.esthost.eu, and there are a lot of<br />
services open on that system. I&#8217;ve done a short scan of the host and the<br />
results are attached in &#8220;scan.txt&#8221;. It seems the host runs openvpn on most of<br />
the ports, which means it is used to disguise the true identity of the<br />
attacker (fx, if the attacker connects himself to the vpn, the external ip of<br />
the site he will visit will be the vpn servers&#8217; ip).</p>
<p>There was one question that bothered me &#8211; HOW did the remote attacker get that<br />
shell on our server? The answer is dead simple and it&#8217;s the awful truth:<br />
SIMPLE PASSWORDS. The &#8220;admin&#8221; user on the joomla install seems to have had the<br />
password &#8220;adminpass&#8221;. I can&#8217;t say wether the password was set remotely, or if<br />
the password was always adminpass, but it is now adminpass. Of course, i<br />
disabled the account, so it can&#8217;t be used anymore.</p>
<p>The password wasn&#8217;t just random trial and error, it was a sure-shot. The<br />
joomla bibtex plugin has a little problem handling some POST-vars, aka it<br />
doesn&#8217;t mysql_real_escape_string or addslashes on the posted data. The exploit is known and you can find more info on this link:<br />
<a href="http://www.milw0rm.com/exploits/4310">http://www.milw0rm.com/exploits/4310 </a></p>
<p>It comes with full info about how to reproduce the bug. I even tested it in<br />
the wild and managed to list users on a couple of sites. On one of them, I<br />
managed to login with FULL administrative access. All this, even though the<br />
password is stored md5-hashed. A simple Google search for the hash revealed<br />
the password (not necesarily the SAME password, but a pwd with the same hash).</p>
<p>So, to sum things up, this is the chain of events: script googles for sites<br />
that expose the com_jombib extension (with, say a simple google search:<br />
inurl:index.<strong style="color: black; background-color: #a0ffff;">php</strong>?option=com_jombib), finds our site, tries the exploit,<br />
and tricks the extension into listing all the joomla users and their md5-<br />
hashed password. A simple google search revealed the true password<br />
(adminpass).</p>
<p>At this stage, the remote user had administrative access to the site. He<br />
now installs a plugin called &#8220;com_article&#8221; &#8211; nothing suspicious about that,<br />
right? The plugin consists of a single <strong style="color: black; background-color: #a0ffff;">php</strong> file &#8211; the <strong style="color: black; background-color: #a0ffff;">php</strong> shell, that was<br />
available at the following link:</p>
<p>The GET parameter is required for the shell to be rendered. Otherwise an error<br />
is thrown. Once the user launched the shell, he edited whatever files he<br />
wanted, and then he uploaded other files as well. And this is the end. Another<br />
compromised box in the wild  <img src='http://www.leinadium.com/wp-includes/images/smilies/icon_sad.gif' alt=':(' class='wp-smiley' /> </p>
<p>I couldn&#8217;t have found out any of the stuff above if it weren&#8217;t for the<br />
accesslogs. It was a good ideea to keep the last 6 months&#8217; archives <img src='http://www.leinadium.com/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' /> </p>
<p>The <strong style="color: black; background-color: #a0ffff;">PHP</strong> shell can be found anywhere on the net (i think), and it had a<br />
&#8220;clever&#8221; trick to disguise its real <strong style="color: black; background-color: #a0ffff;">php</strong> code (it was base64 encoded and inline<br />
compressed TWELVE times &#8211; hence the 12 in the shell12.<strong style="color: black; background-color: #a0ffff;">php</strong> filename).</p>
<p>Any file could&#8217;ve been accessed by the remote attacker and a) deleted b)<br />
searched for various info (passwords, stuff like that). I don&#8217;t know and I<br />
can&#8217;t say what got affected by the shell, as there are no traces in the system<br />
(it is a pseudo-shell, running simple, exec() commands).</p>
<p>As a general preventive measure, systems need to be updated regularly to allow<br />
upstream security patches to be applied. This is true for every linux app,<br />
library, distribution, and for any script (<strong style="color: black; background-color: #ff66ff;">asp</strong>, <strong style="color: black; background-color: #a0ffff;">php</strong>, a.s.o). There is nothing<br />
that the user could&#8217;ve done to prevent this, except for using a stronger password<br />
(even though this is relative &#8211; check this forum thread:</p>
<p>&lt;<a href="http://forum.insidepro.com/viewtopic.php?t=1741">http://forum.insidepro.com/viewtopic.<strong style="color: black; background-color: #a0ffff;">php</strong>?t=1741</a>&gt;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.leinadium.com/security/php-joomla-exploit/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

