Read a Connection Dump During an Incident
During last night's slowdown, someone saved ss -tan from a web server to /home/student/incident/ss-capture.txt. The team wants the same short summary every time.
Create the executable script /home/student/bin/ss-report.sh FILE that prints:
<STATE> <count> per TCP state in the file, sorted by count (highest first), ties by state name,syn-recv-top: <ip> <count>: the remote IP address with the most SYN-RECV connections (ties: the smaller address as text). Leave the line out if there are none,established-443: <count>: ESTAB connections whose local port is 443.Addresses may be IPv4 (10.0.0.5:443), IPv6 ([2001:db8::5]:443) or IPv4-mapped ([::ffff:203.0.113.9]:51514). Report an IPv4-mapped address as plain IPv4 (203.0.113.9). The header line isn't a connection.
About this machine
Ubuntu 24.04 with no internet access. You are student with passwordless sudo. The grader checks the final state of the machine, not the commands you typed. Values like names and ports are generated for you.
Part of Networking and TLS in Practice. Next step: Find the Slow Endpoint with curl
Teaching or writing about this? Embed this lab on your page
Your machine is ready to start
A fresh, isolated Ubuntu machine boots in a few seconds with the task already set up.
No account needed: 3 of 3 free tries left. Guest machines last 30 minutes.