Latest / CyberCode Academy / Course 13 - Network Forensics | Episode 8: Email Analysis and Forensic Investigation
Transcript
- 0:00Speaker 1: When you compose an email, you hit send and it
- 0:03Speaker 1: just it feels like it vanishes right instantaneous.
- 0:06Speaker 2: It does. It feels like a single private interaction between
- 0:09Speaker 2: two computers.
- 0:10Speaker 1: But that simplicity is it's really a mirage. The moment
- 0:14Speaker 1: you hit send, you're actually creating this complex, hidden digital trail.
- 0:18Speaker 2: And that trail is exactly what forensic investigators are interested in.
- 0:22Speaker 2: I mean, whether it's for compliance, internal security, or a
- 0:26Speaker 2: legal matter.
- 0:27Speaker 1: That invisible roadmap is what we're diving into today. We
- 0:30Speaker 1: want to unpack the core elements of email analysis and recovery.
- 0:34Speaker 2: To show you how investigators can track a message back
- 0:37Speaker 2: to its true source, and you know, maybe more importantly,
- 0:40Speaker 2: show the technical and legal complexities that get in the way.
- 0:44Speaker 1: So to start an email isn't just in one place,
- 0:46Speaker 1: is it not?
- 0:47Speaker 2: At all? Forensically, you have to think about three primary locations. First,
- 0:51Speaker 2: there's the sender zone machine, the client where it was written, okay. Second,
- 0:54Speaker 2: you have the entire infrastructure of servers it passes through.
- 0:58Speaker 2: And third, of course the recipient's machine and.
- 1:00Speaker 1: Those servers in the middle. We're talking about huge network
- 1:04Speaker 1: points Internet service providers ISPs, all of them could have
- 1:08Speaker 1: a copy exactly.
- 1:10Speaker 2: That's a lot of potential evidence spread all over the globe.
- 1:13Speaker 2: So to even begin, we need to understand what an
- 1:17Speaker 2: email actually is structurally, right, So what is it? At
- 1:21Speaker 2: its core? Every single email is broken into two distinct halves.
- 1:25Speaker 2: You have the body and you have the header.
- 1:27Speaker 1: The body is the easy part, that's the stuff I
- 1:29Speaker 1: actually read, the text, the attachments, m.
- 1:31Speaker 2: Your signature, all that. It's what the user sees. But
- 1:34Speaker 2: the header, that's the real currency for forensics. It's the
- 1:37Speaker 2: navigation tool.
- 1:39Speaker 1: So what's packed into that header that makes it so critical.
- 1:41Speaker 2: It contains what we call trace information. It's basically a
- 1:45Speaker 2: running list of data fields like field name, field value.
- 1:49Speaker 1: Okay, so two person A from person.
- 1:51Speaker 2: B, right, and here's the key thing. As a user,
- 1:53Speaker 2: you control some of that, the two from maybe the subject.
- 1:57Speaker 2: But what about the data that shows the actual route
- 2:00Speaker 2: the email toech.
- 2:01Speaker 1: That's the stuff I can't touch.
- 2:02Speaker 2: That is the data that matters most. The system timestamps,
- 2:06Speaker 2: the IP addresses the routing data. That's all populated automatically
- 2:10Speaker 2: by your email client and the servers. It's an objective record.
- 2:13Speaker 1: So the header gives us the structure, But how does
- 2:16Speaker 1: the message physically well, digitally travel, that's about protocols, isn't it?
- 2:22Speaker 2: Precisely? We mostly rely on three. The first is SMTP,
- 2:26Speaker 2: the Simple Mail Transfer Protocol. This is strictly for sending messages.
- 2:30Speaker 1: It's the digital mail carrier.
- 2:31Speaker 2: Perfect analogy. It typically runs on port twenty five, so
- 2:34Speaker 2: if you're analyzing network traffic, you're looking for activity on
- 2:37Speaker 2: that port.
- 2:38Speaker 1: So smtps for sending. What about for retrieving messages?
- 2:41Speaker 2: Okay? So for that we have two main ones. There's
- 2:43Speaker 2: POP three, the Post Office protocol. Classically, POP three pulls
- 2:47Speaker 2: the messages down to your local machine and then it
- 2:50Speaker 2: deletes them from the server.
- 2:51Speaker 1: Oh wow, So for an investigator, that immediately tells you something,
- 2:54Speaker 1: doesn't it.
- 2:54Speaker 2: It tells you the primary evidence is probably on the
- 2:57Speaker 2: local hard drive, the server copy might be gone. Really
- 3:00Speaker 2: focuses your effort.
- 3:01Speaker 1: And the other one, more common one today.
- 3:03Speaker 2: That would be IMAP, the Internet Message Access Protocol. IMAP
- 3:07Speaker 2: lets the messages stay on the server as the master copy.
- 3:10Speaker 2: It's why your phone and your laptop are always in sync.
- 3:13Speaker 1: And for forensics that's a huge plus. The server likely
- 3:16Speaker 1: holds the most complete record.
- 3:18Speaker 2: A much more resilient copy. Absolutely.
- 3:20Speaker 1: Okay, So beyond how it moves, the message itself needs
- 3:24Speaker 1: to be packaged correctly.
- 3:26Speaker 2: Right right. The standard for that is called MIM Multipurpose
- 3:30Speaker 2: Internet Mail Extensions. It just wraps everything up text attachment
- 3:35Speaker 2: so it can travel reliably and be put back together
- 3:37Speaker 2: At the other.
- 3:37Speaker 1: End, that sounds pretty open though readable. What if someone
- 3:40Speaker 1: wants privacy? What are you looking for? Then?
- 3:43Speaker 2: If security is the goal, you're looking for encryption layered
- 3:46Speaker 2: on top. The two big ones are summe or PGP
- 3:49Speaker 2: pretty good privacy.
- 3:50Speaker 1: And if you run into a PGP encrypted email.
- 3:53Speaker 2: Then you know you need the corresponding private key to
- 3:56Speaker 2: read the content. It adds this massive layer of complexity
- 3:59Speaker 2: to the whole investigation.
- 4:00Speaker 1: This leads perfectly into the storage battle where the email
- 4:03Speaker 1: actually lives.
- 4:03Speaker 2: You mentioned it's fluid, incredibly fluid, and there's this constant
- 4:10Speaker 2: conflict over who controls it, especially in big companies.
- 4:13Speaker 1: You think example of that. Why would there be a conflict?
- 4:15Speaker 2: Okay, imagine a company needs to keep all emails for
- 4:18Speaker 2: seven years for compliance. That's the rule, but a user
- 4:22Speaker 2: on their local outlook client sets it to not store
- 4:26Speaker 2: copies on the server to save space or something exactly.
- 4:29Speaker 2: But the server operator the company has to override that.
- 4:32Speaker 2: The server is configured to basically say, I don't care
- 4:35Speaker 2: what your client says, I'm saving a copy anyway.
- 4:37Speaker 1: So the server always wins.
- 4:38Speaker 2: The server owns the day stream, so yes, but the
- 4:41Speaker 2: reverse can happen too. A user might set up pop
- 4:44Speaker 2: three to pull a message down and then try to
- 4:47Speaker 2: delete it locally, hoping to hide it. It's a continuous
- 4:50Speaker 2: game of cat and mouse with configuration settings.
- 4:52Speaker 1: So if you can't find the email in a nice,
- 4:54Speaker 1: neat inbox file, where do you look next? On a machine?
- 4:57Speaker 2: You have to go deeper. You're looking for residual evidence,
- 5:00Speaker 2: temporary files, swap space, and most importantly, you target what's
- 5:04Speaker 2: called slackspace.
- 5:05Speaker 1: Okay, slackspace, walk me through what that actually is.
- 5:08Speaker 2: Think of your hard drive like a parking garage with
- 5:11Speaker 2: fixed sized spots. When you save a small file like
- 5:14Speaker 2: a short email, it's like parking a motorcycle in a
- 5:18Speaker 2: spot made for a truck.
- 5:19Speaker 1: There's leftover room, a lot of leftover room.
- 5:22Speaker 2: That's the slack space, and it still contains fragments of
- 5:25Speaker 2: whatever was parked there before. So even if an email
- 5:27Speaker 2: is deleted, pieces of it can be sitting right there.
- 5:31Speaker 2: In that slack space, just waiting to be found.
- 5:33Speaker 1: The digital ghosts of files passed. Yeah, that makes sense.
- 5:36Speaker 1: What about the email clients themselves, don't they use their
- 5:38Speaker 1: own special files?
- 5:39Speaker 2: They do? And for Microsoft Outlook users, the big one
- 5:42Speaker 2: is the PST file, the Personal storage table. It's this
- 5:45Speaker 2: massive container that stores everything emails, calendar, appointments, contacts. Analyzing
- 5:51Speaker 2: PST files is I mean, it's absolutely fundamental to Windows forensics.
- 5:55Speaker 1: And what about now with so much being webmail using
- 5:58Speaker 1: Gmail or Outlook in.
- 5:59Speaker 2: A browser, that changes the game. Less is stored locally
- 6:03Speaker 2: in a big file like a PST. So you pivot
- 6:06Speaker 2: to browser forensics, you're looking at the browser cash browsing history,
- 6:11Speaker 2: even thumbnails that might show a snapshot of the email
- 6:14Speaker 2: being opened. The trail is still there. It's just in
- 6:17Speaker 2: a different place.
- 6:18Speaker 1: Okay, so we know the anatomy and where it hides.
- 6:21Speaker 1: Now for the deep dive actually reading that header to
- 6:24Speaker 1: trace the.
- 6:25Speaker 2: Route, this is where it gets really fascinating. It's what
- 6:27Speaker 2: we call the accumulation effect. Every single server in email
- 6:31Speaker 2: touches adds its own stamp to the header like a passport.
- 6:34Speaker 2: Exactly like a passport, it adds a received message detailing
- 6:37Speaker 2: the route, the time, its own IP address.
- 6:41Speaker 1: And while the basic from field can be easily faked
- 6:44Speaker 1: or spoofed.
- 6:45Speaker 2: That chain of received messages is much much harder to
- 6:48Speaker 2: fit completely because it's built by multiple independent systems.
- 6:52Speaker 1: So here's the fundamental rule. Then how do you read it?
- 6:54Speaker 2: You have to read it in reverse chronological order. You
- 6:57Speaker 2: start at the very top of the header. It's the
- 6:59Speaker 2: last thing that happened. You scroll all the way down
- 7:00Speaker 2: to the bottom to find the first entry.
- 7:02Speaker 1: That's your origin, which brings us to what you call
- 7:05Speaker 1: the single biggest trap in this whole process, the.
- 7:07Speaker 2: Time zone trap. If you just look at the times
- 7:09Speaker 2: on the clock, you will almost certainly be misled.
- 7:11Speaker 1: Okay, let's do a real example. Let's say I'm tracing
- 7:13Speaker 1: email backwards and I'm looking at two received lines.
- 7:16Speaker 2: Go for it.
- 7:17Speaker 1: The first one I see closer to me. The recipient
- 7:19Speaker 1: is time stamped at twenty one point five four point
- 7:22Speaker 1: two three, and it has a zero time zone offset.
- 7:26Speaker 1: So EUTC time.
- 7:27Speaker 2: Okay, nine point five to four pm universal time right now.
- 7:30Speaker 1: Next entry up to chain, the one that should be earlier,
- 7:32Speaker 1: says seventeen point five to four point twenty four, But
- 7:35Speaker 1: it has a Macino four.
- 7:36Speaker 2: Hundred offset minus four hours.
- 7:38Speaker 1: So without thinking, I'd say five point five four pm
- 7:41Speaker 1: happened hours before nine point five four pm. That's the
- 7:44Speaker 1: earlier server, and.
- 7:45Speaker 2: You would be completely wrong. You have to adjust for
- 7:46Speaker 2: the time zone. You take that seventeen point five four
- 7:48Speaker 2: and you add the four hours back to normalize it
- 7:50Speaker 2: to UTC.
- 7:51Speaker 1: So seventeen plus four is twenty one. It's oh, it's
- 7:53Speaker 1: twenty one plus.
- 7:54Speaker 2: Five four point two four, one second later than the
- 7:56Speaker 2: server entry below it.
- 7:57Speaker 1: Wow, So that completely flips the order of delivery. The
- 8:00Speaker 1: set is an optional, it's mandatory for getting it right.
- 8:02Speaker 2: It is the difference between finding the real origin and
- 8:05Speaker 2: chasing a ghost. That one second revealed only by the
- 8:09Speaker 2: offset can change the entire conclusion of an investigation.
- 8:13Speaker 1: So once we have that order right, what other fields
- 8:16Speaker 1: help confirm who the sender is?
- 8:18Speaker 2: You look for the return path, which says where a
- 8:20Speaker 2: reply should go, and you look for the message I.
- 8:23Speaker 1: D message I D Yeah.
- 8:25Speaker 2: It's a unique identifier assigned when the email is first created.
- 8:28Speaker 2: Investigators can use that IDA to request logs from all
- 8:31Speaker 2: the servers in the chain. It's a universal tracking number.
- 8:34Speaker 1: What about secret recipients BCCs.
- 8:39Speaker 2: Ah blind carbon copy, so the other recipients can't see
- 8:42Speaker 2: who is bcced. But if you look at the header
- 8:45Speaker 2: on the receiving servers copy of the message, that BCC
- 8:48Speaker 2: field is often present, it confirms a blind copy was sent.
- 8:51Speaker 1: So once you have the path, what tools are you
- 8:53Speaker 1: using to pull all this together?
- 8:55Speaker 2: For the files themselves, you're using general forensic suites like
- 8:58Speaker 2: FTK or in case. They're built to parse things like
- 9:01Speaker 2: those PST files we mentioned, and to see.
- 9:03Speaker 1: The messages actually moving across.
- 9:04Speaker 2: The network, that's where you use network analyzers like wire
- 9:07Speaker 2: Shark or TCP dump, and analysts can filter all the
- 9:11Speaker 2: raw network traffic and just watch for data moving on
- 9:14Speaker 2: say Port twenty five for SMTP.
- 9:17Speaker 1: It makes you realize how relevant this all is for
- 9:19Speaker 1: cybersecurity today. Email is still the number one way in
- 9:22Speaker 1: for attackers, isn't it? Oh?
- 9:24Speaker 2: Absolutely, It's the primary vehicle for phishing attacks for malware.
- 9:28Speaker 2: Almost every major corporate breach you read about started with
- 9:31Speaker 2: one successful fish that got an employees' credentials.
- 9:34Speaker 1: Which brings us to the legal nightmare, the spaghetti law,
- 9:38Speaker 1: as you put it, When can you actually access these emails?
- 9:40Speaker 2: This is one of the most frustrating parts of the job.
- 9:43Speaker 2: The rules are so nuanced it really boils down to
- 9:45Speaker 2: two things. Has the email been open? And how old
- 9:48Speaker 2: is it?
- 9:48Speaker 1: Okay? So what gets the highest level of protection?
- 9:50Speaker 2: An unopened email that's less than ninety days old, that's
- 9:53Speaker 2: generally considered to have the highest expectation of privacy. You'll
- 9:57Speaker 2: need a full warrant or a subpoena for that.
- 9:59Speaker 1: And if it's been opened, the protection.
- 10:01Speaker 2: Level drops a lot. It's much easier to legally compel
- 10:05Speaker 2: its release even if it's still pretty new, and.
- 10:08Speaker 1: Time just erodes that protection further and further.
- 10:10Speaker 2: It really does after ninety days protection lessons, but the
- 10:14Speaker 2: big threshold is one hundred and eighty days six months.
- 10:17Speaker 2: What happens then after one hundred and eighty days on
- 10:20Speaker 2: a server, an email has almost no legal protection at
- 10:23Speaker 2: all under federal law, whether it's been opened or not.
- 10:26Speaker 2: It's a huge gray area for privacy and compliance.
- 10:29Speaker 1: So we've covered the hidden structure, the protocols, the absolute
- 10:33Speaker 1: battleover storage, and the skill needed to trace a message
- 10:36Speaker 1: with those time zone offsets.
- 10:38Speaker 2: The key takeaway is that the meta data, the data
- 10:40Speaker 2: about the data in the header is often more reliable
- 10:44Speaker 2: than the content itself. You just have to know how
- 10:46Speaker 2: to read it.
- 10:46Speaker 1: So we'll leave you with a final exercise that ties
- 10:49Speaker 1: us all together. If you're tracing an email header in reverse,
- 10:52Speaker 1: and you find two consecutive received lines, the first showing
- 10:55Speaker 1: ten zero zero zero AM with an offset of plus
- 10:58Speaker 1: five hundred, and the next one up showing three point
- 11:00Speaker 1: zero zero PM with an offset of zero, which server
- 11:03Speaker 1: actually received the message first?
- 11:04Speaker 2: Remember you have to adjust both to a common time
- 11:07Speaker 2: zone to find the real order. It's never about the
- 11:09Speaker 2: clock face alone.
- 11:11Speaker 1: That's it for this week's deep dive. We hope you
- 11:13Speaker 1: feel a bit more informed about where your message is
- 11:15Speaker 1: truly hide. We'll see you next time.