f in x
Kali Linux from Scratch: Installation, Tools, and Penetration Testing Environment Setup
> cd .. / HUB_EDITORIALE
Sicurezza Informatica

Kali Linux from Scratch: Installation, Tools, and Penetration Testing Environment Setup

[2026-06-07] Author: Ing. Calogero Bono

You just booted a Kali Linux VM and you're staring at a bare desktop — no tools installed, no network configuration, no aliases, no notes. If you start a penetration test like this, you're wasting precious time and risking missing critical details. Setting up Kali Linux from scratch isn't just about installing an OS; it's about building a reliable, reproducible, and fast security testing workstation. We, at Meteora Web, have been doing this for years in our ethical hacking projects. Let's get into the practical steps, with real commands and zero fluff.

Choosing the Right Installation Method

Kali Linux can be installed in several ways. The choice depends on the context: are you testing an internal network? A cloud web app? An embedded environment? Each scenario requires a different setup. Here are the main options and when to use them.

Virtual Machine (VM) – the go-to for most tests

VM is the most flexible choice. Isolated from the host, easy to snapshot and restore, portable. We use VirtualBox or VMware Workstation. Download the official ISO from kali.org — pick the preconfigured image for your hypervisor. If you prefer full control, use the generic ISO and install manually.

# After boot, install guest additions for better performance
sudo apt update
sudo apt install -y virtualbox-guest-x11

Configure the VM with at least 4 GB RAM and 2 CPU cores. For disk: 40 GB is the minimum, 80 GB if you plan to install many tools or store test results.

Bare Metal – when you need native power

For tests requiring hardware access (WiFi injection, USB fuzzing) or maximum performance, install Kali directly on disk. The process is standard: create a bootable USB with Rufus (Windows) or dd (Linux/macOS).

# On Linux/macOS
sudo dd if=kali-linux-2026.1-installer-amd64.iso of=/dev/sdX bs=4M status=progress
sync

Warning: bare metal installation overwrites everything. Use only on dedicated machines, never on a daily work PC.

Live USB with Persistence – for testing across multiple machines

If you need to move between different computers (e.g., client site tests), a USB stick with a persistent partition lets you keep configurations and tools. After creating the live USB, add an ext4 partition labeled persistence and enable persistence.

# Create the persistent partition (e.g., /dev/sdb2)
sudo mkfs.ext4 -L persistence /dev/sdb2
sudo mkdir /mnt/usb
sudo mount /dev/sdb2 /mnt/usb
echo "/ union" | sudo tee /mnt/usb/persistence.conf
sudo umount /mnt/usb

Initial Configuration: Essential Hardening

Out of the box, Kali is not secure by default. The first login is user kali with password kali. Change it immediately. We see too many testers skipping this step and leaving doors open.

passwd
# Enter a strong new password

Then update the system: not only packages but also kernel and repositories.

sudo apt update && sudo apt full-upgrade -y
sudo apt autoremove -y
sudo reboot

Set up a firewall with ufw or simple iptables.

sudo ufw default deny incoming
sudo ufw default allow outgoing
sudo ufw enable

Disable unnecessary services like Bluetooth, print server, cups. Use systemctl to check active services.

Installing Penetration Testing Tools the Right Way

Kali ships with over 600 tools, but you don't need all of them for every test. Installing the full kali-linux-large metapackage can bloat your system. Pick by category.

Web Application Testing Tools

If you work on web apps (as we often do for e-commerce clients), you'll need:

sudo apt install -y burpsuite zaproxy nikto dirb gobuster wfuzz sqlmap

Burp Suite is the Swiss Army knife: install Professional if you have a license, otherwise Community edition is enough for many tests. ZAP is the open-source alternative from OWASP.

Network Scanning and Enumeration

sudo apt install -y nmap masscan netexec crackmapexec

Nmap is essential. masscan for large subnet scans. crackmapexec for Windows/Active Directory enumeration.

Post-Exploitation Frameworks

sudo apt install -y metasploit-framework powershell-empire starkiller

Metasploit is the go-to framework. Empire for Windows post-exploitation. Starkiller is the GUI for Empire.

Password Cracking and Brute Force

sudo apt install -y hashcat john hydra medusa

Hashcat with GPU support requires separate NVIDIA/AMD drivers. We often use John for offline hash cracking.

Customizing Your Work Environment

A well-organized environment speeds up your work. Every second spent searching for a command is time not spent on the actual test. Let's configure:

Bash Aliases and Functions

Add to your ~/.bashrc:

alias nmapquick='nmap -sV -T4 -Pn'
alias dirbgob='gobuster dir -u'
alias scanweb='nmap -p80,443 -sV --script=http-enum'

function mktestdir() {
    mkdir -p ~/tests/$1/{recon,exploit,evidence,report}
    echo "Directory created: ~/tests/$1"
}

Then run source ~/.bashrc.

Custom Prompt

Show IP and current directory:

export PS1='\[\033[01;31m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\$ '

# Get active IP
export IP=$(ip -4 addr show eth0 | grep -oP '(?<=inet\s)\d+(\.\d+){3}')

Colorized nmap Output with Clean Port Listing

Add a script to extract open ports cleanly:

function nmap_ports() {
    nmap -p- --min-rate=1000 $1 | grep ^[0-9] | cut -d'/' -f1 | tr '\n' ',' | sed 's/,$//'
}

Automation and Reproducibility

A professional penetration test must be reproducible. Use scripts to log every action and save outputs. We, at Meteora Web, built a pipeline that starts with a single command and produces a baseline report.

Quick Setup Script

Save this as setup-pt-env.sh and make it executable:

#!/bin/bash
# Quick PT environment setup for a target

TARGET=$1
mkdir -p ~/tests/$TARGET/{recon,exploit,evidence,report}

cd ~/tests/$TARGET

echo "Running initial NMAP scan..."
nmap -sV -sC -O $TARGET -oA recon/nmap_initial

echo "Running dirb for directory discovery..."
# Use rockyou wordlist if available, otherwise default
dirb http://$TARGET /usr/share/wordlists/dirb/common.txt -o recon/dirb_scan.txt 2>/dev/null

echo "Setup complete for $TARGET. Output in ~/tests/$TARGET/recon/"

Run: ./setup-pt-env.sh 192.168.1.100

Versioning with Git

Initialize a git repository inside the test directory to track changes and maintain history:

cd ~/tests/$TARGET
git init
git add .
git commit -m "Initial recon phase"

Note-Taking and Reporting

A penetration test without notes is like an e-commerce store without tracking: you have no idea what worked and what didn't. We use CherryTree (hierarchical) or Joplin (markdown with sync). For quick terminal session logging, ttyrec records everything.

sudo apt install -y cherrytree ttyrec

Create a structured notes file for each test: scope, findings, commands run, vulnerabilities found, exploit commands. At the end, export to PDF with pandoc.

In Summary — What to Do Now

  1. Choose your installation method based on scenario: VM for flexibility, bare metal for power, live USB for portability.
  2. Harden immediately: change passwords, update everything, enable the firewall.
  3. Install only the tools you need for the type of test (web, network, post-exploitation).
  4. Customize your environment with aliases, functions, and a prompt to speed up your workflow.
  5. Automate the initial setup with scripts that create directories and run basic scans.
  6. Log everything with structured notes and versioning.

You don't need a $10,000 server to do professional penetration testing. With Kali Linux configured properly, you have everything you need. But remember: poorly spent time on setup is money wasted. We see it every day in our clients' projects — companies that invest in security testing but neglect the working environment. Start on the right foot.

If you want to dive deeper into system security, check our guide on Phishing and Social Engineering and AWS IAM privilege management.

Sponsored Protocol

Ing. Calogero Bono

> AUTHOR_EXTRACTED

Ing. Calogero Bono

Co-founder di Meteora Web. Ingegnere informatico, sviluppo ecosistemi digitali ad alte prestazioni. AI, automazione, SEO tecnica e infrastrutture web. Scrivo di tecnologia per rendere complesso… semplice.

[ Read Full Dossier ]

Hai bisogno di applicare questa strategia?

Esegui il protocollo di contatto per iniziare un progetto con noi.

> INIZIA_PROGETTO

Sponsored

> MW_JOURNAL

> READ_ALL()