Repository navigation
Kali Toolbox
The toolbox is a plugin-owned Docker container, dsh-redteam-kali, built from
kalilinux/kali-rolling with hardened defaults. The agent installs packages and runs tools inside
it; the host is never modified with apt. Without Docker the executor uses tools already on the
host PATH and the panel marks the degraded mode. The drawer is described in the panel tour.

Every call resolves a runtime before it runs:
-
docker version --format '{{.Server.Version}}'(5 s budget, cached 10 s) decides whether Docker is usable. -
docker inspectclassifies the container:running,stopped,missingorunknown. - A running container wins (
runtime: docker); otherwiseallowHostFallbackruns the call on the host (runtime: host). Install, remove and setup never fall back.
pentest_exec records the runtime on every run, so Activity and the report can tell the two apart.
ensure() is the only creation path. It pulls the image if docker image inspect fails (900 s
budget), starts a stopped container, and creates a missing one with this argv:
docker run -d --name dsh-redteam-kali --hostname dsh-redteam-kali \
--label dsh.redteam=1 --restart unless-stopped \
--cap-drop ALL --cap-add NET_RAW --cap-add NET_ADMIN --cap-add CHOWN \
--cap-add DAC_OVERRIDE --cap-add FOWNER --cap-add FSETID --cap-add SETGID \
--cap-add SETUID --cap-add MKNOD \
--security-opt no-new-privileges=true --init --pids-limit 2048 \
kalilinux/kali-rolling sleep infinity
| Flag | Why |
|---|---|
--label dsh.redteam=1, --restart unless-stopped
|
Marks the container as ours (recreate refuses anything else) and survives a daemon restart. |
--cap-drop ALL |
Removes every capability first. |
Nine --cap-add values |
NET_RAW/NET_ADMIN keep SYN scans, masscan, Metasploit raw sockets and Responder working; the other seven are what apt/dpkg needs in a dropped-capability container. |
--security-opt no-new-privileges=true, --init
|
No privilege gain through setuid; PID 1 reaps orphans. |
--pids-limit 2048 |
Stops a fork bomb from taking the host down. |
--memory, --cpus, --tmpfs
|
Added only when configured; see Configuration. |
The container is never --privileged. It is never recreated implicitly: only the explicit
recreate action (ensure({ recreate: true })) replaces a labeled container, and that discards
installed tools, not engagement state, which never lives in the container.
The catalog is a planning aid, not an allowlist: any Kali package can be installed. It has 47
entries. pentest_tool_inventory reports each entry's installed state against the running
container, so a catalog miss is visible rather than silent.
| Category | Tools |
|---|---|
| Scanning |
nmap, masscan, nuclei, naabu
|
| Recon |
amass, subfinder, httpx, dnsx, katana, gau, gospider, hakrawler
|
| Web |
whatweb, zaproxy, nikto, wpscan, mitmproxy
|
| Exploitation |
sqlmap, metasploit-framework, searchsploit
|
| Fuzzing |
gobuster, ffuf, wfuzz, feroxbuster
|
| Active Directory |
crackmapexec, impacket, responder, certipy, bloodhound-python, enum4linux-ng, evil-winrm, ldapsearch, smbclient, rpcclient
|
| Passwords |
hydra, john, hashcat
|
| Tunneling |
chisel, ligolo-ng
|
| Utilities |
netcat-openbsd, socat, curl, wget, jq
|
| API |
arjun, paramspider
|
| Network | bettercap |
Catalog names are not always binary names; the executor maps them before spawning, so
metasploit-framework runs msfconsole, searchsploit comes from the exploitdb package,
httpx from httpx-toolkit, crackmapexec from netexec (nxc), impacket from
python3-impacket (impacket-secretsdump), ligolo-ng from ligolo-proxy, gau from the
getallurls package (binary getallurls), certipy from certipy-ad, bloodhound-python from
bloodhound.py, ldapsearch from ldap-utils and rpcclient from smbclient. A 127 means
the mapped binary is genuinely absent.
The inventory reports installed state, version, size and source (dpkg, path or catalog) per
entry. Nuclei ships no templates in the apt package: run nuclei -update-templates once (or
pentest_exec({ tool: "nuclei", args: ["-update-templates"] })); templates land in
/root/.local/nuclei-templates (-tl lists them without scanning). pentest_tool_inventory with refresh:true re-queries the container.
-
Set up (
pentest_setup_toolbox, or the drawer button) is idempotent: pull when needed, create or start, runapt-get updatewithDEBIAN_FRONTEND=noninteractive, then sync bundled wordlists. Installing the first tool does the same automatically. -
Search uses
apt-cache searchinside the container (60 s, at most 50 rows, 200-character query cap). It needs the container; in host mode it returns an empty result with a note. -
Install and remove are serialized through one promise chain, because concurrent
apt-getruns would fight over thedpkglock. Each mutation runsapt-get install|remove -y(up to 30 minutes), thenapt-get clean, deletes/var/lib/apt/listsand refreshes the inventory. Remove checksapt-cache rdepends --installedfirst and warns about dependent catalog tools. - Package names must match
^[a-z0-9][a-z0-9+.-]+$; a permission failure returns a hint naming the seven apt capabilities. Nothing here touches the host, and install/remove still require Docker.
wordlists.sync() writes every bundled, uploaded and AI list to containerWordlistDir
(/opt/redteam/wordlists by default) with mkdir -p and tee over docker exec -i, one list per
call with a 60 s budget. No host shell is involved. In host mode the sync is a no-op with a note,
because the lists are already local. See Wordlists.
allowHostFallback defaults to true. In host mode:
- tools already on
PATHrun normally and reportruntime: host; - installation, removal and container setup are refused;
- the Tool manager badge reads
HOST, and the status banner explains the degradation; -
126/127means the binary is missing from the DSH user'sPATH; the plugin never installs host packages.
Set allowHostFallback: false to refuse host execution entirely; pentest_exec then fails with
docker-unavailable instead of silently running elsewhere.
Each run captures stdout and stderr with a 200 KiB cap per stream, exit code, duration, truncation
flag and PID. The budget is execTimeoutMs (15 min) or a smaller per-call timeoutMs, capped at one
hour. Activity rows offer a kill control; the controller tracks child PIDs and sends SIGKILL,
and disposal kills anything left.
docker inspect --format '{{.State.Running}} {{.HostConfig.PidsLimit}}' dsh-redteam-kali
docker inspect --format '{{json .HostConfig.CapAdd}} {{json .HostConfig.SecurityOpt}}' dsh-redteam-kali
docker exec -i dsh-redteam-kali dpkg-query -W -f='${Package} ${Version}\n' nmap
docker exec -i dsh-redteam-kali apt-get updateA container beyond repair can be removed and rebuilt: docker rm -f dsh-redteam-kali, then Set up
Kali container. That discards installed tools; sessions, evidence and reports stay under
$DSH_HOME/redteam/.
- Badge
UNAVAILABLEorHOST: checkdocker infoas the DSH user and the socket permissions. - Setup stalls: pre-pull
kalilinux/kali-rolling; the pull budget is 900 s. -
apt-geterrors: no container egress, a full disk or a stale mirror; runapt-get updatemanually. -
126/127: install the package, or check which binary the catalog name maps to. A permission hint on install means the seven apt/dpkg capabilities are missing fromcapAdd.
See Troubleshooting for the full symptom-to-fix list.
- Configuration — Docker binary, caps and resource limits
- Wordlists — container sync and paths
- Agent tools — the six toolbox tools
- docs/INSTALL.md
- Field manual: toolbox and intel
dsh-redteam is MIT licensed. Use it only against systems you are authorized to test. — Report a vulnerability · Issues
dsh-redteam
Start here
Reference
- Agent tools
- Configuration
- Kali toolbox
- Wordlists
- OSINT
- Web and API testing
- Exploitation loop
- Team and planning
- Evidence and reports
- Scope and safety
- Resources
- Architecture
Operations
Project