Latest / CyberCode Academy / Course 13 - Network Forensics | Episode 7: Web Traffic Analysis and Browser Forensics: Handshakes, DNSSEC, and Cookies
Transcript
- 0:00Speaker 1: Welcome back to the deep dive. You know, think about
- 0:02Speaker 1: the last time you typed a website into your browser
- 0:05Speaker 1: and hit enter In that split second before anything even
- 0:09Speaker 1: loads your computer and some server, maybe thousands of miles away,
- 0:14Speaker 1: are having this, well, this invisible conversation. It's laying down
- 0:17Speaker 1: this digital trail of breadcrumbs almost meticulously.
- 0:21Speaker 2: And that's exactly the trail we want to follow today.
- 0:24Speaker 2: Our whole mission here is to give you the blueprint
- 0:26Speaker 2: for reading those signals. We're going to dive into the
- 0:29Speaker 2: foundational skills of web traffic analysis and digital forensics. We'll
- 0:34Speaker 2: focus on that very first moment a connection happens and
- 0:37Speaker 2: the deep lasting artifacts that get left behind on a machine.
- 0:40Speaker 1: Right, and this isn't just for high level security professionals.
- 0:44Speaker 1: If you really want to understand the depth the persistence
- 0:47Speaker 1: of your own digital footprint and how experts or even
- 0:50Speaker 1: attackers piece together what you've been doing, this is essential stuff.
- 0:53Speaker 1: The moment you connect, you set off this whole cascade
- 0:55Speaker 1: of events exactly.
- 0:57Speaker 2: And what's so fascinating is that pretty much every sec
- 1:00Speaker 2: scessful communication on the Internet starts with the exact same
- 1:04Speaker 2: formal introduction. It's a very specific three step sequence. It
- 1:08Speaker 2: confirms both intent and capability.
- 1:10Speaker 1: Okay, let's unpack that. I know this is a foundational
- 1:12Speaker 1: skill for anyone looking at like network packets. It's the
- 1:15Speaker 1: famous three way handshake. Right, but let's go beyond just hello,
- 1:19Speaker 1: I hear you, and let's talk what are the technical
- 1:21Speaker 1: steps and what are they actually confirming?
- 1:24Speaker 2: So we're talking about the TCP handshake. The steps are
- 1:26Speaker 2: s yn, s yn, ack, and ack. First, your machine,
- 1:31Speaker 2: the client sends a s yn message. It's a synchronization request.
- 1:35Speaker 2: It's basically saying, hey, I want to start a conversation
- 1:37Speaker 2: and here's my starting number. The server gets that, and
- 1:40Speaker 2: if it's listening, it sends back s Y and ack
- 1:42Speaker 2: that synchronization. The acknowledgement it said, got it, and here's
- 1:45Speaker 2: my starting number.
- 1:46Speaker 1: And then the final ack from the client just locks
- 1:49Speaker 1: it all in.
- 1:49Speaker 2: It locks it in and for an analysis is so powerful.
- 1:52Speaker 1: Why what does it prove right away?
- 1:53Speaker 2: It proves two things immediately. One, the client is real
- 1:56Speaker 2: and it's trying to connect. Two the servers up. It's
- 2:00Speaker 2: listening and it's ready to transfer data. If you see
- 2:03Speaker 2: syn go out but nothing comes back, you know the
- 2:06Speaker 2: server's probably down or maybe a firewall is blocking it.
- 2:09Speaker 2: Seeing that full sequence is the absolute cornerstone. It means
- 2:12Speaker 2: data transfer is about to happen.
- 2:14Speaker 1: And as soon as that handshake is done, you're looking
- 2:16Speaker 1: at the port number to figure out what kind of
- 2:18Speaker 1: traffic it is.
- 2:19Speaker 2: Precisely, the port number is your first clue. If that
- 2:22Speaker 2: connection is going to port eighty, you can bet its
- 2:24Speaker 2: standard unencrypted web traffic HTTP port four to forty three.
- 2:28Speaker 2: That's encrypted. HTTPS. Port twenty three is Telnet unencrypted remote access.
- 2:33Speaker 2: It's like a big flashing sign. This cross referencing is
- 2:36Speaker 2: a critical skill for just rapidly assessing what's going on.
- 2:39Speaker 1: Now. You mentioned something really interesting that analysts can sometimes
- 2:41Speaker 1: figure out the servers operating system almost instantly. How isn't
- 2:46Speaker 1: that usually hidden?
- 2:47Speaker 2: It should be ideally, yes, but often it's not. After
- 2:52Speaker 2: the handshake, the client sends its first real request, usually
- 2:55Speaker 2: a get tea request asking for the web page. What's
- 2:58Speaker 2: critical is the service response header. We've seen captures where
- 3:01Speaker 2: that hitder literally says it's running ICE.
- 3:03Speaker 1: Five ISS five. That sounds like something you'd find in
- 3:06Speaker 1: a digital archaeology DIG Is that kind of disclosure? Just
- 3:09Speaker 1: announcing your software version a major security.
- 3:11Speaker 2: Problem oh, it's a huge one. Absolutely. That is five
- 3:15Speaker 2: example tells a forensic expert that they're almost certainly looking
- 3:17Speaker 2: at a Windows two thousand server. That's ancient. It's been
- 3:21Speaker 2: out of security support for decades. So if you spot
- 3:23Speaker 2: a three way handshake and then see a header revealing
- 3:26Speaker 2: an old, unpatched system, well you know everything you need
- 3:28Speaker 2: to about their security. Good administrators strip that info out,
- 3:31Speaker 2: but it often gets left in.
- 3:33Speaker 1: Okay, so the connection is established with the handshape, we
- 3:35Speaker 1: know the data type from the port. The next logical
- 3:38Speaker 1: step is making sure you're talking to the right server
- 3:40Speaker 1: in the first place. That brings us to DNS, the
- 3:43Speaker 1: Domain Name System correct.
- 3:45Speaker 2: DNS is basically the Internet's phone book. It translates a
- 3:49Speaker 2: name you can read like thedepdive dot com into the
- 3:52Speaker 2: numerical IP address the server actually uses. If the handshake
- 3:56Speaker 2: is starting the call, DNS is making sure you dial
- 3:59Speaker 2: the right number.
- 4:00Speaker 1: But that translation is famously vulnerable. I mean, we hear
- 4:03Speaker 1: about DNS poisoning all the time, right.
- 4:05Speaker 2: Cash poisoning is the common thread, but the most severe
- 4:08Speaker 2: attack is prisoning the source itself. We're talking about the
- 4:11Speaker 2: zone database files. These are the actual authoritative files in
- 4:15Speaker 2: the DNS server that map every name to an IP
- 4:18Speaker 2: for a whole domain. If an attacker gets in and
- 4:21Speaker 2: changes those files, they can silently redirect millions of users
- 4:24Speaker 2: to a malicious site, and they can do it in
- 4:26Speaker 2: a huge scale.
- 4:27Speaker 1: So what's the defense here? How do you add integrity
- 4:29Speaker 1: to a system that, I mean wasn't really built with
- 4:32Speaker 1: security in mind from the start.
- 4:34Speaker 2: The answer is DNS SEC DS security extensions. This isn't
- 4:38Speaker 2: just a small update, it's a major overhaul that adds
- 4:41Speaker 2: digital signatures to the process. So when you make a
- 4:44Speaker 2: DNS query, the server doesn't just give you an IP
- 4:46Speaker 2: address back, it gives you a cryptographically signed response that
- 4:50Speaker 2: proves the information is legitimate and hasn't been tampered with.
- 4:53Speaker 1: That sounds like a pretty big undertaking for organizations to implement.
- 4:57Speaker 1: Are there reasons people are slow to adopt it?
- 5:00Speaker 2: The complexity is definitely a hurdle. You have to manage
- 5:02Speaker 2: cryptographic keys, coordinate updates. It can impact performance a little
- 5:06Speaker 2: bit because the packets is slightly larger, but the security
- 5:08Speaker 2: benefit is just massive. It creates a chain of trust
- 5:12Speaker 2: all the way from the root servers down to your specific.
- 5:14Speaker 1: Domain, and for a forensics team after an attack. How
- 5:17Speaker 1: does DNSSE help them?
- 5:19Speaker 2: It creates accountability. If an attacker wants to compromise a
- 5:23Speaker 2: DNSSEC protected system, they had to jump through so many
- 5:27Speaker 2: more hoops. They can't just swap an IP address anymore.
- 5:30Speaker 2: They'd have to steal the private signing key, which is
- 5:32Speaker 2: a huge operation. And even if they did, the logs
- 5:36Speaker 2: around key management and the signature failures during the attack
- 5:39Speaker 2: would leave behind this highly detailed, undeniable evidence of what
- 5:43Speaker 2: they did.
- 5:43Speaker 1: So we've got the conversations started, secured and pointed in
- 5:47Speaker 1: the right direction. Now we shift from the network itself
- 5:50Speaker 1: to the vehicle or using the web browser, because this
- 5:53Speaker 1: is where the digital footprint gets really personal and incredibly persistent.
- 5:59Speaker 2: This is where web forensics really kicks in. The core
- 6:02Speaker 2: challenge for an investigator is that all the artifacts, your history,
- 6:04Speaker 2: your cash or cookies, they aren't stored in one neat
- 6:07Speaker 2: little place. Where they are depends entirely on the browser
- 6:10Speaker 2: edge Chrome, Firefox, and the version of the operating system.
- 6:14Speaker 2: He said.
- 6:14Speaker 1: The OS version can completely change where an analyst has
- 6:17Speaker 1: to look. Can you give us a really specific example
- 6:19Speaker 1: of that.
- 6:20Speaker 2: Sure, for anyone who's been around Windows for a while.
- 6:22Speaker 2: You'll remember that before Windows Vista, the standard user path
- 6:26Speaker 2: was something like C documents and settings username. That was
- 6:30Speaker 2: the structure, But modern Windows so Vista and everything after
- 6:35Speaker 2: completely retired that path. They switch to the much simpler
- 6:39Speaker 2: C user's username.
- 6:40Speaker 1: That's a huge difference.
- 6:41Speaker 2: It's massive. If a forensics expert is looking for, say,
- 6:45Speaker 2: cookie files on a modern Windows eleven machine, but they're
- 6:49Speaker 2: using old knowledge based on that documents and settings path,
- 6:52Speaker 2: they'll find nothing. They have to know to look in
- 6:55Speaker 2: the modern sea user's path and then navigate deep into
- 6:58Speaker 2: the app data folders for a specific browser. Knowing the
- 7:01Speaker 2: path is step one.
- 7:03Speaker 1: Let's focus on the history files because not all of
- 7:05Speaker 1: them are the same, are they. You have these two
- 7:07Speaker 1: very different structures, one for iedge and one for Firefox.
- 7:10Speaker 2: That's right. The file used by Internet Explorer and the
- 7:12Speaker 2: older edge browsers is called index dot dt and this
- 7:15Speaker 2: thing is famous for holding a huge amount of Internet activity.
- 7:19Speaker 2: But the really critical thing to know is that it's
- 7:21Speaker 2: a binary file.
- 7:22Speaker 1: And binary means what exactly for the person trying to
- 7:25Speaker 1: read it.
- 7:26Speaker 2: It means you can't just open index dot dat in
- 7:28Speaker 2: a text editor like notepad and expect to see website addresses,
- 7:32Speaker 2: it'll just look like gibberish. You need a specialized tool
- 7:35Speaker 2: like an index dot DBT viewer that's built to parse
- 7:38Speaker 2: that binary structure and reconstruct the data into something a
- 7:41Speaker 2: human can read. It makes it much more complex.
- 7:44Speaker 1: Okay, now, how does that compare to Firefox's history file.
- 7:48Speaker 2: So Firefox at least historically used a file called history
- 7:51Speaker 2: dot debt. The big difference is that this file is
- 7:54Speaker 2: saved in aske format. That means you could technically open
- 7:57Speaker 2: it in a text editor and read the URLs and
- 7:59Speaker 2: time t stands directly, no special software needed.
- 8:02Speaker 1: Okay, so it's simpler to read. What's the downside?
- 8:05Speaker 2: The trade off is often about the completeness of the evidence.
- 8:08Speaker 2: While it's easier to read the URLs, thehistory dot dat
- 8:11Speaker 2: file doesn't do a great job of linking that activity
- 8:13Speaker 2: to the cached web pages. So if an analyst wants
- 8:15Speaker 2: to reconstruct exactly what the user saw on the screen
- 8:18Speaker 2: the images, the layout that link between the history entry
- 8:21Speaker 2: and the cash files is harder to make.
- 8:23Speaker 1: All right, Let's move on to what might be the
- 8:25Speaker 1: most valuable artifact of all, the cookie. What is a
- 8:29Speaker 1: cookie and why does it so often survive when someone
- 8:32Speaker 1: tries to delete their history.
- 8:34Speaker 2: A cookie fundamentally is just a small piece of text
- 8:37Speaker 2: that a web server sends to your browser. Its main
- 8:40Speaker 2: job is managing state, remembering things about your visit, your
- 8:44Speaker 2: language preference, what's in your shopping cart, and critically, it
- 8:47Speaker 2: often includes a counter for the exact number of times
- 8:50Speaker 2: your machine has visited that specific site.
- 8:52Speaker 1: And this is where that persistence becomes such powerful evidence.
- 8:55Speaker 1: A user deletes their browser history, but the cookies can just.
- 8:59Speaker 2: Sit there exactly. This is what defeats the classic it
- 9:03Speaker 2: was an accidental click defense. Imagine an investigator finds a
- 9:07Speaker 2: persistent cookie on a machine and the user's claiming, oh,
- 9:10Speaker 2: I only click that link once by mistake. Well, that
- 9:12Speaker 2: cookie might show one hundred and ninety nine visits with
- 9:15Speaker 2: timestamps going back months. Even if they wipe their history
- 9:18Speaker 2: every single day, that persistent cookie remains, counting every single visit.
- 9:22Speaker 1: It's like a silent, detailed witness.
- 9:24Speaker 2: It is, and that's the key difference, right. A session
- 9:27Speaker 2: cookie is temporary, it's gone when you close the browser.
- 9:31Speaker 2: A persistent cookie gets written to the hard drive and
- 9:34Speaker 2: is sent back to the server every time you visit.
- 9:37Speaker 1: This persistence leads to a really fascinating area in e
- 9:41Speaker 1: commerce where machine learning algorithms are actively using this cookie
- 9:44Speaker 1: data to influence our buying habits.
- 9:46Speaker 2: Oh absolutely, think of a big online store selling something
- 9:50Speaker 2: expensive like a new laptop. Their algorithms are watching your
- 9:53Speaker 2: cookie data. If you visit that one laptop's product page,
- 9:57Speaker 2: say twenty times in a single day, the algorithm flags
- 10:01Speaker 2: that it sees extremely high intent. You're very motivated to buy.
- 10:04Speaker 1: The retailer knows you're right on the edge of making a.
- 10:06Speaker 2: Purchase, they do and to push you over that edge
- 10:10Speaker 2: before you go check a competitor, the algorithm might trigger
- 10:12Speaker 2: a special action. Maybe it displays an immediate time sensitive
- 10:16Speaker 2: discount twenty percent off but only for the next two
- 10:19Speaker 2: hours to create that urgency, all based on your cookie data.
- 10:22Speaker 1: And this is where penetration testers can come in. If
- 10:25Speaker 1: the website is just trusting the value in that cookie
- 10:27Speaker 1: to make a decision, that value can be changed, can it.
- 10:30Speaker 2: It's a classic technique. A pen tester will visit the site,
- 10:34Speaker 2: get the first cookie from the server, which probably says
- 10:37Speaker 2: visits one. Then they use a tool something like burpsuite
- 10:41Speaker 2: that lets them intercept their own web traffic before it
- 10:44Speaker 2: goes out to.
- 10:44Speaker 1: The server, so they can pause the traffic and actually
- 10:46Speaker 1: look inside the request.
- 10:48Speaker 2: Correct they look at the cookie in the header, manually
- 10:51Speaker 2: change the value from one visit to something high like
- 10:54Speaker 2: thirty visits, and then they let the modified request go through.
- 10:58Speaker 2: If the website's code is poorly designed and just blindly
- 11:02Speaker 2: trust that number, the server might just go ahead and
- 11:04Speaker 2: give them the special discount. It's a way to test
- 11:06Speaker 2: that vulnerability.
- 11:07Speaker 1: That really highlights the two sides of these artifacts. They're
- 11:10Speaker 1: critical for forensics, but they can also be an attack.
- 11:13Speaker 2: Vector exactly and technically, browsers are supposed to support cookies
- 11:17Speaker 2: up to a minimum size of four KB. Every cookie
- 11:20Speaker 2: has six parts, including a name, of value, and an
- 11:24Speaker 2: expiration date.
- 11:25Speaker 1: And there are security flags too, right, Yes.
- 11:28Speaker 2: The big one for security is the HTTP only flag.
- 11:31Speaker 2: This is vital. It stops client side scripts like JavaScript
- 11:35Speaker 2: from being able to access the cookie. So if a
- 11:37Speaker 2: cookie contains your session ID that proves you're an admin.
- 11:41Speaker 2: Setting that flag means an attacker who injects malicious JavaScript
- 11:45Speaker 2: can't just steal the cookie and impersonate you. It's all
- 11:47Speaker 2: about access control.
- 11:48Speaker 1: This really brings everything we've talked about together. We started
- 11:51Speaker 1: with the first packets of the three way handshake, we
- 11:53Speaker 1: moved to securing the destination with DNSSEC, and we've ended
- 11:57Speaker 1: up with this deep, persistent evidence on the local machine
- 12:00Speaker 1: history files and these incredibly revealing cookies.
- 12:03Speaker 2: The big takeaway here is that your digital footprint isn't
- 12:06Speaker 2: some temporary shadow, It is an extensive and in many cases,
- 12:10Speaker 2: a permanent record. Understanding how the network, traffic and these
- 12:14Speaker 2: local artifacts all connect is just fundamental to security and
- 12:17Speaker 2: accountability online. Even trying to clean up after yourself, like
- 12:21Speaker 2: clearing your history, often leads the most important evidence behind.
- 12:24Speaker 1: So let's leave you with a final thought, a sort
- 12:26Speaker 1: of review exercise that pulls these concepts together. We saw
- 12:30Speaker 1: how different browser artifacts are stored. We learned that cookies
- 12:33Speaker 1: can log every single visit and often survive when a
- 12:35Speaker 1: user deletes their history. Now, if a forensics expert was
- 12:38Speaker 1: looking at a machine, which of the two history files
- 12:41Speaker 1: we contrasted, index dot debt from Ieedge or history dot
- 12:45Speaker 1: debt from Firefox would still require that specific external tool
- 12:49Speaker 1: just to translate its contents into readable text. And why
- 12:52Speaker 1: chew on that technical distinction as you move forward,