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.
- Author: BarΔ±Ε PEKALP
- Version: 3.0 (soft-fail / self-healing refactor)
- Repo: https://github.com/PekSec/Kali-Setup
- Design Philosophy
- Prerequisites
- Quick Start
- Configuration Flags
- What Gets Installed
- Shell Environment (zsh)
- Directory Layout
- Post-Installation
- Updating
- Troubleshooting
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, andsystemctl daemon-reloadare attempted automatically. - Idempotent β safe to re-run. Installed tools are skipped, existing repos are
git pulled, and an existing.zshrcis backed up before replacement. - No system-package breakage β Python tooling uses
pipx(isolated venvs) or user-managed venvs. The script never runspip install --break-system-packages. - Structured logging β everything is timestamped to
~/kali-setup.log, and a colored summary prints at the end.
| 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) |
git clone https://github.com/PekSec/Kali-Setup.git
cd Kali-Setup
chmod +x kali-setup.sh
sudo ./kali-setup.shPass a .crt as the first argument; it is installed into the system trust store:
sudo ./kali-setup.sh /path/to/your-ca.crtThe
.zshrcin this repo is copied to both the invoking user's home and/root. Keep the script and.zshrctogether in the same directory when running.
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.shGit, 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).
| 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) |
fuzzdb Β· SecLists Β· PayloadsAllTheThings Β· Default-Accounts-Arsenal
Python repo tools (XSStrike, Corsy): always cloned. The script attempts an isolated
pipx installof 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.
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.zshrcsources, so the root shell also gets the primary user's~/go/bin,~/.cargo/bin, and~/.local/binon its PATH β root can run tools installed under the user without reinstalling them. Any host can drop its own~/.zshrc.localfor machine-local PATH tweaks. - History: 50k lines, shared across sessions, dedup + ignore-space
| 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> |
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
~/
βββ 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.
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.ini3. 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: adminCollect 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.py5. 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 overviewThe 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 repoOr re-run the setup script β it is idempotent and will pull repos / skip satisfied tools.
Use FORCE_REINSTALL=1 to rebuild everything.
Read the log first β every action is timestamped there:
grep -E 'ERROR|WARNING' ~/kali-setup.log
tail -n 50 ~/kali-setup.logThe 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 50Note: 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.