Introduction
This writeup documents my work from an advanced network security lab at Bellevue College. I've broken down each vulnerability I discovered, including the exploitation process and remediation strategies. These labs really pushed my understanding of network security - hope my documentation shows that!
Improper sudo privilege on hA (10.100.1.10) – CRITICAL
CWE-250, CVSS3.0 9.8:AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
Summary
There was a misconfiguration discovered on the hA Jupyter Notebook server, where anyone logged into the Debian server could execute tcpdump without a password as root. This opens an unnecessary attack vector for attackers, anyone with an active connection to the Jupyter Notebook webserver and the password to enter could potentially elevate themselves to root.
Steps To Reproduce
- Login to Juypter Notebook webserver using password
- Open a new terminal window
- Type
sudo -lto view the misconfiguration: - Craft a payload to create a root owned accessible and executable bash binary:
- Use tcpdump to execute the script as root, generate traffic and wait so tcpdump executes:


- Run the new /bin/rootbash binary to enter a 'root' shell:
- Spawn a new bash shell using 'fake root' privileges to enter a shell with actual root privileges:
- Connect to rA using the SSH keys within /root/.ssh and read the flag:
Remediation Steps
Steps from here will rank from usefulness:
- Remove sudo configuration allowing unrestricted use of tcpdump as root by editing the /etc/sudoers file
- Restrict usage of tcpdump to specific interfaces or by users who need access to the command.
References
https://cwe.mitre.org/data/definitions/250.html https://gtfobins.github.io/gtfobins/tcpdump/




Credential stealing possible from Health Check API server on hA (10.100.0.10) – CRITICAL
CWE-319, CVSS3.0 9.8:AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
Summary
It was discovered that on hA users using tcpdump can listen in to our health check API @ port 5000 and capture credentials for root breaking AAA.
Steps To Reproduce
- Login to Juypter Notebook webserver using password
- Open a new terminal window
- Type
sudo -lto view the misconfiguration: - Listen in on port 5000 for communication using tcpdump as root:
- View plaintext credentials in communication to API server:


- Login as root using stolen credentials:
- Connect to rA using the SSH keys within /root/.ssh and read the flag:
Remediation Steps
Steps from here will rank from usefulness:
- Enable TLS/SSL encryption on HTTP requests made to the port 5000 health check server to avoid credentials being sent over in plaintext.
- Edit the /etc/sudoers file to remove the configuration allowing unrestricted use of tcpdump on the system.
- Reimplement API health check to use API keys or a token based authentication instead of hardcoded credentials.
References
https://cwe.mitre.org/data/definitions/319.html



OSPF poisoning attack possible on 10.200.0.0/24 subnet – CRITICAL
CWE-940, CVSS3.0 9.8:AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
Summary
There was a vulnerability discovered in the OSPF network on 10.200.0.0/24, an attacker if directly connected to the network or had gotten access to the network via one of the routers could potentially poison OSPF tables to intercept traffic coming from any subnet.
Steps To Reproduce
- Once logged into a router or device with routing capabilities, install tcpdump and frr.
- Establish a connection with the OSPF network:
- Create a listener using tcpdump on port 80 (the traffic we're trying to intercept):



- Create 'fake' interfaces that appear to connect directly to the subnets we're targeting:
- Advertise those routes using OSPF:
- Wait and then read our capture for the SSH keys:


- Save and use the SSH keys to login to root on any device on the 10.0.0.0/8 network:
- Login to netadmin @ 10.200.0.10 and read the key:


Remediation Steps
Steps from here will rank from usefulness:
- Implement OSPF authentication to avoid unauthorized routers from joining the OSPF network.
- Implement ACLs to ensure only trusted devices are allowed to communicate with routers on the network.
- Enable passive interfaces on subnets that don't need OSPF to function.
References
https://cwe.mitre.org/data/definitions/940.html
Docker escape possible on netadmin (10.200.0.10) – CRITICAL
CWE-250, CVSS3.0 9.8:AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
Summary
There was a vulnerability detected on the netadmin container located at 10.200.0.10 in the 10.0.0.0/8 network, which when abused allows a docker container to escape its environment and attack the host machine.

Steps To Reproduce
- Logged into root on the netadmin box view the cgroup capabilities of this docker container using the capsh –print command:
Because we have the CAP_SYS_ADMIN capability we're allowed a lot of control over the host device!
- View the disk devices directly connected to the container using lsblk:
- Make a directory and mount the device in its entirety to that folder:


- View the contents and reveal the host operating system:
- Find the flag in the /root/ folder of the host operating system:




Remediation Steps
Steps from here will rank from usefulness:
- Remove privileged capabilities from docker container when running or only allow specific capabilities for the task.
- When running containers prevent access to the host disk devices.
- Run the docker container as a non-root user.
References
https://cwe.mitre.org/data/definitions/250.html https://blog.trailofbits.com/2019/07/19/understanding-docker-container-escapes/ https://unit42.paloaltonetworks.com/container-escape-techniques/