Kamis, 26 Juni 2008

BackTrack 3 USB install and Intel 3945 packet injection

BackTrack 3 USB install and Intel 3945 packet injection
Posted March 9th, 2008 by williamw

I am late announcing this as the official beta has been out since December, however my circumstances recently have changed such that I now have a USB drive. I have been messing around with Backtrack for almost a year and a half now — mostly with the wireless tools — and have been impressed with the powerful arsenal this little bad boy gives you. The best part is that it is FREE!! If you aren’t sure what BackTrack is, I suggest you click here for more information. This will knock your socks off!


For the rest of us who know what it is, I will give you the break down of what you need to do to install BT3 on a USB drive. If you are like me then you are frustrated that your nice laptop comes with such a non-hacker friendly wireless card, the Intel 3945abg. I mean it is a fantastic card for ‘normal’ wireless use–however if one wants to get a little more aggressive with it, than it is near to impossible to allow this card to go into promiscuous mode or to actively inject packets wirelessly. Not to fear though, I will guide you through the steps needed to accomplish both these things.

**The author recognizes there are a variety of methods to go about doing this, however the document procedure below is the one that works best for the author. To follow these EXACT instructions you will need:

1- Computer with Linux

2- Computer with Windows

Step #1

We need to prepare the usb drive for the installation — the usb drive that I used was 8 gig in size, so I wanted to have the majority of the drive available to me as a portable storage space as well as allowing the drive to remain bootable–so my exact process might be a little different than your process. I will try to accommodate for both scenarios.

Ok first off we are going to assume that you don’t have anything on the usb drive (if you do please temporarily move it to another location). Now we need to remove any existing partitions from the USB drive and essentially start from scratch. Insert the USB device into the computer running linux; after the device is recognized and mounted we need to unmount the device from the system so that we can manipulate the partitions. To do this open a terminal window and enter the following command:

umount /dev/sdb [where sdb is the name of the usb drive]

**To find what the drive name is, type: ‘dmesg | tail’ immediately after plugging in the device.

After unmounting the device we want to now use the program called fdisk. From the terminal window type;

sudo fdisk /dev/sdb

[your prompt should change to look like this]

The number of cylinders for this disk is set to 14593.

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):

press ‘p’ to show all the current partitions on the device — I am assuming that there is only one partition on the device, if there are more than one listed then you will need to duplicate the following steps until there are no more partitions showing on the disk.

d [to delete partition]

w [to write changes to disk]

After writing the changes to disk you can press ‘p’ again to confirm that there are no more partitions available on the disk. Now that the device is 100% unallocated space we need to repartition the disk so that we can have a partition for BackTrack 3 to be installed to and another partition to save any changes made to BackTrack and then the third partition is going to be used as the “storage space” that will act as a normal USB drive. Although fdisk is capable of creating new partitions on the device I am going to introduce another program that has a GUI front end that does a good job at creating and formatting the new partitions in one swoop. The program that we will be using is Gparted. If you are using Ubuntu you can install this program from the terminal window by typing:

sudo apt-get install gparted

After installing Gparted we need to start it so in the terminal type:

sudo gparted

This should know open a small rectangle window that displays your current drives partition information. In the upper right hand corner there should be a drop down menu that will allow you to change your device to the USB drive (/dev/sdb) that we just wiped out. After choosing that device you will see that there is no partitions available on the drive and that all space is counted as unallocated. Select the unallocated space and then choose “New”. We need to create a minimum of two partitions, or three if you want some space left on the disk to use as a normal USB drive. Below are the partition sizes and filesystem types I used.

sdb1 — size 6.5 gig — FAT32 [Normal USB storage space]

sdb2 — size 1 gig — FAT32 [BackTrack3 source files]

sdb3 — size 512 MB — EXT2 [BackTrack3 ‘changes’]

**Note you must create a FAT32 parition for the BackTrack3 files to exist on or else the boot script will not run properly

After getting the partitions into the correct order make sure you tell gparted to ‘Write’ the changes to disk. If all goes well gparted will inform you of a success, if not start over at wiping the disk.

Ok so now we have our partitions and file systems it is time to get install BackTrack! First you need to download the installation files specific to a USB installation, click here to get the files. Make sure you get the USB Version. After downloading the the file, extract the files onto the second partition (in my case sdb2). So in the root of the drive I should have two folders “boot and BT3″. After extracting the files we need to run a installation script that will make the first partition bootable. Go into the boot folder and you should see a file called “bootinst.sh” (if you are going to run the script from windows look for the file called “bootinst.bat”). Now we need to run that script file. From the terminal type the following

sudo ./bootinst.sh

Follow the prompts and that should now enable the first partition to be bootable drive. Now we need to configure BackTrack to allow us to save any changes that we make to disk. Once again go into the ‘boot’ folder and then into the ’syslinux’ folder. Inside of that directory there is a file called ’syslinux.cfg’. Open that file up with your favorite text editor. We need to find the section that says “LABEL pc change”, in that section there is a line that says

APPEND vga=0×317 initrd=/boot/initrd.gz ….

And we need to change that line so that it now reads

APPEND vga=0×317 changes=/dev/sdb3 initrd=/boot/initrd.gz

be careful of any extra commas or white spaces, they will disrupt the syntax of the command

(**Note this file displays the different ways that BT3 can be started, because I want to start BT3 in “persistent change” mode (aka it will always save any changes made) I actually moved the entire ‘pc change’ section to the top of the file so that by default BT3 starts in “persistent change” mode. )

After saving the syslinux.cfg file we need to do one last thing — on the third partition that we made (/dev/sdb3) that contains the .EXT2 filesystem we need to create a folder called ‘changes’ in the root level of that partition. Linux is case sensitive so make sure that the folder is called EXACTLY ‘changes’. If your partition numbers are different than what is listed here you need to make the corresponding changes in the syslinux.cfg file to reflect the actual partition number where the ‘changes’ folder is stored. You also need to make sure that your ‘changes’ folder has the proper permissions configured for it; the author has his configured for 777, however this potentially leaves a security problem with respect to this drive. Only configure 755 permissions if you are doing this for testing purposes only. From the terminal window, inside of the /sdb3 root directory issue the following command:

chmod -R 755 changes

ls -l (to confirm that there is total ‘w r x’ permissions on the folder)

Phew well now that is taken care of we need to now enable our intel 3945 wireless card to support monitor mode and packet injection. To do this execute the following commands from the terminal.

1. Download the drivers

mkdir intel-drivers && cd intel-drivers

wget http://homepages.tu-darmstadt.de/~p_larbig/wlan/ipwraw-ng-2.0.0-10072007...

2. Extract the drivers

tar -xjf ipwraw-ng-2.0.0-10072007.tar.bz2

cd ipwraw-ng

3. Compile & Install & Blacklist from startup

make && make install

make install_ucode

echo “blacklist ipwraw” | sudo tee /etc/modprobe.d/ipwraw

depmod -ae

4. Load new modules and put intel 3945 into monitor mode

modprobe -r iwl3945

modprobe ipwraw

5. Test packet injection

aireplay-ng –test wifi0

6. Resort to normal mode

modprobe -r ipwraw

modprobe iwl3945

Well now you have the ultimate setup — BackTrack 3 on a stick and an internal wireless card that supports packet injection, what more could you want? Well ok, maybe there are just a few things . . . Stay tuned and I will keep you updated on new programs and tools I find using BT3.

dikutip dari https://island.byu.edu/blog/34/backtrack-3-usb-install-and-intel-3945-packet-injection

Tidak ada komentar: