2) Getting Linux (and your network card) set up


But Linux is nasty, hairy and complicated right? Well, maybe, but it’s also not deliberately limited in the way it can access your hardware (unlike Windows). Therefore, if you want to see your network the way others will be able to (i.e. you want to find good software for network analysis and penetration testing without paying an arm and a leg for commercial software), you will need to revert to Linux.

****Important note**** I do not take responsibility for anything bad that happens as a result of anything detailed below. I purely describe what I did as a recommendation on the basis that it worked for me – it may not work for you and you may have problems (data loss or worse) if you are installing a new operating system and/or boot loader or if you are repartitioning drives. It is recommended that you back up important data before trying any of this.

Having said that, as long as you don’t delete your windows partition from your hard drive when you are repartitioning, I don’t think you are likely to have any serious problems (I had none).

The key to getting things set up right is to pick the right distribution of Linux (I recommend Knoppix for its compatibility – www.knoppix.org), the right networking hardware and the right drivers. Most tutorials recommend something based on Prism2 or Atheros, but Prism2 is expensive and difficult to find, and there are so many Atheros cards it’s tough to know what to go for (do all of them work?). For my networking hardware, I chose something cheap with an Atheros chipset, the TP-Link TL-WN610G which 3rd party retailers sell on Amazon for about £15 in the UK. In terms of drivers, patched MadWifi drivers are ideal if you choose Atheros.
I recommend you choose something cheap based on Atheros to start off, because it is best to start with something simple that works, and there is no need for antennas etc if you are looking at your own network (your signal strength will be strong without an external antenna, so given that my tutorial is only looking at auditing your own home network, this shouldn’t be required). Why Atheros? Because its very well documented (almost all of the tutorials out there use it) and its functional under Linux. I would recommend a TP Link Atheros based card that is compatible with the Linux MadWifi drivers (see http://madwifi-project.org/ or more specifically http://madwifi-project.org/wiki/Compatibility/TP-Link for other TP Link cards that have been tested with MadWifi) because the TP Link cards are particularly cheap.
Setting up
So you’ve got your laptop, your nice cheap Atheros network card and your freshly burnt Knoppix installation CD. What now? You don’t want to lose all of your data and only boot into Linux do you? No. So instead, you want to resize the existing partition on your hard drive to make it small enough to leave sufficient free space to install Linux.
How much space do you need? I freed up around 8 gigs in Windows (and filled it pretty quickly later on in Linux). Once you have this space, burn a GParted LiveCD (gparted.sourceforge.net) and follow the on-screen instructions to resize your Windows partion, leaving the space you freed up in Windows earlier as actual free space. Then reboot and boot from the Knoppix install CD, create a partition on this free space, and install Knoppix (this should be pretty self explanatory). Make sure you note down your root password. Also, if you’ve never used Linux before, you should take a look at http://www.aboutdebian.com/linux.htm for background and basic commands etc (the commands start about 2/3 of the way down the page).
A note about bootloaders/dual booting: most people will probably want to install LILO or GRUB as a bootloader so that they can boot into both Linux and Windows. I installed GRUB, but it doesn’t really matter as the two are effectively the same (you don’t need to reinstall GRUB to reconfigure it though). Install it into your Master Boot Record or MBR. Don’t be shocked when you reboot and something funny-looking pops up – you’ll get used to it. Instructions on configuring LILO or GRUB (which I haven’t read btw) can be found at http://www.acm.uiuc.edu/workshops/linux_install/lilo.html or http://www.tldp.org/HOWTO/LILO.html or at http://www.gnu.org/software/grub/manual/
Once you have your box dual booting into both Windows and Linux, boot into Linux and open up a command prompt – this looks and works something like the DOS prompt you may have seen in Windows.
You will need to login as root in this command prompt by typing ‘su’ and entering your root password when prompted if you are not already logged in as root (note: logging into the graphical user interface as root is generally not a great idea, so hopefully you are not already logged in as root, but I won’t get into that here).
You will then need to install the patched MadWifi drivers. The MadWifi drivers can be downloaded from http://madwifi.org but whatever version you download and install you will need to make sure you also download the patch for the same version. Patches can be hard to find, but are essential to enable the packet injection that will be required to really get to the bottom of how Wifi security works/doesn’t work. Note that http://patches.aircrack-ng.org/  appears to have some patches – look for ‘madwifi-ng-rxxxx.patch’ where xxxx denotes the release number.
Once you have a version of the MadWifi drivers and the corresponding patch, again go to http://madwifi-project.org to see how to install the drivers (specifically see http://madwifi-project.org/wiki/UserDocs/FirstTimeHowTo) and the documentation that comes with the patch command in Linux (type ‘man patch’) to see how to patch them.
Assuming that you managed all of that, you now have laptop with Linux installed and your network card set up for packet injection. I’m assuming that it is set up as ath0, check by typing ‘ifconfig’ to see a list of network cards available – something like ath0 should be on that list. Note this down (if it’s ath0, you don’t have to).

Be Sociable, Share!
 Posted by at 10:36 pm

 Leave a Reply



You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>