<?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>Hacking With Gum &#187; Router</title>
	<atom:link href="http://hackingwithgum.com/tag/router/feed/" rel="self" type="application/rss+xml" />
	<link>http://hackingwithgum.com</link>
	<description>A Hardware Hacking Blog</description>
	<lastBuildDate>Tue, 23 Mar 2010 00:47:02 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>Installing OpenWRT On The GT-704WG</title>
		<link>http://hackingwithgum.com/2009/09/17/installing-openwrt-on-the-actiontec-gt-704wg/</link>
		<comments>http://hackingwithgum.com/2009/09/17/installing-openwrt-on-the-actiontec-gt-704wg/#comments</comments>
		<pubDate>Fri, 18 Sep 2009 02:05:42 +0000</pubDate>
		<dc:creator>cheffner</dc:creator>
				<category><![CDATA[Routers]]></category>
		<category><![CDATA[ActionTec]]></category>
		<category><![CDATA[GT-704WG]]></category>
		<category><![CDATA[OpenWRT]]></category>
		<category><![CDATA[Router]]></category>

		<guid isPermaLink="false">http://hackingwithgum.com/?p=206</guid>
		<description><![CDATA[I recently picked up an ActionTec GT-704WG DSL router from the thrift store ($15) and wanted to flash it with OpenWRT. Checking out Google and the OpenWRT Wiki, some work has been done on the GT-701WG, but specific information for flashing the GT-704 was scarce. The GT-704 hardware is based on the AR7 from Texas [...]]]></description>
			<content:encoded><![CDATA[<p>I recently picked up an ActionTec GT-704WG DSL router from the thrift store ($15) and wanted to flash it with OpenWRT. Checking out Google and the OpenWRT Wiki, some <a href="http://www.nettwerked.net/actiontec.html">work</a> has been <a href="http://wiki.openwrt.org/oldwiki/openwrtdocs/hardware/actiontec/gt701_wg">done</a> on the GT-701WG, but specific information for flashing the GT-704 was scarce. The GT-704 hardware is based on the AR7 from Texas Instruments, and is nearly identical in specifications to the GT-701:</p>
<blockquote><p><strong><br />
Platform: </strong>Texas Instruments AR7, 150MHz<br />
<strong>Flash:</strong> 4MB<br />
<strong>RAM:</strong> 16MB<br />
<strong>Ethernet:</strong> 4 Ports<br />
<strong>Wireless:</strong> TI ACX111, 802.11b/g</p></blockquote>
<p>The firmware install is pretty straightforward, once you get the commands right. The process is very similar to that <a href="http://oldwiki.openwrt.org/OpenWrtDocs(2f)InstallingAR7.html">documented</a> for generic AR7 devices, but not exactly the same. It helps to have a terminal connected to the JP603 serial port (ttys0, 38400, 8N1)during this process as well, but it is not necessary:</p>
<div id="attachment_216" class="wp-caption aligncenter" style="width: 310px"><a href="http://hackingwithgum.com/wp-content/uploads/2009/09/gw704_serial_port.jpg"><img class="size-medium wp-image-216" title="GT-704WG Serial Ports" src="http://hackingwithgum.com/wp-content/uploads/2009/09/gw704_serial_port-300x225.jpg" alt="The serial port on the right (JP603) is ttys0; the other is not used." width="300" height="225" /></a><p class="wp-caption-text">The serial port on the right (JP603) is ttys0</p></div>
<p>The pinout for the serial port is, as pictured, from bottom to top: ground, transmit, receive, unknown, Vcc, unknown.</p>
<p><span id="more-206"></span>In order to flash the firmware, you&#8217;ll need to get access to the Adam2 bootloader. The easiest way to do this is to turn off the router, hold down the reset button, and turn the router back on. Keep holding the reset button until you see the Power and Internet LEDs stay on; this indicates that the router has dropped into the Adam2 shell prompt.</p>
<p>The prompt can be accessed via the serial connection, or via FTP. To connect via FTP, simply FTP to the router and login with the user name of &#8216;adam2&#8242; and password &#8216;adam2&#8242;. The default adam2 IP address is 192.168.0.1. If this IP address does not work, you will have to connect via the serial connection and issue the following command:</p>
<blockquote><p>printenv<br />&nbsp;</p></blockquote>
<p>Look for the variable named &#8216;my_ipaddress&#8217;, which will list the Adam2 IP.</p>
<p>Once you have access to Adam2 (either via FTP or serial), you will have to set a couple of environment variables. First, you need to create a partition to install OpenWRT to. The existing partitions can be viewed by issuing the printenv command at the serial console. They are:</p>
<blockquote><p>mtd2                  0&#215;90000000,0&#215;90010000<br />
mtd1                  0&#215;90010000,0x900d0000<br />
mtd0                  0x900d0000,0x903e0000<br />
mtd4                                   0x903e0000,0x903f0000<br />
mtd3                  0x903f0000,0&#215;90400000</p></blockquote>
<p>Since the OpenWRT image contains both the kernel and the file system, your new partition should cover both the existing kernel and file system partitions (mtd1 and mtd0, respectively). To create the partition via the serial console, run:</p>
<blockquote><p>setenv mtd5,0&#215;90010000,0x903f0000<br />&nbsp;</p></blockquote>
<p>Or via the FTP connection:</p>
<blockquote><p>quote SETENV mtd5,0&#215;90010000,0x903f0000<br />&nbsp;</p></blockquote>
<p>You will also have to set the MAC_PORT environment variable in order to enable the internal ethernet port. From the serial console:</p>
<blockquote><p>setenv MAC_PORT,0<br />&nbsp;</p></blockquote>
<p>Or from FTP:</p>
<blockquote><p>quote SETENV MAC_PORT,0<br />&nbsp;</p></blockquote>
<p>With that done, you&#8217;re ready to FTP your new firmware to the router; other <a href="http://www.nettwerked.net/actiontec.html">reports</a> on the GT-701 and GT-704 have noted that the ActionTec recovery utility sends a message to UDP port 5035 (actually, two messages in the case of the GT-704). However this appears to be simply for discovery of the router&#8217;s IP address and is not necessary for loading firmware onto the router.</p>
<p>Go to OpenWRT&#8217;s download page, and get the latest release of openwrt-ar7-squashfs.bin (currently <a href="http://downloads.openwrt.org/kamikaze/8.09.1/ar7/">Kamikaze 8.09.1</a>). If you haven&#8217;t already, FTP to the router and login with the previously described credentials. You will need to issue the following commands:</p>
<blockquote><p>ftp<strong>&gt;</strong> <strong>binary</strong><br />
<em>200 Type set to I.</em><br />
ftp<strong>&gt;</strong> <strong>quote MEDIA FLSH</strong><br />
<em>200 Media set to FLSH</em><br />
ftp<strong>&gt;</strong> <strong>quote STOR openwrt-ar7-squashfs.bin mtd5</strong><br />
<em>226 Transfer complete</em><br />
ftp<strong>&gt;</strong> <strong>quote REBOOT</strong></p></blockquote>
<p>It will take the router a minute or two to clear the flash and load the firmware. Note that you do NOT want to enter passive mode for the file transfer; doing so will slow the file transfer significantly (it would have taken about a week by my estimation). You can monitor the router&#8217;s progress via the serial console, or by watching the file transfer in Wireshark. Once the firmware transfer is complete, the reboot command will reboot the router, and you should have a working OpenWRT install:</p>
<blockquote>
<pre>Please press Enter to activate this console.

BusyBox v1.11.2 (2009-05-28 18:22:45 UTC) built-in shell (ash)
Enter 'help' for a list of built-in commands.

  _______                     ________        __
 |       |.-----.-----.-----.|  |  |  |.----.|  |_
 |   -   ||  _  |  -__|     ||  |  |  ||   _||   _|
 |_______||   __|_____|__|__||________||__|  |____|
          |__| W I R E L E S S   F R E E D O M
 KAMIKAZE (8.09.1, r16278) ----------------------------
  * 10 oz Vodka       Shake well with ice and strain
  * 10 oz Triple sec  mixture into 10 shot glasses.
  * 10 oz lime juice  Salute!
 ---------------------------------------------------
root@OpenWrt:/#</pre>
</blockquote>
<p>So far everything checks out OK using the generic firmware image; ethernet and wireless works, opkg updates and installs packages fine. The only downside is that the wireless doesn&#8217;t seem to support WPA, possibly due to the poor <a href="http://acx100.sourceforge.net/">open source</a> support from TI. I haven&#8217;t tested the USB port, but it appears to be a client-only USB device, so it&#8217;s of limited use.</p>
]]></content:encoded>
			<wfw:commentRss>http://hackingwithgum.com/2009/09/17/installing-openwrt-on-the-actiontec-gt-704wg/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
		<item>
		<title>Flashing Asus WL-520GU Firmware Via TFTP</title>
		<link>http://hackingwithgum.com/2009/09/11/flashing-asus-wl-520gu-firmware-via-tftp/</link>
		<comments>http://hackingwithgum.com/2009/09/11/flashing-asus-wl-520gu-firmware-via-tftp/#comments</comments>
		<pubDate>Sat, 12 Sep 2009 01:27:26 +0000</pubDate>
		<dc:creator>cheffner</dc:creator>
				<category><![CDATA[Routers]]></category>
		<category><![CDATA[Asus]]></category>
		<category><![CDATA[OpenWRT]]></category>
		<category><![CDATA[Router]]></category>

		<guid isPermaLink="false">http://hackingwithgum.com/?p=199</guid>
		<description><![CDATA[Today a friend and I were struggling to re-flash an Asus WL-520GU with OpenWRT via TFTP. The router had been previously flashed with DD-WRT, and of course the Web-based firmware update did not recognize the OpenWRT trx file as a valid image (there is currently no OpenWRT .bin file available for the WL-520GU); this left [...]]]></description>
			<content:encoded><![CDATA[<p>Today a friend and I were struggling to re-flash an Asus WL-520GU with OpenWRT via TFTP. The router had been previously flashed with DD-WRT, and of course the Web-based firmware update did not recognize the OpenWRT trx file as a valid image (there is currently <a href="http://downloads.openwrt.org/kamikaze/8.09.1/brcm-2.4/">no</a> OpenWRT .bin file available for the WL-520GU); this left TFTP as the next best option for flashing the firmware.</p>
<p>Usually, it is helpful to have a serial console connected to the router while doing a TFTP transfer, so that you can see when the bootloader (CFE, in the case of the Asus) is listening for TFTP connections, as with the Linksys WRT54G:</p>
<blockquote><p>CFE version 1.0.37 for BCM947XX (32bit,SP,LE)<br />
Build Date: Thu Mar 24 16:31:45 CST 2005 (motoplayer@cvs.gemtek.com.tw)<br />
Copyright (C) 2000,2001,2002,2003 Broadcom Corporation.</p>
<p>Initializing Arena<br />
Initializing Devices.<br />
et0: Broadcom BCM47xx 10/100 Mbps Ethernet Controller 3.90.39.0<br />
CPU type 0&#215;29008: 200MHz<br />
Total memory: 8192 KBytes</p>
<p>Total memory used by CFE:  0&#215;80300000 &#8211; 0&#215;80399700 (628480)<br />
Initialized Data:          0x8032F870 &#8211; 0x80331F50 (9952)<br />
BSS Area:                  0x80331F50 &#8211; 0&#215;80333700 (6064)<br />
Local Heap:                0&#215;80333700 &#8211; 0&#215;80397700 (409600)<br />
Stack Area:                0&#215;80397700 &#8211; 0&#215;80399700 (8192)<br />
Text (code) segment:       0&#215;80300000 &#8211; 0x8032F870 (194672)<br />
Boot area (physical):      0x0039A000 &#8211; 0x003DA000<br />
Relocation Factor:         I:00000000 &#8211; D:00000000</p>
<p>Committing NVRAM&#8230;done<br />
Device eth0:  hwaddr 00-40-77-BB-55-10, ipaddr 192.168.1.1, mask 255.255.255.0<br />
gateway not set, nameserver not set<br />
Reading ::</p></blockquote>
<p>Unlike the WRT54G however, the WL-520GU bootloader did not specify its IP address, and the usual 192.168.1.1 did not work; watching the network traffic while attempting the TFTP transfer revealed that this address was not responding to ARP requests at all. Additionally, while the WRT54G waits for a TFTP connection for a few seconds before timing out, the WL-520GU only listens for about one second before timing out and loading the kernel. Such a short time period, coupled with not knowing the bootloader&#8217;s IP address, made flashing via TFTP nearly impossible.</p>
<p>The solutions to both these problems were found (directly and indirectly) through DD-WRT&#8217;s WL-520GU <a href="http://www.dd-wrt.com/wiki/index.php/Asus_WL-520GU">Wiki page</a>. By holding down the reset button on the router on boot up, the bootloader will enter hardware restoration mode and perpetually listen for TFTP connections rather than continuing with the boot process. This can be confirmed by watching the serial console output; you should see repeating messages that read: &#8220;Reading :: Failed.: Timeout occured&#8221;. The power LED should also be blinking slowly when the router is in hardware restoration mode.</p>
<p>Once you have the router constantly listening for TFTP connections, you still need to know the IP. This was discovered by downloading the Asus <a href="http://support.asus.com/download/download.aspx?SLanguage=en-us&amp;model=WL-520GU">restoration utility</a> and monitoring the network traffic it generated. This revealed that the router&#8217;s bootloader IP address was 192.168.1.49. With the router in hardware restoration mode and knowledge of the bootloader IP address, it was easy to upload the firmware via TFTP:</p>
<blockquote><p>tftp&gt; mode binary<br />
tftp&gt; trace<br />
tftp&gt; connect 192.168.1.49<br />
tftp&gt; put openwrt-brcm-2.4-squashfs.trx<br />
sent DATA &lt;block=1, 512 bytes&gt;<br />
received ACK &lt;block=1&gt;<br />
sent DATA &lt;block=2, 512 bytes&gt;<br />
received ACK &lt;block=2&gt;<br />
&#8230;</p></blockquote>
]]></content:encoded>
			<wfw:commentRss>http://hackingwithgum.com/2009/09/11/flashing-asus-wl-520gu-firmware-via-tftp/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>WiFi Protected Setup Router Backdoor</title>
		<link>http://hackingwithgum.com/2009/05/17/wifi-protected-setup-router-backdoor/</link>
		<comments>http://hackingwithgum.com/2009/05/17/wifi-protected-setup-router-backdoor/#comments</comments>
		<pubDate>Sun, 17 May 2009 15:36:46 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Hacks]]></category>
		<category><![CDATA[Security]]></category>
		<category><![CDATA[Router]]></category>
		<category><![CDATA[WiFi]]></category>
		<category><![CDATA[WPS]]></category>

		<guid isPermaLink="false">http://hackingwithgum.com/?p=7</guid>
		<description><![CDATA[WiFi-Protected Setup is a standard designed to ease the distribution of strong WPA/WPA2 encryption keys. Anyone who has tried to enter a 60-character WPA key into a Wii will immediately appreciate WPS; when you want to add a new client to your wireless network, you simply push a button on the router, push a button [...]]]></description>
			<content:encoded><![CDATA[<p>WiFi-Protected Setup is a standard designed to ease the distribution of strong WPA/WPA2 encryption keys. Anyone who has tried to enter a 60-character WPA key into a Wii will immediately appreciate WPS; when you want to add a new client to your wireless network, you simply push a button on the router, push a button on the client (clients typically have “soft” buttons), and the two will negotiate an 802.11 EAP session which the router uses to securely send the network encryption key to the client.</p>
<p>But what if you want to use WPA and allow anyone to connect to your WiFi network? Well, you&#8217;d simply have to keep pusing the WPS button once every two minutes (WPS has a two minute time-out period). Granted, there probably aren&#8217;t many (any?) legitimate uses for this, but it would be a great opportunity for some nefarious individual: with such a system in place, he can always get in no matter how strong you make your WPA key.</p>
<p><span id="more-7"></span></p>
<p style="text-align: center;">
<p style="text-align: center;">
<p>This hack is very simple; you just have to create a circuit that “pushes” the WPS button on the router. With some routers, such as Linksys, you can simply short out the pins on the WPS button, causing WPS to remain permanently on. This can be done very easily using the foil wrapper from a stick of gum; note that since WPS will always be activated, the WPS LED will be constantly blinking, so it’s probably a good idea to cover up the LED:</p>
<p style="text-align: center;">
<div class="wp-caption aligncenter" style="width: 310px"><a href="http://www.sourcesec.com/wp-content/uploads/2009/05/linksys_hw6.jpg"><img title="Linksys Gum Hack 1" src="http://www.sourcesec.com/wp-content/uploads/2009/05/linksys_hw6.jpg" alt="Placing the foil in the Linksys case" width="300" height="225" /></a><p class="wp-caption-text">Placing the foil in the Linksys&#39; case</p></div>
<div class="wp-caption aligncenter" style="width: 310px"><a href="http://www.sourcesec.com/wp-content/uploads/2009/05/linksys_hw7-300x68.jpg"><img title="Linksys Gum Hack 2" src="http://www.sourcesec.com/wp-content/uploads/2009/05/linksys_hw7-300x68.jpg" alt="When the board is placed back in the case, the foil shorts the pins on the WPS button" width="300" height="68" /></a><p class="wp-caption-text">When the board is placed back in the case, the foil shorts the pins on the WPS button</p></div>
<p style="text-align: center;">
<div class="wp-caption aligncenter" style="width: 310px"><a href="http://www.sourcesec.com/wp-content/uploads/2009/05/linksys_hw9-300x225.jpg"><img title="Linksys Gum Hack 3" src="http://www.sourcesec.com/wp-content/uploads/2009/05/linksys_hw9-300x225.jpg" alt="Use the remaining foil to cover up the WPS LED" width="300" height="225" /></a><p class="wp-caption-text">Use the remaining foil to cover up the WPS LED</p></div>
<p>Although a simple hack, using gum to back door a router is not the best solution. In the routers tested, the gum hack only worked on our Linksys router; the rest require us to push, hold, and release the WPS button before they would activate WPS. Even in the Linksys device, this is a non-stealthy hack, as the administrative interface will (rather obnoxiously) indicate that WPS is activated whenever an administrator logs in to view the wireless settings.</p>
<p>A far better solution can be found by using a simple NE555 timer circuit. The push buttons are typically configured with one contact connected to ground, and the other contact connected to something else that reads the button’s state. Using an NE555, we can connect the non-ground pin on the button to ground for a second or two, and then return the pin to it’s open state. The following circuit will push the WPS button for 1.5 seconds every 2.5 minutes:</p>
<div class="wp-caption aligncenter" style="width: 310px"><a href="http://www.sourcesec.com/wp-content/uploads/2009/05/ne555_schematic-300x184.jpg"><img title="NE555 Schematic" src="http://www.sourcesec.com/wp-content/uploads/2009/05/ne555_schematic-300x184.jpg" alt="NE555 Schematic" width="300" height="184" /></a><p class="wp-caption-text">NE555 Schematic</p></div>
<p>Vcc and ground are connected to the router’s DC power supply. Since the 555 can be powered from a wide range of voltage sources (4.5v &#8211; 16v), no voltage regulator should be required (routers typically run off of 5 &#8211; 12 volt DC power adapters). Conn1 is connected to the non-grounded pin on the WPS button.</p>
<p>The output (pin 3) stays high for 2.5 minutes and goes low (i.e., is grounded) for 1.5 seconds. D1 ensures that there is no charge flowing into pin 3 (probably not likely, but we don’t know exactly what the WPS button is connected to). When pin 3 goes low, it effectively grounds the button connected to Conn1; resistor R3 limits any current flowing through D1 during this period. The circuit can be modified to stay high for much longer periods of time by increasing the value of the R1 resistor.</p>
<p>Although the NE555 is not very precise when used to time long periods, precision is not really a concern in this application, so activating WPS once every 10-12 hours is possible. This has the added benefit of making such a back door more difficult to detect; WPS has a two minute time out period (if no client is found within two minutes, the router stops looking for a client until the button is pushed again), so the light will only be blinking for two two-minute intervals throughout a 24 hour period.</p>
<p style="text-align: center;">
<p>Below are pictures of the above circuit connected to several routers from various vendors. Since the WPS button works the same way on basically all routers, this circuit is a universal hardware back door for practically any router that has WPS support:</p>
<div class="wp-caption aligncenter" style="width: 234px"><a href="http://www.sourcesec.com/wp-content/uploads/2009/05/ne555-224x300.jpg"><img title="NE555 Linksys" src="http://www.sourcesec.com/wp-content/uploads/2009/05/ne555-224x300.jpg" alt="The circuit connected to a Linksys WRT160N" width="224" height="300" /></a><p class="wp-caption-text">The circuit connected to a Linksys WRT160N</p></div>
<div class="wp-caption aligncenter" style="width: 235px"><a href="http://www.sourcesec.com/wp-content/uploads/2009/05/ne555_dlink-225x300.jpg"><img title="NE555 D-Link" src="http://www.sourcesec.com/wp-content/uploads/2009/05/ne555_dlink-225x300.jpg" alt="The circuit connected to a D-Link DIR-628 The circuit soldered up and placed inside a Belkin router" width="225" height="300" /></a><p class="wp-caption-text">The circuit connected to a D-Link DIR-628 The circuit soldered up and placed inside a Belkin router</p></div>
<div class="wp-caption aligncenter" style="width: 310px"><a href="http://www.sourcesec.com/wp-content/uploads/2009/05/belkin_555_1-300x225.jpg"><img title="NE555 Belkin" src="http://www.sourcesec.com/wp-content/uploads/2009/05/belkin_555_1-300x225.jpg" alt="The circuit soldered up and placed inside a Belkin F5D8233-4v3" width="300" height="225" /></a><p class="wp-caption-text">The circuit soldered up and placed inside a Belkin F5D8233-4v3</p></div>
<p>Now, you just wait for WPS to be activated (WPS state can be passively monitored real-time using <a href="http://www.sourcesec.com/2009/05/09/wpscan-wpspy-tools/">WPSpy</a>) and use a WPS-capable <a href="http://www.belkin.com/au/IWCatProductPage.process?Product_Id=474682">WiFi card</a> (or <a href="http://hostap.epitest.fi/wpa_supplicant/">software</a>) to retrieve the key:</p>
<div class="wp-caption aligncenter" style="width: 303px"><a href="http://www.sourcesec.com/wp-content/uploads/2009/05/linksys_key-293x300.jpg"><img title="Belkin WPS Software" src="http://www.sourcesec.com/wp-content/uploads/2009/05/linksys_key-293x300.jpg" alt="Using a Belkin WiFi card to retrieve the WPA key via WPS" width="293" height="300" /></a><p class="wp-caption-text">Using a Belkin WiFi card to retrieve the WPA key via WPS</p></div>
]]></content:encoded>
			<wfw:commentRss>http://hackingwithgum.com/2009/05/17/wifi-protected-setup-router-backdoor/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>
