[00:00.000 --> 00:03.940] All right, hi. Thank you all for coming to Reversing Corruption, Seagate Hard Drive Translators, [00:03.940 --> 00:07.760] also known as the Naked Trill Data Recovery Project. Because we've had some technical [00:07.760 --> 00:12.640] difficulties, I may speak really fast. I'm from New York. I'm sorry. But thank you for [00:12.640 --> 00:16.440] all making it through the maze and through the confusion to be here. I really appreciate it. [00:18.200 --> 00:24.100] My name is Allison. I'm one of several Allison Noctiborns. I'm a software developer by trade. [00:24.100 --> 00:28.940] I build high-level blue software. So this has nothing to do with what I do as a day job. [00:28.940 --> 00:32.360] I haven't really touched hardware since college where I did a bunch of robotics research [00:32.360 --> 00:38.280] and learned that cutting-edge research is the easy part of getting published in IEEE publication. [00:38.280 --> 00:43.420] It left a little bit of a mark. About a dozen years worth of a mark. So that's really it for [00:43.420 --> 00:49.280] my hardware experience. I'm not an expert in this. That's her. That's her job. So feel free [00:49.280 --> 00:58.920] to tell me I'm wrong. That's a slow transition. Look, dude, I'm Mr. Dead. I named the project. [00:58.920 --> 01:06.240] It's a play on our last names. Born naked is her last name in Dutch. I've given talks at [01:06.240 --> 01:12.000] HushCon, Teardown, and then Arch Reactor Hackerspace. I founded Revenant Data, which is a [01:12.000 --> 01:17.280] data recovery company in Oregon with Wire Glitch, who's somewhere around here. I've co-founded a [01:17.280 --> 01:25.040] couple of hackerspaces. The most recent one is Pascal and PDX Hack Labs. I try to do workshops [01:25.040 --> 01:30.740] on reverse engineering and focusing on assembly and binary challenges. I don't have a formal [01:30.740 --> 01:35.700] education. I did not go to Carnegie Mellon University like Allison. Everything that I know [01:35.700 --> 01:42.760] is self-taught. I did do Scott Moulton's data recovery training, the remote one. I've never [01:42.760 --> 01:48.620] actually met him, which is kind of funny. And I do roller derby and I stress bake. I get stressed [01:48.620 --> 01:58.340] out and I bake stuff. That's my non-info sec hacking stuff. Alright, the original quest. We [01:58.340 --> 02:06.960] dubbed it the seemingly undamaged HDD in a really bad day. Uh, so what ends up happening is, this [02:06.960 --> 02:12.100] is out of order. Well, that's fine. I get a lot of these cases in translator corruption, which [02:12.100 --> 02:17.920] basically means I have zero access to user data or sometimes I'll have partial access. Uh, what [02:17.920 --> 02:25.280] that, how that manifests is, it'll boot, spin, it'll get stuck or never, and by, you know, stuck [02:25.280 --> 02:30.020] and busy, it just means not recognized by the host. Uh, and then it never initializes. Another [02:30.020 --> 02:36.420] thing that can happen is it will boot, spin, click, not all clicks are clicks of death. Uh, and [02:36.420 --> 02:43.840] then it'll spin down. So, when that happens, um, especially if there's clicking involved, and [02:43.840 --> 02:49.180] this is always, the type of corruption that we're talking about occurs in pharaoh seagates and [02:49.180 --> 02:53.300] moose seagates, which I know many of you may not actually be familiar with family names in [02:53.300 --> 02:58.360] hard drives, but you can ask me about that later. Um, so when the clicking happens, it usually [02:58.360 --> 03:06.540] is indicating the short points problem. Uh, which means that I have to short the read pins, or [03:06.540 --> 03:10.920] short the read points in order to gain terminal access and then force a regeneration of the [03:10.920 --> 03:16.200] translator. Success. That's a little off, and that's messed up. Success, but it's actually [03:16.200 --> 03:23.100] never really that easy. Um, it can become an, like an extremely awful time sink for me. Uh, [03:23.100 --> 03:28.420] like in order to, I have to short these read pins at a very precise time, and then I have to [03:28.420 --> 03:33.880] send a control Z to gain terminal access at a very precise time, and it can suck up anywhere [03:33.880 --> 03:39.660] between an hour of my time to six hours. I'm not kidding. My, uh, partner and I would often [03:39.660 --> 03:43.660] have to, like, switch off, because we'd get tired of, like, sitting there and listening for the [03:43.660 --> 03:50.140] heads to leave the platter and then, like, start mashing control Z. So, um, what makes this [03:50.140 --> 03:55.500] extremely frustrating is once I get terminal access, forcing the translator regeneration is [03:55.500 --> 04:02.300] actually very simple, but it's this timing issue that drives me nuts. Long story short, um, I [04:02.300 --> 04:07.500] went to the, the hacker space and started complaining about this a lot. I really don't like [04:07.500 --> 04:13.720] this. Yeah, but anyway, um, Allison overheard me and I, I said, oh, I want to automate this. I [04:13.720 --> 04:20.660] would love to be able to bypass this, like, four to six hour timing issue of shorting these [04:20.660 --> 04:24.900] points and sending a terminal command so that I can just, boom, get to the translator [04:24.900 --> 04:29.540] regener- regeneration. And she chimed in. She's like, oh, I can script that. Um. [04:29.540 --> 04:33.280] I think you said, hey, I need some code. It'll be really easy. I'm pretty sure that's what you [04:33.280 --> 04:37.080] said. I may have tried to sucker her into it, knowing damn well, cause I'm not a coder. I [04:37.080 --> 04:42.420] don't like, I, I have very little programming skills. Um, so along the way, while we were [04:42.420 --> 04:45.980] doing research to try to solve this particular issue, we started realizing there's a bunch of [04:45.980 --> 04:50.460] other little, like much simpler tools that we could fit or that we could build. And we started [04:50.460 --> 04:56.000] doing that. Um, cause the ultimate goal where we are currently focusing on translators and [04:56.000 --> 05:01.800] also just Seagates, even more specifically these two families, however, several of our tools do [05:01.800 --> 05:11.180] work on pretty much any Seagate. Uh, 7200.12 and beyond. Um, anywho, yeah, we started, uh, [05:11.180 --> 05:16.660] working on other types of tools that we can fix. We want to turn it into a full on data [05:16.660 --> 05:25.140] recovery suite that's open source. Reasons to care. I know a lot of people think that hard drives [05:25.140 --> 05:32.360] are obsolete or near-obsoletion, obsolescence, but, um, there are some pretty important reasons [05:32.360 --> 05:38.200] to care. Number one, right to know, uh, there are standards for hard drives. A lot of you are [05:38.200 --> 05:43.580] probably familiar with ATA standards, the INCITS T13 committee, they issue those. Um, the [05:43.580 --> 05:49.620] problem is, is majority of these are vendor specific. The tool that we built, we use the, um, [05:49.620 --> 05:55.000] terminal debug interface that has zero standards. Everything's vendor specific. So, if you [05:55.000 --> 05:58.160] don't know what you're doing, you either have to send it to a data recovery company, it's [05:58.160 --> 06:02.780] going to cost you an arm and a leg most likely, or you have to sink, honestly, probably [06:02.780 --> 06:07.780] months if not years of research into figuring out what commands can I use? What does this [06:07.780 --> 06:13.300] command mean? Um, these lack of standards make it really difficult to, like, implement [06:13.300 --> 06:18.980] quality assurance, and again, you're forced to rely on very costly data recovery tools or [06:18.980 --> 06:26.560] services. Um, right to repair, I wholeheartedly believe ownership is not a timeshare. Uh, it [06:26.560 --> 06:31.560] really bugs me that manufacturers want you to use their data recovery services only. Um, [06:31.560 --> 06:39.160] again, I think that ultimately drives down QA. Um, they're not compostable and there are a [06:39.160 --> 06:42.100] hell of a lot of them, especially when you factor in data centers and the fact that they're [06:42.100 --> 06:46.440] still using predominantly spinning disks. Um, they're manufactured with cobalt on the [06:46.440 --> 06:53.080] platters. Um, that can, it can cause neurodegenerative diseases. It's been linked to ALS [06:53.080 --> 06:56.820] recently, and I do have citations for all this. And then of course, silica, also [06:57.560 --> 07:08.600] neurodegenerative diseases. That's you. Yep. This podium is freaking me out. All right, so, [07:11.600 --> 07:23.500] uh, why you know Linux? I'm not an adept Linux user. Yeah, yeah. And apparently I can't use [07:23.500 --> 07:28.680] Windows, so I suppose I don't have any stones to throw. All right. So, of the disks that [07:28.680 --> 07:35.080] cross Mr. Dead's desk for repair, about 50% of them are Seagate's. Of that, just over 8% [07:35.080 --> 07:41.100] display translator corruption. This doesn't sound like a ton, but um, scale's a funny [07:41.100 --> 07:47.720] thing. So, Seagate started shipping drives in 80, 1980, and about 20 years later, they [07:47.720 --> 07:51.800] announced that they shipped 250 million hard drives. And they've kept shipping at about [07:51.800 --> 07:59.080] that rate. So, let's do some bar math. Um, translators really first appeared with the F3 [07:59.080 --> 08:04.580] architecture, which was shipped in about 2008. And if we say there are 100 million drives [08:04.580 --> 08:09.500] active, then we are looking at north of 8 million cases of translator corruption. So the [08:09.500 --> 08:13.880] odds are good if you have a couple drives or you run a data center, it's gonna happen to you. [08:13.880 --> 08:18.100] And when it does, you'll find out that this can be really expensive. We did some social [08:18.100 --> 08:22.860] engineering and we found that the cost of a translator repair can run you somewhere between [08:22.860 --> 08:29.860] 700 and 3,000 dollars. And in general, repair on a hard drive can run you north of 8,000. So [08:29.860 --> 08:33.540] getting your bits back can be extremely expensive. And I don't know about you, but I [08:33.540 --> 08:40.120] don't necessarily have a spare 8K laying around. So, that's the reason you should care [08:40.120 --> 08:44.580] beside the high-minded stuff. I'm gonna try to get through this because I know it's kind of [08:44.580 --> 08:52.060] boring hard drive anatomy. Um, number one, filter, not very important. Number two, [08:52.060 --> 08:56.120] however, those are the platters, aka the media, aka spinning disks. And that's where your data [08:56.120 --> 09:02.940] is technically actually stored. Um, what else to pay attention to? Six, the heads, right? The [09:02.940 --> 09:07.860] read and write elements of the drive. They're gonna fly over the platters reading and writing [09:07.860 --> 09:13.720] data. They're parked on the head ramp there. Uh, but honestly, the second or, you know, third [09:13.720 --> 09:19.120] most important element is seven. That's the head stack connector. So, that's connected via [09:19.120 --> 09:23.140] that number eight, the ribbon, to the actuator arm. And then on the other side, that's [09:23.140 --> 09:27.940] touching the PCB. And just remember, I was talking about shorting read points. Well, I have [09:27.940 --> 09:31.980] to know where those are because that's what I'm doing. I'm preventing, um, via this [09:31.980 --> 09:37.600] solution, the, the read, like the, the heads seeking the service area. It'll stop. I'm [09:37.600 --> 09:46.840] tricking it into giving me a debug mode. So, anatomy. Hard disk geometry. Uh, I wanted to [09:46.840 --> 09:50.480] bring, I wanted you all to kind of have a little bit of background on this because, you [09:50.480 --> 09:57.960] know, CHS, this is introducing you to CHS and LBA. Um, service area is that grayish blue ring [09:57.960 --> 10:03.160] around the outside if they're outer parked heads on a ramp. The, it could also be on the [10:03.160 --> 10:06.920] inner ring, um, which that would be inner parked heads. So, heads are parked on the [10:06.920 --> 10:11.520] platter. I can't issue this solution with those types of drives all the time. It's harder [10:11.520 --> 10:16.280] because I'm literally listening and also kind of feeling for when the heads are leaving the, [10:16.280 --> 10:26.680] the ramp. Um, two, the sectors, which is the S in CHS, um, that is physical location of data. [10:26.680 --> 10:32.900] It is the smallest unit of data on the hard drive. 512 bytes of user data, 520 if you factor [10:32.900 --> 10:38.040] in ECC error correction code. Um, and is then divided up into cylinders, which are [10:38.040 --> 10:42.920] concentrically expanding rings from the center of the drive. Um, if you have multiple [10:42.920 --> 10:48.280] platters, that's going all through every platter. Uh, I highlighted it there. Number four, [10:48.280 --> 10:51.460] that is a cylinder. Those are all cylinders. Some people will dispute and call them tracks. [10:51.460 --> 10:58.860] It's a whole big debate. Uh, and then, um, that cylinder again, that would be the C in CHS. The [10:58.860 --> 11:06.140] H is the heads. Uh, so cylinder head sector. And a zone is, that includes like several [11:06.140 --> 11:13.620] cylinders and it is just a way to like aid in translator, but we're not going to get into that. [11:15.280 --> 11:20.420] There you go, that's you. Hardware is icky. Let's talk about software instead. And guys in [11:20.420 --> 11:25.160] the back, feel free to come in and sit down. We got plenty of seats. So, what's inside the [11:25.160 --> 11:29.420] firmware that we really care about? Well, one of the most important data structures is the [11:29.420 --> 11:33.940] translator. And the translator maps from logical block addresses to cylinder head sectors. [11:34.360 --> 11:39.660] Anytime you've seen the word logical in a name, it's a cue that we made this up. Uh, logical [11:39.660 --> 11:44.440] block addresses are an abstraction. CHS represent a location and physical space on the [11:44.440 --> 11:49.460] disk. Your translator will map between one and the other and vice versa. Well, how does it do [11:49.460 --> 11:55.640] this? Well, like all good data structures or famous hackers, it has a posse. Uh, it's posse is [11:55.640 --> 12:02.200] made up of defect lists. Um, your translator is a great place to hide things if you don't want [12:02.200 --> 12:07.600] the host OS to know they're there. Not that I would encourage you to do this, but in theory, it [12:07.600 --> 12:14.940] wouldn't be half bad. So, the lists that use as a helper to construct the, the translator as a [12:14.940 --> 12:21.260] data structure are two types of lists. We have primary defect lists and grown defects lists. [12:21.300 --> 12:25.800] Primary defects are defined as defects that are found at factory or creation. You're either [12:25.800 --> 12:30.120] borked or you're not. Sectors are just kind of bad sometimes. We make them, no one makes a [12:30.120 --> 12:35.840] perfect disk. Grown defects are the ones that accumulate over time. Flakes of rust, cosmic [12:35.840 --> 12:41.580] rays, aliens staring at your hard drive, stuff just goes bad over time and we know it. So, we [12:41.580 --> 12:46.800] tend to stick them in two lists. The grown defect list usually has a lot more space than the [12:46.800 --> 12:52.080] primary lists because it's, the size of that tends to determine how long your drive will really [12:52.080 --> 12:59.140] stay viable. In Seagates, we find a second form of primary list called the non-resident grown [12:59.140 --> 13:11.260] defect list. This showed up in? It showed up after 7200.12. It doesn't exist in 7200.11. Ask [13:16.620 --> 13:22.420] me about that later. Go, go, go. These two lists are created by something in Seagate lingo [13:22.420 --> 13:26.780] called a self-scan test, as far as I can tell it's a QA test they run. When working with these [13:26.780 --> 13:31.920] lists, they appear to largely function as glorified arrays, but I haven't been able to fully [13:31.920 --> 13:40.510] prove that's what they really are. They just seem to act a lot like it. So, all right, let's [13:40.510 --> 13:44.430] talk about some lists. No, no, no, not lists. This is physical to logical. I was getting [13:44.430 --> 13:51.910] there. Oh. Oh, it's your turn. Wait, I thought this was me. No, it's got my name on it. What? [13:51.910 --> 13:58.330] No, we switched. Management. All right, well then you do it. Okay. So, how does CHS map to [13:58.330 --> 14:03.290] LBA? This is, and how do skip lists and remap lists work? That's what this is showing. Up [14:03.290 --> 14:09.390] above, the darker blocks is cylinder head sector. Those are the physical blocks, geometric [14:09.390 --> 14:14.930] location. Keep in mind, CHS is always oblivious to these defects. It has no idea that it, that [14:14.930 --> 14:19.570] they exist. That's where the translator will come in. The primary lists found at factory, so [14:19.570 --> 14:25.850] P list, NRG list, maybe a few others, we're not entirely sure yet, um, functions like this. So, [14:25.850 --> 14:30.210] zero, one, and two, those are good, those are good blocks, good sectors. And they map [14:30.690 --> 14:38.770] identical, address wise, to the CHS. Physical block three is bad, so we skip it and four becomes [14:38.770 --> 14:43.490] three, and that's how a skip list works. It's fast, it's significantly faster than remaps, [14:43.490 --> 14:50.270] which we will get to now. And an important thing to note, from a perspective, is they have a [14:50.270 --> 14:54.050] limitation. They're static. So, we tend to pair them with primary lists, because they're [14:54.050 --> 15:01.990] expected to be static and unchanging. Physical, physical to logical via remapping, which is [15:01.990 --> 15:07.950] what the grown defects list are, so anything in G list is functioning like a remap. Uh, again, [15:07.950 --> 15:13.950] zero and one, physically, you know, having the similar, having the same address. We get to two [15:13.950 --> 15:21.390] and three, those are both bad. Um, the heads will, you know, hit that and, uh, check the ECC, it [15:21.390 --> 15:26.650] doesn't match. It knows, translator tells it, okay, go to the reserved area, which, the heads [15:26.650 --> 15:32.010] have to fly to a totally different area. This, it can really, really start to increase, um, the [15:32.010 --> 15:36.450] time that you have to spend, you know, waiting for your data to show up. So, a lot of times [15:36.450 --> 15:41.110] when your drive is starting to slow down, it can often indicate via smart data kind of sort of, [15:41.110 --> 15:45.030] don't ever really rely on that, but it can indicate a grown defects list, potentially. [15:46.630 --> 15:54.930] So. If you're in CS, this will cause it to resemble a linked list in a lot of ways. Yeah. And, uh, [15:54.930 --> 15:57.630] yeah, actually that's all I got, but if you have more questions, you can talk to me about that [15:57.630 --> 16:05.650] later, I know it's kind of, it's esoteric. Ah, signs translator may be corrupted. Um, again, as [16:05.650 --> 16:11.330] I mentioned earlier, uh, drive will boot, it'll spin, um, or it'll do the partial boot. [16:11.330 --> 16:17.870] Ultimately it's never recognized by the host. Uh, if you're able to get, you know, terminal debug [16:17.870 --> 16:23.350] mode, you will see these errors. Pretty much anything that begins with LED is indicative of a [16:23.350 --> 16:28.850] translator issue. Uh, that top one there ending in AO51, it's just kind of like a classic stuck [16:28.850 --> 16:36.170] and busy. Uh, could, could be, you know, lists need to be merged or the G list needs to be [16:36.170 --> 16:42.890] purged. Uh, the second one there ending in A7E5, pretty much always means in a Faro or Moose [16:42.890 --> 16:46.730] drive that I'm going to have to do the shorting of the read points in order to gain terminal [16:46.730 --> 16:52.870] access. Um, the SIM errors down here, any SIM error that you see, that's like 1000 through [16:52.870 --> 16:58.210] 1008, probably a corrupted defects list. Don't really know which one you'd have to research [16:58.210 --> 17:04.750] that or memorize it over time. SIM error 1009 pretty much always means, uh, corrupted G list, [17:04.750 --> 17:10.510] which is something that one of our tools can fix. Um, but those are things to look for in terminal [17:10.510 --> 17:19.030] debug mode. If you ever decide to do this for fun or, you know, you. I came up with a plan [17:19.030 --> 17:24.070] worthy of a bond villain. It is foolproof. It cannot possibly fail. So we're going to corrupt a [17:24.070 --> 17:29.210] translator in a controlled manner because I like properly testing my software, run it through a [17:29.210 --> 17:34.530] manual fix, take some notes, take some numbers, model with a program, tested on some [17:34.530 --> 17:41.950] unsuspecting members of our hacker space and profit. Who's written software before? Show a [17:41.950 --> 17:47.790] hands or played with proprietary hardware. Yeah. Yeah. You all know where this is going. [17:47.790 --> 17:54.050] Unsurprisingly, we ran into a few problems. So initially we were expecting to find three [17:54.070 --> 18:00.250] lists. The P list, the NRG list, which is that second form of P list and a G list, right? When we [18:00.250 --> 18:05.110] start spunking in the hardware, we find two out of three. So far so good. We are on track. I'm [18:05.110 --> 18:12.010] feeling good about it. It's warm and fuzzy. Warm and fuzzy never lasts. I'm the reason I can't [18:12.010 --> 18:16.990] have nice names. So instead of finding one G list, we found three, which became our first [18:16.990 --> 18:21.290] problem. Which of these grown defects lists are we going to try to overfill and are they all [18:21.290 --> 18:26.330] really actually G lists? Because we just sort of found a bunch of lists and had to figure out what [18:26.330 --> 18:32.330] they were, what they did and whether they were actually useful. So if you were confused by the [18:32.330 --> 18:37.990] remap, the physical to logical remap, ask me later what is copied and why that happens and [18:37.990 --> 18:45.930] how. Alrighty. Anyway. So we ended up trying to fill some of these lists and seeing what the drive [18:45.930 --> 18:50.270] did and seeing if we got the sort of signs of corruption we were expecting. We ultimately [18:50.270 --> 18:56.150] settled on the eponymous G list, the first one at the top. And that's the one we used for the [18:56.150 --> 19:03.210] rest of our experiments and testing. So that's the list we settled on for future use. We also [19:03.210 --> 19:08.210] found these two. Um, they're called slip lists. That means we found a total of seven lists here [19:08.210 --> 19:12.190] when we were expecting three. It's a little crowded in there. They aren't relevant to this [19:12.190 --> 19:17.110] talk and we're not entirely sure what they do, but we found them and we wanted to share that in [19:17.110 --> 19:26.250] case they're useful to other people. So we, we expected that we'd sort of fill the list by hand [19:26.250 --> 19:35.190] once it fall over at 2000 entries, we'd move on. Uh, that's not how that went. So initially Mr. [19:35.190 --> 19:43.030] Dead here added 3000 some odd entries by hand. Not that she was counting. Uh, I added about 34 [19:43.030 --> 19:47.870] before wanting to throw out the wall and deciding Pi cereal was the lesser of two evils. [19:48.690 --> 19:53.930] Promptly scripted that. So even then I'm like, all right, we'll run it overnight. It'll be done. [19:54.430 --> 19:59.290] Well, we ended up north of 6,000 entries and the translator wouldn't corrupt. And we're like, [19:59.290 --> 20:03.090] we don't think it has that much space. It shouldn't have that much space. We've run some [20:03.090 --> 20:07.710] numbers. We think it should only have like two gigs. And it finally dawned on me that the [20:07.710 --> 20:11.470] translator was actually a little bit smarter than I'd given it credit for. And it was adding entries [20:11.470 --> 20:16.070] sequentially and just skipping the entire block. We were basically telling it as contiguous memory [20:16.070 --> 20:20.190] was bad. And it was like, okay, contiguous memory is bad. We'll just skip that. So I ended up having [20:20.190 --> 20:24.270] to add a randomizer to the script. So it would add random jumps so that it couldn't block it. [20:24.510 --> 20:29.030] Even then we found that the list had way more space. We were expecting it to fall over at 2000 [20:29.030 --> 20:35.890] entries and it usually takes between 4,000 and 5,000 for it to fall over. Um, the drive didn't [20:35.890 --> 20:40.910] like being up for a lot of that. If you look at the far screen over there, you'll see the drive [20:40.910 --> 20:45.850] powering down in the middle of me doing things. So we found we also had to batch it and give the [20:45.850 --> 20:51.450] drive pauses between stuff. And you'll see on the left, that's the screen attached in diagnostic [20:51.450 --> 20:56.250] mode. And it's got way fewer entries in it's G list than I was expecting it to have, which was [20:56.250 --> 20:59.850] sort of my tip off that it was doing something smarter. I'm a little embarrassed to say it took [20:59.850 --> 21:04.430] me a while to see that. I just sort of thought I was doing it wrong or wiring it backward, which [21:04.430 --> 21:12.490] happened a lot. All right. So firmware is really weird, was the third problem I personally ran [21:12.490 --> 21:25.730] into. What does level six E2 do? Any takers? This creates a user batch file zero. Uh, how about [21:25.730 --> 21:32.350] level T, I4, parameters one, you already know the answer. You can clean the erasers after class. [21:32.350 --> 21:38.370] This clears the G list. I have no idea how this corresponds to clearing the G list, but it does. [21:38.930 --> 21:47.210] And so if anyone ever says this to you. Oh, too quick. Every time you say code is self [21:47.210 --> 21:52.370] documenting, God kills a kitten. Yeah. Why are you ruining my punch line? I've been waiting 10 [21:52.370 --> 21:59.550] years to use this picture for my coworkers desk. So Seagate firmware is extremely non-self [21:59.550 --> 22:04.170] documenting and that can be very difficult to work with when you have to rely on partially [22:04.170 --> 22:10.130] transcribed Chinese manuals found on sketching FTP servers. The other problem we ran into that [22:10.130 --> 22:14.490] isn't really on a slide because I didn't think it needed a slide was that we also ran into [22:14.490 --> 22:19.630] differences between firmware, like different behavior, different output. Some commands that [22:19.630 --> 22:24.650] we expected output from didn't output in the Apple firmware version. And it took us a lot of [22:24.650 --> 22:30.150] headbanging to figure that out. So when you were messing with this, you can't even count output [22:30.150 --> 22:34.970] to be consistent across commands, tell you whether something succeeded or not. In some cases, the [22:34.970 --> 22:39.110] Apple version just doesn't do anything. If it succeeds or if it fails, you just have to try [22:39.110 --> 22:46.310] later and see if it actually did something. So again, that timing issue and why I wanted to [22:46.310 --> 22:53.130] automate this because it takes forever. Um, this is just a little graph that Allison made. It's [22:53.130 --> 22:59.450] the results of several timing tests recorded. Um, during our attempts at the manual fix to [22:59.450 --> 23:06.410] short the points problem. Um, this is from powering on the drive to me hearing, listening for the [23:06.410 --> 23:12.610] heads to seek the service area. What's not shown is the timing between shorting the points and [23:12.610 --> 23:18.430] sending control Z. Uh, we didn't include that because we never actually got that far. Um, as [23:18.430 --> 23:24.670] you can see, there's a huge variance. Um, I think it was roughly between like 4.28 or [23:24.670 --> 23:30.750] something like that, uh, up to like almost 6.4 or something. Um, this is only from a single drive [23:30.750 --> 23:36.510] and we spent about two hours with zero success. Uh, so this was, you know, we had successfully [23:36.510 --> 23:40.430] corrupted the drive by overfilling the G list and here we are trying to figure out, well, how are [23:40.430 --> 23:45.050] we going to script this timing issue? And we're still not there. So. [23:45.050 --> 23:53.410] All right. So to recap, we had some surprises. There were more lists than we anticipated. We [23:53.410 --> 23:56.990] ended up stumbling around trying to figure out which one. The translator was smarter than I [23:56.990 --> 24:05.350] expected by actually a fair amount. Firmware is extremely weird. It has differences and the G [24:05.350 --> 24:09.110] list was a lot larger than we anticipated, which did significantly slow us down in places [24:09.650 --> 24:13.870] because I expected to be able to fill that sucker in four hours and it takes closer to 48. [24:17.090 --> 24:22.030] Yeah. Data recovery technicians and professionals are patient when we're working and then in the [24:22.030 --> 24:28.750] rest of life, we're kind of assholes, I think. But, uh, some other problems we ran into, um, you [24:28.750 --> 24:33.510] know, we're only human. We're mere mortals. Uh, lots of human errors. Software engineer can't [24:33.510 --> 24:37.370] hardware, hardware engineer can't software. She crossed wires, I don't know how many times, [24:37.370 --> 24:43.210] probably wasted about four hours on just confusing TX, RX and maybe not even having ground in, [24:43.210 --> 24:48.870] which I think she did actually kill one of our drives by not having ground in. Uh, and then I [24:49.290 --> 24:54.510] failed. I was trying to, you know, use the, her script that she wrote to intentionally corrupt. I [24:54.510 --> 24:59.290] didn't read the documentation. So I'm just like, go, go, go. Nothing's happening, Allison. And I [24:59.290 --> 25:03.990] went back to manually inputting. That was, that was pretty awful. Uh, I also poked through the [25:03.990 --> 25:09.230] PCB when trying to short the points. Um, but it's okay. I have so many of these to play with. Uh, [25:09.230 --> 25:14.050] the significant timing variance, um, the command output that we're waiting for in order to verify [25:14.050 --> 25:18.190] anything could take between one second. She put six minutes. Realistically, it's like 10 [25:18.190 --> 25:22.670] minutes. It could be 10 minutes even with really, really expensive, awesome data recovery tools [25:22.670 --> 25:28.810] like the PC 3000. Had to wait upwards of 10 minutes with the PC 3000. Um, Pi serial was less [25:28.810 --> 25:35.610] reliable. Don't use it on Windows. Um, I'm not the best Linux user at all, but this forced me to [25:35.610 --> 25:45.130] learn a lot more and sort of get away from Windows. So don't judge me, please. All right. So [25:45.130 --> 25:49.650] where we're at now, now that we've Yammered at you for some background and our experimental [25:49.650 --> 25:54.150] progress and emotional journey, we can consistently reverse corruption if diagnostic [25:54.150 --> 26:00.990] mode is available. So if you see sim error 111009, we know we can always reverse that. That [26:00.990 --> 26:06.570] one works very well. We can consistently corrupt our target drive. So I do have good test [26:06.570 --> 26:12.690] environments now. We, so if you want to play with reversing corruption, we can get you a drive [26:12.690 --> 26:18.650] that is in shape for that. The unfortunate thing is though, is we haven't been able to [26:18.650 --> 26:25.130] reproduce the original target solution on our corrupted drives. Because of the variance in [26:25.130 --> 26:30.130] timing and the fact that I don't have a way to programmatically detect where the heads are, I'm [26:30.130 --> 26:35.230] not actually convinced that we'll ever really get to a fully automated fix for the original [26:35.230 --> 26:47.340] problem. But that doesn't stop us from trying. Ta. All right. So before we show you code, the [26:47.340 --> 26:52.060] development philosophy for this project is a little bit different. I generally believe that not [26:52.060 --> 26:56.520] all hackers are coders. It's a little bit of a controversial opinion these days in some [26:56.520 --> 27:00.560] circles, but I do believe that. And I have met some very technical people in the data recovery [27:00.560 --> 27:06.980] community who can't read or write code for, for anything. Like that one. For, not, not that I [27:06.980 --> 27:13.600] would be so crass as to name names at a podium while we're being recorded. Anyway. So, this [27:13.600 --> 27:17.380] makes my spirit, my hacker spirit sad. And the whole point of this project is that the data [27:17.380 --> 27:27.740] privacy community has to, there was not a can of caffeine in that latte, I'm saying. They have to [27:27.740 --> 27:31.420] operate with this giant veil of secrecy. Manufacturers are withholding information, a lot [27:31.420 --> 27:36.640] of it's proprietary. People who make tools are extremely secretive. The large companies that do [27:36.640 --> 27:42.300] data recovery do not share. So, our goal is to make this open. And if you can't read the code, [27:42.300 --> 27:45.780] then you don't really know what it's doing and you haven't learned. Code represents [27:45.780 --> 27:51.200] intelligence. So, this code has been written with those people in mind. If you are a [27:51.200 --> 27:56.920] developer and you are a purist, avert thine eyes because there are fragrant violations of dry, it [27:56.920 --> 28:02.100] is over commented from a developer perspective and it is very procedural and it will basically [28:02.100 --> 28:05.440] piss off anyone who writes code professionally. I'm okay with that because they're not my [28:05.440 --> 28:10.420] target audience. I want people who do data recovery to be able to read it. It's in Python for [28:10.420 --> 28:15.240] two reasons. One, because it's the lingua franca of security and it's our poison of choice. But [28:15.240 --> 28:20.320] also because in my experience teaching people, it is the easiest type of code for non-coders [28:20.320 --> 28:27.080] to understand. It is also GPLV3 because we are interested in making sure this information [28:27.080 --> 28:31.020] stays open. There's already a bunch of proprietary and closed stored stuff. I'm not [28:31.020 --> 28:35.280] interested in spending my precious free time adding to that. So, if you want to yell at me [28:35.280 --> 28:40.980] about the license choice, feel free. Go for it. Uh, please file your bugs with this, this [28:40.980 --> 28:48.220] philosophy in mind. It is a little bit different. So, to the meat of it, what you're going to [28:48.220 --> 28:55.140] need to implement this at home with one of your pharaoh or moose seagate drives. Um, side [28:55.140 --> 29:00.020] note, I wasn't entirely comfortable with this and definitely very used to my expensive fun [29:00.020 --> 29:06.160] tools. Uh, but I very much want this to become open source. So, to do this entire thing, if [29:06.160 --> 29:10.580] you already have the drive, shouldn't cost you more than 15 bucks. You just need a USB to TTL [29:10.580 --> 29:16.860] adapter with the FTDI chip, FT232, access to the ground pin. So, you're going to have to shell [29:16.860 --> 29:23.040] your drive. Um, if you have, if you're not using one of the adapters that has, you know, [29:23.040 --> 29:26.500] shared power with the host, you're going to need a power adapter. You'll need the code, which [29:26.500 --> 29:31.840] you can find on her github. Uh, you'll need pi serial module. We strongly encourage and [29:31.840 --> 29:35.040] encourage, well, we encourage you install screen to issue a sanity check to make sure that [29:35.040 --> 29:38.980] you are in fact connected to the hard drive and that you can send these commands, that you can [29:38.980 --> 29:43.580] cause corruption and reverse corruption. Uh, we also strongly encourage that you'd never use [29:43.580 --> 29:50.340] this on a hard drive with data that you give a damn about. Uh, don't. Um, you do have to match [29:50.340 --> 29:56.660] it in a very particular way. Um, all hard drives are broken up into these really bizarre, like, [29:56.660 --> 30:01.580] uh, families and lots of other things. Um, generally with the, the Seagate Moose and [30:01.580 --> 30:06.760] Ferro, match the model number. You can ID it if it's a good drive via the debug mode and I can [30:06.760 --> 30:10.460] like, you know, we'll document that somewhere. There's a special command you can send for [30:10.460 --> 30:15.080] that. Um, if not, you can kind of go off the model number. Ferro and Moose drives almost [30:15.080 --> 30:19.520] always end in something, something AS with the model number. Uh, match the firmware [30:19.520 --> 30:24.120] versions because again, this, the exact specific type of corruption we were trying to fix with [30:24.120 --> 30:29.940] the shorting of the read points, um, in order to gain terminal access doesn't incur in a [30:29.940 --> 30:35.300] couple of like Apple, well, it can occur there, but it's difficult to fix. Um, because when [30:35.300 --> 30:38.840] it's seeking the service area and at what points it's reading the service area are different [30:38.840 --> 30:43.440] than in other firmware. The Dell specific firmware JC4A, we were never able to get [30:43.440 --> 30:48.400] corruption. I don't know why. I don't know if it's somehow impervious to G list overfill. I'd [30:48.400 --> 30:55.260] have to do a lot more research to figure that out. This is our set up. Um, that's my little, [30:55.260 --> 31:01.160] uh, pin or a read point shorting tool that I, it's just tweezers. And I tried to space them, uh, [31:01.160 --> 31:05.760] as perfectly apart to quickly hit the read points, which are in the middle there. And the, [31:05.760 --> 31:10.280] uh, it's just solder wrapped around the, wrapped around there trying to bridge it. It's a [31:10.280 --> 31:15.220] really shoddy set up and I'm embarrassed by it, I guess. Um, and yeah, those are the read [31:15.220 --> 31:18.940] points we're aiming for when we're, you know, right after power on listening for it to [31:18.940 --> 31:22.740] leave, uh, listening for the heads to leave. And then, uh, once we actually did reach [31:22.740 --> 31:26.440] corruption, because we have done that, uh, I just wanted to verify it in one of my fancy [31:26.440 --> 31:30.080] tools. So it took up to the PC 2000 over there. They have these fancy terminal connectors [31:30.080 --> 31:36.700] that are way better than, way better than that. Um, much less likely to cause connectivity [31:36.700 --> 31:41.560] issues. Um, so yeah, when you're doing this, just make sure that, you know, you're [31:41.560 --> 31:48.960] crisscrossing your RX and TX from host to device. Um, it's like honestly kind of a, uh, kind of a [31:48.960 --> 31:57.260] trick to even figure out what pins are TX, RX on the drives. Um, so TX is always closest to, uh, [31:57.260 --> 32:02.200] the SATA. Then RX right next to it. And then ground is the very last. So we didn't show the [32:02.200 --> 32:09.460] power connector. It's there. Please be very careful. Um, there's a lot that you can do to [32:09.460 --> 32:13.720] destroy your drive and never get access to your data again. So again, if you're going to be [32:13.720 --> 32:18.760] doing this, choose it, choose to start with a drive you don't care about at all. And before [32:18.760 --> 32:22.800] you start, very first thing, back up the service area, which yes you can do via terminal debug [32:22.800 --> 32:28.540] mode commands. You can save that way. Um, ask me about that later. But definitely, [32:28.540 --> 32:35.160] definitely, definitely back up the service area. Alright, so you've got your equipment, you're [32:35.160 --> 32:39.260] ready to go. Please get your software installed in order. Remember to give it executable [32:39.260 --> 32:44.760] permissions. Hook up the connectors. Double check your connectors. If you're in software, [32:44.760 --> 32:48.500] have someone in hardware check your connectors. Determine what port your OS has been [32:48.500 --> 32:54.900] assigned. Re-run the scripts. Read the, I'd say read the documentation before you start, but I'm [32:55.020 --> 33:00.340] a realist and know that nobody does that apparently. So, before you hit run, please read [33:00.340 --> 33:06.840] the documentation because the order of the LBA addresses you enter matters. So, yeah, [33:06.840 --> 33:11.540] running this once you get all your stuff and set up and are good to go is actually pretty [33:11.540 --> 33:19.520] quick. However, there is one gotcha I do want to mention. So, as we mentioned earlier, some of [33:19.520 --> 33:22.720] those re- especially when you get a full G list, your remap operations get really, really [33:22.720 --> 33:28.980] slow. And we did see some of the commands to add entries take north of ten minutes to fully [33:28.980 --> 33:35.260] execute. So, the script will time out. You'll see received byte zero and the set up you can see [33:35.260 --> 33:42.020] on the left that we are actually getting the sectors reassigned, i.e. added to the G list, [33:42.020 --> 33:46.960] even though the script says we got nothing back. This is because I went and made T and came [33:46.960 --> 33:52.160] back and there was the output. So, be aware that if you see received zero, it's not an [33:52.160 --> 33:57.240] indication that the operation failed, it just means it was taking longer than the script was [33:57.240 --> 34:05.240] willing to wait. So, don't freak if you see those. Alright, so what's next? This is a [34:05.740 --> 34:10.160] shameless plug for help. We would like to try solving the original problem without [34:10.160 --> 34:15.840] shorting. We'd like to write it- write some code to configure the translator to rebuild based [34:15.840 --> 34:19.960] on the list you specify. You may remember that we have seven of them to pick from. I'm [34:19.960 --> 34:23.080] guessing you'll get some different behavior and some different performance if you rebuild the [34:23.080 --> 34:26.880] translator with different lists. We'd like to expand this to include other Seagate [34:26.880 --> 34:31.300] families or even better, other manufacturers. Could potentially do this with the ATEA [34:31.300 --> 34:39.800] commands because they are not specific to Seagate. So, again, long term goal, we would like [34:39.800 --> 34:45.260] an open source data recovery suite so that people don't have to spend an arm and a leg or [34:45.260 --> 34:52.980] you know, hundreds to up to ten grand sometimes on data recovery. Feature requests, again, [34:52.980 --> 34:58.060] our current focus is on translators and defects list issues. We do want to expand to include [34:58.060 --> 35:03.080] other solutions and, of course, other manufacturers. Code contributions, just make [35:03.080 --> 35:08.400] sure you please keep Allison's philosophy in mind. You know, make this for people that don't [35:08.400 --> 35:14.120] know how to code. We would love help testing. That doesn't always include just writing [35:14.120 --> 35:18.220] scripts. There's other things that I would definitely like help with and you can ask me about [35:18.220 --> 35:23.100] that later if you're interested. Open knowledge about the firmware. All this, again, data [35:23.100 --> 35:26.580] recovery is super, super, super secretive. The manufacturers are secretive. Other data [35:26.580 --> 35:32.340] recovery companies are very secretive. You know, it's hard. There's a lot of digging. There's [35:32.340 --> 35:37.820] some great forums out there. HDD Oracle is one of my favorite. I highly recommend you visit [35:37.820 --> 35:45.920] that if you haven't. So, acknowledgments. Speaking of HDD Oracle, I really want to thank [35:45.920 --> 35:49.980] Spilled It. I've never met him, but he founded HDD Oracle and he's just a fantastic [35:49.980 --> 35:59.140] researcher. He loves what he does and he's not in it to make money. I think that's it. [36:00.480 --> 36:05.680] I'd like to thank LeapBunny and the two goons who sprinted over across hotels to get us a [36:05.680 --> 36:11.660] projector at T minus five minutes because I don't think I could have done that. LeapBunny is [36:11.660 --> 36:15.660] awesome. He's always wearing a green hat pretty much. Definitely buy him food or booze or [36:15.660 --> 36:22.820] something. And then bibliography you can find on my GitHub that I never use or that little URL [36:22.820 --> 36:28.740] which is totally safe, I promise. And if something happens, find Dean Pierce. He's awesome. [36:28.880 --> 36:34.040] Okay. So, we were supposed to take five minutes of questions, but because we got such a late [36:34.040 --> 36:38.580] start, we're going to take all of our questions over under the hardware hacking village sign to [36:38.580 --> 36:43.820] try to keep this room as on schedule as it is feasible to be at DEF CON. So, thank you all for [36:43.820 --> 36:48.460] coming. Thanks for fording the maze. We look forward to seeing you over there to have a longer [36:48.460 --> 36:49.420] conversation.