<?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>Dmitry Dovidenko's Blog &#187; Networking</title>
	<atom:link href="http://rootit.org/category/everything-related-to-networking/feed/" rel="self" type="application/rss+xml" />
	<link>http://rootit.org</link>
	<description>"A flatterer is a friend who is your inferior, or pretends to be so." - Aristotle</description>
	<lastBuildDate>Thu, 17 Dec 2009 13:23:01 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.6</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>NFS Shares on CentOS</title>
		<link>http://rootit.org/2008/07/nfs-shares-on-centos/</link>
		<comments>http://rootit.org/2008/07/nfs-shares-on-centos/#comments</comments>
		<pubDate>Sun, 06 Jul 2008 01:10:06 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Networking]]></category>

		<guid isPermaLink="false">http://rootit.org/?p=9</guid>
		<description><![CDATA[Many situations require a &#8220;share&#8221; of some sort where data is accessible on several machines from a common source. This way data does not have to be duplicated every time and can be accessed over network. The two popular methods are NFS and Samba. For this tutorial we will try to use NFS. Setting up [...]]]></description>
			<content:encoded><![CDATA[<p>Many situations require a &#8220;share&#8221; of some sort where data is accessible on several machines from a common source. This way data does not have to be duplicated every time and can be accessed over network. The two popular methods are NFS and Samba. For this tutorial we will try to use NFS. Setting up NFS shares on CentOS is fairly easy and mounting them is even simpler!<span id="more-9"></span></p>
<p><strong>I. The server that holds the content to be shared:</strong></p>
<p>First you will want to install the needed apps and libraries:</p>
<blockquote><p>yum install -y nfs-utils nfs-utils-lib nfs-utils-lib-devel</p></blockquote>
<p>Then you should edit /etc/exports and setup your shares. The format is &#8220;/path/to/share ip.ad.dre.ss(options,options) ip.ad.dre.ss(options,options) etc&#8230;&#8221; You should end up with a file like this:</p>
<blockquote><p>/home/something/content1/ 192.168.1.101(async,no_subtree_check,rw) 192.168.1.102(async,no_subtree_check,rw)<br />
/home/something/content2/ 192.168.1.101(async,no_subtree_check,rw) 192.168.1.102(async,no_subtree_check,rw)<br />
/home/something/content3/ 192.168.1.101(async,no_subtree_check,rw) 192.168.1.102(async,no_subtree_check,rw)</p></blockquote>
<p>Then you will want to edit /etc/hosts.allow and add something like:</p>
<blockquote><p>portmap: 192.168.1.101, 192.168.1.102</p></blockquote>
<p>Then start services:</p>
<blockquote><p>/etc/init.d/portmap start<br />
/etc/init.d/nfs start</p></blockquote>
<p>Then make sure the services start on boot:</p>
<blockquote><p>chkconfig nfs on<br />
chkconfig portmap on</p></blockquote>
<p><strong>II. The servers that are pulling the content over NFS:</strong></p>
<p>This is the easy part. You just have to mount the share via /etc/fstab. The format is &#8220;nfshost:/nfs/share /path/to/mount/to nfs option,option,option 0 0&#8243;. So go ahead and open /etc/fstab and add something like this:</p>
<blockquote><p>192.168.1.1:/home/something/content1/    /home/mydomain/public_html/mycontent1    nfs    rw,hard,intr    0 0</p></blockquote>
<p>Then you just need to run:</p>
<blockquote><p>mount -a</p></blockquote>
<p>Which should mount everything in fstab. If there are errors re-read the tutorial and make sure they are nfs related errors, not other errors in your fstab! Google is your friend!</p>
]]></content:encoded>
			<wfw:commentRss>http://rootit.org/2008/07/nfs-shares-on-centos/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Linksys RVS4000 Hacking &#8211; Part I</title>
		<link>http://rootit.org/2008/06/linksys-rvs4000-p1/</link>
		<comments>http://rootit.org/2008/06/linksys-rvs4000-p1/#comments</comments>
		<pubDate>Sun, 29 Jun 2008 07:59:39 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Networking]]></category>

		<guid isPermaLink="false">http://rootit.org/?p=4</guid>
		<description><![CDATA[Remember when CompUSA went out of business? Well if you don&#8217;t then you missed a great opportunity to buy cool gear cheap the last few days they were open. I got quite a haul myself and spent less than $400! This includes my Garmin StreetPilot c580 GPS unit and my Linksys RVS4000 which is the [...]]]></description>
			<content:encoded><![CDATA[<p>Remember when CompUSA went out of business? Well if you don&#8217;t then you missed a great opportunity to buy cool gear cheap the last few days they were open. I got quite a haul myself and spent less than $400! This includes my <a href="https://buy.garmin.com/shop/shop.do?pID=8580">Garmin StreetPilot c580</a> GPS unit and my <a href="http://www.linksys.com/servlet/Satellite?c=L_Product_C2&amp;childpagename=US%2FLayout&amp;pagename=Linksys%2FCommon%2FVisitorWrapper&amp;cid=1150490915278">Linksys RVS4000</a> which is the main focus of this article. I used this router for a long while before I got into playing with it after hearing about flaws in the Linksys software allowing shell access. Now I&#8217;m spending time trying to figure out what cool stuff could be done with it and I&#8217;m going to share my knowledge with you!</p>
<p>In this first article about hacking the RVS4000 I&#8217;ll cover how to enable telnet (utelnetd) through the hidden feature in their software. Help you somewhat secure this telnet daemon. I&#8217;ll also show you a cool flaw in their front-end web software that could be used to run shell commands if you lock yourself out of telnetd! Note that my version of the RVS4000 firmware is V1.1.14.</p>
<p><span id="more-4"></span><strong></strong></p>
<p><strong>*WARNING* -</strong> <span style="color: #993300;">I&#8217;m not liable for any problems this guide may cause your router. If your firmware is ruined and you brick your router don&#8217;t complain as I probably can&#8217;t help you. By visiting this page and reading this tutorial you agree to indemnify and hold harmless Dmitry Dovidenko from any claims resulting from the use of my site, texts and guides. </span></p>
<p><strong>I. Starting utelnetd and accessing telnet.</strong></p>
<p>There is a hidden feature inside the RVS4000&#8217;s Linksys web interface that can enable telnet (utelnetd). It looks like Linksys hid this feature from their interface, but did not actually remove it from the /www.eng directory where the Linksys interface is stored.</p>
<p>Open your browser and browse to <a href="http://192.168.1.1/Hidden_telnet.htm">http://192.168.1.1/Hidden_telnet.htm</a> (change ip if using a different subnet). You should bookmark this page in case you need to access it again! You should see a set of radio buttons on this page. Set telnet to &#8220;enable&#8221; and click &#8220;Save Settings&#8221;.</p>
<p><strong>*WARNING*</strong> &#8211; <span style="color: #993300;">Do not stop following this tutorial here! If you do nothing to secure the telnet daemon it WILL allow ANYONE to access the router as the administrative &#8220;root&#8221; user even on the WAN side of the network! If you are not going to secure it you should either disable it after use or not use it at all!</span></p>
<p>In my examples I&#8217;m going to use a Linux server I host at work, but you can telnet to the router via Windows as well. I believe that PuTTY for Windows can connect via telnet and you can download it <a href="http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html">here</a>.</p>
<p>Once utelnetd has been enabled you should be able to use the &#8216;telnet&#8217; binary on your Linux machine (or other telnet client on Windows) to connect to the router:</p>
<blockquote><p>diamond ~ # telnet 64.218.48.47<br />
Trying 64.218.48.47&#8230;<br />
Connected to 64.218.48.47.<br />
Escape character is &#8216;^]&#8217;.</p>
<p>BusyBox v1.00 (2007.09.12-05:31+0000) Built-in shell (ash)<br />
Enter &#8216;help&#8217; for a list of built-in commands.</p>
<p>#</p></blockquote>
<p>As you can see you are now at a busybox prompt on your router. Try out some commands:</p>
<blockquote><p>ls -al /bin/<br />
ls -al /sbin/<br />
ls -al /usr/bin/<br />
ls -al /usr/sbin/</p></blockquote>
<p>Those are most of the binaries available on the router. You can play around with them to get system info and you should also explore the system later. Note that /www.eng/ contains the web interface which you could also play with! For now I would recommend going to step two of the guide and securing the telnet access!</p>
<p><strong>II. Securing utelnetd via iptables.</strong></p>
<p><strong>Notice:<span style="color: #008000;"> </span></strong><span style="color: #008000;">I&#8217;m going to assume for this section of the guide that you are at least somewhat familiar with iptables or have at least used it once or twice. It&#8217;s probably simple enough for even a total novice to figure out, but I would refrain from messing with anything that I haven&#8217;t covered if you&#8217;re a newbie. You can definitely break the configuration and make your router&#8217;s functionality break.</span></p>
<p>If you ran the command listing /usr/sbin you would have noticed that there is an &#8216;iptables&#8217; binary. First check out the iptables setup:</p>
<blockquote><p>iptables -L -n</p></blockquote>
<p>This should show you the iptables configuration. You may wish to save the output somewhere. INPUT and OUTPUT chains should be the focus of this part of the guide. They should look something like this depending on your router configuration before we make changes:</p>
<blockquote><p># iptables -L INPUT -n<br />
Chain INPUT (policy DROP)<br />
target     prot opt source               destination<br />
ACCEPT       tcp  &#8211;  0.0.0.0/0            0.0.0.0/0       tcp dpt:23<br />
ACCEPT     esp  &#8211;  0.0.0.0/0            0.0.0.0/0<br />
ACCEPT     udp  &#8211;  0.0.0.0/0            0.0.0.0/0          udp dpt:4500<br />
ACCEPT     udp  &#8211;  0.0.0.0/0            0.0.0.0/0          udp dpt:500<br />
DROP       tcp  &#8211;  0.0.0.0/0            0.0.0.0/0          state NEW tcp flags:!0&#215;16/0&#215;02<br />
ACCEPT     all  &#8211;  0.0.0.0/0            0.0.0.0/0          state RELATED,ESTABLISHED<br />
INPUT_UDP  udp  &#8211;  0.0.0.0/0            0.0.0.0/0<br />
INPUT_TCP  tcp  &#8211;  0.0.0.0/0            0.0.0.0/0<br />
ACCEPT     icmp &#8211;  0.0.0.0/0            0.0.0.0/0<br />
ACCEPT     all  &#8211;  0.0.0.0/0            0.0.0.0/0          state NEW</p></blockquote>
<p>And OUTPUT:</p>
<blockquote><p># iptables -L OUTPUT -n<br />
Chain OUTPUT (policy ACCEPT)<br />
target     prot opt source               destination<br />
ACCEPT     icmp &#8211;  0.0.0.0/0            0.0.0.0/0<br />
DROP       icmp &#8211;  0.0.0.0/0            0.0.0.0/0          state INVALID</p></blockquote>
<p>You should figgure out from which computer (and it&#8217;s IP) you will be connecting to telnet and if you will be connecting to the router from the LAN or WAN side and what that IP will be. If you will use the computer you are reading this on and it&#8217;s not behind your router you should see your IP address at the bottom of this page. If you will use another computer that is also not behind your router you could use ipconfig on Windows or ifconfig on Linux or browse to this site to figure out it&#8217;s IP address. If you will use a computer that IS behind your router then use ipconfig via cmd (Start-&gt;Run then type &#8216;cmd&#8217; to open cmd) or ifconfig from shell to find the LAN IP address of that computer.</p>
<p>For the destination (router&#8217;s IP address) the ip address you will be connecting to should be either 192.168.1.1 (unless you are using a different subnet) if the computer connecting to the router is behind the router or the router&#8217;s WAN IP address (from your ISP) if the computer connecting to the router is outside your network.</p>
<p>At this point you should have two things written down. This is how I will refer to them:</p>
<blockquote><p>SRC IP = Source IP Address, the address of the computer connecting to the router via telnet as seen by the router it&#8217;s connecting to.<br />
DST IP = Destination IP Address, the address of the router as seen by the computer connecting to it.</p></blockquote>
<p><em>Example if connecting from within the router&#8217;s network:</em></p>
<blockquote><p><em>SRC IP = 192.168.1.100<br />
DST IP = 192.168.1.1</em></p></blockquote>
<p><em>Example if connecting from outside the router&#8217;s network:</em></p>
<blockquote><p><em>SRC IP = 64.72.120.58<br />
DST IP = 64.218.48.123</em></p></blockquote>
<p>Here are the commands you will need to run on your router (depending on it&#8217;s iptables configuration so use your head!):</p>
<blockquote><p>iptables -I INPUT 2 -p tcp -s 192.168.1.100 -d 192.168.1.1 &#8211;sport 513:65535 &#8211;dport 23 -m state &#8211;state NEW,ESTABLISHED -j ACCEPT</p>
<p>iptables -I OUTPUT 2 -p tcp -s 192.168.1.1 -d 192.168.1.100 &#8211;sport 23 &#8211;dport 513:65535 -m state &#8211;state ESTABLISHED -j ACCEPT</p>
<p>iptables -I INPUT 3 -p tcp -d 192.168.1.1 &#8211;dport 23 -j DROP</p>
<p>iptables -D INPUT 1</p></blockquote>
<p>The reason we are deleting the 1st rule in the INPUT chain at the end is to remove the accept all for port 23. Hopefully you used the right IP&#8217;s for your connection and you stayed connected. If you failed and locked your self out you can have Linksys re-add the 1st rule by disabling and re-enabling the telnet daemon via the hidden URL I showed you before. Once you have verified the rules as working you can also add:</p>
<blockquote><p>iptables -I OUTPUT 3 -p tcp -s 192.168.1.1 &#8211;sport 23 -j DROP</p></blockquote>
<p>To block outbound connections on port 23 as well just in case! You didn&#8217;t want to do this before in case you locked your self out, because the Linksys utility would not automatically remove that rule from the chain for you when re-enabling.</p>
<p>Here is what you should be looking at after this process is complete:</p>
<blockquote><p># iptables -L INPUT -n<br />
Chain INPUT (policy DROP)<br />
target     prot opt source               destination<br />
ACCEPT     tcp  &#8211;  64.72.120.58         64.218.48.123       state NEW,ESTABLISHED tcp spts:513:65535 dpt:23<br />
DROP       tcp  &#8211;  0.0.0.0/0            64.218.48.123      tcp dpt:23<br />
ACCEPT     esp  &#8211;  0.0.0.0/0            0.0.0.0/0<br />
ACCEPT     udp  &#8211;  0.0.0.0/0            0.0.0.0/0          udp dpt:4500<br />
ACCEPT     udp  &#8211;  0.0.0.0/0            0.0.0.0/0          udp dpt:500<br />
DROP       tcp  &#8211;  0.0.0.0/0            0.0.0.0/0          state NEW tcp flags:!0&#215;16/0&#215;02<br />
ACCEPT     all  &#8211;  0.0.0.0/0            0.0.0.0/0          state RELATED,ESTABLISHED<br />
INPUT_UDP  udp  &#8211;  0.0.0.0/0            0.0.0.0/0<br />
INPUT_TCP  tcp  &#8211;  0.0.0.0/0            0.0.0.0/0<br />
ACCEPT     icmp &#8211;  0.0.0.0/0            0.0.0.0/0<br />
ACCEPT     all  &#8211;  0.0.0.0/0            0.0.0.0/0          state NEW</p></blockquote>
<p>And OUTPUT:</p>
<blockquote><p># iptables -L OUTPUT -n<br />
Chain OUTPUT (policy ACCEPT)<br />
target     prot opt source               destination<br />
ACCEPT     icmp &#8211;  0.0.0.0/0            0.0.0.0/0<br />
ACCEPT     tcp  &#8211;  64.218.48.123         64.72.120.58       state ESTABLISHED tcp spt:23 dpts:513:65535<br />
DROP       tcp  &#8211;  64.218.48.123         0.0.0.0/0          tcp spt:23<br />
DROP       icmp &#8211;  0.0.0.0/0            0.0.0.0/0          state INVALID</p></blockquote>
<p>Your IP&#8217;s will be different. I&#8217;m using my server to connect to my router&#8217;s WAN IP address. You should be able to test that this system worked by trying to connect to the router&#8217;s telnet from another machine either to it&#8217;s WAN IP or LAN IP. If an IP that you did not add to the rules is able to connect something broke or you forgot to delete that first chain. If you got locked out something broke. Re-read the article! Do not leave your telnet open to the world, because it&#8217;s a <span style="color: #993300;">BAD IDEA</span>!</p>
<p><strong>III. Flaw in Linksys router management web front-end.</strong></p>
<p>This flaw is what allowed finding the Hidden_telnet.htm file and it can help you out if you lock your self out or have other problems. I did not come up with this method, but instead I tried the bug that someone else found on a different Linksys router&#8217;s software.</p>
<p>First you will need to browse to http://192.168.1.1/ (or your router&#8217;s appropriate subnet) and log in to the router. You should then go to the &#8220;Administration&#8221; tab. Now select &#8220;Diagnostics&#8221; from the tab within the &#8220;Administration&#8221; section. You should see a feature called &#8220;TraceRoute Test&#8221;. This tool is normally used to run trace routes to other hosts to troubleshoot network info. In reality it just runs the traceroute utility on the server and echoes out the output.</p>
<p>The cool thing (from our perspective) is that Linksys developers did not sanitize any of the data input into this form! This means we can enter something like:</p>
<blockquote><p>;/bin/ls /www.eng/</p></blockquote>
<p>In the window that pops up you should now see the files in /www.eng/ after a few seconds. This is where you can see that Hidden_telnet.htm file. In fact you can do everything (other than edit text convienently via vi) that you can via telnet, but it&#8217;s not convenient. It can save you if you lock your self out though!</p>
<p><strong>IV. The future!</strong></p>
<p>I&#8217;m expecting to write at least one more (if not several) articles on this topic as I further explore the RVS4000 router. I&#8217;m curious as to what kind of apps can be ported to it and what we can do with it. I would like to accomplish several things:</p>
<blockquote><p>1. More binaries found on standard distributions. We need grep, less, nano/pico, wget, cut, find and others!</p>
<p>2. Proper user authentication. There is currently no mkpasswd/passwd binary at all on the server and no /etc/shadow file. Telnet just dumps you to root.</p>
<p>3. More features such as traffic monitoring (preferably with graphs).</p>
<p>4. Traffic monitoring via snort or at least port tcpdump to it!</p>
<p>5. I&#8217;d like to run bash as well as I do not like busybox.</p></blockquote>
<p>Until then I hope someone finds this article of some use and plays around. Any cool results submitted as a comment in my blog would be appreciated!</p>
]]></content:encoded>
			<wfw:commentRss>http://rootit.org/2008/06/linksys-rvs4000-p1/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
