How to Setup A Pen Test Lab & How to Play CTF

Null meet Pune

20 August 2011

Basic talk focused on how to setup a pentest lab and how to play CTF’s.

Slides

AI Generated Summary

AI Generated Content Disclaimer

Note: This summary is AI-generated and may contain inaccuracies, errors, or omissions. If you spot any issues, please contact the site owner for corrections. Errors or omissions are unintended.

This presentation, “How to setup a Pen test Lab and how to play CTF”, guides security practitioners through setting up penetration testing labs and participating in Capture The Flag competitions. The deck covers physical and virtual lab configurations, target environments, essential toolsets, and online playgrounds and bug bounty targets. It closes with the two dominant CTF formats and their strategies.

Summary

The talk defines a pen testing lab as, like any other lab, a controlled environment where behavioral or operational patterns of an object or application can be studied to sharpen the practitioner’s skill and knowledge; more specifically, it tries to create a replica of the Wild Wild West and study it in a controlled manner. The motivation slide borrows Abraham Lincoln’s axe-sharpening line alongside the observation that practice enhances perfection. A lab can be generalized or focused on a single approach: network testing, web app testing, malware analysis, mobile analysis, and more.

The setup section starts from basic requirements (a network, 2-3 PCs, some vulnerable stuff, some toolset, and of course a twisted mind) and lays out two approaches. Approach 1 is physical: purchase a switch/router, keep one computer as the target loaded with prebuilt vulnerable software stacks and one as the attacker loaded with a tool chain, more realistic but costly. Approach 2 is virtualization, the recommended path: one powerful machine running VMWare, VirtualBox, or Microsoft Virtual PC with a minimum of two VMs. Attack machine options include self-created builds, BackTrack, Matriux, Moth/Lambert, Helix, and SIFT, with the personal preference of keeping a Windows VM loaded with Windows-specific tools. Targets can be prebuilt vulnerable images (MetaSploitable, unpatched Windows, Damn Vulnerable Linux, pWnOS), vulnerable web applications (WebGoat, the Hacme tools, testfire.net, old Joomla/WordPress/Drupal), and GNS3 for network testing. The do’s and don’ts: avoid using the main machine for analysis, avoid giving VMs read/write access over parent folders, and keep a screenshot of the prepared VM as a restore point after every session.

The second half pivots from the lab to live action, noting that conquering a lab machine fails to reproduce the fun of manhandling a live target, so the talk surveys legal options. CTF formats get one section each. Online CTF: players face the organizer with challenges to complete within a time limit; challenges touch all bases of ethical hacking (web app, RE, forensics, crypto, and more); you can keep your zero days; challenges generally check your approach rather than lookup speed; and nearly 100% require a documented approach to win. One-on-one CTF: generally offline, each team gets a machine containing a flag, and the task is to save your flag while capturing the opponent’s; a good approach splits members between hardening and attack; and these events see lots of DDoS and DoS attacks.

The closing slides list the must-have tools with the caveat that mileage may vary, from nmap, Wireshark, and the aircrack suite to Metasploit and burp/ZAP, with Network Miner the stated reason to keep a Windows VM. Resources to follow: the BackTrack mailing list, Full Disclosure, Security Focus, SANS Internet Storm Center, and Darknet.

Key Themes

Notable Points

  1. Takeaway: virtualization provides the most practical and cost-effective lab setup.
  2. Takeaway: use pre-built vulnerable images to practice without building targets from scratch.
  3. Takeaway: always snapshot VMs before and after sessions for clean state recovery.
  4. Takeaway: CTF competitions build real-world skills across multiple security domains.
  5. Takeaway: combine lab practice with online challenges for continuous skill development.
  6. The virtualization spec given: a laptop/desktop with at least 4GB RAM, 64-bit, 2.4+ GHz (preferably quad core), running VMWare, Oracle Sun Innotek VirtualBox, or Microsoft Virtual PC, with a minimum of two VMs (target and attacker).
  7. Target images named: MetaSploitable, unpatched Windows 2000 and XP, Damn Vulnerable Linux, de-ice, Hackerdemia, pWnOS, Ubuntu 7.04; web targets: WebGoat, Hacme Tools (bank, casino, books, travel), demo.testfire.net, testasp.acunetix.com, and old Joomla/WordPress/Drupal installs; GNS3 (with its VirtualBox edition and documentation at gns3.net) covers network testing with cisco/juniper equipment.
  8. Online playgrounds listed: Honeynet.org, Hackthissite.org, Smashthestack.org, Intruded.net, intern0t, projectshellcode.com, and hacker.org; paying live targets: Facebook.com, Mozilla, and Google.com, with the note to read the SOW before starting.
  9. Online CTF characteristics: challenges cover web app, RE, forensics, crypto, and more; keeping your zero days is allowed; approach matters more than skimming osvdb or exploitdb; nearly 100% of events require documented approaches to win. One-on-one CTF: machine-per-team with flags to defend and capture, hardening plus attack role split, and frequent DDoS/DoS attacks.
  10. The must-have tools list: ping, ssh, telnet, scp, mount, fsck, file, nmap, gdb, strace, ltrace, ptrace, strings, hexedit, Wireshark, aircrack suite, Firefox plugins (tamper data, live header, firebug), Network Miner on Windows (the stated sole reason to keep a Windows VM), Metasploit, and Burp/ZAP, with the caveat “YMMV: your mileage may vary”.

Notable Quotes

“More specifically we try to create a replica of Wild Wild West and try to study it in a controlled manner”

“And of course a Twisted mind”

“It fails to satisfy the fun of manhandling the live target.”

“You can keep your Zero days with you.”

“This is Wild Wild West keep aside all books and start shooting as much arsenal as you have.”

“NOTE : YMMV : your mileage may vary”