Final Engagement
Attack, Defense & Analysis of a Vulnerable Network
Team 4: Anar Jafarov, Mohamed Mohamed, Sabrina Yussef, William Song, Yevgeniya Poshtar
1
Table of Contents (PART 1 - RED TEAM)
2
This document contains the following resources:
Network Topology & Critical Vulnerabilities
Exploits Used
Avoiding Detect
Maintaining Access
Network Topology
& Critical Vulnerabilities
3
Network Topology
Network
Address Range: 192.168.1.0/24
Netmask:
Gateway:
Machines
IPv4: 192.168.1.110�OS: Linux
Hostname: Target 1
IPv4: 192.168.1.115
OS: Linux
Hostname: Target 2
IPv4: 192.168.1.90
OS: Linux
Hostname: Kali
IPv4: 192.168.1.105
OS: Linux
Hostname: Capstone
IPv4: 192.168.1.100
OS: Linux
Hostname: ELK
Critical Vulnerabilities: Target 1
Our assessment uncovered the following critical vulnerabilities in Target 1.
5
Vulnerability | Description | Impact |
Wordpress Website Vulnerability Version 4.8.14 | wpscan will scan WordPress websites for known vulnerabilities, users, passwords etc. As well, running website on HTTP which is insecure service, the data sent over the internet between servers and browsers aren’t encrypted. It’s sent in plain text. It allows hackers to intercept connection and steal data | Enumerates users, displays weak passwords, vulnerable plugins and detects the version of WordPress used. We were able to get access to the Raven website by accessing it through insecure http; we could intercept the data sent over and identify flag 1. We were also able to gain access to user’s account applying brute force attack to get user’s credentials |
SSH Vulnerability | Exploitation of SSH vulnerability allows to gain access to remote systems and privileged accounts | Ability to get access to the privileged account and navigate to root directory (in our example we were able to navigate to /var directory where we captured flag2.txt) |
MySQL Database Exploit | This vulnerability allows to exploit a password bypass vulnerability in MySQL in order to extract the usernames and encrypted password hashes from a MySQL server | Having access to usernames and passwords of privileged users an attacker can establish connection with target machine and gain access to confidential information |
Critical Vulnerabilities: Target 1 (cont’d)
Vulnerability | Description | Impact |
Weak username and passwords | the username and passwords were very weak and easy to guess | Attackers can easily gain access to the system by guessing or bruteforcing using john the ripper |
Python privilege escalation | python utility was available to use without the root privilege | An attacker can spawn a shell and gain access to root |
| | |
Critical Vulnerabilities: Target 2
Our assessment uncovered the following critical vulnerabilities in Target 2.
7
Vulnerability | Description | Impact |
Wordpress Website Vulnerability | Ability to Execute Code from Unknown Folders. WordPress has no system in place to curb the execution of codes in unknown folders, hackers can easily use malicious codes to carry out malicious activities | In our example we were able to get access to Uploads folder where we found flag 3.png. An attacker would be able to inject malicious codes into that folder |
PHPMailer Remote Code Execution Vulnerability (or CVE-2016-10033) | PHPMailer - is an open source PHP library for sending emails from PHP websites.�This critical vulnerability is caused by class.phpmailer.php incorrectly processing user requests. In a result, remote attackers are able to execute code on vulnerable servers | In order to exploit this vulnerable we were able to install and run a script executing.a malicious code on a vulnerable machine. In a result we were able to navigate to root /var directory on a Target 2. From there we got access to other directories, in that case to /www directory where we found flag 2 |
MySQL UDF Dynamic Library Exploit | User Defined Functions (UDF) in MySQL are mainly a default set of functions that can be carried out inside a dynamic library called inside of MySQL. The MySQL databases are usually running on root privileges and the UDF technique allowed us to install and run code as root. | Using a default install of MySQL and having it run as a root user is a huge threat, an attacker would be able to escalate their privileges to a root user by using the User Defined Functions technique. |
Exploits Used
8
Exploitation 1: Wordpress Website Vulnerability
9
Exploitation 2: SSH Vulnerability
10
Exploitation 3: MySQL Database Exploit
11
Exploitation 4: WordPress Website Vulnerability (on Target 2)
Install gobuster - tool used to brute force URI (incl. directories and files) on the web site
Exploitation 4: WordPress Website Vulnerability (on Target 2, cont’d)
In a previous step we identified a vulnerability HPMailer Remote Code Execution Vulnerability (CVE-2016-10033)
In order to exploit that vulnerability we ran a script running the following commands:
In a result we were able to navigate to root /var directory on a Target 2. From there we got access to /www directory where we found flag 2
Exploitation 5: PHPMailer Remote Code Execution Vulnerability (or CVE-2016-10033)
Exploitation 5: PHPMailer Remote Code Execution Vulnerability - Exploitation of Uploads Folder
Exploitation 6: Escalating to Root Privileges
Exploitation 6: Escalating to Root Privileges
Exploitation 6: Escalating to Root Privileges
Exploitation 6: Escalating to Root Privileges
Avoiding Detection
20
Stealth Exploitation of Wordpress Website Vulnerability
Monitoring Overview
Excessive HTTP Errors, but did not detect
Metric: number of HTTP 400+ error responses
Threshold: top five HTTP response status codes above 400 for last 5 minutes
-did not fire at above threshold
-recommend to reconfigure to lower threshold or shorter timeframe (ex. 1 min interval)
21
Mitigating Detection
A new exploit called the Themegrill Demo Importer that was installed on over 100,00 sites in February. A severe vulnerability that resets the whole database.
Stealth Exploitation of Wordpress Website Vulnerability
Maintaining Access
23
Backdooring the Target
Backdoor Overview
24
Table of Contents (PART 2 - BLUE TEAM)
25
This document contains the following resources:
Network Topology & Critical Vulnerabilities
Alerts Implemented
Hardening
Implementing Patches
Alerts Implemented
26
Alert 1 - Excessive HTTP Errors
Alert 1 - Excessive HTTP Errors
Excessive HTTP Errors is implemented as follows:
27
Alert 2 - HTTP Request Size Monitor
Alert 2 - HTTP Request Size Monitor
HTTP Request Size Monitor is implemented as follows:
28
Alert 2 - HTTP Request Size Monitor (Cont’d)
29
Alert 3 - CPU Usage Monitor
Alert 3 - CPU Usage Monitor
CPU Usage Monitor is implemented as follows:
30
Alert 3 - CPU Usage Monitor (Cont’d)
31
Hardening Against Vulnerabilities
Hardening Against WordPress HTTP Vulnerability:
Hardening Against SSH Vulnerability:
Hardening Against MySQL Database Exploit Vulnerability:
Hardening Against PHPMailer Vulnerability:
32
Table of Contents
This document contains the following resources:
Network Topology & Critical Vulnerabilities
Traffic Profile
Normal Activity
Malicious Activity
33
Traffic Profile
34
Traffic Profile
Our analysis identified the following characteristics of the traffic on the network:
35
Feature | Value | Description |
Top Talkers (IP Addresses) | 10.0.0.201, 10.11.11.11, 10.11.11.121, 10.11.11.179, 10.11.11.195, 10.11.11.200, 10.11.11.217, 172.16.4.205 | Machines that sent the most traffic. |
Most Common Protocols | DNS, HTTP, Kerberos, LDAP, HTTPS, SMB | Three most common protocols on the network. |
# of Unique IP Addresses | 808 | Count of observed IP addresses. |
Subnets | 10.6.12.0/24, 172.16.4.0/24, 10.0.0.0/24 | Observed subnet ranges. |
# of Malware Species |
| Number of malware binaries identified in traffic. |
Behavioral Analysis
Purpose of Traffic on the Network
Users were observed engaging in the following kinds of activity.
�“Normal” Activity
Suspicious Activity
36
Normal Activity
37
General Internet Browsing
Summarize the following:
38
Youtube
Summarize the following:
39
Malicious Activity
40
Downloaded Malware
41
Downloaded Malware
42
Infected Machine
Summarize the following:
43
Infected Machine
Summarize the following:
44
Illegal Torrenting
Summarize the following:
45
The End
46