In this environment, there are two Ubuntu endpoints. One is for the attacker and the other to host the vulnerable applications and provide an environment for detection. This first challenge will involve setting up the network detections and packet capture.
-
Start by connecting to the Ubuntu Defender Endpoint
-
Create a new terminal session for Suricata:
screen -S suricata
Note: Multiple terminals will be required to manage the various tasks. Since we are presenting the terminal environment through a browser, the Linux tool
screen
will assist with this.screen -S [name]
= Creates a new terminal session and names itCTRL + A
, let go, and then pressD
= Disconnects from a terminal sessionscreen -r [name]
= Reattaches to an available terminal sessionscreen -ls
= Lists any available screen terminal sessions and their status
-
Start Suricata with the available log4j rules:
sudo suricata -S ~/lab/emerging-threats-log4j.rules -l ~/lab -i eth0
Note: There may be a "Warning" that appears stating the flowbit 'ET.RMIRequest' is checked but not set. This is expected and will not affect your detections.
-
Detach from that session by using the button key combinations of
CTRL + A
, let go, and then pressD
. -
Create a new terminal session for tcpdump:
screen -S tcpdump
-
Start tcpdump:
sudo tcpdump -nn 'not port 22 and not port 443' -w analysis.pcap
Note: To reduce the noise, we are filtering out port 22 (your SSH sessions) and port 443 (the AWS instances generate a lot of automatic HTTPS traffic).
-
Detach from that session by using the button key combinations of
CTRL + A
, let go, and then pressD
. -
At this point you should have two screen sessions. You can check this with:
screen -ls
-
The vulnerable application has been started automatically in a local Docker container. Test to make sure the application is responding:
curl localhost:8080
Note: The application will respond with an error and 400 status code. This is expected and means the application is responding successfully.
-
The Proof of Concept (POC) test will involve creating a new file in the application's /tmp/ directory. Check its current files and take note of what you see there:
sudo docker exec vulnapp2 ls /tmp
Suricata is an open-source Intrusion Detection System (IDS) we will be using to detect Log4j exploits inside network traffic. If you are interested in learning more about Suricata, check out: Network Security Monitoring with Suricata.
Congratulations! It may not seem like much just yet, but you've setup the infrastructure for detection and tested to ensure the vulnerable application is operating properly. We'll come back here, but for now let's move on to the attacker.