Latest / CyberCode Academy / Course 13 - Network Forensics | Episode 4: Log Analysis, SIM Correlation, and Network Attack Signature Detection
Transcript
- 0:00Speaker 1: Welcome back to the deep dive. Today, we are peering
- 0:03Speaker 1: into what you might call the silent history of your network.
- 0:07Speaker 1: We're going to be doing a deep dive into log analysis.
- 0:10Speaker 1: I mean, that's the record of every single tiny event
- 0:13Speaker 1: happening across your devices, your riders, your switches, everything.
- 0:17Speaker 2: Think of it as the complete diary of your entire infrastructure.
- 0:22Speaker 2: And our mission today is really to explain why logging
- 0:25Speaker 2: the right information isn't just a chore, it's really the
- 0:28Speaker 2: foundational first line of defense in cybersecurity. We're going to
- 0:31Speaker 2: break down how analysts turn this this absolute tidal wave
- 0:35Speaker 2: of digital noise into alerts that actually mean something.
- 0:38Speaker 1: Okay, so let's jump right in with the biggest problem,
- 0:40Speaker 1: the one that every security operations center faces, which is
- 0:44Speaker 1: just the noise. The noisy as especially with something like
- 0:47Speaker 1: an intrusion detection system and IDs right out of the box,
- 0:50Speaker 1: they just seem to generate a crazy number of false positives.
- 0:53Speaker 2: Oh, it's a massive issue as one that really undermines
- 0:55Speaker 2: the whole security posture of an organization. I mean, when nine,
- 1:00Speaker 2: maybe even ninety five percent of your alerts are just noise,
- 1:03Speaker 2: it's just junk. Yeah, it's just junk, and it creates
- 1:06Speaker 2: a serious psychological fatigue. It's a real human problem. If
- 1:09Speaker 2: the system is constantly crying wolf, what do you think happens.
- 1:14Speaker 1: Well, your security teams, they're just conditioned to ignore it.
- 1:17Speaker 1: They just tune it out completely.
- 1:18Speaker 2: Exactly, And we have a chilling real world example of
- 1:22Speaker 2: where that exact thing happened.
- 1:24Speaker 1: I think I know the one you're talking about.
- 1:25Speaker 2: The home depot breach. They had FireEye appliances that were
- 1:30Speaker 2: correctly alerting them to suspicious activity. The system was doing
- 1:35Speaker 2: its job.
- 1:36Speaker 1: But no one was listening.
- 1:37Speaker 2: No one was listening. The organizational culture was already so
- 1:40Speaker 2: conditioned to disregard this high volume of false positives that
- 1:44Speaker 2: the critical, legitimate warnings were just missed. Wow, a sophisticated attack,
- 1:49Speaker 2: completely missed because the staff had literally learned to tune
- 1:53Speaker 2: out the noise.
- 1:54Speaker 1: That really drives home a crucial point. Then, before you
- 1:56Speaker 1: can even think about analysis, you can't just collect data blows.
- 2:00Speaker 1: You have to have a.
- 2:01Speaker 2: Baseline, You absolutely must. You have to define what normal
- 2:04Speaker 2: looks like in your environment. Only then do you have
- 2:07Speaker 2: any idea what the right stuff to log even is.
- 2:10Speaker 1: Otherwise you're just creating the conditions for failure yourself.
- 2:13Speaker 2: That preparation is it's mandatory. So when we talk about
- 2:16Speaker 2: the best practices for logging, you have to start at
- 2:19Speaker 2: the strategic level. You need a formal logging strategy. You
- 2:22Speaker 2: need to structure your log data consistently, which is so
- 2:26Speaker 2: critical for machines, to process it, centralize it all using
- 2:30Speaker 2: EQUE ideas, and of course keep it all in real time.
- 2:34Speaker 1: So let's talk about the integrity of that record. You
- 2:36Speaker 1: say logs are this historical record for accountability. How far
- 2:40Speaker 1: does that go. It sounds like you have to treat
- 2:42Speaker 1: them almost like they're sacred.
- 2:44Speaker 2: That's a great way to put it. Yeah, they must
- 2:45Speaker 2: be treated exactly like a general ledger in accounting. Okay,
- 2:49Speaker 2: think about it. If someone can go back and change
- 2:51Speaker 2: the history of financial transactions, the entire record is meaningless worth.
- 2:57Speaker 2: Same thing is true for security logs. Because they provide
- 3:00Speaker 2: that accountability, their integrity is paramount. This means your storage,
- 3:05Speaker 2: your system, it has to enforce read only access. Even
- 3:09Speaker 2: your administrators shouldn't be able to write over old files.
- 3:12Speaker 1: But wait, if an attacker gets control of the machine
- 3:15Speaker 1: that's generating the logs, couldn't they just change them before
- 3:18Speaker 1: they're even sent, or just turn logging off.
- 3:22Speaker 2: That is the nightmare scenario, and it's why we have
- 3:25Speaker 2: layers of integrity controls. So for logs that are already
- 3:28Speaker 2: stored centrally, we rely on technical countermeasures. Yeah, the main
- 3:32Speaker 2: one is hashing.
- 3:33Speaker 1: Okay, so you mean like SAHA two fifty six or
- 3:35Speaker 1: something similar.
- 3:36Speaker 2: Precisely, as soon as a log file is generated and stored,
- 3:40Speaker 2: you immediately run a strong hashing algorithm on it. Then
- 3:43Speaker 2: you store that resulting hash somewhere else, somewhere secure. Sometimes
- 3:47Speaker 2: you'll even use something called hash chaining.
- 3:49Speaker 1: And hash chaining that means if you change one log
- 3:51Speaker 1: it messes up the entire sequence after it.
- 3:53Speaker 2: Exactly, if you modify even a single character in that
- 3:56Speaker 2: log file, the cryptographic hash changes completely, immediate proof of tampering.
- 4:01Speaker 2: But you have to store that hash off device, because
- 4:04Speaker 2: if the attacker owns the log file, they can just
- 4:06Speaker 2: make a new hash for their new file.
- 4:08Speaker 1: Got it. So that separate secure hash is your audit mechanism,
- 4:12Speaker 1: and so hashing is for integrity. But what about just
- 4:15Speaker 1: keeping people from reading them? Confidentiality?
- 4:18Speaker 2: Right, And that's where encryption comes in. Logs can have
- 4:21Speaker 2: really sensitive stuff in them, personal info network blueprints, so
- 4:25Speaker 2: they have to be stored in an encrypted form. So
- 4:27Speaker 2: you've got encryption for confidentiality protecting the content, and hashing
- 4:31Speaker 2: for integrity protecting the history.
- 4:33Speaker 1: Okay, let's pivot a little to the sheer scale of this.
- 4:36Speaker 1: All these controls for every single network event that must
- 4:41Speaker 1: create a monster of a storage problem. I know NIST
- 4:45Speaker 1: has guidance on this, but what's the real world limitation here?
- 4:48Speaker 2: The limitation is pretty simple. You cannot store everything forever.
- 4:53Speaker 2: It's just not feasible, and retention policies usually dictate, you know,
- 4:56Speaker 2: ninety days, six months, maybe a year, and attack They
- 5:00Speaker 2: know this. They are keenly aware of this storage problem,
- 5:04Speaker 2: which is why they use low and slow tactics.
- 5:06Speaker 1: And how does low and slow play on those retention limits, So.
- 5:09Speaker 2: They'll spread their attack out over a very long period,
- 5:11Speaker 2: say eighteen months, just incredibly subtle little moves. By the
- 5:15Speaker 2: time an analyst finally starts seeing activity, it looks like
- 5:17Speaker 2: a breach.
- 5:18Speaker 1: The initial logs are gone.
- 5:19Speaker 2: The initial reconnaissance logs from a year ago have already
- 5:22Speaker 2: been cycled out of retention poof gone, and that makes
- 5:26Speaker 2: correlating the full timeline of the attack, well, basically impossible.
- 5:31Speaker 1: So to fight that, we centralize. I know cislog is
- 5:34Speaker 1: sort of the old standard for collection, but what about
- 5:36Speaker 1: for the actual analysis.
- 5:38Speaker 2: Yeah, cislog is still the most common open source protocol
- 5:41Speaker 2: for just getting all the logs in one place. But
- 5:43Speaker 2: cislog is really just the delivery truck. It's not the brain,
- 5:47Speaker 2: not at all. To really analyze and correlate logs from
- 5:50Speaker 2: all these different sources. You've got files, operating systems, network
- 5:54Speaker 2: traffic applications, you need a security, information and event management system.
- 6:00Speaker 1: So the SIM is the brain.
- 6:01Speaker 2: The SIM is the correlation engine exactly. It's not a
- 6:04Speaker 2: logging system itself. It's an analysis utility that takes in
- 6:07Speaker 2: all those different log formats, normalizes them, and then gives
- 6:10Speaker 2: you near real time notifications by connecting the dots between
- 6:13Speaker 2: events that might be hours or even days apart on
- 6:16Speaker 2: totally different systems.
- 6:18Speaker 1: Okay, let's get into some practical indicators then, starting with
- 6:22Speaker 1: what you said is the most basic but mandatory requirement
- 6:26Speaker 1: log all unsuccessful authentication attempts. Why is that always the
- 6:31Speaker 1: first giveaway?
- 6:32Speaker 2: It's purely a numbers game. You have your baseline, right,
- 6:35Speaker 2: Let's say your company averages. I don't know one hundred
- 6:37Speaker 2: unsuccessful log ins atay, people forget passwords, they have typos.
- 6:40Speaker 2: It's normal, sure, But then suddenly your sim dashboard lights
- 6:45Speaker 2: up with ten thousand unsuccessful attempts in a single day,
- 6:50Speaker 2: all coming from a handful of ips.
- 6:52Speaker 1: Yeah, that's not a typo.
- 6:53Speaker 2: That is not a typo. That exponential spike is an
- 6:56Speaker 2: undeniable indicator of a brude force or a dictionary attack.
- 6:59Speaker 1: No question, It's not just the failures. The successes can
- 7:02Speaker 1: be just as telling, maybe even more so, when an
- 7:04Speaker 1: account is already compromised.
- 7:05Speaker 2: Oh absolutely, you have to log successful authentications. So if
- 7:09Speaker 2: your baseline is a thousand successful log ins a day
- 7:12Speaker 2: for your eight hundred employees, but all of a sudden
- 7:14Speaker 2: you see twenty thousand successes and they're all coming from
- 7:17Speaker 2: just three user accounts from locations that are geographically impossible.
- 7:21Speaker 1: That means the credentials are out there. Someone is using
- 7:24Speaker 1: them repeatedly.
- 7:26Speaker 2: To get into multiple different resources. It's a clear sign
- 7:29Speaker 2: of compromise.
- 7:30Speaker 1: This data problem keeps bringing us back to this idea
- 7:32Speaker 1: of reduction. You mentioned audit reduction tools or preprocessors. Why
- 7:37Speaker 1: do we still need to strip away volume. Even with
- 7:39Speaker 1: all the modern big data tools like hadoop and machine learning.
- 7:43Speaker 2: Well, it really comes down to cost and the performance
- 7:46Speaker 2: of the sim itself. These audit production tools, they're designed
- 7:49Speaker 2: to shrink the sheer volume of records before they ever
- 7:53Speaker 2: hit that expensive correlation engine. Okay, and while yeah, big
- 7:58Speaker 2: data and mL help you analyze law more efficiently, they
- 8:01Speaker 2: still can't efficiently process irrelevant junk. You're just wasting cycles.
- 8:05Speaker 1: And money, which leads us right into this cautionary tale
- 8:08Speaker 1: about the massive cloud bills. Tell us what the financial
- 8:11Speaker 1: risk if you get this step wrong.
- 8:13Speaker 2: It's an operational failure story. I've seen way too many times. Unfortunately,
- 8:17Speaker 2: I've had customers they get so excited about deploying a
- 8:20Speaker 2: new correlation sensor like Splunk, but they make one catastrophic mistake.
- 8:24Speaker 2: They bypass normalization and they just point all their raw
- 8:27Speaker 2: vent logs, all their network traffic directly at the correlation system.
- 8:31Speaker 2: And the consequence of that is the consequence is a
- 8:34Speaker 2: sudden massive bill. The system is designed for filtered data,
- 8:39Speaker 2: but they're just flooding it with raw, unprocessed traffic. And
- 8:42Speaker 2: since the cost for a lot of these cloud based
- 8:44Speaker 2: sims is based directly on data ingestion. Oh no, in
- 8:48Speaker 2: a bill. In one case, I remember it was upwards
- 8:50Speaker 2: of eighty thousand dollars. Oh for that first period of ingestion.
- 8:54Speaker 2: Just because they flooded the sensor, the panic sets in,
- 8:56Speaker 2: they shut it down, but the damage is done. Shows
- 9:00Speaker 2: you that filtering and reduction aren't just for efficiency, they're
- 9:03Speaker 2: a critical financial guardrail.
- 9:05Speaker 1: All right, this is where the deep dog gets really technical.
- 9:08Speaker 1: Let's look at the actual signatures attackers leave behind even
- 9:11Speaker 1: when they're trying to cover their tracks. Starting with a
- 9:13Speaker 1: basic ping or ICMP.
- 9:15Speaker 2: The beauty of ICMP is how predictable it is. The
- 9:18Speaker 2: standard ping request. The payload has this really recognizable pattern.
- 9:24Speaker 2: It's just the alphabet abcd fgh repeating. That's your baseline.
- 9:28Speaker 2: So if a log shows an ICMP packet with a
- 9:31Speaker 2: payload that is anything other than that standard sequence, it
- 9:35Speaker 2: should trigger a high severity alert immediately.
- 9:38Speaker 1: Why what would a different payload even mean.
- 9:40Speaker 2: It's a very strong indicator of covert communication of tunneling.
- 9:44Speaker 2: Attackers are trying to hide data exfiltration or command control
- 9:48Speaker 2: traffic inside the ICMP protocol, trying to make it look
- 9:52Speaker 2: like a simple network health check. You basically just spotted
- 9:54Speaker 2: a secret tunnel.
- 9:55Speaker 1: We can also track the very foundation of network communication,
- 9:58Speaker 1: right the TCP three way handshake s y n ctodss ack.
- 10:03Speaker 1: Which applications should we be watching for after we see
- 10:06Speaker 1: that handshake.
- 10:07Speaker 2: Well, if you see a successful handshake and then activity
- 10:09Speaker 2: on port twenty one, that's FTP file transfer. The logs
- 10:13Speaker 2: for that session will show you everything in plain text.
- 10:16Speaker 2: The log in the password directory changes, any.
- 10:18Speaker 1: File deletions, and port twenty three.
- 10:20Speaker 2: Port twenty three is telnet. And if you see talentet
- 10:23Speaker 2: activity and it has references to nt land Manager NTLM authentication,
- 10:27Speaker 2: that's a huge red flag.
- 10:28Speaker 1: Why is NTLM specifically such a big deal.
- 10:31Speaker 2: NTLM is a legacy Windows authentication protocol. It's much less secure.
- 10:37Speaker 2: Modern networks should be using Carberos. So if an attacker
- 10:40Speaker 2: is somehow triggering NTLM instead, it suggests they're trying to
- 10:44Speaker 2: force a downgrade attack or exploit older vulnerabilities. It's a
- 10:48Speaker 2: little technical nugget hiding right there on the logs.
- 10:51Speaker 1: Now, let's talk about spotting reconnaissance. How do the logs
- 10:54Speaker 1: help us tell the difference between just a single connection
- 10:58Speaker 1: and someone who's actively mapping out our whole network.
- 11:01Speaker 2: It all comes down to pattern recognition. You're looking for
- 11:04Speaker 2: predictable changes in either the destination IP or the destination port. Yeah,
- 11:09Speaker 2: a ping sweep is when the source IP stays the same,
- 11:12Speaker 2: but the destination IP just increments.
- 11:14Speaker 1: Predictably, like it's going down the list dot thirty four,
- 11:17Speaker 1: thirty five, dot thirty.
- 11:18Speaker 2: Six, exactly, just checking to see who's home.
- 11:20Speaker 1: And a port scan is just the opposite of that.
- 11:22Speaker 2: Yes, in a port scan, the source IP is constant,
- 11:25Speaker 2: but now the destination ports are changing. You're scanning one
- 11:27Speaker 2: machine for all its open services, and if you see
- 11:30Speaker 2: it going sequentially port one, part two, Port three, that's
- 11:33Speaker 2: a really sloppy scan that any IDs will catch.
- 11:36Speaker 1: But the modern scanners are smarter.
- 11:38Speaker 2: Oh yeah, way smarter. A tool like endmap, it's not
- 11:40Speaker 2: going to be sequential. It'll jump around to common ports.
- 11:43Speaker 2: Check four forty five for FMB, then jump to three
- 11:46Speaker 2: three eighty nine for RDP, then maybe one thirteen. It
- 11:49Speaker 2: does this specifically to try and avoid those simple detection rules.
- 11:53Speaker 1: We can also look for specific port numbers that are
- 11:55Speaker 1: basically known calling cards for malicious tools.
- 11:58Speaker 2: Definitely, logs will often just light up with non trojan
- 12:01Speaker 2: activity based on the port Port one two three four five,
- 12:04Speaker 2: for example, is famously links to the old netbus trojan
- 12:07Speaker 2: and of course the classic port three one three three.
- 12:10Speaker 1: Seven spells elite in lite speak, the.
- 12:12Speaker 2: Old school hacker calling card, a known indicator of backdoor access.
- 12:16Speaker 1: Okay, let's get even deeper into the mechanics of how
- 12:18Speaker 1: an idea something like snort actually identifies these scans by
- 12:22Speaker 1: looking at the TCP flags.
- 12:24Speaker 2: This is where it gets really granular. A normal TCP
- 12:26Speaker 2: packet starting a connection should just have the s YN
- 12:29Speaker 2: flag set. Yeah, that's it. So if an I DSc
- 12:31Speaker 2: is a packet coming from the outside that is an
- 12:33Speaker 2: SYN packet, it's suspicious.
- 12:35Speaker 1: Well like a null scan.
- 12:36Speaker 2: A null scan is a perfect example. That's a packet
- 12:39Speaker 2: with no flag set at all, that is basically an
- 12:42Speaker 2: anatomically impossible packet for a legitimate connection to guaranteed alert.
- 12:46Speaker 1: And then there's the infamous Christmas scan, the one that's
- 12:49Speaker 1: all lit up.
- 12:49Speaker 2: The Christmas scan, right, it's defined by having the FIN,
- 12:53Speaker 2: the urgent, and the PSH flags all set at the
- 12:57Speaker 2: same time. And to know why that's bad, you have
- 13:00Speaker 2: to know what they mean. Fin means I'm done with
- 13:03Speaker 2: this connection. PSH means push this data now, RG means
- 13:07Speaker 2: that data is.
- 13:08Speaker 1: Urgent, So you're trying to close the connection while also
- 13:11Speaker 1: urgently pushing data.
- 13:13Speaker 2: It makes no logical sense, No legitimate connection would ever
- 13:15Speaker 2: do that. The flags are all lit up like a
- 13:17Speaker 2: Christmas tree, hence the name, and it's designed to confuse firewalls.
- 13:21Speaker 1: And the IDs is so specific it can even tell
- 13:23Speaker 1: what tool was used.
- 13:24Speaker 2: Yes, the rules are that specific. A good IDs will
- 13:26Speaker 2: have rules that can tell the difference between say an
- 13:29Speaker 2: n MAP Christmas scan which only sets fin URG and PSH,
- 13:33Speaker 2: and a more traditional one that might set all the flags.
- 13:35Speaker 2: You know, not just what's happening, but maybe even the
- 13:37Speaker 2: exact tool they're using.
- 13:38Speaker 1: So this whole deep dive really reinforces that the end
- 13:41Speaker 1: goal is always correlation. Taking these raw logs from files,
- 13:46Speaker 1: the OS, network traffic applications, and then using a SIM
- 13:50Speaker 1: to put it all together into one single actionable picture.
- 13:54Speaker 2: And while the industry is just saturated right now with
- 13:57Speaker 2: marketing about AI and machine learning and give you precognitive abilities.
- 14:01Speaker 1: Like seeing attacks before they happen.
- 14:03Speaker 2: Right like the pre cogs and Minority Report, the reality
- 14:06Speaker 2: is we still rely heavily on very carefully tuned baselines,
- 14:10Speaker 2: very precise rules, and the ability to ruthlessly, ruthlessly cut
- 14:14Speaker 2: through the noise.
- 14:15Speaker 1: It's that tension, isn't it, between the sheer scale of
- 14:17Speaker 1: the data and the fact that you just can't store
- 14:19Speaker 1: or process everything forever.
- 14:21Speaker 2: That is the defining challenge, which brings us to a
- 14:23Speaker 2: final thought for you, the listener. Okay, if you are
- 14:26Speaker 2: a security analyst and you're dealing with millions of log
- 14:28Speaker 2: entries every day and your storage is severely limited, what
- 14:32Speaker 2: single non authentication data point would you prioritize logging above
- 14:36Speaker 2: all else to uncover a really sophisticated, low and slow
- 14:40Speaker 2: internal threat. Think about priority, integrity and reduction as you
- 14:44Speaker 2: moll that over