Slort

Penetration Test Report

Introduction

The penetration test report contains all efforts that were conducted during client engagement. The purpose of this report is to ensure that the client has a full understanding of penetration testing methodologies as well as the technical knowledge to remediate any security flaws.

Objective

The objective of this assessment is to perform an internal penetration test against the network. The student is tasked with following methodical approach in obtaining full control of the network. This test should simulate an attacker and how an attacker would start from beginning to end.

Requirements

The pentester will be required to fill out this penetration testing report fully and to include the following sections:

  • Overall High-Level Summary and Recommendations (non-technical)

  • Methodology walkthrough and detailed outline of steps taken

  • Each finding with included screenshots, walkthrough, sample code, and proof.txt if applicable

  • Any additional items that were not included

High-Level Summary

I was tasked with performing an internal penetration test towards the client network. An internal penetration test is a dedicated attack against internally connected systems. The focus of this test is to perform attacks, similar to those of a hacker and attempt to infiltrate internal systems. My overall objective was to evaluate the network, identify systems, and exploit flaws while reporting the findings back to the client.

When performing the internal penetration test, there were several alarming vulnerabilities that were identified on client's network. When performing the attacks, I was able to gain access to multiple machines, primarily due to outdated patches and poor security configurations. During the testing, I had administrative level access to multiple systems. All systems were successfully exploited and access granted. These systems as well as a brief description on how access was obtained are listed below:

  • 192.168.192.53 (slort) - Local File Inclusion & Remote Code Execution

Recommendations

I recommend patching the vulnerabilities identified during the testing to ensure that an attacker cannot exploit these systems in the future. One thing to remember is that these systems require frequent patching and once patched, should remain on a regular patch program to protect additional vulnerabilities that are discovered at a later date.

Methodologies

I utilized a widely adopted approach to performing penetration testing that is effective in testing how well the environments is secured. Below is a breakout of how I was able to identify and exploit the variety of systems and includes all individual vulnerabilities found.

Information Gathering

The information gathering portion of a penetration test focuses on identifying the scope of the penetration test. During this penetration test, I was tasked with exploiting the client network. The specific IP addresses were:

Network

  • 192.168.192.0/24

Penetration

The penetration testing portions of the assessment focus heavily on gaining access to a variety of systems. During this penetration test, I was able to successfully gain access to all systems.

System IP: 192.168.192.53

Service Enumeration

The service enumeration portion of a penetration test focuses on gathering information about what services are alive on a system or systems. This is valuable for an attacker as it provides detailed information on potential attack vectors into a system. Understanding what applications are running on the system gives an attacker needed information before performing the actual penetration test. In some cases, some ports may not be listed.

Server IP Address
Ports Open

192.168.192.53

TCP: 21,135,139,445,3306,4443,5040,7680,8080,49664,49665,49666,49668,49667,49668,49669

UDP:

Nmap Scan Results

Initial Shell - Local File Inclusion & Remote Code Execution

I Start to view the two web ports beginning with port 8080 and see a XAMPP system

XAMPP Dashboard

Nothing of interest however I begin to search for directories and find a web directory called site

Going to the site directory redirects me to a page. Slort.

Slort

Viewing the URL's when viewing the source code shows Home, About, Services and so on appears to be utilizing a php parameter and including the pages.

Page Parameter

With this information I begin to be on the lookout for a local file inclusion vulnerability and find that this is vulnerable to a Local File inclusion as I am able to view the access and error logs

I will attempt to gain remote code execution by sending a web request containing PHP code.

Sending another web request using the browser only this time I include a windows system command to gain a reverse shell

Sending The Request

Vulnerability Explanation

Vulnerability Fix

Severity: Critical

Proof of Concept

Local.txt Proof Screenshot

Local.txt

Local.txt Contents

Privilege Escalation

I begin to start searching files and system directories and came across the Backups directory in the top level of the C drive. Furthermore, inside the backups directory it appears there is a scheduled task running every 5 minutes.

Looking into the permissions of the TFTP.EXE executable, this file can be modified by any user

I proceed into creating a malicious file using prometheus containing a reverse shell.

I copy the file from my attacking machine smb server

Next I overwrite the TFTP.EXE with the malicious file and wait at most 5 minutes.

After a few minutes the task executes and I gain administrative access

Vulnerability Exploited: Insecure Executable Permissions

Vulnerability Explanation: An attacker can modify an executable with their own malicious code as an unprivileged user and can be run

Vulnerability Fix: Remove unnecessary permissions on files such as executables

Severity: Critical

Proof Screenshot Here

Proof.txt

Proof.txt Contents

Maintaining Access

Maintaining access to a system is important to us as attackers, ensuring that we can get back into a system after it has been exploited is invaluable. The maintaining access phase of the penetration test focuses on ensuring that once the focused attack has occurred (i.e. a buffer overflow), we have administrative access over the system again. Many exploits may only be exploitable once and we may never be able to get back into a system after we have already performed the exploit.

House Cleaning

The house cleaning portions of the assessment ensures that remnants of the penetration test are removed. Often fragments of tools or user accounts are left on an organization's computer which can cause security issues down the road. Ensuring that we are meticulous and no remnants of our penetration test are left over is important.

After collecting data from the network was completed, I removed all user accounts and passwords as well as the Meterpreter services installed on the system. the client should not have to remove any user accounts or services from the system.

Additional Items

Appendix - Proof and Local Contents:

IP (Hostname)
Local.txt Contents
Proof.txt Contents

192.168.192.53

1bf81193978891c7b72fc8b9d4bd0a90

30a9b632f36e9aa08c07f1554e7b2b62

Appendix - Modified Prometheus Code

Last updated