Kali Linux Basic Setup

Kali Linux is a Debian-derived Linux distribution designed for digital forensics and penetration testing. It is maintained and funded by Offensive Security Ltd.


Kali Linux Basic Setup

Here are some notes I've cobbled together to get a Kali Linux install ready for educational and CTF use. There are additional steps not included here for a safe malware analysis platform and for discreet professional use.

Basic Steps for Setting up Kali Linux

drawn from:
https://null-byte.wonderhowto.com/how-to/top-10-things-do-after-installing-kali-linux-0186450/
https://kali.training/topic/configuring-services/
https://kali.training/lessons/2-getting-started-with-kali/

Once you've downloaded and imported the OVA from Offensive Security in a VM or downloaded and installed the binaries from Kali.org on a machine or in a VM:

1) Change your root password (default is "toor")
passwd root enter and confirm your new password

2) Generate new SSH keys (so you don't have the same remote access key as every other person who downloads the Kali OVA)
systemctl start ssh
rm /etc/ssh/ssh_host_*
dpkg-reconfigure openssh -server
service ssh restart
systemctl enable ssh

3) Install git (to be able to clone git repositories where lots of new code and tools can be found)
apt install git

4) Add a low-privilege user account (to avoid making radical changes/mistakes later)
adduser kaliuser kaliuser is just an example of a username
usermod -aG sudo kaliuser

5) Install terminal multiplexer (to easily run multiple terminals in one window)
apt install tilix

6) Download & install any additional tool packages you want (optional as OVA contains most/all relevant tools)
http://tools.kali.org/kali-metapackages description of package contents
http://www.kali.org/news/kali-linux-metapackages tool packages

7) Update TOR (if you plan on using it)
echo 'deb https://deb.torproject.org/torproject.org stretch main deb-src https://deb.torproject.org/torproject.org stretch main' > /etc/apt/sources.list.d/tor.list

wget -O- 'https://pgp.mit.edu/pks/lookup?op=get&search=0xA3C4F0F979CAA22CDBA8F512EE8CBC9E886DDD89' | sudo apt-key add -

8) Setup any bash aliases you want (e.g. ll and an updater/upgrader function)
vi /root/.bash_aliases
alias ll = 'ls -l'
function apt-updater(){
   apt-get update &&
   apt-get dist-upgrade -Vy &&
   apt-get autoremove -y &&
   apt-get autoclean &&
   apt-get clean &&
   reboot}
Remember to copy the ./bash_aliases file (or create a new one) over to your low-privilege user account's root directory if you plan on using those aliases with that user account.

9) Download and install atom code editor (less painful than vi)
https://atom.io/download/deb download should start automatically
dpkg -i ~/Downloads/atom-amd64.deb

10) Run apt-updater (to update all of your packages to the most recent release - see step 8)
apt-updater
   likely you will find that you need to update postgresql from 10 to 11
apt install postgresql-11
   likely you will also need to set grub install on sda when prompted

If you are running Kali in a VM, take a snapshot of it now, so that you can restore easily to an already setup machine if anything goes wrong in the future.