Creating BackTrack4 Pentest Virtual Machine

BackTrack4 is an excellent Penetration Testing Distro, but in the LiveCD version it is quite crippled:

  • There is no possibility to install additional software
  • There is no possibility to create custom scripts
  • All attacks need to start from scratch

In order to alleviate this issue, there are several options. My most flexible solution is to create a VMware virtual machine with the installation. Since BackTrack4 has no installer included, here is a brief tutorial with the scripts included.

Preparation
Create a Virtual Machine as Custom Linux, and Choose Ubuntu as the assumed Host Operating System
Choose a SCSI Hard Disk of at least 5GB (We recommend 8GB)
Boot the Virtual Machine from the BackTrack DVD

Creation of Partitions
After booting, log-on and partition the SCSI Hard Drive (/dev/sda)
Create 2 primary partitions, one for BackTrack, Linux - type 83 with at least 4 GB space, and one Linux Swap - type 82 of 512MB
fdisk /dev/sda
After creating the partition table, format the BackTrack partition

mkfs /dev/sda1
After formatting, mount the partition
mkdir /mnt/sda1
mount /dev/sda1 /mnt/sda1/

Copy the BackTrack Data
Create the copying script in the root's home directory
cd
vi create_bt_disk
Paste the following text in the VI editor and save it
list=`cd /;ls -l|awk {'print $8'}`
for i in $list
do
if [ "$i" = 'mnt' -o "$i" = 'proc' -o "$i" = 'sys' ];then i='root';fi
echo $i
cp -pR /$i /mnt/sda1
done
mkdir /mnt/sda1/sys
mkdir /mnt/sda1/proc
mkdir /mnt/sda1/mnt
echo 'Done'

Make the script executable and run it
chmod 755 create_bt_disk
./create_bt_disk

Finishing Touches

After the script finishes, change the root directory to the disk drive in order to make the disk bootable
mount --bind /dev/ /mnt/sda1/dev/
mount -t proc proc /mnt/sda1/proc/
chroot /mnt/sda1

Run LILO to write info to the MBR of /dev/sda. NOTE: The default lilo.conf works with disk /dev/sda and partition /dev/sda1. If you have a different disk configuration, you need to change the /etc/lilo.conf appropriately before running LILO
lilo -v

All done. Just reboot and remove the BackTrack DVD
reboot

We hope that this tutorial eases your use of the BackTrack suite.

Talkback and comments are most welcome

Related posts
BackTrack 4 Penetration Test Distro - First Glance

4 comments:

m0rebel said...

I agree that installing BT4 in a VM is one of the best ways to do it, or even just installing it as an operating system. But using it as a livecd does have it's benefits: you get direct access to hardware instead of virtualized hardware (which I'm sure helps the performance of things like john the ripper, and other things). You can actually run virtual machines within BT4, which is useful if, for example, you need to use some windows tools during a pentest where wine won't cut it (say, Visual Studio 2008, or some proprietary VPN client, or whatever).

You can actually extract the BT4 iso file, add lzm files with your own new packages, and then recreate it as an iso image and burn that. Or, even more conveniently, you can set it up to boot off of a flash drive and just add your own lzm files to the flash drive and they'll be there next time you boot. In this way, you can run BT4 natively off a usb drive, with virtualization software installed and a windows xp VM.

Bozidar Spirovski said...

The USB drive is a very useful approach, and with VM you don't get access to the WiFi for promiscuous mode.
But on the other hand, for training purposes and for simulated attack scenarios, a VM will run much more efficiently then a booted system.
So, based on one's requirements, one can have both options - VM and USB/LiveCD

Shu Fen said...

wow u got me lost there...lol :/

Sunmugam Chidambaram said...

Nice useful tips
Download xender for pc
Very good for share FILES ,PICTURES PC To any Android

Designed by Posicionamiento Web