Skip to content
Visual explainer 3h to learn 4 steps

Practice platforms: TryHackMe, HTB, Juice Shop, DVWA

Practise legally on hosted labs and local vulnerable apps you are allowed to test.

By Invicly Tech, , in Ethical Hacking & Penetration Testing. About 9 minutes to read.

Topic 5 of 32

In short

Hosted platforms like TryHackMe and Hack The Box provide legal targets over a VPN, and local apps like OWASP Juice Shop and DVWA run deliberately vulnerable web apps on your own machine. Each has rules you must read and follow.

Explained simply

You do not have to build every target yourself. Practice platforms give you legal machines to attack. TryHackMe teaches step by step with guided rooms. Hack The Box offers harder, more open challenge machines. Both connect you to their private lab network over a VPN, or give you a ready attack machine in the browser.

For web hacking you can run vulnerable apps on your own computer. OWASP Juice Shop is a modern online shop full of security bugs, with a hidden score board that tracks the challenges you solve. DVWA (Damn Vulnerable Web Application) is an older PHP app with clear lessons and a difficulty switch.

The legal rule is simple: you may only attack the targets the platform gives you, during the time it gives you. The VPN connects you to a network with other players too. Attacking them, or the platform itself, breaks the rules and maybe the law.

Each platform has its own rules on sharing answers. For example, Hack The Box allows public write-ups only for retired machines. Read the rules once, and you will avoid getting banned.

Press Play on a diagram to walk through it one step at a time.

ComparePractice options
Hosted (THM/HTB)
  • Connect over VPN
  • Maintained targets
  • Guided and free rooms
  • Follow platform rules
Local (Juice Shop/DVWA)
  • Run on your machine
  • Full control
  • Great for web practice
  • No internet needed
FlowA learning path across platforms
  1. 1
    DVWA on low

    See each bug with source code

  2. 2
    DVWA higher levels

    Learn why partial fixes fail

  3. 3
    Juice Shop

    Modern app, star-rated challenges

  4. 4
    TryHackMe rooms

    Guided network and web labs

  5. 5
    HTB machines

    Open-ended, less guidance

In depth

How the VPN connection works

TryHackMe and Hack The Box give you an OpenVPN configuration file (.ovpn) tied to your account. When you run it, your machine gets a new network interface, usually tun0, with an address inside the platform's lab range. Traffic to lab targets goes through the tunnel; your normal internet traffic does not.

This means your Kali VM is now on a network shared with other users. Keep your own services closed while connected: do not run a test web server on all interfaces or leave weak passwords on your VM. Disconnect the VPN when you are not practising. If you would rather not run a VPN at all, both platforms offer a browser-based attack machine (TryHackMe AttackBox, HTB Pwnbox), with limits on free use.

SequenceConnecting to a hosted lab
Your Kali VM
Platform VPN server
Lab target
  1. 1sudo openvpn user.ovpn
    Your Kali VM to Platform VPN server: sudo openvpn user.ovpn
  2. 2tun0 gets a lab IP address
    Platform VPN server to Your Kali VM: tun0 gets a lab IP address
  3. 3Scan and test the assigned target IP
    Your Kali VM to Lab target: Scan and test the assigned target IP
  4. 4Responses through the tunnel
    Lab target to Your Kali VM: Responses through the tunnel
  5. 5Disconnect when finished
    Your Kali VM to Platform VPN server: Disconnect when finished

Running Juice Shop and DVWA locally

Containers are the easiest way. Juice Shop has an official image: docker run --rm -p 127.0.0.1:3000:3000 bkimminich/juice-shop, then open http://localhost:3000. DVWA ships a compose file in its GitHub repository; docker compose up -d starts it on http://localhost:4280. Log in with admin and password, then click Create / Reset Database on the setup page.

Notice the 127.0.0.1 in the Juice Shop port mapping. Without it, Docker publishes the port on every interface, so anyone on your Wi-Fi could reach your deliberately vulnerable app. Binding to localhost keeps it private. The same lesson applies to real servers: publish only what must be public.

  • Juice Shop: port 3000, score board hidden in the app
  • DVWA: port 4280 with the repo's compose file
  • DVWA security levels: low, medium, high, impossible
  • Bind to 127.0.0.1 so the LAN cannot reach it

Learning from each difficulty level

DVWA's security levels are a great way to learn defence as well as attack. On low, the code has no protection. On medium and high, the developers added partial fixes such as filtering certain characters, which teaches you why blocklists fail. The impossible level shows the correct fix, such as parameterised queries and anti-CSRF tokens. DVWA lets you view the source of each level, so compare them side by side.

Juice Shop works differently: its challenges are rated by stars from 1 to 6 and cover the OWASP Top 10 and more. Its companion book, Pwning OWASP Juice Shop, explains each challenge and the matching fix.

Platform rules worth knowing

All platforms forbid attacking their infrastructure, other users' machines and VPN connections, or anything that is not an assigned target. Most forbid sharing flags (the secret strings that prove you solved a challenge). Hack The Box allows public write-ups only after a machine retires. TryHackMe allows write-ups for many rooms but not for some, so check the room's notes.

Automated tools are allowed against your targets, but heavy brute force or huge scans can slow shared machines for others; be considerate. Finally, a platform account does not give you permission anywhere else. A technique you practised on HTB is still illegal against a real company without authorization.

Learn it in 4 short steps

About 45m each. Track them with a timer in your plan.

  1. 1
    Connect to TryHackMe or HTB VPN~45m
  2. 2
    Run OWASP Juice Shop locally~45m
  3. 3
    Run DVWA in a container~45m
  4. 4
    Read each platform's rules~45m

Key points

  • Hosted platforms give legal targets over a VPN.
  • Juice Shop and DVWA run locally for web practice.
  • Only test the targets each platform provides.
  • Read and follow every platform's rules.

Key terms

Tap a card to flip it. 0/4 known

Examples

Start Juice Shop and find the score board

Step 1: Run the official container bound to localhost. Step 2: Open http://localhost:3000 in your browser. Step 3: Finding the score board is the first challenge. Open your browser's developer tools and look in the main JavaScript file for route names; one of them leads to the score board page. Step 4: Once there, the score board lists all challenges with their difficulty. The defender lesson: hiding a page is not protecting it, because the client code reveals every route.

bash
docker run --rm -d --name juice -p 127.0.0.1:3000:3000 bkimminich/juice-shop
curl -s -o /dev/null -w '%{http_code}\n' http://localhost:3000   # 200
# stop it when done
docker stop juice

Connect to TryHackMe and check the route

Step 1: Download your .ovpn file from your account's access page. Step 2: Start OpenVPN in Kali. Step 3: In a second terminal, check that tun0 exists and has an address. Step 4: Deploy a room's machine and note its IP. Step 5: Check that the route to that IP goes through tun0 before scanning it. If it does not, your traffic would go out of your normal internet connection to an address that is not your target.

bash
sudo openvpn ~/Downloads/yourname.ovpn
# in another terminal:
ip -br addr show tun0
ip route get 10.10.123.45      # replace with your target IP
# expect: ... dev tun0 ...
ping -c 2 10.10.123.45

Quick reference

  • Only test the target IPs the platform assigns to you
  • sudo openvpn file.ovpn connects; tun0 is the lab interface
  • ip route get TARGET_IP should show dev tun0 before you scan
  • docker run --rm -p 127.0.0.1:3000:3000 bkimminich/juice-shop
  • DVWA default login: admin / password, then Create / Reset Database
  • HTB: public write-ups only for retired machines
  • Disconnect the VPN when you stop practising

Quick quiz

Pick an answer to see if you're right and why.

Question 1

1Why bind Juice Shop to 127.0.0.1 instead of publishing the port on all interfaces?

Question 2

2While on the HTB VPN, you see another player's IP in the same range. May you scan it?

Question 3

3What does DVWA's impossible security level show you?

Question 4

4On Hack The Box, when may you publish a write-up for a machine?

0/4 answered

Practice exercises

Try each one yourself first. Use the hint if you get stuck, then compare with the solution.

  1. Exercise 1easy

    Run Juice Shop locally and prove it is not reachable from another device on your network.

  2. Exercise 2medium

    Start DVWA with its official compose file, log in, reset the database and set the security level to low.

  3. Exercise 3hard

    Pick one DVWA module (for example SQL Injection) and compare the source of the low and impossible levels. Write down the exact change that fixes the bug.

Check yourself

Answer in your head, reveal, then be honest with yourself.

Feel confident about this topic?

Frequently asked questions

TryHackMe or Hack The Box: which should a beginner start with?
Most beginners start with TryHackMe because its rooms explain each step. Hack The Box suits people who want less guidance; its Academy and Starting Point offer a gentler path in.
Are TryHackMe and Hack The Box free?
Both have free content. Paid plans unlock more machines, faster browser attack boxes and learning paths.
Is it legal to use Kali tools on these platforms?
Yes, against the targets they assign you. The platforms give you permission for those machines only, under their terms of service.
Why does DVWA say the database is not set up?
On first start you must click Create / Reset Database on the setup page. After that, log in again with admin and password.

Go deeper

ShareXLinkedInWhatsApp