Goal. You can build a small, isolated lab you are safe to break, and you know the legal and ethical limits on what you may do.
Why it matters#
You learn defence by watching real behaviour on real systems. Doing that on a work laptop, a family computer or someone else's network can cause damage, break the law or end a career. A lab gives you a place where mistakes cost nothing.
What you will learn#
What a lab is#
A lab is a set of machines used only for practice. Most learners use virtual machines (VMs): computers simulated in software on one physical host. The software that runs them is a hypervisor, such as VirtualBox, VMware Workstation, Hyper-V or KVM. A snapshot saves a VM's state so you can return to it after breaking something.
A first lab is small:
- one Windows VM with Sysmon, the "victim" you watch;
- one place to send and search logs (a SIEM); and
- optionally a Linux VM.
Plan for the host: as a rough guide, 16 GB of memory and 100 GB of free disk are comfortable, and 8 GB is possible with a cloud-hosted SIEM. The step-by-step build is in Minimal detection lab.
Isolation#
Choose each VM's network mode deliberately:
| Mode | The VM can reach | Use it for |
|---|---|---|
| NAT | The internet, your local network and the host | Installing and updating only |
| Bridged | Your real network, as a separate machine | Avoid in a security lab |
| Host-only | The host and other VMs on that network | Forwarding logs to a SIEM on the host |
| Internal | Only other VMs on that internal network | Running tests that must not escape |
These are VirtualBox's names. In Hyper-V, "Internal" also reaches the host; "Private" is the switch for VMs only. Also turn off shared folders, shared clipboard and drag-and-drop before running anything you do not trust. Isolation reduces risk and does not remove it: hypervisors have bugs. Keep real malware samples out of a beginner lab altogether. The stages here do not need them.
Hygiene#
- Use throwaway accounts and passwords that you use nowhere else.
- Never sign in to personal email, banking or work accounts inside the lab.
- Never copy real or work data into it.
- Snapshot before a test, revert after it.
- Download operating systems and tools only from the vendor or project.
- Check licences: Microsoft offers time-limited evaluation editions of Windows, with their own terms.
Cloud labs#
A cloud lab needs a few extra rules: MFA on the account, a budget alert on day one, no management ports open to the whole internet, and delete resources when done. Providers also publish rules on what testing you may run against your own resources; read them.
The law#
In most countries, accessing a computer or account without permission is a crime, even if nothing is damaged and the password was easy. Examples include the Computer Misuse Act in the United Kingdom and the Computer Fraud and Abuse Act in the United States. Intercepting traffic and handling personal data have laws of their own. This is not legal advice. Check the law where you are, and where the system is.
Permission means authorisation from someone entitled to give it, in writing, stating:
- what systems are in scope, and what is not;
- what you may do, and when;
- who to contact if something goes wrong; and
- what happens to any data you see.
"It was only a scan", "the site was already exposed" and "I meant to help" are not authorisation. Owning an account on a service does not let you test the service.
Ethics#
Law is the floor. Good practice also means:
- Do no harm. Prefer the least invasive way to learn something.
- Respect privacy. If you come across personal data, stop looking, do not copy it and tell the right person.
- Report responsibly. If you find a weakness in someone else's system, use their disclosure process or
security.txtfile and do not exploit it to prove a point. - Stay within your remit at work. Having admin rights does not give you a reason to read a colleague's files.
- Be honest about what you did, including mistakes.
Practising on other people's targets#
Training platforms and capture-the-flag events give you systems you are explicitly allowed to attack, within their rules. Read the rules; permission for their machines is not permission for anything else.
Do this#
- Write your lab rules (30 minutes). One page: what machines are in the lab, what network mode each uses, what you will never do, and how you reset it.
- Build one VM (2–3 hours). Install a hypervisor and one VM. Take a clean snapshot. Make a change, revert and confirm it is gone.
- Prove isolation (45 minutes). Switch the VM to an internal or host-only network and show that it cannot reach the internet or your home devices. Record how you checked.
- Draft an authorisation note (30 minutes). Imagine a friend asks you to check their small website. Write what you would need agreed before touching it, and what you would refuse to do.
Then work through the lab safety and legal checklist.
Resources#
Free first
- VirtualBox manual - including the networking modes.
- Windows evaluation editions - Microsoft's time-limited trial images.
- NCSC: vulnerability disclosure toolkit - how responsible reporting works.
- security.txt - the standard file sites use to say how to report.
- Computer Misuse Act 1990 - read the first sections to see how short and broad the offences are.
Paid or needs an account
- Hack The Box and TryHackMe (free account, paid tiers) - authorised practice targets and guided rooms.
Checkpoint#
You are ready to move on when you can:
Go deeper (optional)#
- Threat Emulation starts with concepts and authorisation in more depth.
- Read the code of conduct of a professional body such as ISC2.