1 of 24

Capstone Engagement

Assessment, Analysis, �and Hardening of a Vulnerable System

Gezahegn Hora, February 8, 2022

2 of 24

Table of Contents

This document contains the following sections:

01

02

03

04

Network Topology

Red Team: Security Assessment

Blue Team: Log Analysis and Attack Characterization

Hardening: Proposed Alarms and Mitigation Strategies

3 of 24

Network Topology

3

4 of 24

Network Topology

Network

Address Range:192.168.1.0/24

Netmask:255.255.255.0

Gateway:192.168.1.1

Machines

IPv4:192.168.1.90

OS:Linux

Hostname:Kali

IPv4:192.168.1.100

OS:Linux

Hostname:ELK

IPv4:192.168.1.105

OS:Linux

Hostname:Capstone

IPv4:192.168.1.1

OS:Windows

Hostname:Red Vs Blue

5 of 24

Red Team

Security Assessment

5

6 of 24

Recon: Describing the Target

Nmap identified the following hosts on the network:

Hostname

IP Address

Role on Network

Elk Server

192.168.1.100

Logs activity data from the target machine (Capstone)

Kali

192.168.1.90

Attacker Machine

Capstone

192.168.1.105

Vulnerable (Target) machine

Windows

192.168.1.1

Hypervisor, hosts all the Virtual Machines.

7 of 24

Vulnerability Assessment

The assessment uncovered the following critical vulnerabilities in the target:

Vulnerability

Description

Impact

Unrestricted file upload(.php)

Uploaded files represent a significant risk to applications. The first step in many attacks is to get some code to the system to be attacked. Then the attack only needs to find a way to get the code executed. Using a file upload helps the attacker accomplish the first step.

The attacker uploaded .php file into the website and executed the code to get access to hidden folders.

Brute Force password attack

A method of accessing an obstructed device/system by attempting several combinations of numeric/alphanumeric passwords.

The attacker brute forced Ashton’s password, which is leopoldo and access the secret folder.

Open port 80

An open port of 80 can give the attacker access to the victim’s machine.

The attacker used port 80 to connect to the victim’s machine and access a restricted file.

8 of 24

Exploitation: [Open port 80]

Tools & Processes

The attacker used nmap to scan for any open port in the network

01

02

Achievements

The attacker found out that a machine with an ip address of 192.168.1.105 has an open port 80. He was able to connect into the website and have access to important company folders.

03

9 of 24

Exploitation: [Brute Force Attack]

Tools & Processes

The attacker used one of brute forcing tools, hydra to crack Ashton’s password from word lists of passwords.

01

02

Achievements

The attacker was able to crack Ashton’s password and ssh into ashton’s machine to be able to access a secret_folder.

10 of 24

Exploitation: [Brute Force Attack]

Tools used and Processes:

11 of 24

Exploitation: [Unrestricted File Upload]

Tools & Processes

The open port 80 allowed the attacker to connect to the company website so that he uploaded .php file by using local file inclusion (LFI)

01

02

Achievements

The attacker uploaded the .php file onto the website. This allowed the execution of the file to initiate reverse shell.

03

12 of 24

Blue Team

Log Analysis and �Attack Characterization

12

13 of 24

Analysis: Identifying the Port Scan

  • The port scan occurred on Feb 01, 2022 at 18:00
  • 4474 packets were sent from 192.168.1.90
  • A large number of requests were made within a short period of time which indicates that it is a port scan.

14 of 24

Analysis: Finding the Request for the Hidden Directory

  • 16,440 requests were made for the hidden file on Feb 3, 2022 @ 12:45 pm.
  • /Company_folders/Secret_folder were requested and it contains document (.doc)

15 of 24

Analysis: Uncovering the Brute Force Attack

  • 16,401 requests were made in the brute force attack

16 of 24

Analysis: Uncovering the Brute Force Attack

  • 16,401 requests were made in the brute force attack
  • Out of the 16,401 requests only 2 were successful.

Search command: user_agent.original : "Mozilla/4.0 (Hydra)" and not http.response.status_phrase : "unauthorized"

17 of 24

Analysis: Finding the WebDAV Connection

  • 70 requests were made for the Webdav directory.
  • Shell.php, lib, and passwd.dav files were located in the webdav directory.

18 of 24

Blue Team

Proposed Alarms and �Mitigation Strategies

18

19 of 24

Mitigation: Blocking the Port Scan

  • We can set up an alert for 10 port scans in a minute or 100 consecutive ICMP requests.

  • The alert should be set based on the average requests made.

  • The threshold would be more than 10 attempts.

  • Block any untrusted ip reputations or suspicious ip addresses.

  • Firewall rule: Block any incoming traffic from 192.168.1.90.

  • Block ping requests.

System Hardening

Alarm

20 of 24

Mitigation: Finding the Request for the Hidden Directory

  • Alert for any attempt to access the directory or file.

  • The threshold should be more than one attempt.

  • The Server containing the hidden folder should be partitioned and not allowed to be shared for public access.

  • Encrypt all data in the secret folder incase of any breach.

  • Remove the folder from the server.

System Hardening

Alarm

21 of 24

Mitigation: Preventing Brute Force Attacks

  • Alert if ‘401 unauthorized’ is returned to the server.

  • Alert if the ‘user_agent.original’ contains ‘hydra’ in the name.

  • We can set a threshold of 5 attempts per hour.

  • We can drop traffic from the attempting ip address if the number of attempts exceeds the threshold.
  • Temporarily lock account exceeding 5 attempts in 30 minutes.
  • No root access over ssh.

System Hardening

Alarm

22 of 24

Mitigation: Detecting the WebDAV Connection

  • Alert on HTTP, POST, and GET requests.

  • An alert on an attempt to access the directory from any machine and/or IP that is not recognized by whitelisted IP addresses.�
  • Threshold would be one attempt, as access to the folders should not be allowed.

  • Connections to this shared folder should not be accessible from the web interface.

  • Important files/folders should be saved in a more restricted area.

  • Connection to these folders should be restricted by a firewall rule.

System Hardening

Alarm

23 of 24

Mitigation: Identifying Reverse Shell Uploads

  • Alert for any incoming traffic over port 4444.

  • Alert for any file with .php extension.

  • The threshold should be more than 1 attempt.

  • Block the ability to upload files to the directory over the web interface.

  • Only allow specific file extensions.

Store files in a non public accessible directory if possible.

  • Only allow authorized users to use the feature.

System Hardening

Alarm

24 of 24

24