{"id":527,"date":"2012-04-22T18:51:11","date_gmt":"2012-04-23T00:51:11","guid":{"rendered":"http:\/\/www.jedge.com\/wordpress\/?p=527"},"modified":"2012-07-05T22:26:21","modified_gmt":"2012-07-06T04:26:21","slug":"compiling-wireless-tools-for-nokia-n810-post","status":"publish","type":"post","link":"https:\/\/www.jedge.com\/wordpress\/2012\/04\/compiling-wireless-tools-for-nokia-n810-post\/","title":{"rendered":"Compiling Wireless Tools for Nokia N810"},"content":{"rendered":"<p>This tutorial will help you configure the Scratchbox environment to compile the latest svn of aircrack-ng, latest stable kismet, and reaver 1.4 for the Nokia n810.  A lot of love is getting sent to the N900 but the n8x0 series of devices are still great for wireless testing.  With this tutorial you will be not only to compile the software but create Debian packages for easy installation on your Nokia device.  Of important note were the errors I encountered while compiling aircrack-ng.  The error had not been documented on the Internet.  Trust me I Googled my heart out.  Everyones solution was update the linux kernel headers.  Well in this case that wasn\u2019t possible.  I\u2019m not a Linux programmer but I figured out how to edit the header file to make the changed needed to get Aircrack-ng to compile.<br \/>\n<!--more--><\/p>\n<h2>Install and Configure Scratchbox for Diablo<\/h2>\n<p>Visit <a href=\"http:\/\/maemovmware.garage.maemo.org\/2nd_edition\/\" target=\"_blank\">http:\/\/maemovmware.garage.maemo.org\/2nd_edition\/<\/a> and download the Maemo SDK Virtual Image.  It will bring you <a href=\"http:\/\/tablets-dev.nokia.com\/maemo-dev-env-downloads.php\" target=\"_blank\">http:\/\/tablets-dev.nokia.com\/maemo-dev-env-downloads.php<\/a> to download the virtual image.  As of this tutorial the image for Desktop Ubuntu Lucid Lynx is still supported by Ubuntu.  It is an Long Term Service release that will be good until 2013.<\/p>\n<p>Download :  Maemo_Ubuntu_Lucid_Desktop_SDK_Virtual_Image_Final.7z <\/p>\n<p>Extract the image from the compressed 7z archive and boot it with your preferred Virtual Emulator (VMWare, VirtualBox, etc).  How to use Virtual Image software is beyond the scope of this document.  I used Virtualbox (<a href=\"http:\/\/www.virtualbox.org\/manual\/ch01.html\" target=\"_blank\">http:\/\/www.virtualbox.org\/manual\/ch01.html<\/a>) and make some references to it throughout the tutorial.<\/p>\n<p>First thing you should do after you boot your image is update the software and install the Virtual Emulator software\/drivers.  Username and password are maemo\/maemo.  For example, I use VirtualBox and I will install the Guest Additions.  Note, install the latest guest additions and not what comes with the SDK image.<\/p>\n<p>To update the OS open a terminal session and preform these two commands.<br \/>\n<pre><code>$sudo apt-get update\n$sudo apt-get upgrade<\/code><\/pre><\/p>\n<p>In the maemo user home directory Desktop folder are the scripts and programs to install and configure the cross-compilation platform for Maemo 4 OS2008 Diablo.  The SDK comes preconfigured with Maemo 5 Fremantle OS environment.  That environment is for the Nokia N900 Internet phone.<\/p>\n<p>(NOTE:  I prefer to SSH into the image from my Windows 7 host computer using Putty.  This makes it easier to copy and paste commands in this tutorial)<\/p>\n<p><pre><code>\n$cd ~\/Desktop\/DiabloSDKInstall\n$sudo .\/maemo-scratchbox-install_4.1.2.sh -s \/opt\/scratchbox\n$.\/maemo-sdk-install_4.1.2.sh -d -s \/opt\/scratchbox\n\n.\n.\n.\n.\n.\nThis offer is valid for a period of three (3) years.\n\nThe exact license terms of GPL, LGPL and said certain other licenses, as well\nas the required copyright and other notices, permissions and acknowledgements\nare reproduced in and delivered to you as part of the referred source code.\n\n--------------------------------------------------------------------------------\n\nPress Enter to accept (Crtl+C to cancel).\n\nThe process downloads and installs a lot of files.&nbsp;&nbsp;When it is finished you will see\n\nInstallation was successful!\n----------------------------\n\nIMPORTANT! Please read this.\n\nYou now have the maemo 4.1.2 diablo installed on your computer.\nYou can now start your maemo SDK session with \/opt\/scratchbox\/login and\nthen select your target with &#039;sb-conf select DIABLO_ARMEL&#039; for the\narmel target or &#039;sb-conf select DIABLO_X86&#039; for the i386 target.\n\nIf you have any problems with targets&#039; package databases, you can try\nrunning &#039;fakeroot apt-get -f install&#039; on your scratchbox target.\nThis command will try to fix any problems with the package database.\n\nHappy hacking!\n<\/code><\/pre><br \/>\nInstall the Maemo SDK Nokia Binaries.<br \/>\n<pre><code>\n$.\/maemo-sdk-nokia-binaries_4.1.2.sh\n\n.\n.\n.\nDo you accept all the terms of the preceding License Agreement?\nPlease reply with &#039;I accept&#039; if you do.\n&gt; I accept\nThank you.\n\nExtracting files...\n\nNokia binaries repository has now been extracted to a directory under\nyour scratchbox home path. Add the following line to maemo 4.1.2 diablo\nscratchbox targets&#039; \/etc\/apt\/sources.list files to make the repository\nvisible to Debian apt tools:\n\ndeb file:\/home\/maemo\/maemo-sdk-nokia-binaries_4.1.2 diablo explicit\n\nRun &#039;apt-get update&#039; inside scratchbox to read package index files.\n\nNOTE:&nbsp;&nbsp;This line goes in the sources.list file when you are logged into scratchbox\n\n$sudo apt-get install vim\n$sudo \/opt\/scratchbox\/sbin\/sbox_adduser maemo yes\nThe user `maemo&#039; is already a member of `sbox&#039;.\nScratchbox user account for user maemo added\n$sudo \/opt\/scratchbox\/sbin\/sbox_ctl start\n$ \/opt\/scratchbox\/login\nWelcome to Scratchbox, the cross-compilation toolkit!\n\nUse &#039;sb-menu&#039; to change your compilation target.\nSee \/scratchbox\/doc\/ for documentation.\n\n[sbox-DIABLO_ARMEL: ~] &gt;vim \/etc\/apt\/sources.list\nAdd the new repository to the APT sources.list\n[sbox-DIABLO_ARMEL: ~] &gt;apt-get update\n[sbox-DIABLO_ARMEL: ~] &gt;mkdir source\n[sbox-DIABLO_ARMEL: ~\/source] &gt;exit\n$sudo apt-get install subversion libapr1 libaprutil1 libsvn1 vim\n<\/code><\/pre><\/p>\n<h2>Compile and Package Aircrack-ng<\/h2>\n<p>These steps will download the latest version of Aircrack-ng and modify the Maemo Linux header files so the software will compile.<br \/>\n<pre><code>\n$cd \/opt\/scratchbox\/users\/maemo\/home\/maemo\/source\n$svn co&nbsp;&nbsp;http:\/\/trac.aircrack-ng.org\/svn\/trunk\/ aircrack-ng-4.20.2012.svn\n$ \/opt\/scratchbox\/login\n[sbox-DIABLO_ARMEL: ~] &gt;cd source\/aircrack-ng-4.20.2012.svn\n[sbox-DIABLO_ARMEL: ~\/source\/aircrack-ng-4.20.2012.svn] &gt;make\n<\/code><\/pre><br \/>\nClick <a href=\"http:\/\/www.jedge.com\/docs\/aircrack.svn.n810.scratchbox.compile.error.txt\" target=\"_blank\">here<\/a> for compile output including the error messages<\/p>\n<p>The compilation first breaks when trying to compile aireplay-ng.  The beginning of the error is this:<br \/>\n<kbd><br \/>\ngcc -g -W -Wall -O3 -D_FILE_OFFSET_BITS=64 -D_REVISION=-1  -Iinclude   -c -o aireplay-ng.o aireplay-ng.c<br \/>\nIn file included from \/usr\/include\/linux\/cpumask.h:86,<br \/>\n                 from \/usr\/include\/linux\/interrupt.h:10,<br \/>\n                 from \/usr\/include\/linux\/rtc.h:14,<br \/>\n                 from aireplay-ng.c:39:<br \/>\n\/usr\/include\/linux\/bitmap.h: In function `bitmap_zero':<br \/>\n<\/kbd><br \/>\nAfter some research, okay, A LOT of research (Googling), it appears that #include <linux\/interrupt.h>  should not be in rtc.h.  I&#8217;ve found references to a kernel bug on the Internet.  I am specifically creating this tutorial because this error alone wasted a lot of my time and I want to help someone else down the road.<br \/>\n<pre><code>\n[sbox-DIABLO_ARMEL: ~\/source\/aircrack-ng-4.20.2012.svn] &gt;vim \/usr\/include\/linux\/rtc.h\n<\/code><\/pre><br \/>\nLine 14 goes from this <kbd>#include  &lt;linux\/interrupt.h &gt;<\/kbd> to this <kbd>\/*#include  &lt;linux\/interrupt.h &gt;*\/<\/kbd><br \/>\nSave the file and try to compile again.<br \/>\n<pre><code>\n[sbox-DIABLO_ARMEL: ~\/source\/aircrack-ng-4.20.2012.svn] &gt;make\n<\/code><\/pre><br \/>\nSUCCESS!!!  Okay, so you know it compiles.  Best thing to do is make a Debian package so we are going to &#8220;start over&#8221; compiling aircrack-ng<br \/>\n<pre><code>\n[sbox-DIABLO_ARMEL: ~\/source\/aircrack-ng-4.20.2012.svn] &gt;make clean\n<\/code><\/pre><br \/>\nNOTE:  If you like to have your aircrack-ng binaries in \/usr\/(s)bin instead of \/usr\/local\/(s)bin then modify the common.mak file.  Line 73, set prefix to \/usr (or whatever you prefer).<br \/>\n<pre><code>\n[sbox-DIABLO_ARMEL: ~\/source\/aircrack-ng-4.20.2012.svn] &gt;cd ..\n[sbox-DIABLO_ARMEL: ~\/source] &gt;tar czvf aircrack-ng-4.20.2012.svn.tar.gz aircrack-ng-4.20.2012.svn\/\n[sbox-DIABLO_ARMEL: ~\/source] &gt;cd aircrack-ng-4.20.2012.svn\n[sbox-DIABLO_ARMEL: ~\/source\/aircrack-ng-4.20.2012.svn] &gt; dh_make -c gpl -e james.edge@jedge.com -m -f ..\/aircrack-ng-4.20.2012.svn.tar.gz\nMaintainer name : unknown\nEmail-Address&nbsp;&nbsp; : james.edge@jedge.com\nDate&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;: Fri, 20 Apr 2012 11:22:26 -0400\nPackage Name&nbsp;&nbsp;&nbsp;&nbsp;: aircrack-ng\nVersion&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; : 4.20.2012.svn\nLicense&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; : gpl\nType of Package : Multi-Binary\nHit &lt;enter&gt; to confirm:\nDone. Please edit the files in the debian\/ subdirectory now. You should also\ncheck that the aircrack-ng Makefiles install into $DESTDIR and not in \/ .\n<\/code><\/pre><br \/>\nYou can modify the debian\/control file to include more details about the utility and who you are (maintainer).<br \/>\nYou can also modify it so the share files are not created to reduce the amount of space that is taken up on your device.  <\/p>\n<p>Add the following line below <kbd>install-arch:<\/kbd> (line 77) just above <kbd>dh_install -s<\/kbd> (line 87)<br \/>\n<kbd>rm -Rf $(CURDIR)\/debian\/aircrack-ng\/usr\/share<\/kbd><br \/>\n<pre><code>\n[sbox-DIABLO_ARMEL: ~\/source\/aircrack-ng-4.20.2012.svn] &gt;dpkg-buildpackage -rfakeroot -us -uc \u2013B\n<\/code><\/pre><br \/>\nYou now have an Aircrack-ng Debian package!<\/p>\n<h2>Compile and Package Kismet<\/h2>\n<p>Note:  The Maemo 4 kernel is too old for mac80211 or nl80211, even if you have libnl installed.  That is why the latest svn of Kismet will not work.  2011-03-R2 will probably be the latest version of Kismet that will work on the n810.<br \/>\n<pre><code>\n[sbox-DIABLO_ARMEL: ~] &gt; cd source\n[sbox-DIABLO_ARMEL: ~\/source] &gt; wget http:\/\/www.kismetwireless.net\/code\/kismet-2011-03-R2.tar.gz\n[sbox-DIABLO_ARMEL: ~\/source] &gt; tar zxvf kismet-2011-03-R2.tar.gz\n[sbox-DIABLO_ARMEL: ~\/source] &gt; cd kismet-2011-03-R2\n[sbox-DIABLO_ARMEL: ~\/source\/kismet-2011-03-R2] &gt; dh_make -c gpl -e james.edge@jedge.com -m -f ..\/kismet-2011-03-R2.tar.gz\n[sbox-DIABLO_ARMEL: ~\/source\/kismet-2011-03-R2] &gt;vim debian\/rules\n<\/code><\/pre><br \/>\nedit the configure options so that the config files will be in \/etc\/kismet and the binary will be in \/bin (see below).<br \/>\n<kbd>.\/configure --host=$(DEB_HOST_GNU_TYPE) --build=$(DEB_BUILD_GNU_TYPE) --prefix=\/usr  --sysconfdir=\/etc\/kismet --bindir=\/bin --mandir=\\$${prefix}\/share\/man --infodir=\\$${prefix}\/share\/info --with-suidgroup=users CFLAGS=\"$(CFLAGS)\" LDFLAGS=\"-Wl,-z,defs\"<\/kbd><br \/>\nAlso add the following lines below <kbd>install-arch:<\/kbd> (line 86) just above <kbd>dh_install -s<\/kbd> (line 96)<br \/>\n<kbd><br \/>\nrm -Rf $(CURDIR)\/debian\/kismet\/usr\/share\/man<br \/>\ndh_install debian\/manuf etc\/<br \/>\ndh_install conf\/kismet.conf etc\/kismet<br \/>\ndh_install conf\/kismet_drone.conf etc\/kismet<\/kbd><br \/>\n<\/kbd><br \/>\n<pre><code>\n[sbox-DIABLO_ARMEL: ~\/source\/kismet-2011-03-R2] &gt;vim debian\/dirs\n<\/code><\/pre><br \/>\nAdd the directories <kbd>etc<\/kbd> and <kbd>etc\/kismet<\/kbd> to the file<br \/>\n<pre><code>\n[sbox-DIABLO_ARMEL: ~\/source\/kismet-2011-03-R2] &gt;vim conf\/kismet.conf.in\n<\/code><\/pre><br \/>\nUncomment logprefix and set it to the following (line 13)<br \/>\n<kbd>logprefix=\/media\/mmc1<\/kbd><br \/>\nadd the ncsource line that works with the n810 (below line 31)<br \/>\n<kbd>ncsource=wlan0:type=nokia810,fcs=true,validatefcs=true<\/kbd><br \/>\n<pre><code>\n[sbox-DIABLO_ARMEL: ~\/source\/kismet-2011-03-R2] &gt; wget \u2013cd -N -P debian http:\/\/anonsvn.wireshark.org\/wireshark\/trunk\/manuf\n[sbox-DIABLO_ARMEL: ~\/source\/kismet-2011-03-R2] &gt; dpkg-buildpackage -rfakeroot -us -uc -B\n<\/code><\/pre><br \/>\nAfter everything is done you will bind the deb packages in the source folder<\/p>\n","protected":false},"excerpt":{"rendered":"<p>This tutorial will help you configure the Scratchbox environment to compile the latest svn of aircrack-ng, latest stable kismet, and reaver 1.4 for the Nokia n810. A lot of love is getting sent to the N900 but the n8x0 series of devices are still great for wireless testing. With this tutorial you will be not [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"footnotes":""},"categories":[113,3,5],"tags":[98,111,75,103,112,43,109,105,106,104,107,110,108],"class_list":["post-527","post","type-post","status-publish","format-standard","hentry","category-compiling","category-configuration","category-installing-using-tools","tag-aircrack-ng","tag-armel","tag-compile","tag-cross-compile","tag-diablo","tag-kismet","tag-maemo","tag-n810","tag-n8x0","tag-nokia","tag-reaver","tag-scratchbox","tag-wireless-tools"],"_links":{"self":[{"href":"https:\/\/www.jedge.com\/wordpress\/wp-json\/wp\/v2\/posts\/527","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.jedge.com\/wordpress\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.jedge.com\/wordpress\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.jedge.com\/wordpress\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.jedge.com\/wordpress\/wp-json\/wp\/v2\/comments?post=527"}],"version-history":[{"count":7,"href":"https:\/\/www.jedge.com\/wordpress\/wp-json\/wp\/v2\/posts\/527\/revisions"}],"predecessor-version":[{"id":571,"href":"https:\/\/www.jedge.com\/wordpress\/wp-json\/wp\/v2\/posts\/527\/revisions\/571"}],"wp:attachment":[{"href":"https:\/\/www.jedge.com\/wordpress\/wp-json\/wp\/v2\/media?parent=527"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.jedge.com\/wordpress\/wp-json\/wp\/v2\/categories?post=527"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.jedge.com\/wordpress\/wp-json\/wp\/v2\/tags?post=527"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}