Wednesday, March 23, 2011

#2 - Installing BackTrack Linux

In our last section, I detailed for you a late model (older but still
modern) laptop that would be good to use for our penetration testing
laptop.



Behold, Bertha:





Bertha is a Dell Inspiron 6000 from 2005. She has a Pentium M for her CPU, has 320GB of PATA storage (I spent about $75 on the hard drive). She has an Ethernet port, 2 USB ports and a CD-ROM drive. Is she fancy? No. Her case is battered, scratched and, in places, she's faded. But, she will boot up and run Linux and that's more than what we need.



THE OPERATING SYSTEM
There are plenty of security tools out there, loose in the wild. There are Microsoft Windows-based tools, Apple OSX-based tools and Linux-based tools. For the purposes of these lessons, I’ve decided to focus on Linux-based tools. If some tool comes up that is better at a particular purpose and is written for a different platform, we’ll address that then. But for now, for us to become thrifty, economical hackers, we’re going to focus on Linux-based tools. Linux is a free, open-source operating system that works on a broad spectrum of hardware. So, if you’re like me and using an older (but modern) piece of equipment, the chances that Linux will work on your hardware are pretty good.
There are plenty of security-minded distributions of Linux available and I recommend you play with as many as you like. However, for our purposes, we’re going to focus on BackTrack. BackTrack is a penetration testing distribution and it has a plethora of tools available for you, the hacker, to use to accomplish various tasks.
At the time of this writing, BackTrack 4 R2 is the latest available ISO you can download and it’s about 2GB so you’ll need to burn this image onto a DVD-ROM, as a CD-ROM will be too small (only 650Mb). You can obtain this ISO file
from: http://www.backtrack-linux.org/downloads/ directly or from a torrent. Once you have this downloaded, burn it to DVD using whatever DVD authoring software you have at your disposal.  I use Ubuntu Linux at home, so I use K3B to burn CD’s and DVD’s.

CHOOSING HOW TO INSTALL
There are several different ways to install BackTrack onto a machine. I’m going to focus on two main installs: 1) installing BackTrack on a Hard Disk and 2) installing BackTrack (persistently –keep my changes) on a USB Flash Drive
(Stick).
Whichever you choose is up to you. I just wanted to documented the two main ways to use BackTrack.

INSTALLING BACKTRACK ON A HARD DISK
First, ensure your laptop is plugged in or has enough juice to handle an hour or so of battery time. Second, follow these steps to easily install BackTrack onto your laptop’s hard drive.
  1. Boot up off BackTrack DVD
If your equipment is fairly modern, choose the first menu item upon boot: “Start BackTrack FrameBuffer (1024x768)”. If your equipment isn’t so fairly modern, choose the 800x600 option (or even Safe Graphical Mode).


  1. Login to BackTrack
    You will eventually be presented with the login prompt for BackTrack.
    Login with a username of ‘root’ and a password of ‘toor’.

Which will then present you with a rather unassuming looking command prompt (like this).
BT-CMD-PROMPT.jpg



  1. Start GUI Desktop
    From this command prompt, you could run whatever commands you like.  However, most of us would prefer to work from a GUI environment, a desktop with icons. In order to fire up BackTrack’s GUI environment, type ‘startx’ (without the quotes) at this command prompt and hit the Enter key.
    bt-startx.jpg
     
    This will fire up KDE and bring you to a desktop.
    backtrack4-desktop.jpg


  1. Run the ‘install.sh’ Script
    Once you’re on the BackTrack desktop, you can install BackTrack on your hard drive by double-clicking the ‘install.sh’ icon in the top right of the desktop. This will launch the ubiquity installer that has made Ubuntu installing such an easy task
  1. First, ubiquity asks you what Time Zone you are in. Select your proper Time Zone.
ubiq-TimeZone.jpg


  1. Next, choose your keyboard layout.
ubiq-Keyboard.jpg


  1. Next, choose how you want to partition your drive. If you’re using the whole disk, your partitioning will look like this:
    ubiq-partition1.jpg

If you’re sharing your hard drive between Windows and BackTrack, you’re partitioning will look like this (an Ubuntu install is shown in the illustration):
032-ubuntu-partition-setup.jpg


  1. Next, ubiquity (the Linux installer) tells you it is ready to install. Click the ‘Install’ button and you’re ready to grab a coffee and kick your feet up.
    ubiq-install.jpg



  2. During install, you’re presented with a progress bar such as this one.
    ubiq-progress-bar.jpg



  1. Eject the DVD and Reboot
    Once completed, you can eject your BackTrack DVD, restart your laptop and boot up into BackTrack on your hard drive.


INSTALLING BACKTRACK ON A USB DISK
There’s two main ways to install BackTrack onto a USB Disk: either use a Windows-based utility or a Linux-based utility to read in an ISO image of BackTrack (we downloaded it above) and write it to a USB Flash Drive. So, we have the Linux world and we have the Windows world. I’ll describe both below so all of us can enjoy BackTrack goodness on a USB drive (with persistence!).
INSTALLING BACKTRACK ON A USB DISK USING UBUNTU
  1. Installing “Startup Disk Creator”
Ubuntu comes with a utility built into it to write an ISO image to a USB disk. This utility is called “Startup Disk Creator” and you can install it (if it’s missing) by running the following command in ‘sudo’ mode.
sudo apt-get install usb-creator-common usb-creator-gtk
  1. Use “Startup Disk Creator”
Once you’ve got “Startup Disk Creator” installed, you can simply navigate to it by going to System > Administration > Startup Disk Creator
You will be presented with the following screen:
Ubuntu Startup Disk Creator.png
  1. Select the ISO media and the USB media.
Once you’re presented with this screen, you can use the ‘Other’ button to browse to the ISO you’ve downloaded for BackTrack and select the USB Flash Drive you would like to format with that ISO by using the middle section called ‘Disk to use:’.

  1. Make the Startup Disk
Click the ‘Make Startup Disk’ and your USB will be formatted and the BackTrack ISO will be written to the device to make a bootable USB disk that boots BackTrack.


INSTALLING BACKTRACK ON A USB DISK USING WINDOWS
  1. Download “Linux Live USB Creator”
There’s a freely available Windows-based utility called “Linux Live USB Creator” that you can download from http://www.linuxliveusb.com . This utility runs under Microsoft Windows and enables what is termed in the industry as “persistence” of data—meaning, this USB drive will not just act like a bootable CD where you can’t save any changes. It will, in fact, KEEP ALL YOUR DATA AND CHANGES. This is huge. We can make a USB stick our penetration testing environment.


  1. Launch “LiLi” USB Creator

LiLiUSB_Creator.JPG



  1. Select the USB Key that you want to write the ISO to
  2. Choose the BackTrack ISO you want to write to the USB Drive
  3. Choose how big you want your persistant data to be (on an 8GB drive, I chose between 2-4GB)
  4. Last, Click the Lightning button to start the creation process
  5. In about an hour or so, you’ll have a USB Drive that boots BackTrack


SUMMARY
So, we’ve downloaded BackTrack, a Linux distribution focused on penetration testing. We’ve installed BackTrack (either on a laptop’s hard drive or on a USB drive with persistence). Next up, making sure our wireless card works and can be put into “Monitor Mode”. Our toolkit is started. Time to add to it a little.

6 comments:

  1. Rather than a windows usb boot utility you can use a linux based one, unetbootin
    http://unetbootin.sourceforge.net/

    ReplyDelete
  2. Wait a minute...for the "INSTALLING BACKTRACK ON A USB DISK USING WINDOWS", are you installing just the Backtrack ISO file on the USB disk or are you installing the full program on it? I thought that the full program takes over 18GB, so how are you putting that on an 8GB flash drive?

    ReplyDelete
  3. need the install.sh file.... cant find it anywhere.

    ReplyDelete

  4. Thanks for such interesting and terrific post.
    Really useful and helpful information. I’ve twitted your blog.Virtual Edge

    ReplyDelete