<?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>blog.l-lacker.com &#187; Lafonera</title>
	<atom:link href="http://blog.l-lacker.com/tag/lafonera/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.l-lacker.com</link>
	<description></description>
	<lastBuildDate>Sat, 04 Feb 2012 22:52:41 +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>Security &#124; LaFonera Hacking</title>
		<link>http://blog.l-lacker.com/project-lafonera-hacking/</link>
		<comments>http://blog.l-lacker.com/project-lafonera-hacking/#comments</comments>
		<pubDate>Tue, 29 Sep 2009 15:15:50 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Security]]></category>
		<category><![CDATA[hacking]]></category>
		<category><![CDATA[Lafonera]]></category>
		<category><![CDATA[OSX]]></category>
		<category><![CDATA[Projects]]></category>
		<category><![CDATA[Wireless]]></category>

		<guid isPermaLink="false">http://ldashlacker.wordpress.com/?p=53</guid>
		<description><![CDATA[ax0n over at h-i-r.net inspired me to attempt and successfully build this project . His 3 part series (part 1, part 2, part 3) is Awesome (capital A), and he certainly deserves the all the credit for doing the heavy lifting and providing an excellent write up. I used it as my template throughout the <a href='http://blog.l-lacker.com/project-lafonera-hacking/'>[...]</a>]]></description>
			<content:encoded><![CDATA[<p><a href="http://twitter.com/ax0n" target="_blank"><img title="images" src="http://nodatafound.files.wordpress.com/2009/09/images.jpg" alt="images" width="89" height="94" />ax0n</a> over at <a href="http://www.h-i-r.net/" target="_blank">h-i-r.net</a> inspired me to attempt and successfully build <a href="http://www.h-i-r.net/search/label/evilwifi" target="_blank">this project </a>.  His 3 part series (<a href="http://www.h-i-r.net/2009/07/evil-wifi-part-1-jasagerfonera-setup.html" target="_blank">part 1</a>, <a href="http://www.h-i-r.net/2009/07/evil-wifi-part-2-metasploit-framework.html">part 2</a>, <a href="http://www.h-i-r.net/2009/07/evil-wifi-part-3-hamster-ferret.html" target="_blank">part 3</a>) is Awesome (capital A), and he certainly deserves the all the credit for doing the heavy lifting and providing an excellent write up. I used it as my template throughout the entire process.</p>
<p><span id="more-53"></span></p>
<p>This document will reference his article A.LOT. I suggest you stop reading this (for now), and head directly to his article to familiarize yourself with it.</p>
<p>I am simply going to focus on OSX (Snow Leopard &#8211; 10.6). I wanted this to be available on my MacBook at the drop of a hat.</p>
<p>&#8220;So, uh…other than that, what’s the point of this &#8216;article&#8217; ?&#8221; . Hmmm&#8230; great question. I better get started before you leave.</p>
<p><em>Note: I&#8217;m assuming you have met all of the hardware requirements in the h-i-r.net article.</em></p>
<p><em><img title="More..." src="http://nodatafound.wordpress.com/wp-includes/js/tinymce/plugins/wordpress/img/trans.gif" alt="" /><br />
</em></p>
<h2><span style="font-family:Courier New;">Step 1: Flashing the Fon</span></h2>
<p>Enable redboot! I used <a href="http://fonerahacks.com/index.php/Tutorials-and-Guides/How-to-Enable-Redboot.html" target="_blank">this guide.</a> The problem however, is that once I had established the ssh connection to the Fon, I was unable to wget the files. Additionally, I was unable to ping anything external. I&#8217;m sure I was doing something wrong, and there is a simple fix (comment if there is). So what should I do now? I mean, stuck at the second step in the instructions? Fail. To correct the issue, Grab the files referenced in the instructions from <a href="http://fonera.info/camicia/openwrt-ar531x-2.4-vmlinux-CAMICIA.lzma" target="_blank">here</a> and <a href="http://fonera.info/camicia/out.hex" target="_blank">here</a> and while your at it <a href="http://www.digininja.org/files/jasager_firmware_1.0.tar.bz2" target="_blank">grab this</a> (you&#8217;ll need all of these files), launch a <a href="http://ww2.unime.it/flr/tftpserver/" target="_blank">tftp server</a>, unpack the files and place them in the tftp server directory. Then start server. (be sure to make note of the IP address ). I placed the files in a root dir called &#8220;tftp&#8221; this makes it a little easier when typing the path.</p>
<p align="center"><img title="TFTP" src="http://nodatafound.files.wordpress.com/2009/09/screen-shot-2009-09-02-at-1-17-21-pm.png" alt="TFTP" width="655" height="505" /></p>
<h2><span style="font-family:Courier New;">Enabling Redboot</span></h2>
<p>Now that we have the files living in the tftp server dir, Launch a terminal, connect to the Fon via ssh and issue the following commands using the following syntax to grab the files (<em>wget http://[ip.add.re.ss]/[dir]/[filename])</em>:</p>
<pre><strong><span style="font-size:small;">root@OpenWrt:~# cd /tmp
root@OpenWrt:~# wget http://201.37.100.106/tftp/openwrt-ar531x-2.4-vmlinux-CAMICIA.lzma <em>
</em>root@OpenWrt:~# mtd -e vmlinux.bin.l7 write openwrt-ar531x-2.4-vmlinux-CAMICIA.lzma vmlinux.bin.l7
root@OpenWrt:~# reboot</span></strong></pre>
<p>After the Fon comes back online, ssh back in and follow the remaining steps in the instructions to enable redboot.</p>
<pre><strong><span style="font-size:small;">root@OpenWrt:~# cd /tmp
root@OpenWrt:~# wget http://201.37.100.106/tftp/out.hex
root@OpenWrt:~# mtd -e "RedBoot config" write out.hex "RedBoot config"
root@OpenWrt:~# reboot</span></strong></pre>
<p>Once you get to the section<a href="http://www.fonerahacks.com/index.php/Tutorials-and-Guides/How-to-Access-Redboot.html" target="_blank"> &#8220;now your ready to flash&#8221;</a>, you can stop.  Those instructions follow a path we aren&#8217;t going to.</p>
<h2><span style="font-family:Courier New;">Installing the Jasager Firmware</span></h2>
<p>Head over to digininja’s site and follow the instructions here <a href="http://www.digininja.org/jasager/installation.php" target="_blank">&#8220;for firmware users&#8221;</a>. I skipped the redboot.pl installation, as we already have redboot enabled and working.  <a href="http://www.digininja.org/files/jasager_firmware_1.0.tar.bz2" target="_blank">Download jasegar</a>, unpack it and place it in your tftp dir. (if you didn&#8217;t do it earlier) The ONLY tricky part during the flash process is to be SURE you copy and paste the commands or triple check your typing. I mistakenly forgot to load vmlinux.bin.17.  It didn&#8217;t brick the Fon, but I was scared to reboot it.</p>
<pre><span style="background-color:#C0C0C0;">
</span><strong><span style="font-size:small;">RedBoot&gt;</span></strong><span style="font-size:small;"><code><strong> <span style="color:#ff0000;background-color:#000000;">fis init</span></strong></code>
<code><strong>About to initialize [format] FLASH image system - continue (y/n)? <span style="color:#ff0000;background-color:#000000;">y</span></strong></code>
<code><strong>*** Initialize FLASH Image System</strong></code>
<code><strong>... Erase from 0xa87e0000-0xa87f0000: .</strong></code>
<code><strong>... Program from 0x80ff0000-0x81000000 at 0xa87e0000: .</strong></code>
<strong>RedBoot&gt;</strong><code><strong> <span style="color:#ff0000;background-color:#000000;">load -r -b %{FREEMEMLO} openwrt-atheros-vmlinux.lzma</span></strong></code>
<code><strong>Using default protocol (TFTP)</strong></code>
<code><strong>Raw file loaded 0x80040400-0x801003ff, assumed entry at 0x80040400</strong></code>
<strong>RedBoot&gt;</strong><code><strong> <span style="color:#ff0000;background-color:#000000;">fis create -e 0x80041000 -r 0x80041000 vmlinux.bin.l7</span></strong></code>
<code><strong> </strong></code>
<code><strong>&lt; Wait for a while &gt; note: This took about 2 minutes</strong></code>
<code><strong> </strong></code>
<code><strong>... Erase from 0xa8030000-0xa80f0000: ............</strong></code>
<code><strong>... Program from 0x80040400-0x80100400 at 0xa8030000: ............</strong></code>
<code><strong>... Erase from 0xa87e0000-0xa87f0000: .</strong></code>
<code><strong>... Program from 0x80ff0000-0x81000000 at 0xa87e0000: .</strong></code>
<strong>RedBoot&gt;</strong><code><strong> <span style="color:#ff0000;background-color:#000000;">load -r -b %{FREEMEMLO} openwrt-atheros-root.squashfs</span></strong></code>
<code><strong>Using default protocol (TFTP)</strong></code>
<code><strong>Raw file loaded 0x80040400-0x801e03ff, assumed entry at 0x80040400</strong></code>
<strong>RedBoot&gt;</strong><code><strong> <span style="color:#ff0000;background-color:#000000;">fis create -l 0x6F0000 rootfs</span></strong></code>
<code><strong> </strong></code>
<code><strong>&lt; Wait for a long while &gt; note: This took almost 15 minutes. Don’t panic. It’s working.</strong></code>
<code><strong> </strong></code>
<code><strong>... Erase from 0xa80f0000-0xa87e0000: ...........</strong></code>
<code><strong>... Program from 0x80040400-0x801e0400 at 0xa80f0000: ..........................</strong></code>
<code><strong>... Erase from 0xa87e0000-0xa87f0000: .</strong></code>
<code><strong>... Program from 0x80ff0000-0x81000000 at 0xa87e0000: .</strong></code>
<code><strong> </strong></code>
<strong>RedBoot&gt;</strong><code><strong> <span style="color:#ff0000;background-color:#000000;">fconfig</span></strong></code>
<code><strong>Run script at boot: true</strong></code>
<code><strong>Boot script: </strong></code>
<code><strong>Enter script, terminate with empty line</strong></code>
<code><strong>&gt;&gt; <span style="color:#ff0000;background-color:#000000;">fis load -l vmlinux.bin.l7</span></strong></code>
<code><strong>&gt;&gt; <span style="color:#ff0000;background-color:#000000;">exec</span></strong></code>
<code><strong>&gt;&gt; </strong></code>
<code><strong>Boot script timeout (1000ms resolution): 2 (My default was 10)</strong></code>
<code><strong>Use BOOTP for network configuration: false</strong></code>
<code><strong>Gateway IP address: </strong></code>
<code><strong>Local IP address: 192.168.1.1</strong></code>
<code><strong>Local IP address mask: 255.255.255.0</strong></code>
<code><strong>Default server IP address: 192.168.1.254</strong></code>
<code><strong>Console baud rate: 9600</strong></code>
<code><strong>GDB connection port: 9000</strong></code>
<code><strong>Force console for special debug messages: false</strong></code>
<code><strong>Network debug at boot time: false</strong></code>
<code><strong>Update RedBoot non-volatile configuration - continue (y/n)? <span style="color:#ff0000;background-color:#000000;">y</span></strong></code>
<code><strong>... Erase from 0xa87e0000-0xa87f0000: .</strong></code>
<code><strong>... Program from 0x80ff0000-0x81000000 at 0xa87e0000: .</strong></code>
<strong>RedBoot&gt;</strong><code><strong> <span style="color:#ff0000;background-color:#000000;">reset</span></strong></code>
<code><strong> </strong></code>
<code><strong>^]</strong></code>
<code><strong>telnet&gt; Connection closed.</strong></code>
<strong>root@desktop ~ #</strong></span><code><strong><span style="font-size:small;"> </span></strong></code></pre>
<h2><span style="font-family:Courier New;">Sweet!</span></h2>
<p><span style="font-size:small;"> </span></p>
<p><span style="font-size:small;">The hard part is over. So what happens if you make a mistake in fconfig like<br />
me? Type fconfig -n it will list all of the nicknames of the fields you can<br />
change. The shell doesn&#8217;t know what delete is, and<a href="http://ecos.sourceware.org/docs-latest/redboot/redboot-editing-commands.html"> there are all sorts of redboot keyboard-fu</a> you can use to control input. I found it easier to type at the reboot&gt; fconfig field_name [input]. So for<br />
example, if you accidentally entered 192.168.1.11 for the IP address. You could fix just that line by typing: </span><span style="font-family:Courier New;font-size:x-small;">fconfig boot_my_ip 192.168.1.1 </span></p>
<p><span style="font-size:small;"> </span></p>
<p><span style="font-size:small;">Let the Fon reboot, make sure you can ping 192.168.1.1 after all the lights<br />
look good, then open your browser and hit</span><span style="font-size:small;"> </span><span style="font-size:small;"> <a href="http://192.168.1.1:1471" target="_blank">http://192.168.1.1:1471</a> .</span></p>
<p><span style="font-size:small;"> The jasager interface *should* open. If it does not after a few minutes&#8230; try the following. </span></p>
<ol><span style="font-size:small;"></p>
<li>Make sure you are loading and executing vmlinux.bin.17 in fconfig</li>
<li>Reboot the Fon</li>
<li>Double and triple check fconfig.</li>
<p></span></ol>
<p><span style="font-size:small;">If all else fails, repeat the process. I ended up flashing almost 10 times<br />
due for various reasons, ranging from mistakes I made in the network config, to<br />
the Fon not playing nice with DHCP. If you need to reflash, redboot is only<br />
available for a few seconds while the fon device is booting. I hope your<a href="http://www.youtube.com/watch?v=1weOKbOTv3A"><br />
SMB, 3-1 infinite guy</a> timing is still there. Here is what I had to do to hit<br />
the timing properly. </span></p>
<ol><span style="font-size:small;"></p>
<li>Remove power from Fon</li>
<li>Launch a terminal and start pinging 192.168.1.254</li>
<li>Launch another terminal and PREP a telnet session to 192.168.1.254 9000</li>
<li>The first reply you receive from ping, press enter on your telnet session</li>
<li>If it fails. Repeat process until you get it.</li>
<p></span></ol>
<p><span style="font-size:small;">Now, head back to<br />
<a href="http://www.h-i-r.net/2009/07/evil-wifi-part-1-jasagerfonera-setup.html"><br />
part 1</a> of the h-i-r instructions and follow along starting with “tinker<br />
time” </span></p>
<h2><span style="font-family:Courier New;">Step 2: Install the pWn<br />
</span></h2>
<p><span style="font-size:small;"> </span></p>
<p>This is the easy part.  Below are simply notes regarding the process.</p>
<h2><span style="font-family:Courier New;">Metasploit and Karma</span></h2>
<p><span style="font-family:Courier New;font-size:medium;"> </span></p>
<p><span style="font-family:Courier New;font-size:medium;"> </span></p>
<p>This is the part where I point you back to <a href="http://www.h-i-r.net/2009/07/evil-wifi-part-2-metasploit-framework.html" target="_blank">h-i-r.net&#8217;s part 2</a> for the complete setup of this step.  I was able to <a href="http://metasploit.com/framework/download/?id=framework-3.2.tar.gz">drop in the framework</a> to my tools directory with no additional steps required. However, you may want to update ruby if you desire.  Then Download <a href="http://metasploit.com/users/hdm/tools/karma.rc" target="_blank">karma.rc</a>, put it in the root directory with the framework and we are in the home stretch to put this all together.</p>
<p>Head to <a href="http://www.h-i-r.net/2009/07/evil-wifi-part-2-metasploit-framework.html">part 2</a> of the h-i-r instructions. Follow from “Time to tweak stuff”.  You will need to edit karma.rc before you run it.</p>
<p><span style="font-family:Courier New;font-size:medium;"> </span></p>
<h2><span style="font-family:Courier New;">Hamster and Ferret</span></h2>
<p>Last files we need to grab are<a href="http://hamster.erratasec.com/downloads/hamster-macosx-2.0.1.zip"> hamster</a> and <a href="http://hamster.erratasec.com/downloads/hamster-macosx-2.0.1.zip">ferret</a>.</p>
<p>I was having some trouble getting hamster and ferret to compile, even after installing <a href="http://developer.apple.com/tools/xcode/" target="_blank">xcode</a>.  Luckily, <a href="http://hamster.erratasec.com/downloads/hamster-macosx-2.0.1.zip" target="_blank">the binaries are compiled for us already </a>. Download them and place them in a directory you will remember.</p>
<p>You will need to set your browsers proxy to 127.0.0.1:1234 to view the Hamster interface. Be sure you add an exception for your NIC&#8217;s ip address, so you can monitor Jasager as well.</p>
<p><img title="Screen shot 2009-09-02 at 4.19.25 PM" src="http://nodatafound.files.wordpress.com/2009/09/screen-shot-2009-09-02-at-4-19-25-pm.png" alt="Screen shot 2009-09-02 at 4.19.25 PM" width="445" height="536" /></p>
<p>You can now head back to <a href="http://www.h-i-r.net/search/label/evilwifi" target="_blank">ax0n&#8217;s work</a> and button up the rest of the project.</p>
<h2><span style="font-family:Courier New;">Starting the entire process</span></h2>
<p>Here are the steps I use when booting this rig.</p>
<ol>
<li>Power on the Fon and connect it to your PC      with an Ethernet cable.</li>
<li>Make sure Jasager is online and Karma is      active.   I opted to control its state, instead of automatically      starting it.</li>
<li>Open a terminal and Launch Metasploit and      Karma with&gt;      sudo ~./msfconsole -r karma.rc</li>
<li>Open another terminal and launch hamster      with&gt; sudo      ~./hamster</li>
<li>Enable your proxy.  Or use <a href="https://addons.mozilla.org/en-US/firefox/addon/1557" target="_blank">quickproxy</a> for firefox to quickly enable.</li>
<li>Open the Jasager (<a href="http://192.168.1.1:1471" target="_blank">192.168.1.1:1471</a>) and      hamster (<a href="http://127.0.0.1:1234">127.0.0.1:1234</a>) interfaces</li>
<li>Gratz ur      l33+</li>
</ol>
<h2><span style="font-family:Courier New;">Conclusion</span></h2>
<p><span style="font-size:small;"> </span></p>
<p><span style="font-size:small;">While this guide wasn&#8217;t meant to be as comprehensive as the article it was based on. I hope you will find a quick reference for installing this on your Mac Box.</span></p>
<p><span style="font-size:small;"> All the files referenced, I have zipped up and stashed them <a href="http://www.box.net/shared/t1efgv7rkg">here.</a> Comment with questions or <a href="http://www.twitter.com/corykennedy">hit me up via twitter </a></span></p>
<p><span style="font-size:small;"> </span></p>
<pre><strong>
<code> </code></strong>

<strong>
</strong><code> </code></pre>
]]></content:encoded>
			<wfw:commentRss>http://blog.l-lacker.com/project-lafonera-hacking/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

