Skip to content

About

πŸ›‘οΈ Kali Linux Complete Setup Script

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

Β 

History

17 Commits

Folders and files

NameName
Last commit message
Last commit date
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸ›‘οΈ Kali Linux Setup Script

Automated, soft-fail / self-healing setup for a Kali (Debian-based) penetration-testing environment. One run installs ~45 offensive-security tools, a modern zsh shell, and an organized workspace β€” without aborting the whole install when a single tool fails.


πŸ“‹ Table of Contents


🎯 Design Philosophy

This script is deliberately soft-fail: there is no set -e. Every individual tool or package install is wrapped so a failure is logged and recorded, then the run continues. At the end you get a structured summary of soft errors and warnings instead of a half-finished system.

Key properties:

  • No fail-fast β€” one broken tool never blocks the other 40+.
  • Self-healing β€” transient failures are retried; apt/dpkg lock waits, dpkg --configure -a, Go/Rust/pipx environment repairs, and systemctl daemon-reload are attempted automatically.
  • Idempotent β€” safe to re-run. Installed tools are skipped, existing repos are git pulled, and an existing .zshrc is backed up before replacement.
  • No system-package breakage β€” Python tooling uses pipx (isolated venvs) or user-managed venvs. The script never runs pip install --break-system-packages.
  • Structured logging β€” everything is timestamped to ~/kali-setup.log, and a colored summary prints at the end.

πŸ”§ Prerequisites

Requirement Detail
OS Kali Linux / Debian-based (Docker repo defaults to the trixie suite, falls back to bookworm)
Privileges Root or sudo (the script re-execs itself via sudo -E if not run as root)
Disk ~20 GB free (SecLists + PayloadsAllTheThings dominate)
Network Stable connection (many tools build from source / clone from GitHub)

πŸš€ Quick Start

git clone https://github.com/PekSec/Kali-Setup.git
cd Kali-Setup
chmod +x kali-setup.sh
sudo ./kali-setup.sh

With a custom CA certificate

Pass a .crt as the first argument; it is installed into the system trust store:

sudo ./kali-setup.sh /path/to/your-ca.crt

The .zshrc in this repo is copied to both the invoking user's home and /root. Keep the script and .zshrc together in the same directory when running.


βš™οΈ Configuration Flags

All are environment variables β€” set them before the command:

Variable Default Effect
DRY_RUN 0 Print every action without executing it.
FORCE_REINSTALL 0 Reinstall tools even if already present.
PENTEST_YEAR current year Year used for the ~/pentests/<year>.NN monthly folders.
DOCKER_DEBIAN_SUITE trixie Debian suite for the Docker apt repo (auto-falls back to bookworm).
APT_INSTALL_RECOMMENDS 1 Set to 0 to add --no-install-recommends.
LOG_FILE ~/kali-setup.log Log destination.

Example β€” preview everything first:

sudo DRY_RUN=1 ./kali-setup.sh

πŸ› οΈ What Gets Installed

Base system & toolchains

Git, curl, wget, vim, jq, fzf, unzip, p7zip Β· modern CLI (bat, fd-find, ripgrep, tmux, btop) Β· build-essential Β· OpenJDK (21, falls back to 17) Β· Node.js 20 Β· Go (golang-go) Β· Rust (rustup) Β· Python (python3-full, pipx) Β· Docker CE + compose plugin Β· eza (apt, cargo fallback).

Security tooling by category

Category Tools
🌐 Web ffuf, httpx, katana, nuclei, dalfox (Go) · feroxbuster (Rust) · XSStrike, Corsy (git clone) · Arjun (pipx) · sqlmap (apt)
πŸ” Recon subfinder, assetfinder, amass, puredns, dnsx, naabu (Go) Β· rustscan (Rust)
πŸ•ΈοΈ Network chisel, ligolo-ng (proxy + agent) (Go) Β· rustcat (Rust)
πŸ”“ Exploit / C2 Sliver (official installer, git-clone fallback) Β· impacket (pipx) Β· metasploit-framework (apt)
🩸 Active Directory Neo4j (apt) Β· BloodHound CE (git clone β†’ docker compose) Β· RustHound (Rust) Β· Certipy, Coercer (pipx)
πŸ” PrivEsc PEASS-ng (linpeas), linux-exploit-suggester (git clone)
πŸ€– Automation AutoRecon (pipx)
πŸ” OSINT sherlock, holehe, h8mail (pipx)
☁️ Cloud / Container trivy (apt / official script) · kube-hunter, ScoutSuite, Prowler (pipx) · CloudFox (Go)
πŸ”§ Misc Ciphey, haiti (pipx) Β· gitleaks (Go) Β· trufflehog (pipx, Go fallback)

Wordlists (git clones into ~/wordlists/)

fuzzdb Β· SecLists Β· PayloadsAllTheThings Β· Default-Accounts-Arsenal

Python repo tools (XSStrike, Corsy): always cloned. The script attempts an isolated pipx install of the repo; if the repo isn't packaged for pipx, dependencies are not installed system-wide. Create a per-tool venv yourself β€” see Post-Installation.


🐚 Shell Environment (zsh)

The .zshrc in this repo is installed for both the user and root.

  • Framework: Oh My Zsh + Powerlevel10k theme
  • Plugins (loaded only if present): git, sudo, fzf, docker, kubectl, zsh-autosuggestions, zsh-history-substring-search, zsh-syntax-highlighting
  • Colors: Dracula palette for syntax highlighting
  • PATH: auto-adds ~/.local/bin, ~/bin, ~/go/bin, ~/.cargo/bin, /usr/local/go/bin (de-duplicated, only existing dirs)
  • Shared root access: the setup writes /root/.zshrc.local, which .zshrc sources, so the root shell also gets the primary user's ~/go/bin, ~/.cargo/bin, and ~/.local/bin on its PATH β€” root can run tools installed under the user without reinstalling them. Any host can drop its own ~/.zshrc.local for machine-local PATH tweaks.
  • History: 50k lines, shared across sessions, dedup + ignore-space

Functions

Function Purpose
update-system apt update / upgrade / autoremove / autoclean
update-tools Reinstall/upgrade all Go, Rust, pipx tools + nuclei templates
update-wordlists git pull every wordlist repo
venv Activate ./venv or ./.venv in the current directory
zsh-healthcheck Print shell info, PATH, and tool-availability report
toolsweb, toolsrecon, toolsnetwork, toolsexploit, toolsad, toolsprivesc, toolsauto, toolsosint, toolscloud, toolsmisc cd into the matching ~/tools/<category>

Aliases (selected)

ls / ll / la / tree     eza with icons (falls back to coreutils ls)
.. ... ....             cd up 1 / 2 / 3 levels
gst gco gp gps ga gc    git status/checkout/pull/push/add/commit (+ more)
dps dpsa di dex dlog    docker ps / images / exec -it / logs (+ compose: dc, dcu, dcud, dcd)
k kgp kgs kgd kl        kubectl get pods/svc/deploy, logs (+ more)
reload-zsh              source ~/.zshrc

πŸ“ Directory Layout

~/
β”œβ”€β”€ go/bin/           Go tools (in PATH)
β”œβ”€β”€ .cargo/bin/       Rust tools (in PATH)
β”œβ”€β”€ .local/bin/       pipx tools (in PATH)
β”œβ”€β”€ wordlists/        fuzzdb, SecLists, PayloadsAllTheThings, Default-Accounts-Arsenal
β”œβ”€β”€ pentests/         Monthly project folders: <YEAR>.01 … <YEAR>.12
└── tools/            Git-cloned tools + generated README.md
    β”œβ”€β”€ web/          XSStrike, Corsy
    β”œβ”€β”€ recon/        (Go tools live in ~/go/bin)
    β”œβ”€β”€ network/      (Go/Rust tools live in PATH)
    β”œβ”€β”€ exploit/      sliver/ (only if the official installer failed)
    β”œβ”€β”€ ad/           BloodHound/ (BloodHound CE β€” docker compose)
    β”œβ”€β”€ privesc/      PEASS-ng, linux-exploit-suggester
    β”œβ”€β”€ automation/   (AutoRecon lives in ~/.local/bin)
    β”œβ”€β”€ osint/        (pipx tools live in PATH)
    β”œβ”€β”€ cloud/        (mixed PATH locations)
    └── misc/         (mixed PATH locations)

Most binaries land in standard bin dirs already on PATH; ~/tools/ holds the repos that must be run in place.


πŸ”„ Post-Installation

After the run, the summary lists manual steps. In short:

1. Start a new login shell β€” needed for the zsh switch, the docker group, and PATH changes from Go/Rust/pipx. Log out and back in.

2. Configure API keys (optional, for fuller results):

$EDITOR ~/.config/subfinder/provider-config.yaml
$EDITOR ~/.config/amass/config.ini

3. BloodHound CE β€” it is now container-based (no npm build):

cd ~/tools/ad/BloodHound
docker compose -f examples/docker-compose/docker-compose.yml up -d   # path may vary by release
docker compose logs bloodhound | grep -i "Initial Password"          # one-time admin password
# open http://localhost:8080 and log in as: admin

Collect data with RustHound (rusthound ...) or SharpHound, then upload the zip in the UI. The bundled Neo4j service (:7474) is only for the legacy BloodHound.

4. XSStrike / Corsy β€” if dependencies were not auto-installed, make a venv yourself:

cd ~/tools/web/XSStrike
python3 -m venv .venv
.venv/bin/pip install -r requirements.txt
.venv/bin/python xsstrike.py

5. Sliver β€” if the official installer failed, the repo was cloned; build with make in ~/tools/exploit/sliver.

6. Smoke test:

httpx -version
nuclei -version
toolsweb          # should cd into ~/tools/web
zsh-healthcheck   # tool-availability overview

πŸ”ƒ Updating

The installed .zshrc provides update helpers:

update-system      # apt update + upgrade + autoremove + autoclean
update-tools       # reinstall/upgrade all Go + Rust + pipx tools, refresh nuclei templates
update-wordlists   # git pull every wordlist repo

Or re-run the setup script β€” it is idempotent and will pull repos / skip satisfied tools. Use FORCE_REINSTALL=1 to rebuild everything.


πŸ› Troubleshooting

Read the log first β€” every action is timestamped there:

grep -E 'ERROR|WARNING' ~/kali-setup.log
tail -n 50 ~/kali-setup.log

The end-of-run summary also lists soft errors and warnings with their return codes and the exact command that failed, so you can re-run just that piece.

"command not found" right after install

You haven't started a new login shell yet. source ~/.zshrc, or log out and back in β€” Go/Rust/pipx bin dirs are only added to PATH by the new .zshrc.

Docker: permission denied

Your session predates the docker group membership. Run newgrp docker or re-login.

Python tool won't run (missing modules)

For XSStrike/Corsy the deps may not have auto-installed (by design β€” no system-package breakage). Create a venv in the tool's folder and pip install -r requirements.txt there. See step 4 above.

A tool failed but the script "finished"

That's the soft-fail design. Check the summary's "Soft errors" section and the log, fix the blocker (often a transient network issue), and re-run β€” completed tools are skipped.

Neo4j not active (verification warning)
sudo systemctl status neo4j
sudo systemctl restart neo4j
sudo journalctl -u neo4j -n 50

Note: BloodHound CE brings its own database container and does not need this Neo4j service.


Generated tool docs are also written to ~/tools/README.md on each run.

About

πŸ›‘οΈ Kali Linux Complete Setup Script

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages