Perfect Fluxbox Desktop on Kali Linux
This tutorial was tested on Kali Linux 2017.1
For my job, I need a portable Linux environment to run tests, so I often find myself using Kali Linux from a low resourced virtual machine, or booted from a flash drive. In this case scenario, having a lightweight desktop is as important as the tools themselves.
Considerations
It is assumed that:
- You have a Kali Linux environment installed (version 2017.1 is the tested version)
- You have a working Internet connection
- You are logged in as root (As this is the default setting for Kali)
Install Fluxbox
apt-get update
apt-get install fluxbox
Install LightDM
Installing lightDM not only sets a much lighter login screen, but also you would get the lock command for the Fluxbox keys section.
apt-get install lightdm
dpkg-reconfigure lightdm
Set LightDM as the default desktop manager:

Some Additional Tools
Fluxbox is a very lightweight window manager, we may make use of some additional tools to make a friendlier environment. These are just some recommendations:
apt-get install xfce4-screenshooter shutter gnome-do terminator
- Xfce4-screenshooter and Shutter are tools to take screenshots, I need them a lot to document my work. Shutter is more resource-consuming but yet I prefer it.
- Gnome-Do is a program launcher, very handy, specially on Fluxbox, to run applications without touching the mouse.
- Terminator is a feature-rich terminal, awesome if you need terminal programs running together
Note when first launching gnome-do set preference to "Hide window on first launch" so that you don't see it every time you log in. Then you run it with Windows key + space:

Switch to Fluxbox
At this moment you should logout and then login to fluxbox, for that, you should select the session on the login manager, for the case of having installed LightDM it will be located on the upper right corner:

After logging in the first time, the configuration files will be generated.
Open a terminal to continue with the configuration. To do so, right-click the desktop and go to "Applications", "Terminal Emulators" and select a Terminal, or you can hit Alt+F2 and run the command for your favorite terminal.
Backup The Configuration Files
Let's backup, as you should always do, the configuration files we are about to modify:
cp ~/.fluxbox/{,bkp.}menu
cp ~/.fluxbox/{,bkp.}init
cp ~/.fluxbox/{,bkp.}keys
cp ~/.fluxbox/{,bkp.}overlay
cp ~/.fluxbox/{,bkp.}startup
Configure the Fluxbox Menu
If this is your first time inside fluxbox, you will notice at a first glance that you have no menu to go, but it is there, you have to right click on the desktop to deploy it
By now, you should have the default fluxbox menu, which won't be very useful, that's why this chapter...
Let's change the default menu file location (~/.fluxbox/menu), this is a good practice because, depending on the distribution, sometimes you may get this file overwritten:
sed -i 's/\/menu/\/custommenu/1' ~/.fluxbox/init
You can manually edit the menu at any time editing file ~/.fluxbox/custommenu. Note that custommenu is the name I've chosen for the file in the previous command
The menu file itself is very self-explanatory so there's no need to be very detailed on the format. As a personal preference I change the title and put my favorite applications first, for instance:
Manual Configuration
[begin] (Kali Fluxbox!)
[encoding] {UTF-8}
[exec] (Screenshot) {xfce4-screenshooter -r}
[separator]
#Favorites
[exec] (Terminator) {terminator}
[exec] (Files) {nautilus --no-desktop}
[exec] (Firefox) {firefox} <>
[exec] (Chrome) {google-chrome} <>
[exec] (Burp Suite) {burpsuite} <>
[exec] (Metasploit) {gnome-terminal -e msfconsole} <>
[exec] (Run...) {fbrun}
[separator]
#...
Note that the file has a tag formatted style, to mention about the previous file extract:
- [begin]: Starts the menu and specifies the menu title
- [separator]: An organizational bar to separate menus to your preference
- [exec]: Precedes each menu item to execute in the form [exec] (Display name) {command}
Other possibilities are:
- [submenu]: A collapsible menu entry
- [include]: Includes a separate file
I also like to have a poweroff, restart, suspend and lock, so I will add a submenu in the ending:
#...
[separator]
[submenu] (Exit...)
[exec] (Power Off) {poweroff}
[exec] (Reboot) {reboot}
[exec] (Suspend) {systemctl suspend}
[exec] (Lock) {dm-tool lock}
[end]
#...
Even though it is not the default setting for Kali Linux, if you use a non-root user, you may have to set sudoers file so that sudo does not prompt for a password on using these specific programs, and then call sudo in the menu command.
Scripted Kali Menu
Kali Linux comes with a very well organized and categorized menu, this won't be available by default in Fluxbox. So I wrote a bash script to collect the software and mimic Kali's menu for Gnome Shell in the fluxbox menu:
#!/bin/bash
# Script to generate Fluxbox Menu for Kali based on XDG menu settings from the distribution
# This program is free software: you can redistribute it and/or modify it under the terms
# of the GNU General Public License as published by the Free Software Foundation, either
# version 3 of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
# without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the GNU General Public License for more details.
#
# Please, see http://www.gnu.org/licenses/.
kaliXDG="/usr/share/applications/kali-*.desktop"
tmpMenu=$(mktemp /tmp/fbm.XXXXX) || { echo "Error creating temp"; exit 1; }
fbMenu="$HOME/.fluxbox/kalimenu"
for category in $(grep "^Categories" $kaliXDG | cut -d"=" -f2 | cut -d";" -f1 | sort | uniq | grep -vE "^[0-9][0-9]-[0-9][0-9]"); do
echo "[submenu] ($(echo $category | sed 's/-/ /g;s/\b\(.\)/\u\1/g'))" >> $tmpMenu
for app in $(grep "^Categories=${category:0:2}" $kaliXDG | cut -d":" -f1); do
appTerm=`grep "^Terminal" $app | cut -d"=" -f 2`
appCat=`grep "^Categories" $app | cut -d"=" -f 2 | cut -d";" -f 1`
appExec=`grep "^Exec" $app | cut -d"=" -f 2`
appName=`grep "^Name" $app | cut -d"=" -f 2`
if [ "$appTerm" == "false" ]; then
echo " [exec] ($appName) {$appExec}" >> $tmpMenu
else
appExec=$(echo $appExec | cut -d'"' -f2 | cut -d";" -f1)
echo " [exec] ($appName) {xterm -bg black -fa 'Monospace' -fs 11 -e '$appExec ; bash'}" >> $tmpMenu
fi
done
echo "[end]" >> $tmpMenu
done
cp $tmpMenu $fbMenu
exit 0
Copy the text to an executable file and run it
After running the script you will get a new file in ~/.fluxbox/kalimenu
I just included that generated file in my custommenu file like this:
[separator] [submenu] (Kali) [include] (~/.fluxbox/kalimenu) [end] [separator]
Final Menu Files
After the previous changes, the configuration files ended like this:
~/.fluxbox/custommenu:
[begin] (Kali Fluxbox!)
[encoding] {UTF-8}
[exec] (Screenshot) {xfce4-screenshooter -r}
[separator]
#Favorites
[exec] (Terminator) {terminator}
[exec] (Files) {nautilus --no-desktop}
[exec] (Firefox) {firefox} <>
[exec] (Chrome) {google-chrome} <>
[exec] (Burp Suite) {burpsuite} <>
[exec] (Metasploit) {xterm -bg black -fa 'Monospace' -fs 11 -e 'msfconsole ; bash'} <>
[exec] (Run...) {fbrun}
[separator]
[submenu] (Kali)
[include] (~/.fluxbox/kalimenu)
[end]
[separator]
[submenu] (fluxbox menu)
[config] (Configure)
[submenu] (System Styles) {Choose a style...}
[stylesdir] (/usr/share/fluxbox/styles)
[end]
[submenu] (User Styles) {Choose a style...}
[stylesdir] (~/.fluxbox/styles)
[end]
[workspaces] (Workspace List)
[submenu] (Tools)
[exec] (Window name) {xprop WM_CLASS|cut -d \" -f 2|xmessage -file - -center}
[end]
[commanddialog] (Fluxbox Command)
[reconfig] (Reload config)
[restart] (Restart)
[exec] (About) {(fluxbox -v; fluxbox -info | sed 1d) \
2> /dev/null | xmessage -file - -center}
[separator]
[exit] (Exit)
[end]
[separator]
[submenu] (Exit...)
[exec] (Power Off) {poweroff}
[exec] (Reboot) {reboot}
[exec] (Suspend) {systemctl suspend}
[exec] (Lock) {dm-tool lock}
[end]
[end]
~/.fluxbox/kalimenu:
[submenu] (01 Info Gathering)
[exec] (0trace) {xterm -bg black -fa 'Monospace' -fs 11 -e '0trace.sh ; bash'}
[exec] (acccheck) {xterm -bg black -fa 'Monospace' -fs 11 -e 'acccheck ; bash'}
[exec] (automater) {xterm -bg black -fa 'Monospace' -fs 11 -e 'automater -h ; bash'}
[exec] (braa) {xterm -bg black -fa 'Monospace' -fs 11 -e 'braa -h ; bash'}
[exec] (casefile) {sh -c "casefile"}
[exec] (cdpsnarf) {xterm -bg black -fa 'Monospace' -fs 11 -e 'cdpsnarf -h ; bash'}
[exec] (dmitry) {xterm -bg black -fa 'Monospace' -fs 11 -e 'dmitry ; bash'}
[exec] (dnmap-client) {xterm -bg black -fa 'Monospace' -fs 11 -e 'dnmap_client ; bash'}
[exec] (dnmap-server) {xterm -bg black -fa 'Monospace' -fs 11 -e 'dnmap_server ; bash'}
[exec] (dnsenum) {xterm -bg black -fa 'Monospace' -fs 11 -e 'dnsenum -h ; bash'}
[exec] (dnsmap) {xterm -bg black -fa 'Monospace' -fs 11 -e 'dnsmap ; bash'}
[exec] (dnsrecon) {xterm -bg black -fa 'Monospace' -fs 11 -e 'dnsrecon -h ; bash'}
[exec] (dnstracer) {xterm -bg black -fa 'Monospace' -fs 11 -e 'dnstracer ; bash'}
[exec] (dnswalk) {xterm -bg black -fa 'Monospace' -fs 11 -e 'dnswalk --help ; bash'}
[exec] (enum4linux) {xterm -bg black -fa 'Monospace' -fs 11 -e 'enum4linux ; bash'}
[exec] (fierce) {xterm -bg black -fa 'Monospace' -fs 11 -e 'fierce -h ; bash'}
[exec] (fping) {xterm -bg black -fa 'Monospace' -fs 11 -e 'fping -h ; bash'}
[exec] (fragroute) {xterm -bg black -fa 'Monospace' -fs 11 -e 'fragroute -h ; bash'}
[exec] (fragrouter) {xterm -bg black -fa 'Monospace' -fs 11 -e 'fragrouter -h ; bash'}
[exec] (ftest) {xterm -bg black -fa 'Monospace' -fs 11 -e 'ftest ; bash'}
[exec] (hping3) {xterm -bg black -fa 'Monospace' -fs 11 -e 'hping3 -h ; bash'}
[exec] (ike-scan) {xterm -bg black -fa 'Monospace' -fs 11 -e 'ike-scan -h ; bash'}
[exec] (intrace) {xterm -bg black -fa 'Monospace' -fs 11 -e 'intrace ; bash'}
[exec] (iputils-arping) {xterm -bg black -fa 'Monospace' -fs 11 -e 'arping ; bash'}
[exec] (irpas-ass) {xterm -bg black -fa 'Monospace' -fs 11 -e 'ass -h ; bash'}
[exec] (irpass-cdp) {xterm -bg black -fa 'Monospace' -fs 11 -e 'cdp ; bash'}
[exec] (lbd) {xterm -bg black -fa 'Monospace' -fs 11 -e 'lbd ; bash'}
[exec] (maltegoce) {sh -c "maltegoce"}
[exec] (masscan) {xterm -bg black -fa 'Monospace' -fs 11 -e 'masscan --help ; bash'}
[exec] (miranda) {xterm -bg black -fa 'Monospace' -fs 11 -e 'miranda -h ; bash'}
[exec] (nbtscan) {xterm -bg black -fa 'Monospace' -fs 11 -e 'nbtscan -h ; bash'}
[exec] (ncat) {xterm -bg black -fa 'Monospace' -fs 11 -e 'ncat -h ; bash'}
[exec] (netdiscover) {xterm -bg black -fa 'Monospace' -fs 11 -e 'netdiscover -h ; bash'}
[exec] (netmask) {xterm -bg black -fa 'Monospace' -fs 11 -e 'netmask -h ; bash'}
[exec] (nmap) {xterm -bg black -fa 'Monospace' -fs 11 -e 'nmap ; bash'}
[exec] (onesixtyone) {xterm -bg black -fa 'Monospace' -fs 11 -e 'onesixtyone ; bash'}
[exec] (p0f) {xterm -bg black -fa 'Monospace' -fs 11 -e 'p0f -h ; bash'}
[exec] (recon-ng) {xterm -bg black -fa 'Monospace' -fs 11 -e 'recon-ng ; bash'}
[exec] (smbmap) {xterm -bg black -fa 'Monospace' -fs 11 -e 'smbmap -h ; bash'}
[exec] (smtp-user-enum) {xterm -bg black -fa 'Monospace' -fs 11 -e 'smtp-user-enum -h ; bash'}
[exec] (snmp-check) {xterm -bg black -fa 'Monospace' -fs 11 -e 'snmp-check -h ; bash'}
[exec] (sparta) {xterm -bg black -fa 'Monospace' -fs 11 -e 'sparta ; bash'}
[exec] (sslcaudit) {xterm -bg black -fa 'Monospace' -fs 11 -e 'sslcaudit -h ; bash'}
[exec] (ssldump) {xterm -bg black -fa 'Monospace' -fs 11 -e 'ssldump -h ; bash'}
[exec] (sslh) {xterm -bg black -fa 'Monospace' -fs 11 -e 'sslh -h ; bash'}
[exec] (sslscan) {xterm -bg black -fa 'Monospace' -fs 11 -e 'sslscan ; bash'}
[exec] (sslyze) {xterm -bg black -fa 'Monospace' -fs 11 -e 'sslyze -h ; bash'}
[exec] (swaks) {xterm -bg black -fa 'Monospace' -fs 11 -e 'swaks --help ; bash'}
[exec] (thcping6) {xterm -bg black -fa 'Monospace' -fs 11 -e 'thcping6 ; bash'}
[exec] (theharvester) {xterm -bg black -fa 'Monospace' -fs 11 -e 'theharvester ; bash'}
[exec] (tlssled) {xterm -bg black -fa 'Monospace' -fs 11 -e 'tlssled ; bash'}
[exec] (twofi) {xterm -bg black -fa 'Monospace' -fs 11 -e 'twofi -h ; bash'}
[exec] (unicornscan) {xterm -bg black -fa 'Monospace' -fs 11 -e 'us -h ; bash'}
[exec] (urlcrazy) {xterm -bg black -fa 'Monospace' -fs 11 -e 'urlcrazy -h ; bash'}
[exec] (wafw00f) {xterm -bg black -fa 'Monospace' -fs 11 -e 'wafw00f -h ; bash'}
[exec] (wol-e) {xterm -bg black -fa 'Monospace' -fs 11 -e 'wol-e -h ; bash'}
[exec] (xprobe2) {xterm -bg black -fa 'Monospace' -fs 11 -e 'xprobe2 -h ; bash'}
[exec] (zenmap) {sh -c "zenmap;${SHELL:-bash}"}
[end]
[submenu] (02 Vulnerability Analysis)
[exec] (bed) {xterm -bg black -fa 'Monospace' -fs 11 -e 'bed ; bash'}
[exec] (cisco-global-exploiter) {xterm -bg black -fa 'Monospace' -fs 11 -e 'cge.pl ; bash'}
[exec] (cisco-ocs) {xterm -bg black -fa 'Monospace' -fs 11 -e 'cisco-ocs ; bash'}
[exec] (copy-router-config) {xterm -bg black -fa 'Monospace' -fs 11 -e 'copy-router-config.pl ; bash'}
[exec] (dhcpig) {xterm -bg black -fa 'Monospace' -fs 11 -e 'pig.py -h ; bash'}
[exec] (enumiax) {xterm -bg black -fa 'Monospace' -fs 11 -e 'enumiax -h ; bash'}
[exec] (golismero) {xterm -bg black -fa 'Monospace' -fs 11 -e 'golismero -h ; bash'}
[exec] (iaxflood) {xterm -bg black -fa 'Monospace' -fs 11 -e 'iaxflood ; bash'}
[exec] (inviteflood) {xterm -bg black -fa 'Monospace' -fs 11 -e 'inviteflood -h ; bash'}
[exec] (lynis) {xterm -bg black -fa 'Monospace' -fs 11 -e 'lynis -h ; bash'}
[exec] (merge-router-config) {xterm -bg black -fa 'Monospace' -fs 11 -e 'merge-router-config.pl ; bash'}
[exec] (nikto) {xterm -bg black -fa 'Monospace' -fs 11 -e 'nikto -h ; bash'}
[exec] (ohrwurm) {xterm -bg black -fa 'Monospace' -fs 11 -e 'ohrwurm ; bash'}
[exec] (openvas initial setup) {xterm -bg black -fa 'Monospace' -fs 11 -e 'openvas-setup ; bash'}
[exec] (openvas start) {xterm -bg black -fa 'Monospace' -fs 11 -e 'openvas-start ; bash'}
[exec] (openvas stop) {xterm -bg black -fa 'Monospace' -fs 11 -e 'openvas-stop ; bash'}
[exec] (powerfuzzer) {sh -c "powerfuzzer;${SHELL:-bash}"}
[exec] (protos-sip) {xterm -bg black -fa 'Monospace' -fs 11 -e 'protos-sip -help ; bash'}
[exec] (rtpbreak) {xterm -bg black -fa 'Monospace' -fs 11 -e 'rtpbreak -h ; bash'}
[exec] (rtpflood) {xterm -bg black -fa 'Monospace' -fs 11 -e 'rtpflood ; bash'}
[exec] (rtpinsertsound) {xterm -bg black -fa 'Monospace' -fs 11 -e 'rtpinsertsound -h ; bash'}
[exec] (rtpmixsound) {xterm -bg black -fa 'Monospace' -fs 11 -e 'rtpmixsound -h ; bash'}
[exec] (sctpscan) {xterm -bg black -fa 'Monospace' -fs 11 -e 'sctpscan ; bash'}
[exec] (sfuzz) {xterm -bg black -fa 'Monospace' -fs 11 -e 'sfuzz -h ; bash'}
[exec] (siege) {xterm -bg black -fa 'Monospace' -fs 11 -e 'siege -h ; bash'}
[exec] (siparmyknife) {xterm -bg black -fa 'Monospace' -fs 11 -e 'siparmyknife ; bash'}
[exec] (sipp) {xterm -bg black -fa 'Monospace' -fs 11 -e 'sipp -h ; bash'}
[exec] (spike-generic_chunked) {xterm -bg black -fa 'Monospace' -fs 11 -e 'generic_chunked ; bash'}
[exec] (spike-generic_listen_tcp) {xterm -bg black -fa 'Monospace' -fs 11 -e 'generic_listen_tcp ; bash'}
[exec] (spike-generic_send_tcp) {xterm -bg black -fa 'Monospace' -fs 11 -e 'generic_send_tcp ; bash'}
[exec] (spike-generic_send_udp) {xterm -bg black -fa 'Monospace' -fs 11 -e 'generic_send_udp ; bash'}
[exec] (svcrack) {xterm -bg black -fa 'Monospace' -fs 11 -e 'svcrack -h ; bash'}
[exec] (svcrash) {xterm -bg black -fa 'Monospace' -fs 11 -e 'svcrash -h ; bash'}
[exec] (svmap) {xterm -bg black -fa 'Monospace' -fs 11 -e 'svmap -h ; bash'}
[exec] (svreport) {xterm -bg black -fa 'Monospace' -fs 11 -e 'svreport -h ; bash'}
[exec] (svwar) {xterm -bg black -fa 'Monospace' -fs 11 -e 'svwar -h ; bash'}
[exec] (t50) {xterm -bg black -fa 'Monospace' -fs 11 -e 't50 --help ; bash'}
[exec] (thc-ssl-dos) {xterm -bg black -fa 'Monospace' -fs 11 -e 'thc-ssl-dos -h ; bash'}
[exec] (unix-privesc-check) {xterm -bg black -fa 'Monospace' -fs 11 -e 'unix-privesc-check ; bash'}
[exec] (voiphopper) {xterm -bg black -fa 'Monospace' -fs 11 -e 'voiphopper ; bash'}
[exec] (yersinia) {xterm -bg black -fa 'Monospace' -fs 11 -e 'yersinia --help ; bash'}
[end]
[submenu] (03 Webapp Analysis)
[exec] (apache-users) {xterm -bg black -fa 'Monospace' -fs 11 -e 'apache-users ; bash'}
[exec] (blindelephant) {xterm -bg black -fa 'Monospace' -fs 11 -e 'BlindElephant.py -h ; bash'}
[exec] (burpsuite) {sh -c "java -jar /usr/bin/burpsuite"}
[exec] (cadaver) {xterm -bg black -fa 'Monospace' -fs 11 -e 'cadaver ; bash'}
[exec] (clusterd) {xterm -bg black -fa 'Monospace' -fs 11 -e 'clusterd -h ; bash'}
[exec] (commix) {xterm -bg black -fa 'Monospace' -fs 11 -e 'commix ; bash'}
[exec] (cutycapt) {xterm -bg black -fa 'Monospace' -fs 11 -e 'cutycapt --help ; bash'}
[exec] (davtest) {xterm -bg black -fa 'Monospace' -fs 11 -e 'davtest ; bash'}
[exec] (deblaze) {xterm -bg black -fa 'Monospace' -fs 11 -e 'deblaze.py -h ; bash'}
[exec] (dirb) {xterm -bg black -fa 'Monospace' -fs 11 -e 'dirb ; bash'}
[exec] (dirbuster) {sh -c "dirbuster;${SHELL:-bash}"}
[exec] (fimap) {xterm -bg black -fa 'Monospace' -fs 11 -e 'fimap -h ; bash'}
[exec] (grabber) {xterm -bg black -fa 'Monospace' -fs 11 -e 'grabber -h ; bash'}
[exec] (httrack) {xterm -bg black -fa 'Monospace' -fs 11 -e 'httra