The Asus Eee PC. A palm-sized 900Mhz computer that includes a 4Gb Solid state hard drive. Now consider the fact that this beautiful machine includes an Atheros-Chipset based wificard that supports injection, and has 3 USB 2.0 ports. You have the perfect hack-top. The only thing that could make it better is to match this great hack-top with a great Hack-OS.
BackTrack is the top rated linux live distribution focused on
penetration testing, and supports the Eee PC natively. This tutorial will walk you though the installation of BackTrack 3.0 (beta) onto the Eee PC. This is the first of many tutorials using this great platform!
Items Needed:
- Asus Eee PC
(4G Non-Surf used in this tutorial)
- 2gb (or larger) flash drive
- Second computer running linux or windows
- 4Gb (or larger) SDHC card (completely optional)
WARNING: THIS TUTORIAL WILL COMPLETELY OVERWRITE YOUR STOCK OS ON YOUR EEE PC, AS WELL WILL COMPLETELY DESTROY ANY DATA ON YOUR FLASH DRIVE.
Preparing the Flash DriveOn the second (NON-Eee PC) computer begin to download the USB version of BT3 from http://www.remote-exploit.org/backtrack_download.html (~950mb). The USB package is an extended version of BackTrack, and when expanded will take up most of our 4Gb SSD (Solid State Disk) in the Eee PC. While this is downloading, use this PC to prepare your Flash Drive.
Format your flash drive, making sure to use Fat32 and giving the drive a label.
In Windows: After inserting your flash drive, Open Windows Explorer and right click on the drive and select format. (Fat32 - Give it label 'Backtrack')
In Linux:
| When you see text shown like this, it should be typed in your terminal
|
First run "fdisk -l" to identify your flash drive. (should be sdX: sda, sdb, sdc, etc) Replace the X in the following sdX1 command to correspond with your flash drive.
| mkfs.vfat -F 32 -n Backtrack /dev/sdX1
|
| parted /dev/sdX set 1 boot on
|
Once BackTrack has finished downloading, Unrar and copy both the "BT3" and "Boot" folders to the root of the flash disk.
Finally we need to make this flash drive bootable. The BackTrack3 USB install includes scripts to perform these step for us. These scripts will attempted to locate where the drive is installed, and then copy the grub bootloader onto the flash drive. Once the script has completed you can remove the flash drive. (Unmount if needed)
In Windows: Open Windows Explorer and navigate to your flash drive. You should see the two folders we previously put on there. Navigate to and double click on the \boot\bootinst.bat (make sure you are on the thumbdrive before you run it!!!)
In Linux: In your terminal window, navigate to the flash drive. You should see the two folders we previously put on there. Navigate to the boot/ folder. Make the script excutable by typing:
And the execute it.
Booting BackTrack3Insert the flash drive into the EeePC (doesnt matter which USB port) and turn it on. When the grey "Starting EeePC" screen shows, press the Escape Key 'Esc' which will bring up a boot menu, allowing you to select the flash drive as your boot device.
If everything went correctly, you should be presented with the BackTrack Grub loader. Make sure to arrow down and select "BT3 Graphics mode (Compiz) - Experimental"
At this point, if you would like to keep your stock Xandros OS on your SSD, and only boot BackTrack from the flash drive when you want it, you are done. You will notice however since Backtrack3 is booting from your USB drive, it will be much slower to boot than the default Xandros OS. By following the remainder of this tutorial we will fix that by installing Backtrack3 to your SSD.
Once Backtrack has booted fully, open a terminal window:
Use fdisk again to locate your SSD drive, in order to determine where we will be installing BackTrack3.
By default the included 4Gb SSD has 4 partitions on it (hdc1, hdc2, hdc3, hdc4). Since we dont plan on keeping Xandros, we can simply blow the first two (hdc1 & hdc2) away. Hdc3 & hdc4 are used for Xandros recovery. I dont plan on ever keeping Xandros on my Eee, so I went ahead and deleted all four and created a single 4gb partition. The choice is up to you, but I figured the BackTrack3 image was so big I wanted to utilize as much SSD space as possible.
First, type 'p' to make sure you see those same four partitions we identified earlier.
(This step is just a safety step to make sure you are on the correct drive.
Second use the 'd' command, and delete all four partitions. (1-4) *Or just 1 & 2
At this point go ahead and do another 'p' to print the partition table. It shouldnt see any "linux" partitions. Now lets create the partition we will install BackTrack on.
Use the command 'n', then 'p', then '1'.
It will now ask you were you want this partition to start and end, since we want the whole drive, the First Cylinder should be '1', and the last should be whatever the last is. (You can just hit enter on both of these accepting the defaults)
Now we need to make this partition bootable: type 'a' then '1'. You might want to do a final 'p' to ensure you only have one linux partition. After you are satisfied type 'w' to write the changes to the partition table.
At this point, shutdown and restart your Eee. This is just simply a good computing step when partitioning drives.
When your Eee is coming back up, dont forget to hit "Esc" and select your flash drive as the boot device.
At the BackTrack Grub menu, make sure to select the "BT3 Graphics mode (Compiz) - Experimental"
Once BackTrack has finished booting, Open a new command windows and type: 'fdisk -l' to identify your SSD. (just like earlier)
The next step we need to do, is create the filesystem on the partition that we created earlier.
This might be a good place to discuss which filesystem you should use on your Solid State Disk. Since the flash media used in the Eee's SSD "degrades" over time (simply a characteristic of Flash media) we want to minimize the amount of write cycles to the drive. There are hundreds of posts & wiki entries argueing which should be used. Some say you should avoid ext3 because it’s
journaling function causes writes. These people advise ext2. Personally, I think the data integrity risks of ext2 outweigh the
reduction in write cycles, and would advise the use of a journaled
filesystem. The Xandros install
used an ext2 partition for the system files, and ext3 for the home
directory. Since we are only making one partition, I chose to go with ext3. It must be stated that Asus has come out and said that the use of Journaled filesystems do NOT void the warranty.
Back In your terminal type:
and then
(assuming your SSD was identified as hdc)
Once this is finished, we will need to remount the partition, so we can install the Backtack3 OS onto your SSD. (press enter after each command)
Using the K-Menu (like Start Menu), open K/Backtrack/Install Backtrack.
Keep the Source the default, but change the Install path to the location you just mounted. (/tmp/bt3) Write new MBR to /dev/hdc.
Make sure the installation method is real, and you uncheck the "Restore Original MBR after lilo" box.
Make sure your EeePC is connected to AC power, and click the "Install" button to begin the copying process. Note, this can take awhile, and can seem to get stuck at some places. This is where it is unpacking and moving some big files -- give it some time to continue. (might greater than 10 mins)
You are almost done, but before you reboot, first make a backup copy of /etc/xorg.conf. Either via the command line or with Konquerer navigate to /etc/X11 and copy the xorg.conf to your flash drive. You will need this file later. (Make sure to replace sdX1 with where ever your flash drive was mounted)
| cp /etc/X11/xorg.conf /mnt/sdX1/
|
Once the installer has completed, and you have backed-up the xorg.conf, shutdown and restart. K / Log Out
Then shut down (with restart)
(Let it go all the way down on its own, dont hold down the power button) Finally remove the USB drive. If everything worked right, your Eee should be booting BackTrack3 from your SSD, and you will soon be terrorizing the neighborhood. (I mean performing penetration tests ><)
House Keeping For the most part, the BackTrack3 install does a pretty good job, however there are some tweaks and fixes we need to make in order to to call this "Finished"
Continue reducing write cycles:Edit your /etc/fstab using your favorite editor (vi, nano, kedit) and add the following lines to the bottom of the file.
tmpfs /tmp tmpfs defaults,noatime,mode=0777 0 0
tmpfs /var /tmp tmpfs defaults,noatime,mode=0777 0 0
tmpfs /var/log tmpfs defaults,noatime,mode=0777 0 0
(delete the space betwen /var and /tmp in the second line)
**Note: This places all your log files in a temporary location in system RAM. This means that your logs will not exist after a reboot. If you need to diagnose something, be sure to comment these lines out in order to check logs.
Fix CompizWith BackTrack3 running, Plug in your flash drive. The drive should auto-mount and open a window asking what you would like to do. Select "Open in a new Window". Navigate to /bt3/optional/ then press f4 to open your terminal there. (make sure to notice where your USB drive was mounted example: system:/media/sdc1)
Next replace the running xorg.conf with the one that you backed up earlier. (Make sure to replace sdX1 with where-ever your flash drive was mounted)
| cp /etc/X11/xorg.conf.back
|
| cp /mnt/sdX1/xorg.conf /etc/X11/
|
Log out, and restart X
At this point, Compiz should be working. Press Ctrl + Alt + Left Arrow. You should see the cube spin.
Use FastTrack to update everythingFor those who don't know, FastTrack is an "Auto-pwn'ing & Auto-Updating" script that you will probably want to get to know in the future. We are going to use it to prepare our systems perform a debian-style system update.
Launch Fastrack (K / Backtrack / Penetration / FastTrack) and have FastTrack update itself. After it updates, you will need to exit and relaunch. Next navigate to the "Fast-Track Updates / Installation Menu / Install Slapt -Get / Install Sapt-Get". After Slapt-get is finished installing, navigate the same path and choose the other option; "Update SlackWare (slapt-get --update --upgrade --ignore-excludes". This will take awhile, but it is downloading, compiling, and installing udpated system software.
Once this is done, you need to "Install Everything" in FastTrack by going to "Fast-Track Updates / Installation Menu / Install Everything"
Once that is done, you need to "Update Everything" in FastTrack by going to "Fast-Track Updates / Update Everything"
Once this is done, you can exit FastTrack.
Fix KismetOpen a terminal window and edit /usr/local/etc/kismet.conf
| nano /usr/local/etc/kismet.conf
|
(you can use whatever editor you want: vi, kwrite, etc)
Find the line:
source=none,none,addone
and replace it with:
source=madwifi_g,wifi0,madwifi
Save kismet.conf (ctrl+x in nano). You will now need to start kismet from the terminal (rather than the K / Backtrack menu) by typing:
Fix Shutdown BugSome people report that when they shutdown Backtrack, the screen
goes blank, but the power light remains on. If you are having this
problem, then try the following:
Using your favorite editor, add this line to /etc/rc.d/rc.6
modprobe -r snd_hda_intel
just before the line:
echo "Unmounting local file systems."
Additional NotesTo put your card into monitor mode, open a terminal window and type:
That will create a new madwifi interface (ath0) in monitor mode.
In order to take your card out of monitor mode, and place it back into managed mode (in oder to join a wifi access point)
wlanconfig ath create wlandev wifi0
|
|