Penetration Testing Labs: Hands-On Projects to Build Real-World Skills 2026 Edition
Cybersecurity

Penetration Testing Labs: Hands-On Projects to Build Real-World Skills 2026 Edition

by Carter Hayes

$9.99
Genre Cybersecurity
Author Carter Hayes
Format eBook (PDF & EPUB)
Delivery Instant digital download

About This Book

Cybersecurity is a field where practical skill matters more than memorized facts. The threats facing organizations and individuals grow more sophisticated every year, and the best defense is a workforce that understands how attackers actually operate. This book gives you the hands-on knowledge and structured approach you need to move from curiosity to real competence.

The material is designed for people who want real results, not just theory. It explains the concepts behind the tools, walks you through realistic scenarios, and shows you how to apply what you learn in actual testing environments. Whether you are studying for a certification, building a security career, or protecting your own infrastructure, this guide is built to move you forward.

What sets this book apart is its focus on doing the work. Each chapter connects ideas to actions, so you understand not only what a technique does but why it works and when to use it. The exercises and examples are built around tools and situations you are likely to encounter in real assessments, labs, and job roles.

By the time you finish, you will have more than a list of commands. You will understand how attacks fit together, how to spot weak points in a system, and how to explain your findings in a way that helps people fix problems. Those skills are the foundation of a successful career in cybersecurity.

Read a Sample ▸

Not sure yet? Here is the full table of contents and the first chapter, exactly as it appears in the book.

Contents

  • Chapter 1: Building Your Penetration Testing Laboratory
  • Chapter 2: Reconnaissance and Information Gathering Techniques
  • Chapter 3: Scanning and Enumeration Fundamentals
  • Chapter 4: Web Application Vulnerability Assessment
  • Chapter 5: Exploitation Frameworks and Payload Delivery
  • Chapter 6: Password Attacks and Credential Harvesting
  • Chapter 7: Wireless Network Penetration Testing
  • Chapter 8: Active Directory Attack Pathways
  • Chapter 9: Post-Exploitation and Lateral Movement
  • Chapter 10: Social Engineering and Phishing Campaigns
  • Chapter 11: Mobile Application Security Testing
  • Chapter 12: Cloud Security Testing Methodologies
  • Chapter 13: Evading Detection and Bypassing Defenses
  • Chapter 14: Exploit Development Fundamentals
  • Chapter 15: Network Pivoting and Tunneling Techniques
  • Chapter 16: Professional Reporting and Documentation
  • Chapter 17: Automated Vulnerability Scanning Integration
  • Chapter 18: Continuous Learning and Career Development

18 chapters in the complete book.

Chapter 1: Building Your Penetration Testing Laboratory

Every penetration tester needs a safe, controlled environment where they can sharpen their skills, experiment with new techniques, and break things without legal or ethical consequences. Your personal penetration testing laboratory is more than just a collection of virtual machines, it’s your training ground, your proving ground, and your experimental workshop all rolled into one. Whether you’re just starting out in cybersecurity or you’re a seasoned professional looking to build a more sophisticated testing environment, the lab you construct today will directly impact the skills you develop tomorrow.

The beauty of modern penetration testing labs is their accessibility. Gone are the days when you needed a server rack in your closet and thousands of dollars in hardware. Today’s virtualization technologies allow you to build enterprise-grade testing environments on modest hardware. Cloud platforms offer nearly unlimited scalability for those who need it. But with this accessibility comes responsibility: and the need to make informed decisions about architecture, isolation, and resource management that will serve you well throughout your career.

In this chapter, we’ll build your penetration testing laboratory from the ground up. You’ll learn not just what to install, but why certain architectural decisions matter, how to balance performance with functionality, and how to create an environment that grows with your skills. By the time you finish, you’ll have a fully functional lab ready for the hands-on projects in subsequent chapters.

Understanding Your Hardware Requirements

Before you download a single ISO file or spin up your first virtual machine, you need to understand the hardware foundation that will support your lab. Penetration testing environments are resource-intensive by nature: you’ll often run multiple virtual machines simultaneously, each consuming memory, CPU cycles, and storage. Underestimate these requirements, and you’ll face frustrating performance issues that derail your learning.

For a basic penetration testing lab that supports three to four concurrent virtual machines, you’ll want a system with at least 16GB of RAM, though 32GB provides a much more comfortable experience. Your CPU should be a modern multi-core processor, ideally something with at least four physical cores and eight threads. Intel i5 or i7 processors from the last five years work well, as do AMD Ryzen 5 or 7 chips. The key factor is virtualization support: ensure your CPU has Intel VT-x or AMD-V technology enabled in the BIOS.

Storage deserves special attention. You’ll need at least 500GB of available space for your virtual machines, snapshots, and testing tools. More importantly, you want fast storage. A solid-state drive makes an enormous difference in lab performance, the difference between waiting thirty seconds for a VM to boot versus three minutes. If budget allows, consider a 1TB NVMe SSD dedicated to your lab environment. Traditional spinning hard drives will work, but they’ll test your patience.

Working with a laptop? Thermal management matters. Running multiple virtual machines generates significant heat, and sustained thermal throttling will impact performance. Ensure adequate cooling, use a laptop cooling pad if necessary, and monitor temperatures during extended lab sessions. Desktop systems generally handle sustained loads better, making them preferable for serious lab work if you have the space and budget.

Don’t let these recommendations discourage you if your hardware is more modest. A system with 8GB of RAM can still run a basic Kali Linux attack VM and a single target machine: you’ll just need to be more strategic about which systems you run simultaneously. Cloud-based alternatives, which we’ll explore later in this chapter, offer another path forward for those with hardware constraints.

Selecting Your Virtualization Platform

The virtualization platform forms the foundation of your penetration testing lab. Your choice here influences everything from performance to networking capabilities to ease of snapshot management. The two dominant platforms for local virtualization are VMware Workstation Pro or its free counterpart VMware Workstation Player, and Oracle’s VirtualBox. Each has distinct advantages and tradeoffs.

VMware Workstation Pro represents the gold standard for local virtualization in security testing. Its performance overhead is minimal, its networking capabilities are sophisticated, and its snapshot and cloning features are robust and reliable. VMware’s virtual networking is particularly strong, you can create complex network topologies with multiple isolated segments, implement network address translation, configure custom routing, and simulate realistic enterprise network architectures. The downside is cost: VMware Workstation Pro requires a commercial license, though educational pricing and occasional sales bring it within reach for many practitioners.

VMware Workstation Player offers much of the same underlying technology without the licensing cost, but it lacks some advanced features like multiple snapshots and complex network configuration. For beginners building their first lab, Player provides an excellent starting point. You can always upgrade to Pro later as your needs grow.

VirtualBox takes a different approach. Completely free and open-source, it runs on Windows, macOS, and Linux host systems, providing all the core functionality needed for penetration testing labs. Its networking is capable though less intuitive than VMware’s, and its performance can be slightly lower in some scenarios. VirtualBox’s greatest strength is its accessibility, anyone can download it immediately and start building without licensing concerns. Its extension pack adds useful features like USB 2.0 and 3.0 support and remote display capabilities.

For the projects in this book, either platform works well. Choosing for the first time? Consider these factors: VirtualBox for maximum accessibility and zero cost, VMware Workstation Player for better performance on modest hardware, and VMware Workstation Pro for the most sophisticated networking and snapshot capabilities. This chapter’s instructions apply to both platforms with minor variations that we’ll note as we proceed.

Once you’ve selected your platform, download the latest version from the official website. VMware from vmware.com or VirtualBox from virtualbox.org. Install using default options, which configure the necessary kernel modules and networking components. On Windows, you may need to disable Hyper-V if you encounter conflicts. On Linux, ensure your user account is added to the appropriate group (typically “vboxusers” for VirtualBox) for full functionality.

Designing Your Network Architecture

Network architecture distinguishes a casual collection of virtual machines from a professional penetration testing laboratory. Your network design determines isolation, simulates realistic enterprise environments, and enables the sophisticated scenarios you’ll encounter in later chapters. Getting this right from the beginning saves considerable rework later.

The fundamental building block is the isolated virtual network: a software-defined network that exists entirely within your virtualization platform, completely separated from your home or office network. This isolation is essential. It prevents your testing activities from accidentally affecting other systems, blocks potential malware from escaping your lab environment, and creates a safe sandbox where you can experiment freely.

Most penetration testing labs benefit from a multi-network architecture that mirrors realistic enterprise environments. Consider this standard configuration: Create a primary attack network where your Kali Linux and other offensive tools reside. This network represents the external attacker’s perspective or a compromised segment of an organization’s infrastructure. Create a second network for vulnerable target machines: think of this as the internal corporate network you’re attempting to penetrate. Create a third network for your defensive tools and monitoring systems, simulating a security operations center.

In VMware, these networks map to custom virtual network adapters (like VMnet2, VMnet3, VMnet4) configured in the Virtual Network Editor. Set each to host-only mode initially, which creates isolated networks that can’t reach your physical network or the internet. You’ll assign static IP ranges to each network, for example, 192.168.10.0/24 for your attack network, 192.168.20.0/24 for target systems, and 192.168.30.0/24 for defensive infrastructure.

VirtualBox uses different nomenclature but the same concepts. You’ll create internal networks for isolation and attach virtual machines to them. The key is ensuring each network segment is truly isolated until you explicitly configure routing between them: this isolation is your safety net.

For virtual machines that need internet access (primarily your attack machines when downloading tools or updates) configure a second network adapter in NAT mode. This gives the VM internet connectivity through your host system while keeping it isolated from your local network. Your Kali Linux attack machine typically runs with two adapters: one connected to your isolated attack network, another in NAT mode for internet access.

Document your network architecture in a simple diagram. Note which network each VM connects to, the IP addressing scheme for each network, and the purpose of each segment. This documentation becomes invaluable as your lab grows more complex. Within a few months, you might have ten or fifteen virtual machines across four networks, and clear documentation prevents confusion.

Installing and Configuring Kali Linux

Kali Linux is the primary attack platform for most penetration testing activities. It will be your most frequently used virtual machine throughout this book. Developed and maintained by Offensive Security, Kali includes hundreds of security testing tools preinstalled and preconfigured, saving countless hours of manual tool installation and troubleshooting.

Start by downloading the latest Kali Linux virtual machine image from kali.org. Kali provides prebuilt images specifically for VMware and VirtualBox, eliminating the need to install from ISO. These prebuilt images are fully functional and include the virtual machine guest additions, which provide better performance and integration with your host system. Download the appropriate image for your virtualization platform, typically a 7-ZIP or RAR archive several gigabytes in size.

Extract the downloaded archive to your virtual machine storage location. Import the extracted VM into your virtualization platform. In VMware, use File > Open to browse to the .vmx file. In VirtualBox, use File > Import Appliance and select the .ova file. The import process creates a new virtual machine with Kali’s recommended hardware settings.

Before booting Kali for the first time, adjust the virtual machine settings to match your hardware capabilities. Allocate at least 2GB of RAM, though 4GB provides better performance for tool-heavy operations. Assign two CPU cores if your host system has four or more. Configure the network adapters according to your architecture, typically one adapter on your isolated attack network and a second in NAT mode for internet access.

Boot the virtual machine and log in using the default credentials. As of 2026, Kali uses “kali” as both username and password for the prebuilt VM images. Your first action should be updating the system. Open a terminal and run “sudo apt update” followed by “sudo apt full-upgrade”. This updates all packages to their latest versions and patches any security vulnerabilities. The update process may take fifteen to thirty minutes depending on your internet connection and how recently the VM image was published.

Change the default password immediately after updating. Run “passwd” in the terminal and choose a strong password you’ll remember. Consider using a password manager to store your lab credentials securely. You’ll create many virtual machines with different passwords, and tracking them all becomes challenging without systematic management.

Configure your keyboard layout, time zone, and locale settings through the system preferences. These small configuration steps prevent frustrating issues later, nothing slows you down like hunting for special characters on an incorrectly mapped keyboard during a critical testing phase.

Take your first snapshot once Kali is fully updated and configured. Name it something descriptive like “Clean Install – Updated” with the date. This snapshot becomes your baseline: if you corrupt the system through experimentation or install problematic software, you can revert to this known-good state in seconds. Snapshots are your laboratory’s undo button, and you’ll rely on them constantly.

Setting Up Target Systems

A penetration testing lab without targets is like a boxing gym without punching bags: you need something to practice against. Your target systems should include a variety of operating systems and vulnerability profiles that represent realistic attack scenarios you’ll encounter in professional engagements.

Start with a Windows 10 or Windows 11 virtual machine as your primary Windows target. Microsoft provides free evaluation virtual machines specifically for testing purposes through their developer website. These VMs are fully functional for 90 days, after which they expire: but that’s where snapshots become your safeguard. Before the evaluation period expires, take a snapshot of the VM in its activated state. You can revert to this snapshot repeatedly, effectively resetting the evaluation period. This approach is permitted for educational and testing purposes.

Deploy the Windows VM with default security settings initially. This represents a typical workstation configuration: the kind of system you might encounter on a corporate network. Disable Windows Update temporarily to maintain consistency in your testing environment. A constantly updating target makes it difficult to develop and test exploits reliably. Assign the VM to your target network with a static IP address, and document its network configuration.

Intentionally vulnerable virtual machines form another critical component of your target infrastructure. Projects like Metasploitable, DVWA (Damn Vulnerable Web Application), and HackTheBox release VMs specifically designed for security testing and skill development. Metasploitable 2 remains popular despite its age because it contains numerous well-documented vulnerabilities that help beginners learn methodically. Metasploitable 3 provides a more modern Windows-based vulnerable environment with realistic corporate services.

Download Metasploitable 2 from SourceForge or Rapid7’s website. It comes as a VMware virtual machine that imports into both VMware and VirtualBox with minimal conversion. Deploy it on your target network with a static IP. Never connect Metasploitable directly to the internet or any network with sensitive systems: it’s deliberately vulnerable and easily compromised.

For web application testing, deploy DVWA as either a standalone VM or within a Linux server you configure yourself. DVWA is a PHP application that contains common web vulnerabilities in an educational context. Installing it yourself on an Ubuntu Server VM provides valuable experience with Linux server administration while creating a web application target. Configure the server with Apache, MySQL, and PHP, then install DVWA following its documentation. This hands-on server setup teaches skills directly applicable to real penetration testing engagements.

Consider adding a vulnerable Windows Server VM to simulate enterprise Active Directory environments. Building this yourself (installing Windows Server evaluation edition, configuring Active Directory Domain Services, creating user accounts and group policies) teaches you how enterprise networks are structured. You can then intentionally misconfigure aspects of the domain to create testing scenarios. Understanding Active Directory from an administrator’s perspective makes you a far more effective penetration tester.

Document each target system in your lab notes: its purpose, known vulnerabilities or misconfigurations, network location, and credentials. Create a spreadsheet or markdown document that is your lab inventory. Include columns for hostname, IP address, operating system, services running, and notes about what you intend to practice against each target.

Implementing Snapshot Management Strategies

Snapshots represent one of virtualization’s greatest gifts to penetration testers: the ability to freeze a system’s state and return to it instantly. Effective snapshot management transforms your lab from a fragile environment that requires constant rebuilding into a flexible workspace where experimentation carries no permanent consequences.

Develop a systematic snapshot strategy for each virtual machine. Create a base snapshot immediately after initial configuration and updating: this is your factory reset point. Label it clearly with the date and a description like “Base Configuration – 2026-01-15”. This snapshot should represent a clean, updated, fully functional system ready for testing.

Create milestone snapshots after significant changes or successful configurations. Spend two hours hardening a Windows server with specific group policies? Take a snapshot before testing against it. Successfully exploit a system and want to preserve the compromise for later analysis? Snapshot it. About to attempt something risky that might corrupt a VM? Snapshot first.

Most importantly, develop the habit of reverting to snapshots frequently. After completing a penetration testing exercise that left artifacts and changes across your target systems, revert all affected VMs to their base snapshots. This resets your lab to a known state and ensures consistent conditions for your next project. Consistency matters enormously in skill development, when you’re learning a new technique, eliminating variables helps you understand what’s working and why.

Be aware that snapshots consume disk space. Each snapshot stores the delta: the changes since the previous state. Run a system for weeks without reverting, and its snapshot file grows large. Monitor your storage space and consolidate or delete unnecessary snapshots periodically. VMware’s snapshot manager shows the snapshot hierarchy and disk usage. VirtualBox provides similar information in its snapshot view.

Consider using linked clones when you need multiple similar systems. Need three identical Windows 10 workstations for a specific testing scenario? Create one fully configured system with a base snapshot, then create linked clones from that snapshot. The clones share the base disk image but maintain independent changes, dramatically reducing storage requirements compared to full copies.

Configuring Network Isolation and Safety Measures

Your penetration testing lab contains deliberately vulnerable systems and potentially dangerous tools. Proper isolation protects your home network, your work environment, and the internet at large from accidental consequences of your testing activities. This isolation is both a technical requirement and an ethical obligation.

Verify that your isolated networks truly are isolated. Boot a VM on one of your internal networks and attempt to ping your host machine’s physical network adapter. You should not receive a response. Attempt to reach other devices on your home or office network. Again, these should be unreachable. If you can reach systems outside your lab environment from an isolated network, revisit your network configuration immediately.

For networks that do have internet access through NAT, understand what protections this provides and what it doesn’t. NAT allows outbound connections from your VMs to the internet while preventing inbound connections from the internet to your VMs. This is generally safe for attack platforms like Kali Linux. However, NAT doesn’t prevent a compromised VM from attacking other systems on your local network if your virtualization software’s network security features aren’t properly configured.

Enable your virtualization platform’s network isolation features. In VMware, ensure “Connect VMs to host” is disabled for your isolated networks in the Virtual Network Editor. In VirtualBox, use internal networks rather than host-only adapters when you want complete isolation. Host-only adapters include connectivity to the host system, which may not be desirable for all scenarios.

Implement a security rule for your lab: no deliberate disabling of isolation to test against production systems. It’s tempting to point your tools at real websites or networks to see if techniques work, but this crosses legal and ethical boundaries instantly. Everything you need to learn can be practiced against lab systems or authorized platforms like HackTheBox, TryHackMe, or similar services.

Consider physical network isolation for advanced scenarios. Some penetration testers use a completely separate physical computer for their lab, disconnected from their primary network. This eliminates any possibility of crossover. If you’re testing particularly dangerous malware or building red team infrastructure, physical isolation adds another layer of safety. For most learners, properly configured virtual network isolation suffices.

Exploring Cloud-Based Laboratory Options

Not everyone has powerful local hardware or the space for a dedicated lab system. Cloud platforms offer an alternative that’s increasingly viable as prices decrease and capabilities expand. AWS, Azure, Google Cloud, and DigitalOcean all support security testing scenarios, though with different pricing models and capabilities.

AWS provides the most comprehensive cloud penetration testing platform with explicit support for security testing within their terms of service. You can spin up EC2 instances of various sizes, configure virtual private clouds (VPCs) with complex network topologies, and deploy vulnerable applications for testing. AWS even maintains a list of services that don’t require prior authorization for penetration testing, streamlining the legal aspects.

The cost model matters significantly. A typical cloud-based lab might include one t3.medium instance for Kali Linux and two t3.small instances for target systems, running continuously. This costs approximately $150 to $200 monthly. However, you can dramatically reduce costs by stopping instances when not in use, you only pay for storage, not compute, for stopped instances. Spin instances up when you have time for lab work and stop them afterward. This cuts costs to $30 to $50 monthly.

Microsoft Azure offers similar capabilities with slightly different pricing and excellent integration with Windows-based targets. Azure’s security center includes tools specifically for security professionals, and their educational programs provide credits for students and researchers. If your work or academic institution uses Azure, you may have access to credits that make cloud labs essentially free.

DigitalOcean takes a simpler approach with straightforward pricing and easy-to-understand infrastructure. Their droplets cost as little as $5 monthly for basic instances, and you can build a functional penetration testing lab for $25 to $40 monthly. The platform lacks some advanced features of AWS or Azure, but for straightforward testing scenarios, DigitalOcean’s simplicity is refreshing.

When building cloud-based labs, network security requires extra attention. Always deploy your testing infrastructure in isolated VPCs or equivalent constructs, never in default networks with public internet exposure. Use security groups to restrict access to your instances, your Kali Linux system should only accept SSH or RDP connections from your IP address, and target systems should only be reachable from your Kali instance.

Cloud labs excel in specific scenarios: when you’re traveling and need access to your testing environment, when you’re collaborating with other penetration testers who need shared access to systems, or when you need to simulate geographically distributed infrastructure. They’re less ideal for bandwidth-intensive activities or when you need to run many virtual machines simultaneously, as costs scale with resources consumed.

Understanding Legal and Ethical Boundaries

Building a penetration testing lab comes with responsibilities that extend beyond technical configuration. The tools and techniques you’ll learn are powerful and potentially dangerous if misused. Understanding legal and ethical boundaries isn’t just about avoiding prosecution: it’s about developing the professional mindset that separates security professionals from criminals.

The fundamental rule is simple: only test systems you own or have explicit written permission to test. Your lab environment meets the ownership criterion: you built it, you own it, test freely. Public services like HackTheBox, TryHackMe, PentesterLab, and others provide explicit permission through their terms of service. Everything else is off-limits unless you have documented authorization.

This includes websites you find interesting, your friend’s server (unless you have written permission), your school’s network, your employer’s systems (unless your job responsibilities explicitly include security testing with proper authorization), and random systems you discover through scanning. The computer fraud and abuse laws in most countries are broadly written. Unauthorized access (even if you cause no damage and intend no harm) is prosecutable.

Understand that ignorance is not a defense. Claiming you didn’t know you needed permission or thought the system was fair game because it was vulnerable doesn’t protect you legally. Professional penetration testers work under contracts that explicitly define scope, rules of engagement, and authorized activities. Even with these safeguards, they sometimes face legal challenges when activities are misinterpreted or go wrong.

Your lab configuration should reflect this ethical framework. Creating network diagrams that show your lab’s isolated networks? Include explicit labels identifying these as testing environments. Documenting your testing activities? Include clear notes that testing occurred in your authorized lab environment. These details matter if you ever need to prove your activities were legal and authorized.

Be cautious about sharing certain types of lab configurations or information. While discussing your lab setup broadly is fine, avoid sharing details that might help others conduct unauthorized testing. If you write blog posts or create videos about your lab and testing activities, include clear disclaimers about authorization and legal boundaries. Position yourself as someone who takes these responsibilities seriously.

Professional penetration testers develop a mindset where they instinctively consider authorization before testing anything. Cultivate this mindset from the beginning. When you discover an interesting system or technique, your first thought should be about how to test it legally and ethically in your lab, not whether you could get away with testing it elsewhere. This professional framework serves you throughout your career.

Building Your Foundation for Advanced Projects

The lab you’ve built in this chapter provides the foundation for every project in this book. You’ve created isolated networks that protect your environment while enabling sophisticated testing scenarios. You’ve deployed attack platforms with powerful toolsets and target systems with intentional vulnerabilities. You’ve implemented snapshot management for quick recovery and experimentation without fear. You’ve either configured powerful local infrastructure or explored cloud alternatives that provide flexibility and scalability.

More importantly, you’ve learned the principles behind these choices. You understand why network isolation matters and how to verify it’s working. You know how snapshot strategies save time and enable effective learning. You grasp the legal and ethical framework that governs security testing activities. These principles guide you as your lab grows more complex with additional systems, services, and scenarios.

Your lab isn’t static: it’s a living environment that evolves with your skills and interests. As you work through subsequent chapters, you’ll add new virtual machines for specific projects. You might deploy a vulnerable web server for application testing, configure an Active Directory domain for enterprise scenarios, or build a wireless access point simulation for Wi-Fi security testing. The foundation you’ve built accommodates this growth.

Take time to explore your new lab before moving to the next chapter. Boot each VM and verify it’s functioning correctly. Test network connectivity between systems according to your architecture design. Practice taking snapshots and reverting to them. Get comfortable with your virtualization platform’s interface and features. This familiarity pays dividends when you’re focused on learning new penetration testing techniques rather than troubleshooting infrastructure.

Document what you’ve built. Create a simple diagram showing your network topology with labeled segments. List each virtual machine with its purpose, network location, and important credentials. Add notes about your storage locations and snapshot naming conventions. This documentation seems unnecessary when everything is fresh in your mind, but it becomes invaluable when you return to your lab after a few weeks away.

Your penetration testing laboratory represents more than a technical configuration: it’s your commitment to developing security skills through hands-on practice. Every professional penetration tester has a story about building their first lab, staying up late troubleshooting network configurations, and feeling the satisfaction when everything finally worked. You’re now part of that tradition, ready to move beyond theory into practical application where real learning happens.

… and that is just the beginning. The complete book continues from here, instant download, DRM-free, yours to keep.

More by Carter Hayes