Sunday, September 21, 2014

Things to do after installing Kali Linux

1. Fix Device not managed error – wired network

If you want NetworkManager to handle interfaces that are enabled in /etc/network/interfaces: Set managed=true in /etc/NetworkManager/NetworkManager.conf. So this file looks like:
[main]
plugins=ifupdown,keyfile

[ifupdown]
managed=true
How to fix Wired Network interface is Unmanaged error in Debian or Kali Linux - 1  - blackMORE Ops
Read the full article on fixing Wired Network interface “Device not managed” error in Debian or Kali Linux.

2. Fix default repository

The simplest way is to edit the /etc/apt/sources.list remove or comment every-line with # at the front and add the following lines..
 leafpad /etc/apt/sources.list
Comment or remove existing config with the following lines:
## Regular repositories
deb http://http.kali.org/kali kali main non-free contrib
deb http://security.kali.org/kali-security kali/updates main contrib non-free
## Source repositories
deb-src http://http.kali.org/kali kali main non-free contrib
deb-src http://security.kali.org/kali-security kali/updates main contrib non-free
Save and close the file.   Details and explanations can be found in adding official Kali Linux Repositories page.

3. Update, Upgrade, Dist-Upgrade

Clean, update, upgrade and dist-upgrade your Kali installation.
 apt-get clean && apt-get update && apt-get upgrade -y && apt-get dist-upgrade -y
 
 

4. Fix PulseAudio warning

My Kali throws me this warning:
[warn] PulseAudio configured for per-user sessions ... (warning). Debian variants also throws similar warning during boot.To fix this do the following:
leafpad /etc/default/pulseaudio
Find this line:
PULSEAUDIO_SYSTEM_START=0 Replace 0 with 1
PULSEAUDIO_SYSTEM_START=1 Where, 0 = don’t start in system mode, 1 = start in system mode
reboot
Details and explanations can be found in Fixing PulseAudio configured for per-user sessions … (warning) in Kali Linux page.

5. Enable sound on Boot

Follow the steps below to fix sound mute in Kali Linux on boot
apt-get install alsa-utils -y In GNOME Desktop (The default Kali Desktop)
  • Right Click on the small volume ICON and select Sound Preferences
  • Alternatively, you can also go to Applications > System Tools > Preferences  > System Settings > Sound to bring up the same options.
  • Use the Output volume slider to ON, shown similar the screenshot above. That’s it you’re done. Close Sound window.
Fix sound mute in Kali Linux on boot - 2 - blackMORE Ops
Details and explanations can be found in fixing sound mute in Kali Linux on boot page.

Useful utilities and Software’s


6. Install Java

Go to the following link and download jdk7. At the time of writing this guide the jdk version was jdk-7u45-linux-x64. Note that I’m using x64 which is 64-bit. 32-bit users should choose their versions accordingly. Not that tough really!
Oracle Sun Java JDK in Kali Linux

Following is what I’ve used. JDK-7u45-Linux-x64 At the time of writing this guide the available version was jdk-7u45-linux-x64.tar.gz Download and save the file in /root directory.
tar -xzvf /root/jdk-7u45-linux-x64.tar.gz mv jdk1.7.0_45 /opt cd /opt/jdk1.7.0_45 This step registers the downloaded version of Java as an alternative, and switches it to be used as the default:
update-alternatives --install /usr/bin/java java /opt/jdk1.7.0_45/bin/java 1 update-alternatives --install /usr/bin/javac javac /opt/jdk1.7.0_45/bin/javac 1 update-alternatives --install /usr/lib/mozilla/plugins/libjavaplugin.so mozilla-javaplugin.so /opt/jdk1.7.0_45/jre/lib/amd64/libnpjp2.so 1 update-alternatives --set java /opt/jdk1.7.0_45/bin/java update-alternatives --set javac /opt/jdk1.7.0_45/bin/javac update-alternatives --set mozilla-javaplugin.so /opt/jdk1.7.0_45/jre/lib/amd64/libnpjp2.so Follow installing Java JDK in Kali Linux post for step by step instructions and testing options.

7. Install Flash

This is fairly simple and easy and should work from most people out there: In the terminal:
apt-get install flashplugin-nonfree and then type in:
update-flashplugin-nonfree --install That’s it. You flash should be working as expected.

Adobe Flash in Kali Linux

Follow installing Flash in Kali Linux post for step by step instructions and testing options. This post also includes manual Flash installation procedures for those whose installation might fail with above mentioned process.

8. Install File Roller – Archive Manager

Kali Linux lacks a proper GUI archive manager. Install it Archive Manager (File Roller) using the following command:
apt-get install unrar unace rar unrar p7zip zip unzip p7zip-full p7zip-rar file-roller -y You can now find Archive Manager in Applications > Accessories > Archive Manager.

9. Add a standard user

Kali Linux got only root user by default. While most applications require root access, it’s always a good idea to add a second user. Open terminal and type following to create new user (replace user1 with your desired user name)
useradd -m user1 (Note: -m means create home directory which is usually /home/username)
How to add remove user - Standard usernon-root - in Kali Linux - blackMORE Ops -2
Now set password for this user
passwd user1 Enter desired password twice Add user to sudo group (to allow user to install software, allow printing, use privileged mode etc.)
usermod -a -G sudo user1 (Note: -a means append or add and –G mean to specified group/groups) Change default shell of previously created user to bash
chsh -s /bin/bash user1 To learn more, follow this excellent and detailed post on adding remove user (standard user/non-root) in Kali Linux. This post explains how to add a user with all user directories already in place (thereby avoiding “Could not update .ICEauthority var/lib/gdm3/.ICEauthority” or any error containing .ICEauthority or permission in general.

10. Add add-apt-repository

Debian allows users to add and use PPA repositories by an application named add-apt-repository however, Kali Linux didn’t include this in their default package list. With Kali, because this is a special purpose application and certain modifications were made to make it work for what it does best (Penetration Test). To enable PPA Repository via add-apt-repository application, follow the steps below: First install Python Software properties package.
apt-get install python-software-properties Next install apt-file
apt-get install apt-file Update apt-file.
apt-file update This takes a while, so in case your apt-file update is SLOW, you might want to try and fix that as well. (Note that I got repo.kali.org in my /etc/apt/sources.list file instead of http.kali.org.) Once apt-file update is complete, you should be able to search for it.
apt-file search add-apt-repository Your output should look similar to this:
python-software-properties: /usr/bin/add-apt-repository python-software-properties: /usr/share/man/man1/add-apt-repository.1.gz The default add-apt-repository application located in (/usr/bin/add-apt-repository) works for Debian. So if you’re using Kali, chances are it won’t work. There’s a nice fix for that which I will add at the bottom of this post, (try them on VirtualBox if you feel like). But I found we can just mimic Ubuntu Oneiric to make add-apt-repository work.
cd /usr/sbin vi add-apt-repository Add the following code and save the file.
#!/bin/bash if [ $# -eq 1 ] NM=`uname -a && date` NAME=`echo $NM | md5sum | cut -f1 -d" "` then ppa_name=`echo "$1" | cut -d":" -f2 -s` if [ -z "$ppa_name" ] then echo "PPA name not found" echo "Utility to add PPA repositories in your debian machine" echo "$0 ppa:user/ppa-name" else echo "$ppa_name" echo "deb http://ppa.launchpad.net/$ppa_name/ubuntu oneiric main " >> /etc/apt/sources.list apt-get update >> /dev/null 2> /tmp/${NAME}_apt_add_key.txt key=`cat /tmp/${NAME}_apt_add_key.txt | cut -d":" -f6 | cut -d" " -f3` apt-key adv --keyserver keyserver.ubuntu.com --recv-keys $key rm -rf /tmp/${NAME}_apt_add_key.txt fi else echo "Utility to add PPA repositories in your debian machine" echo "$0 ppa:user/ppa-name" fi Note: In this line echo "deb http://ppa.launchpad.net/$ppa_name/ubuntu oneiric main" >> /etc/apt/sources.list I’ve used Oneiric. You can try to use Lucid, Raring or Saucy as per your choice. Now chmod and chown the file.
chmod o+x /usr/sbin/add-apt-repository chown root:root /usr/sbin/add-apt-repository Now that we added the correct code, we can use add-apt-repository to add a PPA repository. I tried the following to add themes and custom icons in Kali Linux.
/usr/sbin/add-apt-repository ppa:noobslab/themes /usr/sbin/add-apt-repository ppa:alecive/antigone
Kali Linux add PPA repository add-apt-repository - adding PPA Repository using add-apt-repository - 7 - blackMORE Ops
I’ve removed all screenshots from this post, but if you want see read and understand how it all works, I suggest reading the details post on  adding PPA repository add-apt-repository in Kali Linux.

11. Install Tor

Tor is free software and an open network that helps you defend against traffic analysis, a form of network surveillance that threatens personal freedom and privacy, confidential business activities and relationships, and state security. This guide guides your through installing tor in Kali Linux. Tor protects you by bouncing your communications around a distributed network of relays run by volunteers all around the world: it prevents somebody watching your Internet connection from learning what sites you visit, and it prevents the sites you visit from learning your physical location.

How to install Tor - logo - blackMORE Ops

Tor is available in Kali repository, to install it directly from the repository open your Terminal and type this:
apt-get install tor Enable tor service from command line:
service tor start Browse with confident by using proxychains and tor
proxychains iceweasel To keep things simple in this post, I’ve only shows one part of using Tor. You might want to read the full details in Installing Tor In Kali Linux post.

12. Install Filezilla FTP Client

No Linux installation is complete with a proper fully fledged FTP Client. Filezilla is the best out there, so install Filezilla using the following command:
apt-get install filezilla filezilla-common -y

13. Install HTOP and NetHogs

This is a special one, HTOP shows running process and memory used including many more details. (you could use top command, but HTOP is just more useful). NetHogs is useful and it shows traffic used by applications per interface. Install them using the following command:
apt-get install htop nethogs -y You can now run then using the following commands:
htop nethogs eth0 nethogs wlan0 I’m almost certain, you’ll enjoy using these tiny tools.

14. Install proprietary drivers for your Graphics card

Depending on which graphics card you’re using, (AMD or NVIDIA), you might want to install proprietary drivers to unlock more features. There’s some excellent post I’ve made on Install AMD ATI proprietary driver (fglrx) in Kali Linux.

Install AMD ATI Driver (fglrx) in Kali Linux 1.x - blackMORE Ops

NVIDIA users can just stick to the official documentation for installing NVIDIA Drivers. In case, official documentation is not working or you’ve hit rock bottom, you can try following this other post I’ve written to install NVIDIA binary drivers manually.
How to Install Nvidia Kernel Module Cuda and Pyrit in Kali Linux - blackMORE Ops

15. Install Recordmydesktop and Reminna Remote Desktop Client

Recordmydesktop gives you the ability to record and make a video of your activities in Kali Linux. Remmina is simialar to Windows Remote Desktop Client. Both very useful. Install them using the following command:
apt-get install gtk-recordmydesktop recordmydesktop remmina -y

16. Install GDebi Package Manager

dpkg is a powerful tool, but it doesn’t install dependencies automatically. What we need is some package installer that can go out and fetch all required dependencies while installing a .deb package. The best one out there is gdebi. Install it using the following command:
apt-get install gdebi -y
10 - Install Skype in Kali Linux - apt-get install gdebi - blackMORE Ops

Enhancements and accessibility


17. Install a theme

Installing theme and revving up your desktop is a great idea. Kali default desktop is dull and boring. There’s two different ways you can change theme.
  1. Manually install theme
  2. Install theme via PPA repository
Read details here to and find out how to change or install GTK3 themes in Kali Linux.


18. Install a new desktop environment (I prefer XFCE).


Finally, follow follow these instructions to permanently switch Desktop Environments.(i.e. boot into XFCE instead of GNOME).

How to install remove GNOME Desktop Environment on Kali Linux - blackMORE Ops

19. Enable Autologin user

It’s a simple change. Just open and edit the file called /etc/gdm3/daemon.conf, assuming you’re using GNOME Display Manager(gmd3) a your main Display Manager. You might want to try out other desktops as well. Here’s a link to Add/Remove different desktop Managers in Kali Linux.

root@kali:~# leafpad /etc/gdm3/daemon.conf
In the daemon section un-comment the 2 lines for automatic login. It should finally look like this
[daemon] # Enabling automatic login AutomaticLoginEnable = true AutomaticLogin = root
That’s it. Too easy. In case you’re wondering how to use a different user than root, here’s how
[daemon] # Enabling automatic login AutomaticLoginEnable = true AutomaticLogin = myanotheruser
Auto login root user at system start in Kali Linux - GNOME and KDE - blackMORE Ops

Last but not the least, reboot to check if it worked. (which it will, cause it’s Linux and Kali is awesome)
reboot
You might want to follow up on this one or if you’re KDE user, then here’s the instructions to Auto login root user at system start in Kali Linux – GNOME and KDE. This article also shows how to auto-login a different non-root user… quite handy.




LIve Kali Linux on USB Flash Drive

Booting and installing Kali from a USB stick is our favorite and fastest method of getting up and running. In order to do this, we first need to image the Kali ISO on a USB drive.

Preparing for the USB copy

  1. Download Kali linux.
  2. If running Windows, download Win32 Disk Imager.
  3. No special software is needed for a *nix OS.
  4. A USB Key (at least 2GB capacity for mini, 4GB for regular).

Kali Linux Live USB Install Procedure

Imaging Kali on a Windows Machine

  1. Plug your USB stick into your Windows USB port and launch the Win32 Disk Imager software
  2. Choose the Kali Linux ISO file to be imaged and verify that the USB drive to be overwritten is the correct one.
  3. kali-usb-install-windows
  4. Once the imaging is complete, safely eject the USB drive from the Windows machine. You can now use the USB device to boot into Kali Linux.

Imaging Kali on a Linux Machine

Creating a bootable Kali Linux USB key in a Linux environment is easy. Once you’ve downloaded your Kali ISO file, you can use dd to copy it over to your USB stick as follows (make sure you’re root first):
WARNING. Although the process of imaging Kali on a USB stick is very easy, you can just as easily destroy arbitrary partitions with dd if you do not understand what you are doing. Consider yourself warned.
  1. Plug in your USB device to your Linux computer’s USB port.
  2. Verify the device path of your USB storage with dmesg.
  3. Proceed to (carefully!) image the Kali ISO file on the USB device:
 dd if=kali.iso of=/dev/sdb bs=512k
That’s it, really! You can now boot into a Kali Live / Installer environment using the USB device.

Imaging Kali on a OSX Machine

Creating a bootable Kali Linux USB key in an OSX environment is similar to the Linux method. Once you’ve downloaded your chosen Kali ISO file, you can use dd to copy it over to your USB stick as follow:
WARNING. Although the process of imaging Kali on a USB stick is very easy, you can just as easily destroy arbitrary partitions with dd if you do not understand what you are doing. Consider yourself warned.
  1. Plug in your USB device to your Apple computer’s USB port.
  2. Verify the device path of your USB storage with diskutil list.
  3. Unmount the drive (note, in this example, the USB stick is /dev/disk2):
  4. diskutil unmount /dev/disk2
  5. Proceed to (carefully!) image the Kali ISO file on the USB device:
  6. sudo dd if=kali-linux-*.iso of=/dev/disk2 bs=1m
    Note: Increasing the blocksize (bs) will speed up the write progress, but increase the chances of creating a bad USB stick.
The time to dd the image across will depend on the speed of the system used, USB stick, and USB port.
And that’s it! You can now boot into a Kali Live / Installer environment using the USB device.
If you choose to boot on an Apple device, you can bring up the boot menu by pressing the Option key immediately after powering on the device.

Install Kali Linux (Dual boot with Windows)


Installing Kali alongside a Windows installation can be quite useful. However, you need to exercise caution during the setup process. First, make sure that you’ve backed up any important data on your Windows installation. Since you’ll be modifying your hard drive, you’ll want to store this backup on external media. Once you’ve completed the backup, we recommend you peruse Kali Linux Hard Disk Install, which explains the normal procedure for a basic Kali install.
In our example, we will be installing Kali Linux alongside an installation of Windows 7, which is currently taking up 100% of the disk space in our computer. We will start by resizing our current Windows partition to occupy less space and then proceed to install Kali Linux in the newly-created empty partition.
Download Kali Linux and either burn the ISO to DVD, or prepare a USB stick with Kali linux Live as the installation medium. If you do not have a DVD or USB port on your computer, check out the Kali Linux Network Install. Ensure you have:
  • Minimum of 8 GB free disk space on Windows
  • CD-DVD / USB boot support

Preparing for the Installation

  1. Download Kali Linux.
  2. Burn The Kali Linux ISO to DVD or copy Kali Linux Live to USB.
  3. Ensure that your computer is set to boot from CD / USB in your BIOS.

Dual Boot Installation Procedure

  1. To start your installation, boot with your chosen installation medium. You should be greeted with the Kali Boot screen. Select Live, and you should be booted into the Kali Linux default desktop.
  2. Now launch the gparted program. We’ll use gparted to shrink the existing Windows partition to give us enough room to install Kali Linux.

    dual-boot-kali-01
  3. Select your Windows partition. Depending on your system, it will usually be the second, larger partition. In our example, there are two partitions; the first is the System Recovery partition, and Windows is actually installed in /dev/sda2. Resize your Windows partition and leave enough space (8GB minimum) for the Kali installation.

    dual-boot-kali-03
  4. Once you have resized your Windows partition, ensure you “Apply All Operations” on the hard disk. Exit gparted and reboot.
    dual-boot-kali-05

Kali Linux Installation Procedure

  1. The installation procedure from this point onwards is similar to a Kali Linux Hard Disk install, until the point of the partitioning, where you need to select “Guided – use the largest continuous free space” that you created earlier with gparted.

    dual-boot-kali-09
  2. Once the installation is done, reboot. You should be greeted with a GRUB boot menu, which will allow you to boot either into Kali or Windows.
    dual-boot-kali-11

Install Kali Linux (Single Boot)

Kali Linux Installation Requirements

Installing Kali Linux on your computer is an easy process. First, you’ll need compatible computer hardware. Kali is supported on i386, amd64, and ARM (both armel and armhf) platforms. The hardware requirements are minimal as listed below, although better hardware will naturally provide better performance. The i386 images have a default PAE kernel, so you can run them on systems with over 4GB of RAM. Download Kali Linux and either burn the ISO to DVD, or prepare a USB stick with Kali Linux Live as the installation medium.

Installation Prerequisites

  • A minimum of 10 GB disk space for the Kali Linux install.
  • For i386 and amd64 architectures, a minimum of 512MB RAM.
  • CD-DVD Drive / USB boot support

Preparing for the Installation

  1. Download Kali linux.
  2. Burn The Kali Linux ISO to DVD or Image Kali Linux Live to USB.
  3. Ensure that your computer is set to boot from CD / USB in your BIOS.

Kali Linux Installation Procedure

  1. To start your installation, boot with your chosen installation medium. You should be greeted with the Kali Boot screen. Choose either Graphical or Text-Mode install. In this example, we chose a GUI install.

    Kali Install
  2. Select your preferred language and then your country location. You’ll also be prompted to configure your keyboard with the appropriate keymap.

    localechooser_languagelist_0
  3. The installer will copy the image to your hard disk, probe your network interfaces, and then prompt you to enter a hostname for your system. In the example below, we’ve entered “kali” as our hostname.

    netcfg_get_hostname_0
  4. Enter a robust password for the root account.

    kali-linux-install-02
  5. Next, set your time zone.

    time_zone_0
  6. The installer will now probe your disks and offer you four choices. In our example, we’re using the entire disk on our computer and not configuring LVM (logical volume manager). Experienced users can use the “Manual” partitioning method for more granular configuration options.

    partman-auto_init_automatically_partition_0
  7. Next, you’ll have one last chance to review your disk configuration before the installer makes irreversible changes. After you click Continue, the installer will go to work and you’ll have an almost finished installation.

    kali-linux-install-03
  8. Configure network mirrors. Kali uses a central repository to distribute applications. You’ll need to enter any appropriate proxy information as needed.

    NOTE! If you select “NO” in this screen, you will NOT be able to install packages from Kali repositories.
    kali-linux-install-04
  9. Next, install GRUB.

    kali-linux-install-05
  10. Finally, click Continue to reboot into your new Kali installation.

    finish-install_reboot_in_progress_0

Post Installation

Now that you’ve completed installing Kali Linux, it’s time to customize your system. The Kali General Use section of our site has more information and you can also find tips on how to get the most out of Kali in our User Forums.