Use regular expressions to solve the following challenges and uncover evidence in this outsider threat scenario.
Your organization has detected suspicious activity suggesting an outsider may be exfiltrating sensitive data.
As the forensic analyst, you need to investigate logs from April 8-9, 2025 to identify the culprit and understand what happened.
Your mission: Solve the four progressive challenges that require regex skills to identify the culprit.
The first step is to identify any suspicious external IPs attempting to access our systems.
HTTP status code 401 means "Unauthorized" - look for this number in the logs.
Try creating a regex that matches an IP address excluding the internal network range followed by something that contains "401".
Account for irrelevant characters within a line using the pattern "".*" which means any non-newline character 0 to as many times.
^(?!192\.168\.)([25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?\.){3}([25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?).*401
What This Reveals:External IP address 198.51.100.72 made failed login attempts with 401 (Unauthorized) error codes.
Now that we've identified a suspicious IP, we need to determine if and when they successfully accessed our systems.
Look for the word "Accepted" in combination with the suspicious IP address.
The auth logs show successful login attempts with the format "Accepted password for [username]".
Accepted password for admin from 198\.51\.100\.72
What This Reveals:After three failed attempts, the intruder successfully logged in as "admin" at 23:19:45 on April 8, 2025. The log even flags this as "SUSPICIOUS_LOGIN_TIME" since it's after normal business hours.
Now we need to determine what sensitive data may have been compromised during this breach.
Look for the keyword "customer" in the command logs.
For a basic regex, you can simply use the word "customer" to find all related entries.
.*customer.*
What This Reveals:This will match the line in auth-log.txt showing:
Apr 09 01:15:41 server sudo: admin : USER=root ; COMMAND=/bin/tar -czvf /tmp/secret_archive.tar.gz customer_database.xlsx
The intruder created an archive of our customer database file, which contains sensitive customer information.
Finally, we need to determine how the intruder removed the data from our network.
Look for email addresses containing "competitor.com" in the domain part.
Look for evidence of emails to external domains, uploads to external sites, or USB storage activity.
@(?!company\.com).*\.com
What This Reveals:This will match the line in email-log.txt showing:
Apr 09 01:23:32 mail-server postfix[7830]: to=<jane.doe@competitor.com>, relay=mail.competitor.com, status=sent
The intruder sent our customer database to an email address at our competitor, indicating corporate espionage.
Intruder: External actor from IP 198.51.100.72
Access Time: April 8, 2025 at 23:19:45 (after hours)
Compromised Data: Customer Database (Excel format)
Exfiltration Methods:
Key Evidence: Multiple connections to competitor.com domain, suggesting corporate espionage.