Latest / CyberCode Academy / Course 11 - Mobile Forensics Fundamentals | Episode 3: iOS and iPhone Forensics: Security, Acquisition Techniques, and Artifact Analysis
Transcript
- 0:00Speaker 1: Welcome to the deep dive. Today, we are taking a
- 0:04Speaker 1: crowbar to one of the most protected digital vaults in
- 0:08Speaker 1: the world.
- 0:09Speaker 2: The iOS operating system.
- 0:11Speaker 1: Exactly. This is Apple's mobile fortress, this system that's really
- 0:15Speaker 1: built its entire reputation on being well impenetrable.
- 0:20Speaker 2: It really is the gold standard in mobile security. And
- 0:22Speaker 2: that's I mean, that's why it's so critical for anyone
- 0:25Speaker 2: in cybersecurity or forensics to really understand how it's built.
- 0:28Speaker 1: Right. We need to get past the marketing.
- 0:30Speaker 2: Yeah, we have to look at the actual technical architecture
- 0:33Speaker 2: that makes it so strong, and maybe more importantly, understand
- 0:36Speaker 2: where the vulnerabilities are, you know, the single points of
- 0:38Speaker 2: failure that hackers and investigators are looking for.
- 0:41Speaker 1: So our mission today is pretty simple. Yeah, we want
- 0:43Speaker 1: to grasp the architecture, understand the hardware defenses, and then
- 0:47Speaker 1: trace the pathways of attack.
- 0:49Speaker 2: From zero days all the way to like million dollar
- 0:52Speaker 2: forensic tools.
- 0:53Speaker 1: And that gets us right to the core of it,
- 0:54Speaker 1: doesn't it This paradox you.
- 0:56Speaker 2: Mentioned the catch twenty two, it's fundamental to understanding iOS
- 1:01Speaker 2: because Apple keeps such a tight grip on the ecosystem.
- 1:04Speaker 2: You know, every new iPhone runs basically the same kernel,
- 1:07Speaker 2: same hardware, same architecture. The security is incredibly effective most
- 1:12Speaker 2: of the.
- 1:12Speaker 1: Time, but that last one percent, Well, if.
- 1:14Speaker 2: A single vulnerability is found, it's not just a key,
- 1:18Speaker 2: it's a universal master key.
- 1:20Speaker 1: Because the environment is so predictable.
- 1:21Speaker 2: Exactly, that exploit becomes highly reproducible across millions and millions
- 1:26Speaker 2: of identical devices. So that standardization gives you amazing security,
- 1:31Speaker 2: but when it breaks, the failure is catastrophic, way more
- 1:35Speaker 2: so than on say the Android ecosystem, which is just
- 1:37Speaker 2: so fragmented.
- 1:38Speaker 1: Okay, so let's unpack this fortress. Let's use an analogy
- 1:41Speaker 1: to make these layers of defense clear. If we think
- 1:43Speaker 1: of iOS as like a high tech smart city, what
- 1:46Speaker 1: are the layers here? Starting from the ground up?
- 1:48Speaker 2: Okay, so deep down, you've got the bedrock, the physical infrastructure.
- 1:52Speaker 2: That's the COROS, the Unix based kernel. Yeah, it's the foundation.
- 1:56Speaker 2: It's managing all the essential services, the security frameworks, direct
- 2:00Speaker 2: interaction with the radios, Bluetooth, all that low level stuff.
- 2:05Speaker 2: If you compromise this layer, you basically own the city's
- 2:09Speaker 2: power grid.
- 2:10Speaker 1: And if COROS is the power grid, then what are
- 2:12Speaker 1: like the city's utilities that.
- 2:14Speaker 2: Would be the core services. This layer is what talks
- 2:17Speaker 2: to the kernel. It handles all the base communications like
- 2:20Speaker 2: what think of the TCPIP stack for internet access, how
- 2:23Speaker 2: it connects to iCloud. And this is a big one.
- 2:26Speaker 2: The default browser engine WebKit.
- 2:28Speaker 1: Okay, so we're moving up.
- 2:29Speaker 2: What's next the media layer. This is the infrastructure for
- 2:33Speaker 2: more specialized tasks. It handles all the heavy lifting for
- 2:35Speaker 2: things like graphics, video rendering, and all the hardware acceleration
- 2:39Speaker 2: that modern apps need to run smoothly.
- 2:42Speaker 1: And then, finally, the top layer, the one we actually
- 2:44Speaker 1: see and interact with.
- 2:45Speaker 2: That's Cocoa Touch. This is the living room, you know,
- 2:48Speaker 2: the user facing environment. It manages the apps themselves, handles
- 2:52Speaker 2: all your taps and swipes, and deals with all the
- 2:54Speaker 2: documents and files inside those apps.
- 2:56Speaker 1: So why is that specific stacking so important? Is it
- 3:00Speaker 1: to make sure that if I break through one layer,
- 3:02Speaker 1: I immediately hit another wall?
- 3:03Speaker 2: Precisely? It's all about limiting the blast radius, okay, And
- 3:07Speaker 2: that brings us to the actual defense mechanisms. First up
- 3:11Speaker 2: is sandboxing, or as some call it, jailing, the classic
- 3:15Speaker 2: isolation method. It's more than that, though, every single app
- 3:19Speaker 2: runs in its own little bubble its own restrictive environment.
- 3:21Speaker 2: It can't just go and read the memory or files
- 3:24Speaker 2: of another app without very specific permission.
- 3:27Speaker 1: So it's stopping them from talking to each other, right.
- 3:29Speaker 2: It's dynamically preventing that inner process communication. That's why the
- 3:33Speaker 2: term jail break exists. People are literally trying to find
- 3:37Speaker 2: flaws to break out of that isolated jail.
- 3:39Speaker 1: We also hear a lot about ASLR address basically out randomization.
- 3:44Speaker 1: If sandboxing is the jail cell, what's ASLR protecting?
- 3:47Speaker 2: So ASLR is a huge defense against a really common
- 3:51Speaker 2: type of attack called a buffer overflow. Traditionally, an attacker
- 3:55Speaker 2: finds a predictable address in memory where a program's instructions
- 3:58Speaker 2: are stored, and they can exploit it over and over again.
- 4:01Speaker 1: Because the addresses are always in.
- 4:02Speaker 2: The same place exactly ASLR is like a constantly shifting maze.
- 4:06Speaker 2: Every time the program runs, ASLR just shuffles all those
- 4:09Speaker 2: memory addresses around.
- 4:11Speaker 1: So it doesn't actually stop the attack.
- 4:12Speaker 2: It doesn't stop the underlying vulnerability, no, but it makes
- 4:16Speaker 2: the attack non reproducible. An exploit might work once by
- 4:20Speaker 2: pure luck, but the next time the app runs, that
- 4:23Speaker 2: memory address is gone. It's somewhere else.
- 4:25Speaker 1: Ah, So you make the exploit unreliable.
- 4:28Speaker 2: You make it so unreliable it's almost useless for a
- 4:31Speaker 2: large scale attack. And on top of all of that,
- 4:33Speaker 2: of course, you have the data itself protected with you know,
- 4:36Speaker 2: military grade.
- 4:37Speaker 1: Encryption AES two fifty six bit.
- 4:39Speaker 2: Yep, the FHIPS one two compliance standard. So you've got isolation,
- 4:43Speaker 2: you've got randomization, you've got bulletproof encryption. Logically, that should
- 4:48Speaker 2: be the end of the.
- 4:48Speaker 1: Story, but it's not. Because of that uniformity we talked about,
- 4:53Speaker 1: that commitment to a standardized experience. That's what opens up
- 4:56Speaker 1: this other really high stakes avenue for attack. This is
- 4:59Speaker 1: the catch twenty action.
- 5:00Speaker 2: It really is. Let's go back to the core services
- 5:03Speaker 2: layer for a second. We mentioned WebKit, the browser engine. Well,
- 5:06Speaker 2: from a business perspective, code reuse is great, it's cheaper,
- 5:09Speaker 2: it's efficient, but for security it can be a nightmare.
- 5:12Speaker 2: If a zero day exploit, an unknown vulnerability is found
- 5:16Speaker 2: in WebKit.
- 5:17Speaker 1: Then every single app that uses WebKit to show web
- 5:21Speaker 1: content is instantly vulnerable.
- 5:23Speaker 2: Instantly. That uniformity that gave us all that security now
- 5:28Speaker 2: creates this single point of catastrophic failure. Wow, and that's
- 5:31Speaker 2: what enables attack like drive by downloads. You don't have
- 5:34Speaker 2: to click a bad link or download an attachment. You
- 5:37Speaker 2: just have to visit one malicious website, and because that
- 5:40Speaker 2: shared WebKit component has a flaw, your whole device can
- 5:43Speaker 2: be compromised.
- 5:44Speaker 1: We've seen this in practice too. There have been some
- 5:46Speaker 1: crazy historical examples where these simplified checks just led to
- 5:50Speaker 1: fundamental flaws. Tell us about the mass grading attack.
- 5:53Speaker 2: Oh, that was a fascinating one. It was a security
- 5:55Speaker 2: bypass that really exploited a flaw. And how Apple managed trust?
- 5:58Speaker 1: How did it work?
- 5:59Speaker 2: So when a developer compiles an app, it has an
- 6:02Speaker 2: internal project name. Malicious actors figured out that if they
- 6:05Speaker 2: built their malware using the exact same internal project name
- 6:08Speaker 2: as a legitimate app you already had installed.
- 6:10Speaker 1: The system would get confused.
- 6:11Speaker 2: Well, the system only did a very basic check. It
- 6:14Speaker 2: just checked to see if the new code was.
- 6:16Speaker 1: Signed, just that it was signed, not who signed.
- 6:19Speaker 2: It, right, It didn't bother to check if the new
- 6:21Speaker 2: signature matched the signature of the original legitimate app. As
- 6:25Speaker 2: long as the internal names matched and it was signed
- 6:27Speaker 2: by someone, the malicious version would just overwrite the original one.
- 6:31Speaker 1: That's terrifying. So the malware could just run with all
- 6:34Speaker 1: the permissions of.
- 6:35Speaker 2: The real app and access all its data. The user
- 6:37Speaker 2: would have no idea the code underneath had been completely
- 6:41Speaker 2: swapped out.
- 6:41Speaker 1: These system level exploits are so powerful they basically become
- 6:47Speaker 1: black market commodities. We've all heard of things like the
- 6:50Speaker 1: Gray key box. This is a whole industry.
- 6:53Speaker 2: It's a constant arms race, and the price tags they
- 6:55Speaker 2: definitely reflect the difficulty. Gray key got famous because it
- 6:59Speaker 2: was this physical box that could systematically bypass a specific
- 7:03Speaker 2: hardware flaw, which forced Apple to patch it. But you
- 7:06Speaker 2: see zero day exports auctioned online for I mean upwards
- 7:10Speaker 2: of one hundred thousand dollars, sometimes way more. For law
- 7:13Speaker 2: enforcement or state level actors. You either have to pay
- 7:17Speaker 2: that massive sum for a way in, or the investigation
- 7:20Speaker 2: just hits a dead end, which.
- 7:22Speaker 1: Brings us to the final wall, the hardware wall that
- 7:24Speaker 1: Apple controls. Why is it so incredibly difficult to get
- 7:28Speaker 1: data off a modern locked iPhone even if you somehow
- 7:32Speaker 1: manage to get past all the software layers we just talked.
- 7:35Speaker 2: About, Because the keys themselves are physically isolated, we're talking
- 7:38Speaker 2: about to really specialized low level hardware components. Here first
- 7:42Speaker 2: is the secure boot chain.
- 7:44Speaker 1: Okay, what's up.
- 7:45Speaker 2: It's this read only ROM that verifies the bootloader and
- 7:49Speaker 2: the kernel before the operating system even starts to load.
- 7:52Speaker 1: So it's like a bouncer at a club checking the
- 7:54Speaker 1: OS's ID before it lets it in.
- 7:56Speaker 2: That's a great way to put it. It ensures the
- 7:57Speaker 2: integrity of the OS load, so you can't just sneak
- 8:00Speaker 2: in a malicious kernel at startup and then for the
- 8:03Speaker 2: keys themselves. You have the secure enclave, the coprocessor exactly.
- 8:07Speaker 2: It's basically a separate mini computer on the chip that
- 8:09Speaker 2: does one thing and one thing only, cryptographic operations. It
- 8:13Speaker 2: has its own encrypted memory, its own secure power, its
- 8:16Speaker 2: own random number generator. It's completely walled off, so even.
- 8:21Speaker 1: If an attacker gets full control of the main iOS kernel,
- 8:24Speaker 1: they still can't just reach over and grab the master
- 8:26Speaker 1: encryption keys.
- 8:27Speaker 2: They cannot. That's the whole beauty of the design. The
- 8:30Speaker 2: secure enclave keeps the keys totally isolated. It prevents all
- 8:34Speaker 2: those common forensic methods like trying to do a memory
- 8:36Speaker 2: dump to find the keys because the keys are never
- 8:38Speaker 2: ever exposed in the main CPU's memory and the.
- 8:41Speaker 1: Keys are physically tied to the chip itself, right, You
- 8:44Speaker 1: can't separate.
- 8:45Speaker 2: That's right. The device's unique identifiers or UIDs are physically
- 8:49Speaker 2: burned into the silicon during manufacturing. The encryption keys are
- 8:53Speaker 2: then tied directly to those hardware identifiers.
- 8:55Speaker 1: So older methods like chipof forensics are useless, now completely unreliable.
- 9:00Speaker 2: You can't just desolder the chip and read it anymore.
- 9:02Speaker 2: Physical access is no longer than magic bullet it once was.
- 9:06Speaker 1: So if the secure enclave is this unbreachable fortress, the
- 9:09Speaker 1: only way in is to convince the device to unlock itself,
- 9:14Speaker 1: which brings us back to the passcode and biometrics.
- 9:16Speaker 2: And that auto white feature. That's the final wall. You
- 9:19Speaker 2: get ten failed passcode attempts and poof the data is
- 9:23Speaker 2: essentially gone forever.
- 9:24Speaker 1: And what about biometrics, touch ID, face ID.
- 9:28Speaker 2: They seem secure, they're convenient, but consumer biometric systems always
- 9:33Speaker 2: always sacrifice some security for user convenience. How So, it's
- 9:37Speaker 2: all about something called the crossover air rate or CEER.
- 9:41Speaker 2: That's the point where the rate of false positives letting
- 9:44Speaker 2: a bad guy in crosses the rate of false negatives
- 9:46Speaker 2: locking the good guy out.
- 9:48Speaker 1: And manufacturers don't want to lock out the actual user exactly.
- 9:51Speaker 2: They don't want you to get frustrated, so they often
- 9:53Speaker 2: lower the security threshold to make it work more reliably,
- 9:56Speaker 2: which makes it less strict. And that's what let's determined
- 9:59Speaker 2: attackers beat it with, you know, high quality molds or masks.
- 10:02Speaker 1: So what's a truly secure biometric.
- 10:05Speaker 2: You'd need something much more complex like hang geometry, which
- 10:08Speaker 2: measures multiple variables at once, all five fingers, the palm structure,
- 10:13Speaker 2: even heat signatures. But that's not exactly convenient for a phone.
- 10:17Speaker 1: We can't really talk about this encryption wall without getting
- 10:20Speaker 1: into the huge power struggle it created. I'm thinking of
- 10:24Speaker 1: the San Bernardino case. Apple made a very specific choice
- 10:28Speaker 1: to stop storing copies of private keys on its own servers.
- 10:31Speaker 2: They did, and that decision was driven by one marketing
- 10:36Speaker 2: to really cement their image as the leader in privacy,
- 10:40Speaker 2: and two to reduce their own legal liability.
- 10:43Speaker 1: It completely changed the game.
- 10:45Speaker 2: It did. Once they stopped holding those keys, they genuinely
- 10:48Speaker 2: couldn't unlock an encrypted phone for law enforcement, even if
- 10:51Speaker 2: they had a court order telling them to.
- 10:52Speaker 1: So you have the most powerful law enforcement agencies in
- 10:55Speaker 1: the world, and they have to spend a fortune because
- 10:57Speaker 1: the company that made the device either can't or won't
- 11:00Speaker 1: open it.
- 11:00Speaker 2: It's an insane power dynamic. They ended up spending about
- 11:04Speaker 2: a million dollars for a one time exploit. It only
- 11:07Speaker 2: worked on that specific iPhone model running that specific OS version,
- 11:11Speaker 2: and of course that exploit was immediately commoditized and became
- 11:14Speaker 2: this incredibly valuable asset on the global market.
- 11:17Speaker 1: Okay, let's shift to the practical side. If you're an
- 11:20Speaker 1: investigator and you have physical control of one of these devices,
- 11:24Speaker 1: what are the first steps? How do you even get
- 11:26Speaker 1: it ready to talk to?
- 11:27Speaker 2: Well, you often have to manually force it into a
- 11:29Speaker 2: specific state. We rely on modes like recovery mode, which
- 11:33Speaker 2: can be activated if the boot process fails, or even
- 11:36Speaker 2: more powerfully, DFU mode device firmware update, and that.
- 11:40Speaker 1: Involves those weird button combinations, right.
- 11:42Speaker 2: Yes, specific time sequences like holding the power and home
- 11:46Speaker 2: button for exactly ten seconds then letting one go. You're
- 11:49Speaker 2: signaling the device to skip the normal OS broute and
- 11:52Speaker 2: enter a state where it will accept a new firmware
- 11:54Speaker 2: image from a computer.
- 11:56Speaker 1: So once you have that gateway open, there are two
- 11:58Speaker 1: main ways to get data off.
- 11:59Speaker 2: Two primary methods, yeah, logical acquisition and physical acquisition.
- 12:03Speaker 1: Logical is the easy one.
- 12:05Speaker 2: Logical is the easier path, for sure. It basically relies
- 12:08Speaker 2: on the device's own protocols, usually by leveraging the iTunes
- 12:12Speaker 2: backup process. If the phone is unlocked and you have
- 12:14Speaker 2: the pin, you can get a ton of stuff pretty quickly,
- 12:17Speaker 2: app data, the file structure, videos, but you only get
- 12:21Speaker 2: what the OS decides to include.
- 12:23Speaker 1: In a backup. It's not a complete picture of the
- 12:25Speaker 1: drive exactly.
- 12:26Speaker 2: For a full true disk image, you need physical acquisition.
- 12:30Speaker 2: And this is what's effectively impossible on modern locked encrypted
- 12:34Speaker 2: devices without that.
- 12:35Speaker 1: Key, because even if you get the raw data, it's
- 12:37Speaker 1: just gibberish.
- 12:38Speaker 2: All you have is a massive file of uncrackable as
- 12:42Speaker 2: two fifty six ciphertext. The amount of computing power you'd
- 12:45Speaker 2: need to brute force that is, I mean, it's just
- 12:47Speaker 2: not feasible in any useful amount of time.
- 12:49Speaker 1: So the key is still the absolute bottleneck. Okay, but
- 12:51Speaker 1: let's say we do get the key, or we have
- 12:53Speaker 1: a recent logical backup. Where do investigators hunt for those
- 12:56Speaker 1: really critical digital artifacts.
- 12:58Speaker 2: We start by looking at the structure or even the metadata.
- 13:01Speaker 2: We look very hard at p list files. What are
- 13:03Speaker 2: those they're XML formatted property lists. They store all this
- 13:07Speaker 2: critical data that the user probably doesn't even know is there,
- 13:10Speaker 2: like the device's Imei serial number, the last time it
- 13:13Speaker 2: was backed up, even network IDs that can link the
- 13:16Speaker 2: phone to specific cell towers.
- 13:17Speaker 1: And you mentioned time, the ability to spot when someone
- 13:21Speaker 1: is tampered with time stamps.
- 13:22Speaker 2: Yeah, we deal with epoch time scamps, which is just
- 13:25Speaker 2: the Unix format a long string of seconds since nineteen seventy.
- 13:29Speaker 2: Our tools convert that instantly. But the real forensic gold
- 13:32Speaker 2: is in the consistency. What do you mean If a
- 13:34Speaker 2: user tries to manually change a file's time, they might
- 13:37Speaker 2: get the seconds or minutes right, but the system records
- 13:41Speaker 2: time down to the microsecond or nanosecond. So a file
- 13:43Speaker 2: that was supposedly created at exactly eleven point one five
- 13:46Speaker 2: and thirty five point zero zero zero seconds, that perfect
- 13:50Speaker 2: rounding is a dead giveaway.
- 13:52Speaker 1: The tail kale wobble.
- 13:53Speaker 2: That's a telltale wobble that suggests tampering. We compare the
- 13:56Speaker 2: file system time with the metadata time, and that's where
- 13:58Speaker 2: we find the discrepancy.
- 14:00Speaker 1: And then they're the real gold mines, the little data statues.
- 14:02Speaker 1: People forget about that review their intents.
- 14:04Speaker 2: Oh yeah, these are the hidden gems. Number one, drafts, folders,
- 14:08Speaker 2: email or SMS.
- 14:10Speaker 1: How's that useful?
- 14:11Speaker 2: People trying to communicate covertly will write a message, save
- 14:14Speaker 2: it as a draft, and their accomplice logs into the
- 14:17Speaker 2: same account, reads the draft, and deletes it. The message
- 14:21Speaker 2: was never technically sent, so there's no carrier log but
- 14:24Speaker 2: the draft often remains on the local device.
- 14:27Speaker 1: Yeah, okay, what's number two?
- 14:29Speaker 2: Clipboard data? It's temporary, but people are constantly copying and
- 14:33Speaker 2: pasting passwords, crypto keys, sensitive text messages before deleting them
- 14:37Speaker 2: somewhere else. That clipboard can tell you the very last
- 14:40Speaker 2: sensitive piece of information they handled.
- 14:42Speaker 1: And the ultimate digital diary of intent the keyboard cash.
- 14:46Speaker 2: Absolutely the keyboard cash or the dynamic text file. This
- 14:51Speaker 2: isn't a keylogger recording every single keystroke. Instead, it learns
- 14:54Speaker 2: and stores frequently typed uncommon words like what usernames, unique passwords,
- 14:59Speaker 2: specific addresses, private slang or terminology. It reveals the user's
- 15:04Speaker 2: intent and their specific authentication details. Even if they've meticulously
- 15:08Speaker 2: cleared their browser history and messages, you will often find
- 15:11Speaker 2: the exact keywords or logging credentials hiding in plain sight
- 15:14Speaker 2: in that cash.
- 15:15Speaker 1: This whole deep dive really just underlines that iOS security
- 15:19Speaker 1: is this perpetually escalating arms race. Apple improves the hardware,
- 15:24Speaker 1: the secure on play, the boot chain, and that just
- 15:27Speaker 1: forces exploit developers to spend incredible amounts of time and
- 15:30Speaker 1: money to find that one tiny crack in the software armor.
- 15:34Speaker 2: And that standardization, the very thing that makes the system
- 15:37Speaker 2: so tough, also makes every single successful exploit universally effective.
- 15:43Speaker 2: I mean, the sheer difficulty of doing a physical acquisition
- 15:45Speaker 2: on a locked phone today just highlights the incredible value
- 15:48Speaker 2: of strong encryption, and it's why every mistake and investigator
- 15:52Speaker 2: makes can be so catastrophic.
- 15:54Speaker 1: That's right. For professionals in the field, the stakes are
- 15:57Speaker 1: just they're existential. Any mistake with author is, especially if
- 16:01Speaker 1: you're touching cloud data like an iCloud backup without the
- 16:04Speaker 1: right warrant, that can destroy your credibility and get an
- 16:06Speaker 1: entire case thrown out.
- 16:07Speaker 2: It just takes one mistake.
- 16:09Speaker 1: So let's leave you with this final thought. This is
- 16:11Speaker 1: a logical acquisition relies on a backup, which is just
- 16:14Speaker 1: a finite slice of data and time. What specific digital
- 16:18Speaker 1: artifact one that often reveals authentication details would you prioritize
- 16:23Speaker 1: analyzing immediately if you suspected the device owner it just
- 16:26Speaker 1: cleared all their activity to hide their communications. You're hunting
- 16:28Speaker 1: for intent, not just a message.
- 16:30Speaker 2: You would go straight for the dynamic text file the
- 16:33Speaker 2: keyboard cash because it contains the most recent, most valuable
- 16:36Speaker 2: authentication data that the user almost certainly forgot to manually clear.
- 16:41Speaker 2: It is the footprint of their most frequently used secrets.