Setting up a hacking lab: isolated networks, snapshots, and targets you own

Build a practice lab on one machine: a hypervisor, a host-only network, a vulnerable-by-design target, a monitoring VM, and snapshots so every mistake can be undone.

Lesson 4 of 18 · 14 min read · practice only with authorization

What is an ethical hacking lab?

An ethical hacking lab is an isolated place where failure is expected: virtual machines, a network that does not reach the rest of the house or a workplace, and accounts that exist only there. It is where practice is allowed. It is not permission to point the same activity outward.

Who is affected when a lab is not isolated?

You, and anyone on a network or in an account the lab can still reach. A shared password, a workplace VPN, or a cloud project that also holds real data means a lab mistake is a real incident.

What do you change when you set up a lab?

Use a host-only or otherwise internal network. Use accounts that exist only in the lab, and take a snapshot you can revert. Write down how to tear it down. For a target you do not want to build, use a public range whose rules allow the exercise, and stop at those rules.

Diagram

A single-host lab with nothing exposed

Follow the path. One example at a time.

Step 1 of 4

Hypervisor

VirtualBox, VMware Workstation, Hyper-V, or KVM on a machine with 16 GB of RAM or more.

Illustration: Hypervisor
# Hypervisor
# VirtualBox, VMware Workstation, Hyper-V, or KVM on a
# machine with 16 GB of RAM or more.

The example on the open step is one illustration, or the fix you can paste into an application you own.

What this page is made of

3 pieces. Each one says what fails, who is affected, what you would notice, and what you change.

  1. Isolation first

    What fails
    A vulnerable VM bridged to your home network is a vulnerable machine on your home network.
    Who is affected
    Everyone else on that network, including family devices.
    What you would notice
    The target VM gets an address from your home router.
    What you change
    Use host-only or internal networking and verify from inside the VM that the internet is unreachable.
  2. Snapshots are the undo button

    What fails
    Exercises change targets. Without a snapshot, the next exercise starts from an unknown state.
    Who is affected
    You, when a result cannot be repeated.
    What you would notice
    A target that behaves differently every session.
    What you change
    Snapshot before each exercise and revert afterward. Name snapshots with a date.
  3. Watch your own traffic

    What fails
    A lab without a sensor teaches only the attack side.
    Who is affected
    Future you, who will need to recognize these techniques in real logs.
    What you would notice
    No packet capture or log VM in the lab.
    What you change
    Add a sensor VM with Zeek, Suricata, or Security Onion on the same host-only network.

What to run it on

A laptop or desktop with 16 GB of RAM handles three small VMs; 32 GB is comfortable for a Windows domain lab. Use an SSD. Cloud labs work too, but they cost money and expose a public address, so they need firewall rules and billing alerts before anything vulnerable is started.

Targets that are meant to be tested

Use systems built for practice: OWASP Juice Shop and DVWA for web, Metasploitable for old services, a small Active Directory lab built from evaluation media, and the deliberately vulnerable containers many training courses publish. Download them from the project’s own page and check the hash.

Keep personal accounts, browser profiles, and password managers out of lab VMs. A dedicated browser profile with the testing proxy certificate stays inside the lab.

docker run --rm -p 127.0.0.1:3000:3000 bkimminich/juice-shop
# bound to localhost only; browse http://127.0.0.1:3000

Before the first exercise

Walk the checklist once and write the answers in a lab notebook. It doubles as the scope document for your own lab.

  • Every target on host-only or internal networking
  • Internet unreachable from the target
  • Clean snapshot named and dated
  • Sensor VM capturing
  • Lab notebook with addresses and credentials

Check yourself

Recognition and the fix. Nothing here is a procedure.

1 / 3

Your target VM received 192.168.1.47 from your home router. What is wrong?

Go deeper

Specific techniques, exercises, and glossary cards for this topic.

  1. 01Lab environments you are allowed to breakA lab is an isolated place where failure is expected. Includes the diagram and a defensive fix.
  2. 02Scope, authorization, and the point of the workEthical hacking is defined by permission and purpose. Includes the diagram and a defensive fix.
  3. 03Introduction to ethical hacking: permission, method, and the reportEthical hacking is security testing that an owner asked for in writing. Includes the diagram and a defensive fix.

Exercises

  1. 01Scope deskEight situations. Decide whether the work is in scope, needs a written change, or stops.
  2. 02Terminal mission: Where a /26 endsThe authorization lists a /26, a short range, and one hostname. Check a colleague’s target file against it and find the two addresses that sit just past the boundary.
  3. 03Terminal mission: Scan only what the client signed forRead the authorization, then run a service scan against the three hosts it lists. The lab scanner refuses anything outside scope, just as your own process should.
  4. 04Terminal mission: An address the client no longer ownsThe client’s asset list is from December. Compare it with today’s Elastic IP allocations and CloudTrail to find the address that was released and may now belong to someone else.
  5. 05Terminal mission: Scans the rules of engagement did not allowThe rules of engagement ban brute-force scripts and the fastest timing template. Review the tester’s shell history line by line and list the commands that broke them.