Assignment Chef icon Assignment Chef
All English tutorials

Programming lesson

Mastering Penetration Testing: A Guide to CS6262 Project 1 Fall 2025

Learn the essential penetration testing techniques used in CS6262 Project 1, including network scanning, Shellshock exploitation, Metasploit brute force, privilege escalation, and password cracking with John the Ripper.

penetration testing tutorial CS6262 project 1 Shellshock vulnerability exploit Metasploit brute force privilege escalation techniques John the Ripper password cracking network scanning with nmap ethical hacking assignments cybersecurity lab setup SetUID exploit password security 2026 AI in penetration testing VM networking NAT bridge ARM Mac emulation UTM Gradescope submission tips

Introduction to Penetration Testing

Penetration testing is a critical skill in cybersecurity, often compared to a security audit where you simulate attacks to find vulnerabilities before real attackers do. In the context of CS6262 Project 1 Fall 2025, you'll dive into hands-on tasks that mirror real-world scenarios. This guide will walk you through the core concepts without solving the assignment directly, helping you build a methodical approach.

Setting Up Your Environment

Before you start, ensure your virtual machine is configured correctly. The project uses a pre-built VM with Ubuntu Server and a lightweight desktop environment (XFCE for x86, KDE for ARM). If you're on an ARM-based Mac, you'll need to emulate x86 using tools like UTM. The VM is large (14GB) due to pre-installed tools like Docker, PyCharm, and VSCode. Use NAT networking for safety unless you understand the risks of bridged mode.

Connecting to the VM

You can access the VM directly via its GUI or through SSH from your host. For SSH, you'll need the VM's IP address. In NAT mode, use port forwarding: forward host port 2222 to guest port 22. Then connect with ssh -p 2222 user@localhost. This is a common setup in penetration testing labs and mimics remote server management.

Task 1: Network Scanning (10 points)

Network scanning is the reconnaissance phase. You'll use tools like nmap to discover live hosts and open ports. Think of it as checking which doors are unlocked in a building. In the VM, scan the local network to identify targets. For example:

nmap -sV 192.168.1.0/24

This command performs a version scan on all hosts in the subnet. Pay attention to services like HTTP (port 80), SSH (port 22), and any unusual ports. This step is foundational for ethical hacking tutorials and helps you map the attack surface.

Task 2: Exploit the Shellshock Vulnerability (20 points)

Shellshock (CVE-2014-6271) is a vulnerability in Bash that allows remote code execution via environment variables. It's a classic example of how legacy bugs persist. To exploit it, you need to find a CGI script that uses Bash. Use a tool like curl to send a malicious header:

curl -H "User-Agent: () { :; }; /bin/bash -c 'command'" http://target/cgi-bin/vulnerable

This injects a command into the Bash environment. In the VM, you'll locate a vulnerable CGI endpoint and execute a reverse shell. This mimics real-world cybersecurity assignments where you chain multiple exploits.

Task 3: Brute Force with Metasploit (20 points)

Metasploit is a powerful framework for developing and executing exploits. For brute force, you'll use the auxiliary/scanner/ssh/ssh_login module. This is like trying every key on a keyring until one fits. The module requires a username list and password list. Example commands:

msfconsole
use auxiliary/scanner/ssh/ssh_login
set RHOSTS target_ip
set USER_FILE /path/to/users.txt
set PASS_FILE /path/to/passwords.txt
run

This task teaches you about password security and why strong passwords are essential. In 2026, with AI-powered password crackers, this skill is even more relevant.

Task 4: Privilege Escalation (20 points)

Once you have a low-privilege shell, you need to escalate to root. This often involves exploiting SetUID binaries. SetUID allows a program to run with the permissions of its owner. Find misconfigured SetUID binaries using:

find / -perm -4000 -type f 2>/dev/null

Then research known exploits for those binaries. For example, if pkexec is present, you might use CVE-2021-4034 (PwnKit). This is a common privilege escalation technique taught in advanced security courses.

Task 5: Password Cracking (30 points)

Password cracking is the art of recovering passwords from hashes. You'll use John the Ripper to crack hashes from a zip file and a GPG file. First, extract the hash:

zip2john task51.zip > hash.txt
john --wordlist=/usr/share/wordlists/rockyou.txt hash.txt

For the GPG file, use gpg2john. This demonstrates why you should never use weak passwords. With the RockYou wordlist, many simple passwords fall quickly. In 2026, cracking techniques have evolved, but the fundamentals remain the same.

Best Practices and Tips

  • Document everything: Keep a README.txt with your attempts. It helps you avoid repeating failed methods.
  • Use the autograder wisely: You have unlimited submissions, but don't abuse it by brute-forcing answers.
  • Understand the network: NAT vs. bridged modes affect your ability to reach the target.
  • Stay ethical: Only attack systems you own or have permission to test.

Trend Connection: AI in Penetration Testing

In 2026, AI tools like ChatGPT are used to generate exploit code and automate reconnaissance. However, understanding the underlying principles is crucial because AI can make mistakes. For example, an AI might suggest a payload that doesn't work due to network restrictions. Your manual skills from this project will help you verify and adapt AI-generated attacks.

Conclusion

CS6262 Project 1 is a comprehensive introduction to penetration testing. By mastering network scanning, Shellshock, Metasploit, privilege escalation, and password cracking, you'll build a strong foundation for a career in cybersecurity. Remember: the goal is not just to get the points, but to understand the methodology. Good luck!