Before you hack anything, you need a proper workspace. A good lab saves hours of pain later.
Before you hack anything, you need a proper workspace. A good lab saves hours of pain later.
If you're here, you probably think hacking is cool. You're right — it is. But before you touch a single tool, let's talk about what you're actually getting into.
Penetration testing (pentesting) is the practice of authorized simulated attacks against computer systems, networks, and web applications. The goal is simple: find vulnerabilities before real attackers do, then help the organization fix them.
Think of it like this — a company hires you to break into their building. Not because they want to be robbed, but because they want to know if their locks, cameras, and alarms actually work. You test the defenses, write a report about what you found, and they fix the weaknesses. That's pentesting, but for computers.
The difference between a pentester and a criminal is one thing: authorization.
You're learning skills that can cause real damage if misused. The cybersecurity community takes ethics seriously — and so should you. Everything you learn here is meant to help you protect systems, not attack them. The best hackers in the world work on the defensive side, making the internet safer for everyone.
🧭 Remember: With great power comes great responsibility. Seriously. The skills you're about to learn are powerful. Use them to build a career, earn bug bounties, protect organizations, and compete in CTFs — never to harm others.
A typical penetration test follows a methodology. Here's the high-level flow of what you'll be learning throughout this path:
Learning these skills opens doors to multiple career paths:
💡 Pro tip: You don't need a degree to break into cybersecurity. Many top pentesters are self-taught. What matters is demonstrable skill — CTF rankings, bug bounty findings, certifications (OSCP, CPTS, CEH), a portfolio of writeups, and a GitHub full of tools. This learning path is designed to build exactly that kind of portfolio.
Kali Linux is the industry-standard penetration testing distribution. It comes pre-loaded with hundreds of tools. You have three main options for running it:
# Minimum specs for a Kali VM
RAM: 2 GB minimum, 4 GB recommended (8 GB ideal for Burp + browser + tools)
CPU: 2 cores (4 is better)
Disk: 20 GB minimum, 80 GB recommended (you'll fill 40 GB fast with wordlists and tools)
Network: NAT (for internet) + Host-Only (for lab networks)
Display: Enable 3D acceleration, 128 MB video RAM
💡 Pro tip: Download the official Kali VM image from kali.org/get-kali/#kali-virtual-machines instead of installing from the ISO. It's pre-configured with VMware Tools or VirtualBox Guest Additions — saves 30 minutes of setup.
Your VM's network adapter settings control how it connects to networks. Getting this wrong is a common source of "why can't I reach the target?" frustration. Here's what each mode does:
┌─────────────────────────────────────────────────────────────────────┐
│ VM NETWORK MODES │
├──────────────┬──────────────────────────────────────────────────────┤
│ NAT │ VM shares host's IP. VM → internet works. │
│ │ Host → VM doesn't work without port forwarding. │
│ │ Other VMs can't see this VM. │
│ │ USE FOR: General internet access, updates. │
├──────────────┼──────────────────────────────────────────────────────┤
│ Bridged │ VM gets its own IP on your real network. │
│ │ Appears as a separate device on your LAN. │
│ │ USE FOR: When target is on your local network. │
├──────────────┼──────────────────────────────────────────────────────┤
│ Host-Only │ Private network between host and VMs only. │
│ │ No internet access. Isolated. │
│ │ USE FOR: Lab networks, VM-to-VM communication. │
├──────────────┼──────────────────────────────────────────────────────┤
│ NAT Network │ Like NAT, but VMs on the same NAT Network can │
│ │ talk to each other. Best of both worlds. │
│ │ USE FOR: Multi-VM labs that need internet. │
└──────────────┴──────────────────────────────────────────────────────┘
Typical CTF setup: Use NAT for your main adapter (so you can update tools and connect to VPN), then add a second adapter as Host-Only if you need to communicate with other local VMs. For HackTheBox/TryHackMe, NAT is usually all you need — the OpenVPN tunnel creates a virtual adapter that routes to the lab network through your internet connection.
Before you start modifying your Kali VM, take a snapshot. Snapshots save the exact state of your VM so you can roll back if something breaks. Think of them as save points in a video game.
# Take snapshots at these milestones:
1. "Fresh Install" → Right after initial setup + updates
2. "Tools Installed" → After installing your extra tools
3. "Pre-Engagement" → Before starting a new CTF box or assessment
# In VirtualBox: Machine → Take Snapshot (Host+T, default Host key is Right Ctrl)
# In VMware: VM → Snapshot → Take Snapshot
⚠️ Warning: Snapshots consume disk space — each one stores the delta from the previous state. If you have 5 snapshots and your VM is heavily modified, that's a lot of extra disk. Delete old snapshots you don't need. Keep 2-3 max.
┌─────────────────────────────────────────────────────────────────────┐
│ YOUR PENTESTING LAB │
│ │
│ ┌───────────────┐ ┌──────────────────────────────────┐ │
│ │ Your Host OS │ │ Kali Linux VM │ │
│ │ (Windows/Mac)│◄──────►│ 192.168.56.2 (Host-Only) │ │
│ │ │NAT │ 10.0.2.15 (NAT — internet) │ │
│ └───────┬───────┘ │ 10.10.14.X (VPN — HTB labs) │ │
│ │ └──────────┬───────────────────────┘ │
│ │ │ OpenVPN tunnel │
│ ┌───────┴───────┐ ┌──────────┴───────────────────────┐ │
│ │ Internet │ │ HTB/THM Lab Network │ │
│ │ │────────│ 10.10.10.0/24 (target machines) │ │
│ └───────────────┘ └──────────────────────────────────┘ │
│ │
│ Adapter 1: NAT ──────────► Internet access (updates, VPN) │
│ Adapter 2: Host-Only ───► Talk to host + other local VMs │
│ tun0: VPN tunnel ──► CTF lab network (HTB/THM targets) │
└─────────────────────────────────────────────────────────────────────┘
Kali Linux ships with several hundred security tools pre-installed (the exact count varies by installation profile and release). You don't need to install everything manually. Here are the categories you'll use most, with the key tools in each:
nmap, enum4linux, dnsenum, whois, theharvesterburpsuite, nikto, gobuster, sqlmap, wfuzzjohn, hashcat, hydra, wordlists (in /usr/share/wordlists/)metasploit-framework, searchsploit, msfvenomaircrack-ng, reaver, wifiteautopsy, binwalk, foremost, volatilityghidra, radare2, gdb (available via sudo apt install or the kali-tools-reverse-engineering metapackage if not pre-installed)wireshark, tcpdump, netcat, socat💡 Don't get overwhelmed. You won't use most of these for months. Start withnmap,gobuster,burpsuite, andnetcat. Add tools to your workflow as you need them — learning one tool deeply beats knowing 20 superficially.
Wordlists are critical for brute-forcing. Kali includes SecLists if you install it:
# Kali's built-in wordlist
ls /usr/share/wordlists/rockyou.txt.gz
gunzip /usr/share/wordlists/rockyou.txt.gz # Unzip it first!
# Install SecLists — the gold standard collection
sudo apt install seclists -y
ls /usr/share/seclists/
# Discovery/ Fuzzing/ Passwords/ Payloads/ Pattern-Matching/ Usernames/
Fresh Kali install? Do these things immediately. The sudo command runs things as root (the system administrator) — you'll see it a lot because installing software and changing system settings requires admin privileges.
# 1. Update everything first
# apt is Kali's package manager — it downloads and installs software.
# 'update' refreshes the list of available packages,
# 'full-upgrade' installs the latest versions of everything.
sudo apt update && sudo apt full-upgrade -y
# 2. Install additional tools not included by default
# seclists: huge collection of wordlists for fuzzing and brute-forcing
# gobuster/feroxbuster: tools that discover hidden directories on web servers
# bloodhound + neo4j: maps Active Directory networks to find attack paths
# pipx: installs Python tools in isolated environments (avoids dependency conflicts)
# jq: parses JSON output from APIs and tools
# tmux: terminal multiplexer — run multiple terminals in one window
# flameshot: screenshot tool for documenting your work
# cherrytree: note-taking app designed for pentesting
sudo apt install -y seclists gobuster feroxbuster bloodhound neo4j \
pipx golang-go jq tmux flameshot cherrytree
# 3. Install Python tools via pipx (isolated environments)
# impacket: collection of Python tools for attacking Windows/AD networks
# certipy-ad: exploits Active Directory Certificate Services misconfigurations
pipx install impacket
pipx install certipy-ad
pipx install bloodhound
# 4. Clone essential GitHub repos to /opt
# These are collections of scripts and payloads you'll use during pentests:
# PEASS-ng: automated privilege escalation scanners (LinPEAS, WinPEAS)
# nishang: PowerShell scripts for Windows exploitation
# PowerSploit: another PowerShell offensive toolkit
# PayloadsAllTheThings: cheat sheets and payloads for every vulnerability type
sudo mkdir -p /opt/tools && cd /opt/tools
sudo git clone https://github.com/peass-ng/PEASS-ng.git
sudo git clone https://github.com/samratashok/nishang.git
sudo git clone https://github.com/PowerShellMafia/PowerSploit.git
sudo git clone https://github.com/swisskyrepo/PayloadsAllTheThings.git
# 5. Configure your terminal
# Add to ~/.zshrc:
alias ll='ls -la'
alias serve='python3 -m http.server 8888'
alias myip='ip addr show tun0 | grep "inet " | awk "{print \$2}" | cut -d/ -f1'
export PATH="$HOME/.local/bin:$PATH"
# 6. Set up Burp Suite certificate for browser
# Burp Suite is a web proxy — it sits between your browser and
# the target, letting you intercept, inspect, and modify HTTP
# requests. Installing its CA certificate lets Burp decrypt HTTPS
# traffic without your browser throwing security warnings.
# Open Burp → Proxy → Options → Import/Export CA Certificate
# Install in Firefox: Settings → Privacy → Certificates → Import
You've got your Kali VM ready. But where do you actually practice hacking legally? There are several platforms designed specifically for this. Here's everything you need to know about the big ones.
What it is: TryHackMe is a guided, browser-based cybersecurity training platform. Think of it as Duolingo for hacking — it breaks complex topics into structured "rooms" with step-by-step instructions, questions to answer, and virtual machines you can access directly from your browser. It was founded in 2018 by Ashu Savani, and has grown into one of the most popular platforms for learning cybersecurity from scratch.
How to sign up: Go to tryhackme.com, click "Get Started," and create a free account with your email. That's it — no invite code, no challenge to solve. You can start learning within minutes.
Free vs Premium ($14/month, or ~$10/month billed annually):
Key features that make THM special:
Best for: Absolute beginners, people who want structure and hand-holding, anyone who doesn't want to set up a VM right away.
Rooms to start with (all free):
Network access: You can either use the in-browser AttackBox or download a .ovpn file to connect from your own Kali VM (more on VPN setup below). For beginners, the AttackBox removes all friction — for serious work, you'll want your own VM.
💡 Pro tip: Start with the "Pre-Security" learning path if you have zero technical background. If you're somewhat comfortable with computers and want to jump into hacking faster, go straight to the "Complete Beginner" path. Both are excellent.
What it is: HackTheBox is a more advanced, competition-style cybersecurity platform. Unlike TryHackMe, there's minimal hand-holding — you get vulnerable machines ("boxes") and it's up to you to figure out how to hack them. Each box has a user flag (proves you got initial access) and a root flag (proves you escalated to administrator). Finding both flags proves you've fully compromised the machine.
HTB was founded in 2017 by Haris Pylarinos. It started as a side project and grew into the go-to platform for serious CTF players and OSCP prep. Fun fact: it used to require solving a hacking challenge just to create an account — that's no longer the case, but it tells you something about the culture.
How to sign up: Go to hackthebox.com and create an account. It's straightforward now — no invite challenge required.
Free vs VIP ($14/month) vs VIP+ ($20/month):
Key features:
HTB Academy (separate product): HTB also has an "Academy" — structured courses similar to THM but with HTB's depth and rigor. Some modules are free, others require "cubes" (their currency, earned or purchased). Think of it as the educational wing of HTB. Particularly good for learning specific techniques in depth.
Best for: People who want to develop independent problem-solving skills, CTF competitors, OSCP preparation, anyone who's outgrown guided content.
Difficulty: Machines are rated Easy / Medium / Hard / Insane. Start with Easy and Starting Point. Don't touch Medium until you've done 5-10 Easy boxes comfortably. Hard and Insane are for experienced players.
Community: Active forums and Discord, official writeups released after machine retirement, Ippsec's YouTube walkthroughs (watch these — they're gold), community blogs and writeups.
💡 Pro tip: When you're stuck on an HTB box, don't immediately look at the writeup. Spend at least 2-3 hours struggling. Google specific error messages. Try different approaches. The struggle is where the learning happens. When you DO look at a writeup, read Ippsec's video for that box — he explains his thought process, not just the commands.
Both platforms are excellent, and most people use both at different stages of their journey:
THM and HTB are the big two, but there are other excellent platforms for specific needs:
Still not sure where to begin? Here's a quick guide based on your background:
🚀 Our recommendation: Start with TryHackMe to build foundations, then move to HackTheBox once you can comfortably navigate Linux, understand basic networking, and know what port scanning is. Use PortSwigger alongside either platform for web security depth. This isn't a competition — use whatever helps you learn.
A VPN (Virtual Private Network) creates an encrypted tunnel between your machine and a remote network, as if you plugged a virtual cable directly into it. CTF platforms like HackTheBox and TryHackMe host their vulnerable machines on private lab networks that aren't on the public internet — a VPN is how you connect to those networks so you can interact with the target machines.
OpenVPN is the VPN software that creates this tunnel. When you sign up for HTB or THM, you download a .ovpn file — this is a configuration file containing the server address, encryption keys, and connection settings that OpenVPN needs to establish the tunnel. Think of it like a key card that grants you access to the lab network.
# Download your .ovpn file from the platform dashboard
# Connect to HackTheBox
# sudo is required because OpenVPN needs to create a virtual
# network interface (tun0) — that requires root privileges
sudo openvpn ~/Downloads/lab_username.ovpn
# Verify connection — you should get a 10.10.14.x address
# tun0 is the virtual network interface that OpenVPN creates.
# It's your "identity" on the lab network — this IP is what
# target machines see when you interact with them.
ip addr show tun0
# Test connectivity to a machine
ping 10.10.10.2
# Pro tip: Run VPN in background with tmux
tmux new -s vpn
sudo openvpn ~/htb/lab.ovpn
# Ctrl+B, D to detach — VPN stays running
# tmux attach -t vpn to reconnect
⚠️ Important: Never connect to HTB/THM VPN from your host machine or a work computer. Always use your Kali VM. Other players on the same VPN network can potentially see your traffic. Treat the lab network as hostile.
Organization matters. When you've done 50 boxes, you'll be grateful for a clean structure. Here's what works:
~/htb/
├── boxes/
│ ├── easy/
│ │ ├── lame/
│ │ │ ├── nmap/ # scan results
│ │ │ ├── exploits/ # scripts, payloads
│ │ │ ├── loot/ # creds, hashes, flags
│ │ │ └── notes.md # your walkthrough
│ │ └── pilgrimage/
│ └── medium/
│ └── sandworm/
├── thm/ # TryHackMe rooms
├── wordlists/ # custom wordlists
└── vpn/
└── lab.ovpn
/opt/tools/ # shared tools (git repos)
├── PEASS-ng/
├── PayloadsAllTheThings/
├── nishang/
└── PowerSploit/
# Quick setup script
mkdir -p ~/htb/{boxes/{easy,medium,hard},thm,wordlists,vpn}
mkdir -p /opt/tools
# Create a new box workspace quickly:
mkbox() {
mkdir -p ~/htb/boxes/$1/{nmap,exploits,loot}
echo "# $1" > ~/htb/boxes/$1/notes.md
cd ~/htb/boxes/$1
echo "[+] Workspace ready: $(pwd)"
}
Good notes are the difference between finishing a box in 2 hours and spending 8 hours retracing your steps. Pick one system and stick with it:
vim or nano with .md files in each box directorygrep to search across all notes instantly# Template: notes.md
## Box Name — Difficulty — OS
### Recon
- IP: 10.10.10.x
- Open ports: 22, 80, 443
- Hostname: target.htb
### Enumeration
- [paste interesting findings]
### Foothold
- Vulnerability: [what you exploited]
- Payload: [exact command]
### Privilege Escalation
- Vector: [SUID, sudo, kernel, etc.]
- Command: [exact command]
### Flags
- user.txt: [hash]
- root.txt: [hash]
### Lessons Learned
- [What was new? What would you do differently?]
You'll constantly juggle multiple terminals: one for VPN, one for listeners, one for exploitation, one for enumeration. tmux lets you manage all of them in a single window.
# Start a new session
tmux new -s htb
# Key bindings (Ctrl+B is the prefix)
Ctrl+B, C # Create new window
Ctrl+B, N # Next window
Ctrl+B, P # Previous window
Ctrl+B, % # Split pane vertically
Ctrl+B, " # Split pane horizontally
Ctrl+B, Arrow # Switch between panes
Ctrl+B, D # Detach (session keeps running!)
tmux attach -t htb # Reattach later
# Typical HTB tmux layout:
# Window 0: VPN connection
# Window 1: Nmap / enumeration
# Window 2: Exploit / shell
# Window 3: Notes (vim notes.md)
# Window 4: Listener (nc -lvnp 9001)
sudo apt update refreshes the package lists from repositories. This should always be followed by sudo apt full-upgrade -y to install all available updates. Running outdated tools can mean missing features or having known bugs.CTF platforms are great, but sometimes you want to practice offline, test without VPN lag, or build a specific scenario. Here are the most popular intentionally vulnerable targets you can run locally:
docker run -p 3000:3000 bkimminich/juice-shop. Best for web app pentesting practice.docker run -p 80:80 vulnerables/web-dvwa# Quick vulnerable lab with Docker
docker pull bkimminich/juice-shop
docker run -d -p 3000:3000 bkimminich/juice-shop
# Visit http://localhost:3000 from your Kali browser
# DVWA setup
docker pull vulnerables/web-dvwa
docker run -d -p 80:80 vulnerables/web-dvwa
# Default creds: admin / password
# Metasploitable — download from Rapid7, then in VirtualBox:
# Import Appliance → select the .vmdk
# Set network to "Host-Only" adapter
# Boot it up, find IP with: nmap -sn 192.168.56.0/24
💡 Pro tip: Use Docker for web app targets (Juice Shop, DVWA) — they start in seconds and you can trash and recreate them instantly. Use full VMs (Metasploitable, VulnHub) for network-level practice where you need real services running on real ports.
You're running offensive tools and intentionally vulnerable software. If this stuff touches your home network or the internet, bad things can happen. Take isolation seriously:
0.0.0.0 — on a cloud server, this means the entire internet can access your DVWA instance.# Check what's listening on your machine
ss -tlnp # TCP listeners
ss -ulnp # UDP listeners
# Make sure Docker only binds to localhost
docker run -p 127.0.0.1:3000:3000 juice-shop # ✅ Only localhost
docker run -p 3000:3000 juice-shop # ⚠️ Binds to 0.0.0.0
Before you test anything that isn't an intentionally vulnerable lab or CTF platform, you need written authorization. This isn't just good practice — it's the law. The Computer Fraud and Abuse Act (CFAA) in the US and similar laws in other countries make unauthorized computer access a criminal offense, even if your intentions are educational.
⚠️ The bottom line: CTF platforms = always legal. Your own lab VMs = always legal. Bug bounty programs = legal within their scope. Anything else requires explicit written authorization from the system owner. "I was just learning" is not a legal defense.
Even as a student, build good OPSEC habits. These will matter in your career:
mkbox shell function.tun0 connectivity.Can you explain these without looking them up?
tun0 represent and why do you check it after VPN connection?sudo apt update && sudo apt full-upgradetun0tun0 interface represent after connecting to a VPN?tun0 is the virtual TUN (tunnel) device created by OpenVPN. It gives you an IP address on the lab network (typically 10.10.14.x for HTB). This is the IP you use for reverse shells and file transfers — not your LAN IP (192.168.x.x) which isn't routable on the lab network.