8 minute read

I have this information over in my GitLab but wanted to replicate it in a blog post here with extended commentary. As of the date this post was published (updated), these are the steps I take after installing or opening up a fresh Kali Linux VM. These instructions can be considered largely opinion.

1. System Baseline

  1. Log in to the desktop with the credentials kali:kali
  2. Prepare to patch the deployment by opening up a terminal session
    • sudo apt update -y && sudo apt upgrade -y
    • Wait FOREVER.

2. Configure Accounts

  1. Enable desktop login for root account. I mostly work from the unprivileged account but I like to have options.
    • sudo apt -y install kali-root-login
  2. Set the root password
    • sudo passwd root
    • Enter a pass phrase
  3. While you’re at it, change the password for kali
    • passwd
    • Enter a DIFFERENT pass phrase

Optional Configuration for kali Account

Change the username from kali to something custom. In my case, I like to go by “tac0shell” on the command line. This can be an annoying step so I only recommend doing it if you can afford to be particularly vain (i.e. not on your employer’s dime). As Kali/Linux/desktop environments evolve, more steps than below may be needed to swat bugs to make the whole thing work properly.

  1. Logout of your kali desktop session and login as root
  2. You’ll probably still have processes running as the kali user so in order to continue renaming that account, you’ll have to murder those proceesses. Continuing along this section without doing so will result in the error user kali is currently used by process ###
    • pkill -9 -u kali
  3. Rename the account, rename the associated group, create new home directory and move all content from old home into new home
    • usermod -l tac0shell kali
    • groupmod -n tac0shell kali
    • usermod -d /home/tac0shell -m tac0shell
  4. Verify the name and owners of the new home directory and its contents are correct, and that the the uid and gid match (usually 1000)
    • ls -al /home && ls -al /home/tac0shell && id tac0shell
  5. One other thing that needs to be done is to delete the xfce cache from your previous login session. Without doing this, you’ll log out of root and back in to the new kali/tac0shell account and be presented with no usable desktop environment.
    • rm -rf /home/tac0shell/.cache/sessions/*
  6. Log out and log back in as your old, new user.

Install Software

This section covers my favorite tools and services to use and is in no way comprehensive or even the best software out there. If you have a strong opinion about a good tool or a better alternative to something listed here, comment below and tell me about it.

Kali Metapackage

Metapackages are pre-packaged software installations of common tools for Kali that are intended to help you rapidly deploy a specific niche instance. For example, if you are going on a wifi assessment, you can install all the wifi penetration testing tools Kali has to offer by installing the kali-tools-802-11 metapackage. If you are low on storage space, you can install kali-tools-top10.

  1. I like make my hard drives sweat by installing all the things. At the time of publishing, this installs nearly 9GB of software, but I don’t like installing tools mid-engagement. Based on your circumstances, make your own metapackage choice.
    • sudo apt install -y kali-linux-everything

Terminal Software

I like to use terminator to interact with the command line. Additionally, I will add a “professional” profile that I can quickly change to when I need to collect screenshots for a professional report. There are various reasons for this, but in my 2023 experience people print things more than we thought they would back in 2003 and printing a black terminal can chew up a lot of ink.

  1. sudo apt install terminator
  2. Open a Terminator session. Right click on the in the main window and select Preferences.
  3. In the Global tab, select the checkbox for “Re-use profiles for new terminals.”
  4. Click on the Profiles tab and create a new profile, Professional. This will be a profile with settings friendly to report-writing.
  5. With your new profile highlighted, click on the Scrolling tab and check the “Infinite Scrollback” setting.
  6. In the “Colors” tab, make sure the selected “Built-in scheme” is “Black on white” or whatever your preference may be. At the time of writing, this was not a great selection for my chose zsh prompt colors. I will have to come back to this.

If you prefer to use the default Kali Terminal Emulator, here are the same steps to professionalize the terminal screen for reports.

  1. File > Preferences > Appearance
    1. Color scheme: BlackOnWhite or BreezeModified
    2. Application transparancy: 0%
  2. File > Preferences > Behavior
    1. Unlimited history: Selected
    2. Confirm multiline paste: Checked
    3. Ask for confirmation when closing: Checked
    4. Open new terminals in current working directory: Checked

ServerSetup by Noah Powers

ServerSetup is a recent project suggested to me with which I don’t have extensive experience. It appears to be a shortcut to deploying common server services often needed during an engagement (Mail Server, SMB Share, HTTPS C2). As such, I’ve made a note of it here but may either remove or expand on it in the future, depending on whether I find it utilitous. Follow the install instructions on the GitHub page for the most up-to-date process.

Screenshot Software

I love the Flameshot software for my screenshots. It has markup tools available during the capture and gives me the option to save it, copy it to my clipboard, immediately upload it to imgur.com, pixelate information, resize my capture area, and all sorts of useful stuff that I haven’t found anywhere else for free.

From the command line:

  1. Run sudo apt install -y flameshot
  2. Go to the Kali xfce menu in the top-left and click on Settings > Keyboard > Application Shortcuts > +Add
  3. In the “Command” field, type /usr/bin/flameshot gui and click “Ok”
  4. Press your desired shortcut/hotkey

Quality of Life Configurations

Customize zsh Experience

My preferred shell prompt settings for .zshrc can be found at https://gitlab.com/patrickriggs/new-kali-vm/-/blob/main/zshrc. I enjoy a prompt with a ticking timestamp that will put a temporal marker on my pen testing screenshots. “When did you do That Thing?” “It’s on the screenshot.”

In addition, there are some shell history tweaks that I prefer, including date and timestamping entries, and immediately writing to the history file instead of waiting until I cleanly exit my shell session. One thing I also do that does bring it’s own challenges is I thread all my terminal session histories into the same single-stream which, at times, make it harder to determine the context of a given command.

Power and Screen Lock Settings

  1. Left-click on the battery icon on the top-right of the xfce desktop
  2. In the Power Manager window, click on the “Display” tab and toggle the master switch on the top-right of that window so it appears to be off
  3. Move the “Black after” slider all the way to the left to set it as “Never”
  4. In the “Security” tab, change “Automatically lock the session” to “Never”

Alternatively, you can temporarily prevent the whole thing from locking by ignoring these settings, which are persistent, and toggling the “Presentation mode” slider that appears when you click on the battery icon.

Timezone Settings

  1. Right-click the time on the task bar, click Properties
  2. Set your timezone and display preferences
  3. Set timezone on command line
    1. timedatectl list-timezones | grep *Berlin* or *New York*
    2. sudo timedatectl set-timezone *chosen timezone*

Leave a comment