Tribal Chicken - Comprehensive Setup and Configuration Guide

advertisement
Tribal-Chicken
Tribal-Chicken
Comprehensive
Setup & Configuration Guide
For Backtrack
Version 1
29 April 2013
Tribal Chicken Comprehensive Setup and Configuration Guide for Backtrack, Version 1
Page 1
Tribal-Chicken
Table of Contents
Section
Page #
1. Introduction
2. Assumptions
3. How to Read This Guide
4. Install and Configure Ubuntu
5. Install and Configure Backtrack
6. Customize the Interface
7. Running Updates
8. Making New ISO with Tribal Chicken
9. Testing & Validation
10. Burning an ISO to DVD or Blu-ray Disc
3
3
4
5
9
15
16
16
17
18
Tribal Chicken Comprehensive Setup and Configuration Guide for Backtrack, Version 1
Page 2
Tribal-Chicken
Introduction
This is a guided walkthrough aimed at setting up the Tribal Chicken environment. It is intended
for those installing the utilities and environment for the first time and/or running the
maintenance and updates of the baseline.
Assumptions
1. Materials on hand:
a. Blank 160GB hard disk drive (to be installed as first disk (/dev/sda)
i. (Optional) If building within a virtual environment, this virtual disk drive is
recommended to be at lease 80GB in size.
b. DVD of Ubuntu 10.04 (64-bit) or higher.
i. Note: This guide was generated using Ubuntu 12.04 (64-bit).
ii. The use of 32-bit software is outside the scope of this documentation, but
follows the exact same steps.
c. DVD of Backtrack 5R3 (64-bit)
i. The use of 32-bit software is outside the scope of this documentation, but
follows the exact same steps.
d. Copy of the Nessus install folder (‘/root/bin/nessus’ and/or ‘/opt/nessus’) from a
previous install.
2. Active network connection with access to the internet.
a. If there are no DHCP services on the network, you will not be able to complete this
guide without appropriately setting up basic networking services and active internet
connectivity.
b. This guide assumes that the reader possesses the knowledge to setup and configure
ethernet adapters for network connectivity.
3. Some familiarity with the Linux command line interface.
a. Many of the commands contained within this guide are to be run in a Linux shell
environment. Aside from basic level knowledge of navigation, administration, and
file execution.
Tribal Chicken Comprehensive Setup and Configuration Guide for Backtrack, Version 1
Page 3
Tribal-Chicken
How to Read This Guide
1. This guide is meant as a complete walkthrough; varying from certain steps may cause
problems with steps later on in the guide.
2. “Actions,” such as mouse clicks and commands entered in a terminal window are
designated by a word followed by a greater than sign. (Examples: Click>)
3. The action for entering commands; “Enter>,” represents a command that is intended to be
a single line of input to the command line interface of a terminal window.
4. “Notes” are Bolded and italicized.
Tribal Chicken Comprehensive Setup and Configuration Guide for Backtrack, Version 1
Page 4
Tribal-Chicken
Install & Configure Ubuntu
1. Installing Ubuntu 12.04 (64-bit) to (/dev/sda3)
a. Put Ubuntu 12.04 media into the appropriate drive and boot to disk.
b. Click> Install Ubuntu
c. (IF networking is available at this time), Check mark; “Download updates while
installing”
d. Click> Continue
e. Select> “Something Else”
f. Click> Continue
g. Setup partitions on (/dev/sda)
(Note: (/dev/sdb) should be your archive drive if you have one. Be careful not
to install over the top of your archive drive.)
i. Select (/dev/sda).
ii. Click> New Partition Table
1. A general warning will appear. Click> Continue.
iii. Select> “free space” located under (/dev/sda)
iv. Click> (+) To Add a new partition.
v. Select the following setting;
1. Type = Primary
2. Partition Size = 20000
3. Location = Beginning
4. Use as (Formatting) = Ext4 Journaling File System
5. Mount Point = {Leave this field Blank)
vi. Click> OK
(This will create (/dev/sda1) which will be used later on for the
installation of BackTrack 5R3)
vii. Select> “free space” located under (/dev/sda)
viii. Click> (+) To Add a new partition.
ix. Select the following setting;
1. Type = Primary
2. Partition Size = 8000 (Note: Set to 2x RAM)
3. Location = End
4. Use as (Formatting) = Swap Area
5. Mount Point = {Should be grey’d out)
x. Click> OK(This will create (/dev/sda2) which will be used as the swap
area for both operating systems)
Tribal Chicken Comprehensive Setup and Configuration Guide for Backtrack, Version 1
Page 5
Tribal-Chicken
h.
i.
j.
k.
l.
m.
n.
o.
p.
q.
r.
xi. Select> “Free Space”
xii. Click> (+) To Add a new partition.
xiii. Select the following setting>
1. Type = Primary
2. Partition Size = {All Remaining Space}
(Note: Should be automatically calculated for you)
3. Location = End
4. Use as (Formatting) = Ext4 Journaling File System
5. Mount Point = /
xiv. Click> OK
(This will create (/dev/sda3) which will be used for this installation of
Ubuntu 12.04 (64-bit))
xv. Under, “Device for boot loader installation, Select> (/dev/sda)
Click> Install Now
i. A warning will appear concerning the formatting of the drive. This is
normal. Continue on.
Select> {Appropriate Time Zone}
Click> Continue
Select> {Desired Keyboard Layout}
Click> Continue
Define a user. Fill in the following fields>
i. Your Name = {username}
ii. Your Computer’s Name = {Whatever You Like)
iii. Pick a username = {username}
iv. Choose a password = {Whatever You Like}
v. Confirm your password = {Same password}
vi. Select “Log in” settings = (Recommended) “Require my password to log
in”
Click> Continue
(Installation will proceed; approximately 1hr if updates are to be download.
After successful installation, continue to next step.)
When prompted, Click> Restart Now
When prompted; Remove Ubuntu installation media.
Press> “Enter” key
The machine will reboot. When prompted; log in with your credentials set in
steps 1m(iii) and 1m(1iv).
Tribal Chicken Comprehensive Setup and Configuration Guide for Backtrack, Version 1
Page 6
Tribal-Chicken
2. Setting Up Directories
a. Open a terminal window: (<CTRL>+<ALT>+T)
b. Enter> pwd
i. Verify current directory as “/home/{username}”
c. Enter> mkdir -p build/DVD64
d. Enter> cd build/DVD64
e. Enter> mkdir casper isolinux preseed .disk (the “.” Is important)
f. Enter> cd
i. Returns to home directory
3. (Optional) Add Mount Point for a second hard drive. (/dev/sdb1)
Note: This is recommended so packages do not need to be downloaded every
time you build this environment.
a. Enter> sudo mkdir /archive
b. Use “vi” or “nano” to edit the file> sudo vi /etc/fstab
c. Add the following line to the end of the file>
i. /dev/sdb1{tab} /archive{tab} ext4{tab} rw{tab} 0{tab} 0
1. DO NOT TYPE: {tab}; these entries were added to highlight the
importance to using a TAB instead of a space between elements.
d. Enter> sudo mount –a
4. Update APT Packages & Listings
a. Enter> sudo apt-get update && sudo apt-get –y upgrade
i. Depending on the speed of your internet connectivity and number of
patches to be downloaded, this may take up to an hour.
5. Install additional packages
(Note:Double check the spelling of the following command “BEFORE” pressing enter or
omit the “-y”. Some packages may already be installed and up-to-date; this will not
cause an error when installing other packages.)
a. Enter> sudo apt-get –y install genisoimage aptitude dialog squashfs-tools
gparted subversion growisofs
6. Import Source Code
a. Enter> svn checkout http://tribal-chicken.googlecode.com/svn/trunk/ ~/build/
i. This will download all of the required source code for Tribal-Chicken.
Tribal Chicken Comprehensive Setup and Configuration Guide for Backtrack, Version 1
Page 7
Tribal-Chicken
7. Install VirtualBox
(Note: If the file does not exists in the Archive drive [Step 7ai; then go to Step 7d)
a. Enter> ll /archive/virtualbox*
i. Verify VirtualBox for Ubuntu “Precise” exists.
1. (Note: If using Ubuntu Quantal, use the appropriate VirtualBox
package for Quantal.)
b. Enter> sudo dpkg -i /archive/virtualbox_{version for Precise Ubuntu distro}.deb
c. When successfully completed; go to Step 8.
d. (Only if file did not exist) Download VirtualBox for the installed version of
Ubuntu;
i. Found at: https://www.VirtualBox.org/wiki/Linux_Downloads (Spell
hyperlink exactly as shown)
ii. Choose the AMD64 option for the current Ubuntu version installed on
the system.
1. To validate OS version installed, Enter> cat /etc/lsb-release
iii. Once the download is completed (assuming it saved to ~/Downloads)
1. Enter> sudo dpkg -i ~/Downloads/virtualbox-[version]_amd64.deb
iv. After installation successful, Enter> virtualbox &
1. Verify that VirtualBox Launches correctly.
2. Save downloaded package to your archive directory for future
use.
8. Prep Build Directory with Backtrack 5R3 media
a. Put Backtrack 5R3 media into CD-ROM (should auto-mount, a notification
window may pop-up).
b. Change to the media’s folder (usually mounts as /media/BT5/ but check), Enter>
cd /media/BT5/
c. Copy all needed file, Enter> for name in `find -type f -print |grep -v filesystem`;
do cp $name /home/{username}/build/DVD64/$name; done
i. DO NOT use single quotes(‘); the command uses backticks (`).
ii. The for loop copies all files except for the filesystem files (a later script
generates those).
d. Enter> cd ~/build
Tribal Chicken Comprehensive Setup and Configuration Guide for Backtrack, Version 1
Page 8
Tribal-Chicken
Install Backtrack 5R3
1. Install Backtrack 5R3 to (/dev/sda1)
(This step assumes that you are starting from within the Ubuntu 12.04 installation,
that you have just completed Step 8d, and the Backtrack 5R3 media is still connected.)
a. Reboot the machine to the Backtrack5R3 media
i. From the current Ubuntu terminal window, Enter> sudo reboot
ii. In a VMWare, press “ESC” to enter the boot menu and select boot from
CD-ROM.
b. At the prompt, Enter> startx
i. This will launch the GUI for Backtrack
c. Double-click the install icon on the desktop.
2. Configuring Backtrack Installation
a. Select appropriate language. Click> Forward.
b. Select appropriate time zone. Click> Forward.
c. Select appropriate keyboard settings. Click> Forward.
d. Select> Specify Partition Manually (Advanced). Click> Forward.
e. Select partition for Backtrack to be installed.
i. Double Click> /dev/sda1
1. A secondary window will appear.
ii. Set “Use”> ext4
iii. Put a checkmark in the box next to “Format.”
iv. Set “Mount Point”> /
v. Click> OK
1. The window will close and return you to the main screen.
vi. Click> Forward.
f. Click> Install.
g. When prompted, Click> Restart Now.
3. When prompted for login, default login is;
a. Username: root
b. Password: toor
c. Enter> startx
i. This will launch the GUI for BackTrack.
4. Configure Networking
Tribal Chicken Comprehensive Setup and Configuration Guide for Backtrack, Version 1
Page 9
Tribal-Chicken
a. Launch a terminal window by clicking the icon near the bottom left hand corner
of the screen.
b. Enter> ifconfig –a
i. This will identify “all” networking ports available (assuming “eth0”)
c. Enter> ifconfig eth0 {IP_address}/{Cider_Notation} or {Subnet_Mask)
d. Enter> route add default gateway {YouGateway’sIP_address}
e. Enter> echo nameserver 8.8.8.8 >/etc/resolve.conf
i. (You can add up to 2 more nameserver entries to this file; but use the
following command instead of the one above. The difference is the
amount of “>’s” used.)
1. Enter> echo nameserver {IP_address} >> /etc/resolv.conf
5. Update APT Packages & Listings
a. Enter> apt-get update && apt-get –y upgrade
i. (Note: there may be a warning about Beef not functioning correctly.
This is a problem for 64-bit installations of BT. Ignore this warning for
now.)
ii. (Note: Depending on your internet connection, this command may need
to be run multiple times.)
b. Enter> apt-get autoremove
i. This will clean up any packages that have been determined as needing to
be uninstalled.
6. Install additional packages
(Note:Double check the spelling of the following command “BEFORE” pressing enter or
omit the “-y”. Some packages may already be installed and up-to-date; this will not
cause an error when installing other packages.)
a. Enter> apt-get –y install abiword aptitude ftpd gnome-utils gqview gparted
k3b kcalc lynx pdfsam smb2www tftp tsclient ubiquity
ubiquity-frontend-gtk ubiquity-slideshow-unbuntu vifm yakuake
b. After completeion, Enter> apt-get update && apt-get –y upgrade
i. (Note: Depending on your internet connection, this command may need
to be run multiple times.)
c. (If necessary) Enter> apt-get autoremove
Tribal Chicken Comprehensive Setup and Configuration Guide for Backtrack, Version 1
Page 10
Tribal-Chicken
i. This will clean up any packages that have been determined as needing to
be uninstalled.
7. Import Scripts
a. Enter> mount /dev/sda3 /mnt
i. This will mount the disk used for the recent Ubuntu 12.04 installation.
b. Enter> mkdir /root/bin
c. Enter> cp -R /mnt/home/{username}/build/hostfiles/btbin/* /root/bin/
d. Enter> cp -R /mnt/home/{username}/build/hostfiles/bash_aliases
~/.bash_aliases
e. Enter> ls /root/bin
i. Verify files have been successfully transferred.
f. Enter> umount /mnt
g. (Optional) Enter> mount /dev/sdb1 /mnt
i. This will mount the archive disk. If previously saved, packages can be
loaded from this location rather than waiting for downloads.
h. Enter> cd ~/bin
i. Enter> ./fix_path
i. This will add “/root/bin” to the PATH variable when you launch a new
terminal window.
j. Close the current terminal window session and then open a new one.
8. Install Google Chrome Browser
(Note: If the file does not exists in the Archive(/mnt) drive go to Step 8d; then continue
on with the guide)
a. Enter> ll /mnt/google*
i. Verify Google Chrome .deb package exists.
b. Enter> dpkg -i /mnt/google-chrome-stable_current_amd64.deb
i. (Note: Even if this package is out of date, after installation the path to
update the google-chrome package will be available; therefore, after
running the next “apt-get upgrade” command, Chrome will update
itself.)
c. When successfully completed; go to Step 7d(v) below.
d. (Only if file did not exist) Download Google Chrome;
i. Found at: http://chrome.google.com/
ii. The site should redirect you to a secure site for downloading the linux
version.
Tribal Chicken Comprehensive Setup and Configuration Guide for Backtrack, Version 1
Page 11
Tribal-Chicken
iii. Once the download is completed (assuming it saved to ~/Downloads)
1. Enter> dpkg -i ~/Downloads/google-chrome{Version}.deb
iv. After installation successful, Google Chrome will need to be “fixed.”
1. Enter> fix_chrome
v. Enter> google-chrome &
1. Verify that Google Chrome launches correctly.
9. Install VirtualBox
(Note: If the file does not exists in the Archive(/mnt) drive go to Step 9d; then continue
on with the guide)
a. Enter> ll /mnt/VirtualBox*
i. Verify VirtualBox for Ubuntu “Lucid” exists.
b. Enter> dpkg -i /mnt/VirtualBox{Version}.deb
c. When successfully completed; go to Step 9d(iv) below.
d. (Only if file did not exist) Download VirtualBox for Ubuntu Precise;
i. Found at: https://www.VirtualBox.org/wiki/Linux_Downloads
1. (Note: Spell hyperlink exactly as shown)
ii. Choose the AMD64 option for the current Ubuntu version installed on
the system.
1. To validate OS version installed, Enter> cat /etc/lsb-release
iii. Once the download is completed (assuming it saved to ~/Downloads)
1. Enter> dpkg -i ~/Downloads/virtualbox-[version]_amd64.deb
iv. After installation successful, Enter> virtualbox &
1. Verify that VirtualBox Launches correctly.
10. Configure Mozilla Firefox Browser
a. Open Firefox.
b. From the file menu bar on top, Select> ToolsAdd-Ons
c. Search for and install the following;
i. Firebug
ii. FlashFirebug
iii. Groundspeed
iv. JSView
v. JSONView
vi. SQL Inject Me
vii. UnPlug
viii. XSS Me
Tribal Chicken Comprehensive Setup and Configuration Guide for Backtrack, Version 1
Page 12
Tribal-Chicken
ix. MitM Me
x. Hackbar
xi. …. Anything else you want…
d. Once everything is installed; disable all plugins except for the “NoScript” plugin.
e. Configure plugins and Firefox NOT to automatically update.
f. Close Firefox
11. Install & Configure Nessus
a. Download Nessus 5.0 or higher from http://www.nessus.org/download
b. From a terminal window; Enter> dpkg -i ~/Download/Nessus-{version}.deb
c. Enter> nessus-adduser
i. When prompted, Enter> {username} -Assuming “root” for guide.
ii. When prompted, Enter> {password} - Assuming “toor” for guide.
iii. When prompted, Enter> y (okay for admin access)
iv. When prompted, Enter> {Nothing, just press the Enter key}
v. When prompted, Enter> y (to accept the settings)
The following steps are for the Nessus HomeFeed ONLY! If you have a
professional feed license, please consult the documentation for your licensed
version of Nessus. Using a HomeFeed for business use is a violation of the EULA.
d. Register for a Nessus Home Plugin Feed; in any browser navigate to:
http://www.nessus.org/register
i. Activation code sent to your e-mail.
ii. Code is in this format: X001-Y002-Z003-A004-B005
e. In a terminal window, Enter> nessus-fetch --challenge
i. (Note: Command output's a hash; save this for now.)
f. Register Offline (For Home Feeds ONLY!)
g. In any browser navigate to: https://plugins.nessus.org/offline.php
i. Enter activation and challenge keys into the browser.
ii. Click> Okay
iii. Download the "nessus-fetch.rc" file from the next webpage.
1. (Note: At the bottom of the page.)
h. Activate your Nessus Home Plugin Feed
i. In a terminal window, Enter> mv ~/Downloads/nessus-fetch.rc
/opt/nessus/etc/nessus/
Tribal Chicken Comprehensive Setup and Configuration Guide for Backtrack, Version 1
Page 13
Tribal-Chicken
i.
j.
ii. Enter> nessus-fetch --register-offline /opt/nessus/etc/nessus/nessusfetch.rc
iii. Enter> nessus-fetch –check
1. Verify that a Nessus HomeFeed has been registered.
iv. Enter> nessus-update-plugins
1. (Note: This may take a while depending on your internet
connection and can also hang from time-to-time (approximately
30 minutes). Press CTRL+C to escape the update process if the
program hangs. Continue on with the guide, as the program will
attempt to update the plugin feed while starting the service.)
v. Enter> nessusd start
(Assuming no errors from previous step) Start Google Chrome and navigate to;
https://127.0.0.1:8834
i. (Note: The page may not come up right away. Sometime it can take
almost 10 minutes to boot. If this is the case, use the following
command in a terminal window to verify it’s still running)
1. Enter> ps -e |grep -i nessus
Refresh the webpage every couple of minutes and it will “eventually”
come up.
Login with credentials defined in Step 11c(i-ii). (root/toor)
12. Run Update Script
a. Enter> /root/lhost/run_updates
13. (Optional) Disable IPv6 and DHCP of eth0
a. Use Nano, VI, or a text editor of your choice to stop DHCP on all interfaces.
i. Enter> nano /etc/network/interfaces
1. Remove “dhcp” from ALL interfaces
2. Save and exit.
b. Use Nano, VI, or a text editor of your choice to disable IPv6 on all interfaces.
i. Enter>nano /etc/sysctl.conf
ii. Add the following lines to the bottom of the file:
1. net.ipv6.conf.all.disable_ipv6 = 1
2. net.ipv6.conf.default.disable_ipv6 = 1
3. net.ipv6.conf.lo.disable_ipv6 = 1
c. Reboot the machine for settings to take effect.
i. Enter> reboot
Tribal Chicken Comprehensive Setup and Configuration Guide for Backtrack, Version 1
Page 14
Tribal-Chicken
ii. NOTE: After rebooting the machine, the eth0 interface will be up but
will have no functionality. To bring it back online from a terminal
window;
1. Enter> ifconfig eth0 {IP_Address}/{CIDR}
2. Enter> route add default gw {gateway_IP_Address}
3. Verify settings:
a. Enter> ifconfig eth0
b. Enter> ping {gateway}
Customize the Interface
(Note: Below are just a few suggestions. These steps are not mandatory, but useful before
creating a live DVD of Tribal Chicken. After customization continue to “Building an ISO.”)
1.
2.
3.
4.
5.
6.
Panel
Panel Shortcuts
Keyboard Shortcuts
Screensaver Settings
Background
Special Windows Effects
Tribal Chicken Comprehensive Setup and Configuration Guide for Backtrack, Version 1
Page 15
Tribal-Chicken
Running Updates
1. Boot into the Backtrack partition (assumed /dev/sda1)
2. Login (root/toor)
3. Launch GUI with;
a. startx
4. Run Updates
a. This will vary depending on how you configured you installation and the
packages you have added.
5. Validate Nessus starts correctly
6. Update Firefox Plugins
Building an ISO using Tribal Chicken
1. Reboot into Ubuntu 12.04 (assumed /dev/sda3)
2. Login
3.
(IMPORTANT) If running in a Virtual Environment! Turn off the screen-
saver! This will need to be completed for both the current Ubuntu system AND the
parent operating system as well!
a. If either OS’s screen saver comes on while the building process below is using
“squash-fs” then the output of the build will be ruined and you will have to run
the process again.
4. Start Tribal-Chicken
a. Open a terminal window
b. Start the Tribal Chicken utility
i. Enter> cd build
ii. Enter> sudo ./tribal-chicken
5. Using the arrow keys on the keyboard, check ISO Configuration.
a. Highlight> “1 Change_Config”
b. Press> Enter key
c. Verify the following settings; change where bolded below.
i. ARCH_BASE
= 64
ii. ARCHIVE_FLAG
= false
iii. BUILD_BASE
= /home/[username]/build
iv. DVD_BASE
= DVD64
v. DEFAULT_ISO_NAME = {DATE}_Tribal_Chicken_64.iso
Tribal Chicken Comprehensive Setup and Configuration Guide for Backtrack, Version 1
Page 16
Tribal-Chicken
6.
7.
8.
9.
vi. DEFAULT_VERSION = 0.MM.DD.YY
vii. MIGRATE_DIR
= /home/[username]/build/migrate
viii. MIGRATE_FLAG
= false
ix. ROOT_FILENAME
= {DATE}_root_64.fs
x. SRC_PARTITIONT
= /dev/sda1 (Location of BackTrack 5R3 Install)
xi. BURN_TO_DISC
= false
(true = burn ISO during creation)
xii. RECORDING_DEVICE = /dev/[device]
d. Highlight> Quit
e. Press> Enter key
i. Returns to the main window.
Highlight> “2 Build_ISO”
Press> Enter key
When prompted, Highlight> YES
Press> Enter key
(Note: Depending on the machine and/or settings of the virtual machine, this can take
between 30 and 120 minutes.)
Testing & Validation (Short Version)
(Note: that if you build a 64-bit ISO in a virtual player (Virtualbox or VMplayer) then you will not
be able to test it from within the Ubuntu installation. You will need to transfer the ISO off the
VM and test it. A 64-bit VM cannot run inside of another 64-bit or 32-bit Virtualized OS.
1. Create virtual machine and set the boot process to launch from an ISO file.
2. Test the status of the following:
a. Nessus
b. VirtualBox
c. Metasploit
d. NMAP
e. Wireshark
f. Firefox
g. Chrome
h. Other
3. Shutdown system.
Tribal Chicken Comprehensive Setup and Configuration Guide for Backtrack, Version 1
Page 17
Tribal-Chicken
Burning an ISO to a DVD or Blu-Ray Disc
This step is for those that have already created an ISO using tribal chicken and wish to burn the
ISO directly to a disc rather than run through the Tribal-Chicken script.
1. Boot into Ubuntu 12.04 and open a terminal window.
a. Enter> growisofs -overburn -Z=/dev/[recording_device] ~/build/{yourISO}.iso
i. [recording_device] is usually “cdrw” or “sr0”, but will be specific to your
machine.
2. Boot your disc and repeat Step 1 through Step 3.
This concludes this guide for building customized versions of Tribal Chicken.
Tribal Chicken Comprehensive Setup and Configuration Guide for Backtrack, Version 1
Page 18
Download