How to Install Backtrack 3 Final onto an eeePC SDHC card

Today boys and girls, we will learn how to install a full working copy of Backtrack to an SDHC card for booting on an eeePC, the procedure however should work on any computer that can boot from usb devices. The procedure below will create a full install of Backtrack, not a live version, all changes will be persistent as with a regular operating system. I found the live version and saving my changes as modules rather annoying so I found this to be a better alternative, it may not be for you, but I like it.

You might ask first of all, why use Backtrack 3 Final since Backtrack 4 Beta is out? Well, I tried that, and the Bt4b didn't detect my mouse hardware correctly on my eeePC (701 4g Surf), so I went with the tried and true Bt3f since it has worked in the past, and personally I like Slackware much better, I understand the reasons for using a Debian based OS, but I'll stick with what I like (as previously stated).

The requirements:

At least a 4Gigabyte SDHC card, class 4 or better if you want it to load in under 2 minutes, Ideally you'd have a 16Gb Class 6 SDHC, but you can meek by with 4Gb class 4 (I am).

An eeePC, any one should be fine, I used a 701 series, all should be the same besides possibly a drive being mapped to a different mount point, in my examples I will be using /dev/sda as the SD card drive path. Make sure this corresponds with your system.

A fresh copy of Backtrack, in my case Backtrack 3 Final usb version, you can find the downloads here.

A seperate USB drive with a live version of Backtrack you wish to install already setup.

The Procedure:

I'm going to write this out exactly how you'd do it in a console so no one can get confused, take note that on the eeePC I decided not to make a swap partition simply because the SDHC medium is rather slow and swapping out memory onto it will slow it down. Go ahead and boot Backtrack from the usb disk you've prepared (live version) and we'll begin:


1. Let's start by partitioning the disk (ensure the previous partitions have been erased by selecting d and the partition numbers).


Code:
root@bt:~# fdisk /dev/sda

The number of cylinders for this disk is set to 1044.
There is nothing wrong with that, but this is larger than 1024,
and could in certain setups cause problems with:
1) software that runs at boot time (e.g., old versions of LILO)
2) booting and partitioning software from other OSs
(e.g., DOS FDISK, OS/2 FDISK)

Command (m for help): n
Command action
e extended
p primary partition (1-4)
p
Partition number (1-4): 1
First cylinder (1-1044, default 1): [enter]
Using default value 1
Last cylinder, +cylinders or +size{K,M,G} (1-1044, default 1044): +64M

Command (m for help): n
Command action
e extended
p primary partition (1-4)
p
Partition number (1-4): 2
First cylinder (10-1044, default 10): [enter]
Using default value 10
Last cylinder, +cylinders or +size{K,M,G} (10-1044, default 1044): [enter]
Using default value 1044

Command (m for help): a
Partition number (1-4): 1

Command (m for help): w
The partition table has been altered!

Calling ioctl() to re-read partition table.
Syncing disks.
root@bt:~#


2. Ok, great, now that the disks are partitioned, we have to create the filesystems, we'll be using ext3, yes I know journaling increases writes but your card will still be good well over 10 years, that's far longer than you'll even have the eeePC probably. After that is done we'll chroot into the new environment.


Code:
root@bt:~# umount /dev/sda1
root@bt:~# umount /dev/sda2
root@bt:~# mke2fs /dev/sda1
root@bt:~# mkfs -t ext3 /dev/sda2
root@bt:~# mkdir /mnt/bt
root@bt:~# mount /dev/sda2 /mnt/bt/
root@bt:~# mkdir /mnt/bt/boot
root@bt:~# mount /dev/sda1 /mnt/bt/boot
root@bt:~# cp --preserve -R \
/{bin,dev,home,pentest,root,usr,boot,etc,lib,opt,sbin,var} /mnt/bt/
root@bt:~# mkdir /mnt/bt/{mnt,tmp,proc,sys}
root@bt:~# chmod 1777 /mnt/bt/tmp/
root@bt:~# mount -t proc proc /mnt/bt/proc
root@bt:~# mount -o bind /dev /mnt/bt/dev/
root@bt:~# chroot /mnt/bt/ /bin/bash


3. Now, we need to configure our fstab and remove unnecessary mount lines, your fstab should look similar to this when done.
Note: if you're feeling lazy this part isn't extremely crucial, just ensure /dev/sda2 is listed as ext3.
to edit your fstab type nano /etc/fstab. Crl-O saves, Ctrl-X exits.


Code:
/dev/sda2 / ext3 defaults 0 0 # AutoUpdate
proc /proc proc defaults 0 0 # AutoUpdate
sysfs /sys sysfs defaults 0 0 # AutoUpdate
devpts /dev/pts devpts gid=5,mode=620 0 0 # Auto
tmpfs /dev/shm tmpfs defaults 0 0 # AutoUpdate


4. We're getting there, just hold on, we just need to edit our lilo.conf and the hard work will be done.
Note: To edit your lilo.conf, nano /etc/lilo.conf will do fine. Crl-O saves, Ctrl-X exits.
The most major parts are making sure that the root is set to /dev/sda2 and that append="rootdelay=10" is set to allow time for the bios to query the SD card before mounting the filesystem otherwise you will get all kinds of nasty errors and kernel panic.


Code:
# LILO configuration file
# generated by 'liloconfig'
#
# Start LILO global section
lba32 # Allow booting past 1024th cylinder with a recent BIOS
boot = /dev/sda
#message = /boot/boot_message.txt
prompt
timeout = 1
# Override dangerous defaults that rewrite the partition table:
change-rules
reset
# VESA framebuffer console @ 1024x768x256
vga = 769  #This is for the eeePC, recommend 773 for all other computers
# Normal VGA console
# vga = normal
# VESA framebuffer console @ 1024x768x64k
# vga = 791
# VESA framebuffer console @ 1024x768x32k
# vga = 790
# VESA framebuffer console @ 1024x768x256
# vga = 773
# VESA framebuffer console @ 800x600x64k
# vga = 788
# VESA framebuffer console @ 800x600x32k
# vga = 787
# VESA framebuffer console @ 800x600x256
# vga = 771
# VESA framebuffer console @ 640x480x64k
# vga = 785
# VESA framebuffer console @ 640x480x32k
# vga = 784
# VESA framebuffer console @ 640x480x256
# vga = 769
# End LILO global section
# Linux bootable partition config begins
image = /boot/vmlinuz
root = /dev/sda2
label = Backtrack3Final
read-only
append="rootdelay=10"
# Linux bootable partition config ends


5.
Ok! just one more command and you can reboot and enjoy a full install of Backtrack on your SDHC card.
Note: you should receive one error about the partition not being the main boot device, this is fine since on the eeePC we won't need to install a bootloader to the superblock, when booting the eeePC simply press escape and choose the SDHC card, it will enter lilo and boot normally. This will allow you to simply do nothing to boot to your normal OS (Windows in my case).


Code:
root@bt:/# lilo -v
LILO version 22.8, Copyright (C) 1992-1998 Werner Almesberger
Development beyond version 21 Copyright (C) 1999-2006 John Coffman
Released 19-Feb-2007, and compiled at 14:08:06 on May 15 2008
Ubuntu

Reading boot sector from /dev/sda
Using MENU secondary loader
Calling map_insert_data

Boot image: /boot/vmlinuz
Mapping RAM disk /boot/splash.initrd
Added BT4 *

Writing boot sector.
Backup copy of boot sector in /boot/boot.0800

root@bt:~# reboot


That's all there is to it, you now have a full copy of Backtrack on your SDHC card you can boot to anytime you like!

----

Final notes:

When backtrack boots on the eeePC, it complains about undefined video modes, simply hit spacebar and everything will be fine.

If you wish to use the Backtrack 4 beta anyhow because your not using an eeePC or think you can get it working normally, it's recommended you don't use the ext3 filesystem, in step two, replace mkfs -t ext3 /dev/sda2 with mkreiserfs /dev/sda2 and everything else will be fine.

I recommend when you get Backtrack booted, you login with the default user and pass (root:toor) and immediately run passwd in order to change your password, then type startx to get to the graphical desktop. Once on the desktop, open up the menu and open the backtrack context menu at the top, now find penetration and select Fast Track, a shell will open, type ./fast-track.py -i in order to start the interactive shell script and enter the Fast-Track updates menu (1). Select to update everything (9). When that is done, go back to the update menu and select the Installation menu (8) and install everything (8 again). One final thing to do when that is done is to go back to the Installation menu, select Install Slapt-Get (1) and choose to update SlackWare (1). You are now done updating as far as fast-track is concerned. Though you still will need a couple thing and I will provide them to you.

Download Gslapt - Graphical frontend for slapt-get (Slackware 12.0 version should be fine)
Grab the ShamanVirtuel mega pack
Download the latest version of Network Autoscan (extremely useful tool for lans)

Install gslapt by running pkgtool in the directory you downloaded the tarball into (usually your home directory), the network autoscan package has a self installer executable, simply unpack it via tar -xvzf AutoScan-Network-Linux-x.xx.bin.tar.gz and run the executable by double clicking on it or typing the name into your shell. the sv megapack contains lzm modules, for those who are clueless as to what they are, I will simply explain to you how to install them.

lzm2dir modulename.lzm /

That's all there is to it, they will unpack into the proper directories and you can use them, in the case of Charon and Svaas, you will have icons placed on your desktop, spoonwep v.2 and spoonwpa v.2 are accessible via the shell (simply enter the name in any directory).

Enjoy!

 

What did you think of this article?




Trackbacks
  • No trackbacks exist for this entry.
Comments

Leave a comment

Submitted comments will be subject to moderation before being displayed.

 Enter the above security code (required)

 Name

 Email (will not be published)

 Website

Your comment is 0 characters limited to 3000 characters.