This guide is for defenders and authorised testing only: Kali Linux puts several hundred offensive security tools on one machine, and an unmanaged Kali host is both a legal liability and a security risk. It covers what Kali is, how to choose an installation option, how to keep a testing environment isolated, verified and up to date, and how to govern the use of a testing distribution inside an organisation. It also explains what a blue team should expect to see when Kali-based testing is pointed at its estate. It is written for security managers, internal test teams and SOC leads.
Key takeaways
- Authorisation comes before installation. Using these tools against systems without written permission can be an offence under the Computer Misuse Act 1990 and equivalent laws; a signed scope and rules of engagement are the control that makes testing lawful.
- Kali is a specialist tool, not a desktop. The Kali project itself says it is not intended for general-purpose use or for people learning Linux, and it advises first-time users to start in a virtual machine.
- Verify the image, every time. Download only from kali.org, check the SHA256 value and verify the GPG-signed checksum file before a testing host is built.
- Isolate the lab and the data. Test hosts hold credentials, scan output and client findings; keep them off production networks except for an approved test window, and encrypt and retire the data on a schedule.
- Treat a test as a detection exercise too. Every authorised test is a chance to check that scanning, brute force and tool use show up in the SOC, and to record what did not.
What the tool does
Kali Linux is an open-source, Debian-based Linux distribution for penetration testing and security auditing, formerly known as BackTrack Linux. It is one of OffSec's community projects, it is free of charge and its source is published in a public Git tree. It runs on x86-64 hardware, ARM single-board computers, mobile devices (NetHunter), cloud images, containers and Windows Subsystem for Linux.
Several design choices matter to a defender building a controlled environment:
- Network services off by default: systemd hooks disable network services so that installed packages do not expose listeners unexpectedly, and Bluetooth is blocklisted by default.
- Non-root default user: since the 2020.1 release Kali creates a standard user instead of running everything as root, which reduces the damage from a mistake or a compromised browser session.
- Small, signed repository set: packages come from a deliberately minimal set of Kali sources signed with the Kali archive key. The project warns that adding untested repositories or PPAs can break the system and does not support them.
- Metapackages: tools are grouped so a host only carries what an engagement needs.
kali-linux-coreis the base,kali-linux-headlesshas no desktop,kali-linux-defaultmatches the desktop images andkali-linux-everythinginstalls every tool. Category packages (kali-tools-*) cover areas such as vulnerability assessment, web, wireless, forensics, reverse engineering and reporting. - Kali Purple: introduced as a technical preview in Kali 2023.1, a defensive edition whose menu is organised by the NIST CSF functions (Identify, Protect, Detect, Respond, Recover).
Defender use cases
Kali is most useful to a defensive organisation as an assurance platform: it lets an internal team test whether controls work, under authority, before an adversary does. The NCSC describes penetration testing as assurance over your vulnerability management process, much like an external audit, rather than the primary way to find vulnerabilities.
| Use case | Who runs it | What it proves | Related NHIMG guide |
|---|---|---|---|
| Authorised internal or external penetration test | Internal test team or contracted testers under a signed scope | Whether known weaknesses are exploitable in your configuration | Penetration Testing Guide |
| Validating vulnerability scanner coverage | Vulnerability management team | Whether a second view finds services or hosts your scanner misses | Vulnerability Scanning Guide |
| Purple team exercises | Red and blue teams together | Whether specific ATT&CK techniques are logged, alerted and triaged | Purple Teaming Guide |
| Red team operations | Specialist team under rules of engagement | Whether detection and response hold against a realistic scenario | Red Teaming Guide |
| Training and certification practice | Staff in an isolated lab | Skills, using deliberately vulnerable targets only | Building a Cybersecurity Home Lab Guide |
| Forensic and reverse engineering support | DFIR analysts | Uses the forensics and reverse engineering tool sets on evidence copies | Digital Forensics (DFIR) Guide |
Authorisation and legal requirements
The tools are lawful to own; using them against systems you are not authorised to test is not. In the UK the Computer Misuse Act 1990 makes unauthorised access an offence (section 1), adds aggravated offences for access with intent to commit further offences (section 2), unauthorised acts that impair a computer (section 3) and acts causing serious damage (section 3ZA), and section 3A covers making, supplying or obtaining articles for use in those offences. Other jurisdictions have equivalents, such as the US Computer Fraud and Abuse Act. Testers working for a client also need that client to own, or have permission to authorise testing of, every in-scope asset, which matters for cloud and SaaS services run by third parties.
- Written scope: the NCSC lists the scoping output as technical boundaries, test types, timeframe and effort, scenarios, team requirements, compliance and legal requirements, reporting requirements and time constraints. See the Penetration Test Scoping Checklist.
- Rules of engagement: named contacts, testing windows, prohibited actions, stop conditions and how evidence and credentials are handled. See the Red Team Rules of Engagement Template.
- A reachable technical contact: the NCSC advises keeping a technical point of contact available at short notice during testing, because testers cannot fully rule out unexpected reactions in production systems.
- Out-of-scope discoveries: if testers find a component outside scope that affects an in-scope system, the risk owner decides whether to extend scope or record the exclusion as a limitation. Testers do not decide on their own.
- Qualified testers: UK government bodies are advised to use CHECK scheme companies; other organisations commonly ask for recognised industry accreditation. See the Penetration Testing Provider Buyer's Guide.
Deployment and safe use
Choosing an installation option
| Option | Best for | Main risks | Isolation notes |
|---|---|---|---|
| Virtual machine | Most internal teams, training, first use (the Kali project's own advice) | Shared clipboard and folders leak data to the host | Snapshots allow a clean state per engagement; use host-only or dedicated virtual networks for labs |
| Bare metal laptop | On-site tests needing wireless hardware or full performance | Device loss exposes client data and credentials | Full disk encryption, a dedicated asset tag, no personal use |
| Live USB | Short, ad hoc assessments from a known image | Persistence options can store data unencrypted | Rebuild from a verified image each time |
| Cloud image (AWS, Azure, Linode) | External perimeter testing from a fixed source address | Cloud provider testing policies, exposed management ports, shared tenancy of test data | Restrict inbound access to the tester's address, tear down after the test, tell the client the source IP |
| Container (Docker) or WSL | Running a few tools inside an existing workstation | Weak separation from the corporate host and its EDR; tools may trip endpoint controls | Use only on approved test workstations, never a standard corporate build |
| ARM and NetHunter | Drop boxes and mobile assessments in physical or wireless tests | Device left on a client network, unclear chain of custody | Inventory every device, record placement and retrieval |
A phased rollout for an internal test capability
- Approve the capability: a short policy naming who may hold testing tools, on which devices, and the sign-off needed before any test against production. Map it to NIST SP 800-53 CA-8 (Penetration Testing) and CM-11 (User-installed Software).
- Build a golden image: download from kali.org over TLS, check the SHA256 value and verify the GPG signature on the SHA256SUMS file against the Kali signing key fingerprint published on kali.org. Discard any image that fails. Install only the metapackages the team needs (
kali-linux-headlessorkali-linux-defaultrather than everything), keep the non-root default user and enable full disk encryption. - Choose an update track:
kali-rollingis the default branch most users should run;kali-last-snapshotonly changes at each point release (roughly four a year) and the project calls it the safest option. Do not enable both, and do not use the experimental or bleeding-edge branches on engagement hosts. - Isolate the lab: keep training targets on a separate virtual network or VLAN with no route to production or the internet, and keep engagement hosts on a dedicated test network segment when not in use.
- Pilot with the SOC: run a first internal test with the SOC informed of the window and source addresses, so false positives and missing detections are both recorded.
- Freeze before each engagement: the Kali project advises verifying tools work before an engagement and avoiding updates during one. Snapshot the VM so you can roll back if an update breaks a tool.
- Retire data: after reporting, export findings to the agreed repository, then delete or revert the host so client credentials and output do not persist.
Data handling
- Credentials found during testing: store them encrypted, use them only within scope and report them so the owner rotates them. Captured service account passwords and API keys are non-human identity findings; see the Penetration Testing Guide for reporting.
- Personal data: test output can include personal data from databases or file shares; agree in the scope how it is minimised, stored and deleted.
- Repository hygiene: add software only from official Kali sources. The project does not support PPAs or third-party repositories, and an unvetted package on a host that holds client credentials is a supply chain risk.
Detection and hardening value
Authorised testing only pays off if the blue team learns from it. Kali's tools generate the same telemetry as a real attacker using similar tooling, so each test is a chance to measure detection. The table maps common test activity to the ATT&CK techniques defenders should be able to see and the controls that apply.
| Test activity (authorised) | ATT&CK technique | What defenders should see | Control mapping |
|---|---|---|---|
| External scanning of internet-facing ranges | T1595 Active Scanning | Firewall and WAF logs showing many ports or paths from one source, IDS scan alerts | NIST SP 800-53 RA-5; CSF 2.0 ID.RA-01 |
| Internal service discovery | T1046 Network Service Discovery | East-west connection spikes in NetFlow or NDR, EDR network events from an unexpected host | NIST SP 800-53 CA-8; D3FEND D3-NTA Network Traffic Analysis |
| Password guessing against approved accounts | T1110 Brute Force | Windows Event ID 4625 (failed logon) and 4771 (Kerberos pre-authentication failed) bursts, identity provider sign-in failure alerts, lockouts | CSF 2.0 DE.CM-03; see the Detection Engineering Guide |
| Testing tools placed on a host | T1588.002 Tool (attacker acquiring tools) | EDR detections on known offensive tool signatures; application control blocks | NIST SP 800-53 CM-7, CM-11 |
- Record expected alerts before the test: agree with the SOC which detections should fire, then compare. Missed detections become detection engineering backlog items, not just report footnotes.
- Do not whitelist the tester blindly: blanket exclusions for the tester's source address hide the very behaviour you want to measure and are often forgotten afterwards. Use time-boxed tagging instead.
- Feed findings into improvement: CSF 2.0 ID.IM-02 expects improvements to be identified from security tests and exercises; track them to closure.
Metrics
- Percentage of engagements with signed scope and rules of engagement on file before day one (target 100%).
- Percentage of planned test techniques that produced a SOC alert within the agreed time.
- Mean time from test report to remediation of high findings, against your remediation SLAs.
- Number of testing hosts in inventory with verified image, full disk encryption and current updates.
- Number of tester exclusions left in security tooling more than 7 days after a test window (target zero).
Alternatives
| Option | When it fits | Trade-offs |
|---|---|---|
| Kali Linux | Broad engagements, teams that want a maintained, signed tool collection | Rolling updates can break tools; large attack surface if everything is installed |
| Other security distributions (for example Parrot Security or BlackArch) | Teams with existing skills on those platforms | Different packaging and update models; the same governance applies |
| Hardened standard Linux build with selected tools | Regulated environments wanting a minimal, centrally managed host | More maintenance effort; tools installed outside a curated repository need their own supply chain checks |
| Commercial or managed testing platforms | Organisations that buy testing as a service | Less control over tooling; vendor due diligence and data handling terms matter |
| Kali Purple | Learning defensive tooling organised by CSF function | Released as a technical preview; validate before relying on it |
For small organisations, contracting a qualified provider is usually safer than building an internal capability; for large organisations with a standing test team, a governed internal build with documented images and SOC coordination gives better repeatability. For a wider view of tool choices see the Burp Suite for Authorised Web Testing Guide and the Nmap for Defenders Guide.
Common failure patterns
- Testing on a verbal go-ahead: no signed scope, so a tester touches a third-party system or a host the requester did not own. Get written authorisation from the asset owner every time.
- Unverified images: a Kali image downloaded from a mirror or file share without checking the signed checksums. A tampered testing host is an attacker's ideal foothold.
- Kali as a daily driver: email, browsing and testing on one machine mixes client data with personal risk; the project itself advises against general-purpose use.
- Forgotten cloud hosts and drop boxes: a test instance left running with open management ports, or a device left on a client network after the test.
- Updating mid-engagement: a rolling update breaks a tool on day two; freeze and snapshot before you start.
- Permanent SOC exclusions: tester IP addresses or hosts excluded from alerting and never removed, creating a blind spot a real attacker can use.
Practitioner checklist
- Publish a short policy on who may hold offensive testing tools and on which approved devices.
- Require signed scope and rules of engagement from the asset owner before any test against production.
- Build test hosts only from kali.org images whose SHA256 and GPG signature you have verified.
- Install the smallest metapackage set the work needs, keep the non-root user and encrypt the disk.
- Choose kali-rolling or kali-last-snapshot deliberately, and freeze and snapshot before each engagement.
- Keep training labs on isolated networks with deliberately vulnerable targets only.
- Agree expected detections with the SOC before each test and record which fired.
- Store found credentials encrypted, report them for rotation, and wipe test data after reporting.
- Remove tester exclusions from security tooling when the window closes.
- Inventory every testing laptop, cloud instance and drop box, and review the inventory quarterly.
Standards and references
- Kali Linux: What is Kali Linux?
- Kali Linux: Should I Use Kali Linux?
- Kali Linux: Downloading Official Kali Linux Images
- Kali Linux: Kali Branches
- Kali Linux: Metapackages
- UK legislation: Computer Misuse Act 1990
- NCSC: Penetration Testing
- NIST: SP 800-53 Rev. 5
Related NHI Mgmt Group resources: Penetration Testing Guide · Purple Teaming Guide · Building a Cybersecurity Home Lab Guide · Red Teaming Guide · Ghidra for Malware Analysis Guide