BackTrack 4: Assuring Security by Penetration Testing
上QQ阅读APP看书,第一时间看更新

Updating BackTrack

BackTrack is a Linux distribution that consists of several application software and an operating system. You need to update each of the components to fix the bugs contained in the previous version and also to have the latest features of the software.

We suggest you only update the software and kernel from the BackTrack software package repository, as these softwares have been tested with BackTrack.

Updating software applications

The first thing to do after you have successfully installed and configured BackTrack is to update BackTrack itself. Since BackTrack 4 is based on Ubuntu, you can use the Ubuntu/Debian command (apt-get) to do the updating process.

The apt-get will consult the /etc/apt/sources.list file to get the update server; please make sure you have the correct source files.

The default sources.list file included in BackTrack 4 is:

deb http://archive.offensive-security.com pwnsauce main microverse macroverse restricted universe multiverse
#deb http://archive.offensive-security.com/repotest/ ./
# BackTrack Devel Repository

Before you can update the process, you need to synchronize the package index files from the repository specified in the /etc/apt/sources.list file. The command to do this synchronization is:

apt-get update

Make sure you always run apt-get update before doing any package update or installation.

After the package index has been synchronized, the upgrade can be performed.

There are two command options available to do an upgrade:

  • apt-get upgrade: This command will upgrade all of the packages currently installed on the machine to the latest version. If there is a problem in upgrading the package, that package will be left intact at the current version.
  • apt-get dist-upgrade: This command will upgrade the entire BackTrack distribution, such as, if you want to upgrade from BackTrack 4 to BackTrack 4 R1 you can use this command. This command will upgrade all of the packages currently installed and it will also handle conflict during the upgrade process.

After you choose the appropriate command options for updating BackTrack, the apt-get program will list all of the packages that will be installed, upgraded, or removed. You will then need to give the confirmation.

If you have given the confirmation, the upgrade process will start. Please be aware that this upgrade process might take a long time to finish, depending on your network connection speed.

Updating the kernel

The update process mentioned in the previous section is enough for updating the software applications. However, sometimes you may want to update your kernel, because your existing kernel doesn't support your new device. Please remember that because the kernel is the heart of the operating system, failure to upgrade may cause your BackTrack to be unbootable. You need to make a backup of your kernel and configuration. You should ONLY update your kernel with the one made available by the BackTrack developers. This Linux kernel is modified to make certain "features" available to the BackTrack users and updating with other kernel versions could disable those features.

Before you upgrade your kernel, you need to know the kernel version running in your existing machine by giving the following command in the command:

uname -a

The system will respond with the kernel version, such as:

Linux nirvana 2.6.27.45-0.1-default #1 SMP 2010-02-22 16:49:47 +0100 x86_64 x86_64 x86_64 GNU/Linux

The latest kernel available in BackTrack 4 at the time of writing is kernel version 2.6.34. If your kernel version is lower than 2.6.34 and you have problems with your hardware driver, then you may need to upgrade your kernel.

As the kernel is just another software package, the process to upgrade the kernel is the same as updating the software applications. First, you issue the synchronization command apt-get update, and then issue the apt-get upgrade command to upgrade the kernel.

That command will inform you of what kernel packages are available to be upgraded. The kernel package names are:

  • linux-image-<kernel-version>: This is the Linux kernel binary image
  • linux-headers-<kernel-version>: This is the header files for Linux kernel
  • linux-source-<kernel-version>: This is the source code for Linux kernel

The kernel-version refers to the version of the kernel. If you see those package names, it means there is a new kernel available to be upgraded, but you also need to check the kernel version. Make sure the upgraded packages have newer version than the existing packages available in your machine.

After you are sure that you need to upgrade, answer Y to continue the process. Then the apt-get command will download all the necessary software packages.

Usually for the other software packages, if they have been downloaded, the apt-get will install them automatically and you don't need to do anything. However, for the kernel, you need to do several configurations after the kernel installation.

First the apt-get will display a notification regarding the kernel image configuration:

Next, it will display whether you want to continue or stop the kernel installation, because the kernel-image is already installed. You can answer No to continue installing the kernel image, or you can opt for Yes to stop the installation.

After the installation finishes, you will be asked what to do about the menu.lst file. This file is a configuration menu for GRand Unified Boot Loader (GRUB) boot loader. The default option selected by apt-get is keep current. If you select this option, your new kernel-image will not be added to the menu.lst file, thus you can't select it during the boot process.

We suggest you choose the diff option first to see what are the differences between the existing menu.lst file and the new one.

Symbol + denotes it is an additional item, the line is only available in the new menu.lst, while the symbol - means that the line is to be deleted in the new menu.lst.

After you've checked the differences, you can decide what to do. Usually the new menu.lst file will contain all of the content of the existing menu.lst and the lines for the new kernel-image. So it should be safe to install the new menu.lst file by selecting install new.

The apt-get will install the new menu.lst file after you choose to install it. Several minutes later you can reboot your machine to test your new kernel.

To check your kernel version, type the following command after you login:

uname -a

The following is the result in our system:

Linux bt 2.6.34 #1 SMP Wed Jul 7 16:45:27 EDT 2010 i686 GNU/Linux