Skip to content

SanjuCyb3r/Basic-Pentesting-1

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

22 Commits
 
 
 
 
 
 

Repository files navigation

Basic-Pentesting-1

Description: This is a small boot2root VM I created for my university’s cyber security group. It contains multiple remote vulnerabilities and multiple privilege escalation vectors. I did all of my testing for this VM on VirtualBox, so that’s the recommended platform. I have been informed that it also works with VMware, but I haven’t tested this personally.

This VM is specifically intended for newcomers to penetration testing. If you’re a beginner, you should hopefully find the difficulty of the VM to be just right. Your goal is to remotely attack the VM and gain root privileges. Once you’ve finished, try to find other vectors you might have missed! If you enjoyed the VM or have questions, feel free to contact me at: [email protected]

If you finished the VM, please also consider posting a writeup! Writeups help you internalize what you worked on and help anyone else who might be struggling or wants to see someone else’s process. I look forward to reading them!

Basic Pentesting 1 - Walkthrough

Basic Pentesting 1 is a beginner-friendly, boot2root CTF challenge that offers an exciting way to dive into penetration testing. In this lab, you’ll uncover vulnerabilities, exploit them, and elevate your privileges to gain root access. It's perfect for sharpening your skills in a controlled environment!

Think like a hacker, use popular tools like Nmap, Hydra, and Metasploit, and navigate your way to success. Ready to take on the challenge? Let’s get started!

Author: Josiah Pierce

Release Date: December 8, 2017

Objective: Gain root access by exploiting vulnerabilities.

Alt Text

Virtual Machine Setup

Before starting the challenge, ensure the virtual machine is configured correctly:

Ensure the VM is set up correctly with VMware Workstation 17.5+. Verify network configuration before starting.

Alt Text

Login Screen

Upon powering on the VM, you'll see the Ubuntu 16.04 LTS login screen. Username: marlinspike; password must be discovered during the challenge.

This is where the challenge begins—time to put your hacking skills to the test!

Alt Text

Network Discovery

Scanned the network with netdiscover to identify active devices in the 192.168.164.0/24 subnet.

This step is critical to identifying the target machine's IP address for further exploitation.

Alt Text

Verifying Target Availability

Confirmed target availability at 192.168.164.129 using the ping command. Successful ICMP responses indicate the target is reachable.

Alt Text

Nmap Scan

Conducted a detailed Nmap scan on 192.168.164.129 to identify open ports and services, providing valuable exploitation information.

This scan lays the groundwork for identifying potential vulnerabilities to exploit.

Alt Text

Let's start with Port 21 Vulnerability Scan

Performed an Nmap vulnerability scan on port 21 (FTP) to identify potential issues.

Alt Text

Launching Metasploit Framework

Launched Metasploit Framework (msfconsole) to exploit identified vulnerabilities.

This step sets the stage for using Metasploit to exploit the ProFTPD backdoor vulnerability identified earlier.

Alt Text

Searching for Exploit Modules

Identified the ProFTPD 1.3.3c Backdoor Command Execution module in Metasploit as a potential exploit.

Alt Text

Setting Up the Exploit

Selected the proftpd_133c_backdoor module in Metasploit and configured necessary parameters.

Alt Text

Configuring Payload for Exploitation

Configured the ProFTPD 1.3.3c Backdoor exploit by setting the payload and options for a reverse shell connection.

Alt Text

Exploitation Successful

Executed the exploit successfully, resulting in a reverse shell session with root privileges.

This marks the successful exploitation of the ProFTPD 1.3.3c backdoor, providing full root access to the target system.

Alt Text

Interactive Shell Access

Established a fully interactive shell on the target system after gaining a reverse shell.

Alt Text

Accessing Sensitive Files

Accessed the /etc/shadow file with root privileges to view stored password hashes, which are critical for user authentication.

Alt Text

Cracking Password Hash

Cracked the password hash from /etc/shadow using John the Ripper to retrieve the plaintext password.

Alt Text

FTP Access and File Enumeration

Established FTP server access using cracked credentials.

Alt Text

Let's work on Apache Server Port 80 by doing Vulnerability Scan

Conducted an Nmap vulnerability scan on the Apache HTTP server (port 80).

Alt Text

Default Web Page Confirmation

Navigated to http://192.168.164.129/ and confirmed the default Apache web server page, indicating the HTTP service is operational.

Alt Text

Directory Enumeration with dirb

Performed directory brute force on http://192.168.164.129/ using dirb and the big.txt wordlist.

Alt Text

Accessing the Secret Blog

Discovered a WordPress site titled 'My Secret Blog' in the /secret/ directory. The homepage displays the default WordPress theme.

Alt Text

Exploring the Blog Content

Accessed the WordPress site at /secret/ and found the default 'Hello World!' post, indicating minimal customization.

Alt Text

WordPress Login Page Analysis

Analyzed the WordPress login page (/wp-login.php) for administrative access.

Alt Text

Observations from the WordPress Login Page

Observed the features and potential weaknesses of the WordPress login page.

Alt Text

WPScan Analysis Summary

Used WPScan to identify vulnerabilities in the WordPress site.

Alt Text

WordPress Brute-Force Attack and Admin Login Credentials

WPScan identified valid admin credentials (username: admin, password: admin) for the WordPress site.

Alt Text

WordPress Exploit Module Enumeration

Enumerated WordPress-related exploit modules in Metasploit.

Alt Text

Configuring Exploit Module for WordPress Admin Shell Upload

Configured a Metasploit exploit module for uploading a shell via WordPress admin.

Alt Text

Gaining Shell Access via Exploitation

Authenticated with WordPress admin credentials (admin:admin), uploaded and executed the payload, establishing a reverse TCP connection and Meterpreter session.

Alt Text

Other Method by doing a Reverse Shell Script

Demonstrated an alternative method using a reverse shell script.

Alt Text

Configuring the Reverse Shell Script

Customized the php-reverse-shell.php script with the attacker's IP (192.168.164.128) and listening port (1234).

Alt Text

Gaining Access to the WordPress Admin Dashboard

Gained access to the WordPress admin dashboard, allowing control over content, themes, plugins, and settings for potential malicious modifications.

Alt Text

Accessing WordPress Plugin Directory

Accessed the WordPress plugin directory for potential exploitation

Alt Text

Plugin Upload Attempt

Attempted to upload a PHP reverse shell as a WordPress plugin.

Alt Tetx

Accessing the Reverse Shell File

Accessed the reverse shell file to trigger the payload and establish a connection to the attacker's machine.

Alt Text

Setting Up a Netcat Listener

Set up a Netcat listener to receive the reverse shell connection

Alt Text

Reverse Shell Connection Established

Established a reverse shell connection, providing user-level access

Alt Text