Did you see that?
Something feels off on this machine. No alerts. But the network is not quiet.
Snort is installed. It should be catching something. So either:
I don't like either answer. Let's find out what's really happening.
Wait for the Snort VM on the right to finish booting. Once the login prompt appears, log in.
root
No password. Just hit Enter.
If something is hitting this machine, it has to come in somewhere. That somewhere is called a network interface.
ip addr show
You'll get a list. Look for one marked UP with an IP address on it. Something like:
2: ?????: <BROADCAST,MULTICAST,UP>
inet A.B.C.D/24 brd ...
Write down what you found:
Good. Now you know where traffic arrives. Every command from here uses that interface name.
Snort is installed. But it's doing nothing. Here's why: Snort runs on rules. Without rules, it sees traffic and reports nothing.
Rules live here on this machine:
/etc/snort/rules/local.rules
cat /etc/snort/rules/local.rules
You'll see a mostly empty file. Maybe some comments, no real rules. That's why Snort is blind.
Somewhere in the traffic hitting this machine, the attacker is sending a pattern, a keyword. Your job is to write a rule that catches it.
What does a Snort rule look like?
Every rule follows this structure:
"alert".Since we don't know the attacker's details yet, what will you enter to catch them? Write the whole rule:
Open the rules file in an editor and add your rules. Use nano if you want
something simple, or vi if you're comfortable with it.
nano /etc/snort/rules/local.rules
vi /etc/snort/rules/local.rules
Write your rules, one per line. Save when done.
nano: save with Ctrl+O, exit with Ctrl+X.vi: press i to start typing, then Esc and type :wq to save and exit.
Rules are ready. Start Snort and point it at the interface you found in Step 2.
snort -A console -q -i <interface>
When traffic matches your rules, Snort prints something like this:
[**] [1:1000001:1] UDP TRAFFIC [**] [Priority: 0]
{UDP} 10.0.0.???:48752 -> 10.0.0.10:????
That second line is the important one. It shows where the traffic came from and where it's going.
10.0.0.??? — the attacker's IP. You need the last number after the final dot.:???? — the number at the end of your
machine's address.
Now for the payload. The alerts show you the IP and port, but not what's inside the packet. To see the content being sent, you need to look deeper.
Stop Snort with Ctrl+C, then run it in sniffer mode:
snort -v -d -e -i <interface>
This dumps the full packet. On the right side you'll see readable text. Look for a word in there:
50 4B 54 3A 36 30 34 20 67 68 6F 73 74 PKT:604 ????
That word is what the attacker is sending. Write it down.
You have all three. Now put them together.
The IT team needs a report. Package what you found into a single string.
The last octet
The attacker's IP is four numbers separated by dots:
A.B.C.D. You only need D, the last one.
10.0.0.138 → use 138
The destination port
From the alert line, the number after the colon on your machine's side:
10.0.0.138:48752 -> 10.0.0.10:3306
use this one
The keyword
The word you spotted in the packet dump:
PKT:604 ghost → use ghost
Put it together:
found
Type your flag when prompted. Use your actual values, not the example.
cat /etc/snort/rules/local.rules
nano /etc/snort/rules/local.rules
snort -A console -q -i <interface>
snort -v -d -e -i <interface>
found