1 00:00:00,000 --> 00:00:05,920 A little bit of introduction, I've had the privilege of spending my entire career in free and open source software. 2 00:00:05,920 --> 00:00:08,360 And I'm a manager these days. 3 00:00:08,760 --> 00:00:13,300 So I do this so that my brain doesn't rot completely. 4 00:00:14,080 --> 00:00:19,880 And because I used to be an embedded engineer, and I find this fun. 5 00:00:20,100 --> 00:00:33,780 Also, I'm the co-founder of a small R&D shop in Boston, and we do stuff relating to sound and computers. 6 00:00:33,780 --> 00:00:38,180 So that got me into this strange topic. 7 00:00:38,680 --> 00:00:41,760 Now, usually I talk about hardware hacking. 8 00:00:41,760 --> 00:00:46,240 This is actually part of our HHV track. 9 00:00:46,580 --> 00:00:56,160 And usually there is a humorous obligatory disclaimer to all my talks that will most likely break some hardware while we're playing with it, and it will come out of your pocket. 10 00:00:56,160 --> 00:00:58,020 In this case, we're not breaking anything. 11 00:00:58,020 --> 00:01:06,720 The no liability disclaimer is that there is a lot of stuff here that is adjacent to classified material. 12 00:01:06,980 --> 00:01:10,920 None of what we will be discussing is classified. 13 00:01:10,920 --> 00:01:13,240 It's all coming from open sources. 14 00:01:13,540 --> 00:01:17,320 So that's good, I suppose. 15 00:01:19,360 --> 00:01:24,320 I literally don't know the part that's classified, so I cannot accidentally tell you. 16 00:01:27,640 --> 00:01:30,840 We have quite a bit to go through. 17 00:01:30,840 --> 00:01:31,940 So let's go. 18 00:01:33,840 --> 00:01:38,140 Now, this talk is all about abusing our beloved keyboards. 19 00:01:39,840 --> 00:01:45,700 Keyboards have access to the plain text of what we're so carefully encrypting. 20 00:01:45,780 --> 00:01:49,340 They have access to our passwords before hashing. 21 00:01:49,360 --> 00:01:53,640 It follows we obviously want some exploit action here. 22 00:01:53,720 --> 00:02:01,400 And there is some pretty wild stuff out there, mostly in research more than in active use that we can see. 23 00:02:01,400 --> 00:02:07,720 Of course, we don't know what countries are doing to each other, but we kind of have a sense of what's going on in the industry. 24 00:02:09,240 --> 00:02:18,800 So we cannot tell what the big boys in the Intel community are doing, but it seems like there is plenty of fun going on in academia. 25 00:02:19,920 --> 00:02:21,860 Let's start with something light. 26 00:02:22,000 --> 00:02:31,600 So there is this book, Eric Hasselton, interesting career, trained in neurology, then became a Disney Imagineering executive. 27 00:02:31,860 --> 00:02:36,760 Then he was recruited by General Hayden to run the NSA's R&D department. 28 00:02:36,760 --> 00:02:38,540 This was about 20 years ago. 29 00:02:39,660 --> 00:02:42,600 I can't remember if Clinton or Bush was president. 30 00:02:43,460 --> 00:02:46,980 An original career trajectory, if I ever saw one. 31 00:02:47,180 --> 00:02:52,380 So the first movie connection here is Disney, but the second one is coming from Hasselton's book. 32 00:02:54,980 --> 00:03:00,220 Great book, by the way, absolutely enjoyable to read if you are into tech and espionage. 33 00:03:00,540 --> 00:03:05,640 Details of the discovery of IBM's electric implants and typewriters in the U.S. 34 00:03:05,640 --> 00:03:09,760 Embassy in the Eastern Bloc, among other stories, very nicely written. 35 00:03:10,040 --> 00:03:17,840 At this point here, he's talking about Charles Gandy, the legendary NSA researcher, and how he got started in the business. 36 00:03:18,060 --> 00:03:20,380 Spoiler, it's the movies. 37 00:03:20,620 --> 00:03:23,580 So now I need to read for you. 38 00:03:26,000 --> 00:03:36,920 In the movie, FBI agents monitoring Nazi spies in America remotely beamed energy from a dish antenna at a room where the spies were planning their next attack. 39 00:03:37,160 --> 00:03:47,500 The intrepid FBI agents were able to decode voice signals in the room from reflections of a vibrating speaker in a telephone headset and to work to the attack. 40 00:03:47,520 --> 00:03:56,840 Eleven-year-old Gandy was in awe of FBI's advanced technology and vowed to use it to defend the United States. 41 00:03:56,840 --> 00:03:59,680 And then he became an NSA agent. 42 00:03:59,880 --> 00:04:05,860 Well, later, because this is 1940s, the NSA is not there anymore and is not there yet. 43 00:04:07,220 --> 00:04:10,740 Now, usually this is represented with a Tempest code word. 44 00:04:10,740 --> 00:04:18,180 The Tempest code word brings us the first attack vector, which colloquially we call Van Eck freaking. 45 00:04:18,580 --> 00:04:21,960 Somewhat of a misnomer, but that's a cool name. 46 00:04:22,640 --> 00:04:41,480 Dutch researcher Wim Van Eck opened Pandora's box on EM signal emissions with his 1985 paper, publishing what SIGINT professionals had known since the 40s, but kept classified. 47 00:04:41,480 --> 00:04:50,060 It was in the open that signal leakage existed, but it was generally assumed to require expensive equipment and expertise. 48 00:04:50,980 --> 00:05:04,340 In Van Eck's attack, he exploits the emanation of unshielded CRT screens containing frequency components in the UHF band, which is old over the air television for the young ones among you. 49 00:05:04,340 --> 00:05:15,280 Monitoring synchronization pulses are missing and have to be recreated by the attacker, and he creates some circuitry and costs him about $15 to make. 50 00:05:15,480 --> 00:05:22,740 And voila, he can display the resulting feed on a television from hundreds of meters away, up to one kilometer. 51 00:05:23,000 --> 00:05:27,300 People freak out about this once about every 20 years. 52 00:05:27,620 --> 00:05:31,720 I find that they forget and then the next generation does the same. 53 00:05:31,720 --> 00:05:37,340 And from unclassified NSA histories, we know that the Intel community did the same. 54 00:05:37,340 --> 00:05:39,560 The labs discovered it in 1943. 55 00:05:39,560 --> 00:05:42,700 The CIA rediscovered it in 1951. 56 00:05:42,820 --> 00:05:47,060 So looks like this keeps happening. 57 00:05:47,060 --> 00:05:56,680 So this is the BBC showing the exploit, mid 80s. 58 00:05:56,680 --> 00:05:58,400 So here's the BBC video. 59 00:05:58,400 --> 00:06:01,500 We don't have time for the whole thing, but it's on YouTube. 60 00:06:01,500 --> 00:06:06,380 Decent introduction explains what's going on and how a CRT monitor works. 61 00:06:06,460 --> 00:06:13,480 And then they drive around in a van with some kind of antenna down the street. 62 00:06:13,480 --> 00:06:20,760 And as one does, they read a letter from some unknown gentleman eight floors up on the building. 63 00:06:20,760 --> 00:06:25,460 Let's see if the media will work for us here. 64 00:06:25,460 --> 00:06:28,800 And that's a rather unwelcome birthday greeting. 65 00:06:29,060 --> 00:06:37,140 Well, that same hacker has now linked this terminal to the computer at Dairsbury, which is used for nuclear research. 66 00:06:37,740 --> 00:06:41,840 You can read all this data because it's obviously low level security. 67 00:06:41,840 --> 00:06:47,120 But if I try and go deeper into the computer, the data will be encoded. 68 00:06:47,120 --> 00:06:51,080 So all I'll get back is this sort of information, what's known as shash. 69 00:06:51,080 --> 00:06:55,220 To be able to read that, I'd need to have access to a decoding system. 70 00:06:56,060 --> 00:06:58,400 So you will get to it in a second. 71 00:06:58,400 --> 00:07:05,940 He drives in his van down the street and they literally read the TV on a monitor eight floors up. 72 00:07:06,220 --> 00:07:07,780 And this is interesting. 73 00:07:07,780 --> 00:07:17,480 I guess in the 1980s, it was not necessarily legal in England where they set up to read the TV of somebody who was connected with them. 74 00:07:18,340 --> 00:07:24,200 The phenomenon is quite simply that all electrical equipment gives off signals. 75 00:07:24,200 --> 00:07:34,760 If you take even a pocket calculator and you put it near to a radio which has long wave on it, you can hear the interference as I press the keys here. 76 00:07:36,440 --> 00:07:45,960 Well, even if a calculator radiates a signal like that, you might still be surprised to learn that a computer terminal radiates a signal that can be picked up over two miles. 77 00:07:46,560 --> 00:07:52,140 We're going to skip the rest because in the interest of time, since we skipped so much of it. 78 00:07:52,140 --> 00:07:55,280 But you can find it on YouTube. 79 00:07:55,320 --> 00:07:57,960 It's BBC Tempest. 80 00:07:57,980 --> 00:08:01,340 And you will have the slides at the end so you can pick it out a bit. 81 00:08:01,660 --> 00:08:08,380 So CRT monitors look like this for those of you that are less than 25. 82 00:08:10,820 --> 00:08:24,300 But Tempest as a code word refers for a classified protection standard for unintended signal emissions leaked through EM or other means. 83 00:08:24,700 --> 00:08:28,180 Most common sources were CRT monitors. 84 00:08:28,420 --> 00:08:33,100 Here's an exemplary from my retrocomputing research. 85 00:08:35,280 --> 00:08:38,980 But EM is not the only one. 86 00:08:38,980 --> 00:08:45,360 That much we know because the code word definition itself has been declassified in 2008. 87 00:08:45,360 --> 00:08:49,580 Much of it is blanked out, but a few interesting things were disclosed. 88 00:08:50,080 --> 00:09:00,440 Discovered in 1943 at Bell Labs, a reading and encrypting machine from across the street and rediscovered in 1951 by the CIA. 89 00:09:00,440 --> 00:09:07,220 Strategies for mitigation include shielding, so putting the Faraday cage around the device. 90 00:09:10,060 --> 00:09:18,240 Filtering, so trying to control the frequencies that get out, and masking, so creating so much noise that you don't know which noise you want to look at. 91 00:09:18,520 --> 00:09:41,600 Eventual resolution for the military in the 1950s after trying a bunch of filtering and shielding was that they just told anybody that had a teletype transmitting classified information to control an area 200 feet in all directions around the device so that nobody could get close enough with equipment to collect a signal. 92 00:09:42,140 --> 00:09:50,280 This was out of practicality because they didn't think that it was possible to control more than 200 feet in all of these stations, not out of measurement. 93 00:09:50,280 --> 00:09:56,620 They kind of thought 200 made sense, but the measurement numbers are still classified. 94 00:09:56,620 --> 00:10:02,060 We don't know what the NSA believes are the actual safe numbers. 95 00:10:02,940 --> 00:10:11,280 The other instruction was to operate 10 teletypes at once so masking would confuse everyone. 96 00:10:11,360 --> 00:10:17,620 That, we understand now, doesn't really work very well, but great for teletype vendors back then, I suppose. 97 00:10:20,280 --> 00:10:24,600 Another bit of the classified memo is this Peter Wright. 98 00:10:24,600 --> 00:10:26,260 He worked for MI5. 99 00:10:30,520 --> 00:10:36,000 Now, there is this bit of a story in his memoir. 100 00:10:36,140 --> 00:10:47,600 In the 60s, the UK government was trying to get into the EU, funny given recent news, and French President de Gaulle had a chip on his shoulder about the British, so he was stopping them. 101 00:10:47,640 --> 00:10:54,680 So, the foreign office, as one does, instructed MI5 to wiretap the French embassy. 102 00:10:54,840 --> 00:11:10,240 As they wiretapped the French embassy to discover what the French negotiating position would be, the technician discovered that aside from the encrypted signal, which they expected to see on the line, there was another much weaker signal. 103 00:11:11,020 --> 00:11:14,740 And once they amplified that, they discovered it was the plain text of the transmission. 104 00:11:15,300 --> 00:11:19,040 And the reason for this was not that the French machine was bad. 105 00:11:19,040 --> 00:11:20,420 The French machine was excellent. 106 00:11:20,420 --> 00:11:22,500 The British could not break the ciphertext. 107 00:11:23,180 --> 00:11:32,020 The problem was that there was a machine with encrypted data and a machine with decrypted data in two rooms that were adjacent. 108 00:11:32,280 --> 00:11:42,060 And the plain text that was leaking across the room, crosstalk literally, and the Brits could pick it out on the line. 109 00:11:42,880 --> 00:11:51,180 It didn't do them any good because de Gaulle blocked the admission into the EU until he died and the Brits could only get into the EU in the 1970s. 110 00:11:51,180 --> 00:11:55,240 But in a signal intelligence scenario, it was interesting. 111 00:11:56,160 --> 00:11:59,380 Now, of course, we know what happened in the last 10 years. 112 00:11:59,380 --> 00:12:01,820 So the world is strange. 113 00:12:04,700 --> 00:12:14,020 This, however, gave us the other bit of security directive that the NSA gives that we know about, which is red-black separation. 114 00:12:14,120 --> 00:12:22,020 Keep the ciphertext machines and the plain text machines separate according to certain rules. 115 00:12:22,020 --> 00:12:23,560 We don't know what the rules are. 116 00:12:23,560 --> 00:12:28,640 We just, well, we know something about the wiring that's being declassified, but we don't know. 117 00:12:28,640 --> 00:12:31,820 We do know that they want them strictly separated. 118 00:12:32,820 --> 00:12:37,560 Additionally, the declassified code word describes signal emanations in other domains. 119 00:12:37,700 --> 00:12:44,460 Seismic, presumably referring to vibration, but only the headliner is in the declassified thing. 120 00:12:44,460 --> 00:12:46,620 The rest is all blanked out, so my guess. 121 00:12:47,300 --> 00:12:50,140 And then acoustic is listed there. 122 00:12:50,140 --> 00:12:51,260 We understand that one. 123 00:12:51,260 --> 00:12:56,940 So the noise made by the machine, quaintly termed phenomenon number five by the NSA. 124 00:12:56,940 --> 00:12:58,380 I have no idea why. 125 00:12:59,700 --> 00:13:03,820 So here is another target of the age, electric typewriters. 126 00:13:03,820 --> 00:13:07,000 This one is from my IBM office in Massachusetts. 127 00:13:07,900 --> 00:13:16,000 Obviously, we have the EM emanation problem here, but the interesting bit is the sound emanation. 128 00:13:16,040 --> 00:13:18,320 These machines make a serious racket. 129 00:13:18,480 --> 00:13:24,220 Turns out you can figure out what is being typed by listening to a typewriter or teletype sound. 130 00:13:24,400 --> 00:13:32,200 And the temp test memo itself indicates this can be done from 100 feet away with a shotgun parabolic microphone. 131 00:13:32,200 --> 00:13:43,040 Another interesting nugget that, contrary to expectations, soundproofing a room helps the attacker as it dampens background noise better than it does the main signal. 132 00:13:43,600 --> 00:13:50,100 And this was something confirmed by others over 40 years of research in academia. 133 00:13:50,100 --> 00:13:51,340 So it's public. 134 00:13:52,460 --> 00:13:54,500 It's public in the open literature. 135 00:13:54,500 --> 00:14:01,000 And the range limits for these interceptions look, seem to be dictated by the ratio between signal and noise. 136 00:14:01,000 --> 00:14:02,120 That would make sense. 137 00:14:02,120 --> 00:14:06,680 And if you have soundproofed room, the noise is very low. 138 00:14:06,680 --> 00:14:11,420 So actually, it goes out farther. 139 00:14:13,040 --> 00:14:15,620 And reducing the noise is the wrong strategy. 140 00:14:18,220 --> 00:14:20,520 There is a lot out there about Tempest. 141 00:14:20,520 --> 00:14:22,420 Some of it is even true. 142 00:14:22,720 --> 00:14:24,180 But there is more. 143 00:14:24,180 --> 00:14:29,940 And those of you in the room who cannot tell us know what it is. 144 00:14:29,940 --> 00:14:32,180 So there is no point dredging gossip. 145 00:14:33,300 --> 00:14:36,800 You can Google yourselves what is out there. 146 00:14:37,620 --> 00:14:46,580 The other word beside Tempest you can search for is PEMEN, which unlike Tempest has an officially disclosed acronym. 147 00:15:06,160 --> 00:15:10,330 Okay, my Cyrillic needs exercise. 148 00:15:10,960 --> 00:15:16,360 Which translates to something like unwanted electromagnetic radiation and interference. 149 00:15:17,120 --> 00:15:20,860 So the Russian literature uses that instead of Tempest. 150 00:15:20,860 --> 00:15:26,000 And briefly around the turn of the millennium, the Russians declassified a whole bunch of documents. 151 00:15:26,000 --> 00:15:31,600 If you can translate them, and if you can find them, there is something interesting there about the physics of EM 152 00:15:34,640 --> 00:15:35,680 emissions . 153 00:15:35,680 --> 00:15:41,880 However, they've reclassified them since so you have to find them in places like archive.org or the like. 154 00:15:42,240 --> 00:15:45,860 Now let's change a little bit to go into more fun things. 155 00:15:46,200 --> 00:15:47,040 LEDs. 156 00:15:47,380 --> 00:15:51,380 I will take revenge of the caps lock for 500 Regis. 157 00:15:51,820 --> 00:15:57,880 I must admit, I was disappointed to find no reports of signal leakage from the keyboard LEDs. 158 00:15:57,880 --> 00:15:59,680 That would have been cool. 159 00:15:59,980 --> 00:16:03,580 But it's actually cool that at least something works the way we expect. 160 00:16:03,900 --> 00:16:06,040 There is unintentional leakage. 161 00:16:06,220 --> 00:16:19,920 There are multiple exfiltration research papers showing reasonable bandwidth in defeating air-gapped systems by blinking lights to export data from an air-gapped system. 162 00:16:21,760 --> 00:16:25,300 I recall one reaching 56 kilobytes. 163 00:16:25,300 --> 00:16:28,420 I don't know if somebody has reached higher speeds. 164 00:16:28,740 --> 00:16:35,520 Actually, a character in Neil Stephenson's Cryptonomicon exfiltrates data using caps lock just this way. 165 00:16:36,120 --> 00:16:40,880 And this is also a novel that makes massive use of Van Eck freaking. 166 00:16:40,880 --> 00:16:43,020 So pretty cool. 167 00:16:44,020 --> 00:16:45,800 And then there is this. 168 00:16:45,900 --> 00:16:55,840 We have an entire industry of pen testers, and the gold standard for them is a keystroke injection tool disguised as a USB drive, which I expect every single person here knows about. 169 00:16:55,840 --> 00:17:00,720 Unless you've been living under a rock on one of the outer planets, you know what a rubber ducky is. 170 00:17:00,720 --> 00:17:03,400 So I'll reclaim the time from this. 171 00:17:03,400 --> 00:17:07,500 But the short version is it's a USB stick. 172 00:17:07,500 --> 00:17:08,180 You plug it in. 173 00:17:08,180 --> 00:17:12,380 It is recognized by the system as a keyboard, not as a storage device. 174 00:17:12,380 --> 00:17:19,060 And then it fires off commands at superhuman speed as a keyboard . 175 00:17:19,060 --> 00:17:31,460 Now, when you have that, it has storage, but the ducky is a USB keyboard to the OS, which enables the attack, but then hampers data exfil. 176 00:17:31,460 --> 00:17:35,700 You cannot copy data to a keyboard until 2002, that is. 177 00:17:35,700 --> 00:17:38,160 And 2022, that is. 178 00:17:38,980 --> 00:17:52,820 To reduce the price of PC keyboards, IBM delegated the management of the cap state and lights to the host, giving us a side channel keyboards, or rather the ducky, can now use to exfiltrate data to its internal storage. 179 00:17:53,060 --> 00:17:55,560 Side channel, four decades in the making. 180 00:17:55,740 --> 00:18:02,720 Keystroke reflection relies only on caps lock, num lock and scroll lock to establish a data transfer path. 181 00:18:02,880 --> 00:18:06,840 This is something a rubber ducky can now do out of the box. 182 00:18:06,940 --> 00:18:12,900 No more need to connect to IRC servers in strange parts of the internet to export data. 183 00:18:14,760 --> 00:18:16,740 Unless you want to, that is. 184 00:18:16,740 --> 00:18:18,760 But wait, there is more. 185 00:18:19,980 --> 00:18:26,840 For one, this comes from Lagre and Ampers paper. 186 00:18:27,040 --> 00:18:28,580 What is this? 187 00:18:28,580 --> 00:18:36,720 The lower line is an RS-232 signal, a serial line, straight from the port itself. 188 00:18:36,720 --> 00:18:41,700 So it's the upper one is slightly more jagged. 189 00:18:44,860 --> 00:18:49,880 Is the brightness variation of a modem's TX LED. 190 00:18:49,880 --> 00:18:52,840 This was published in 2002. 191 00:18:54,040 --> 00:19:03,100 They could read the data transmission of the modem by looking at the flickering of the TX light on it. 192 00:19:03,340 --> 00:19:06,300 This was termed optical tempest at the time. 193 00:19:06,300 --> 00:19:09,880 It was quite spectacular for 2002. 194 00:19:11,600 --> 00:19:20,060 Modems are obviously a thing of the past, but you could read the transmission from across the room and likely across the street with some help. 195 00:19:20,920 --> 00:19:32,440 One bright spot of their study, because they tested other hardware, is that modems and data transmission hardware had this in a lot of cases, but at least hard disk drives did not. 196 00:19:32,440 --> 00:19:36,840 The hard disk lights were not leaking IO that way. 197 00:19:36,880 --> 00:19:39,300 But wait, there is even more. 198 00:19:39,820 --> 00:19:43,940 So continuing the thread of what can you do with the LEDs. 199 00:19:48,100 --> 00:19:56,940 The previous gentleman who's from Lockheed Martin was topped in the LED category by a team at Ben Gurion University of the Neve Gev. 200 00:19:57,400 --> 00:20:00,200 This was two years ago. 201 00:20:01,200 --> 00:20:09,200 They figured out a way to read the sound in a room by looking at the flickering on the speaker lights. 202 00:20:10,980 --> 00:20:27,020 So the speaker that's playing your Zoom conference has an LED light or the USB hub that's powering the speaker has a USB light. 203 00:20:27,240 --> 00:20:34,760 And from that flicker, they could read the voice payload of the Zoom connection. 204 00:20:35,020 --> 00:20:41,060 And you can see there is, I don't know if it's bright enough, but you can see this looks like a 10 inch telescope. 205 00:20:41,420 --> 00:20:44,040 They were doing this from 25 meters away. 206 00:20:44,740 --> 00:20:48,760 This is not itself a keyboard attack, but it leads us to one more. 207 00:20:50,900 --> 00:20:57,600 It used to be don't drink and drive, math jokes, but now it's don't Skype and type. 208 00:20:58,640 --> 00:21:16,000 A team led by a researcher at the University of Rome, La Sapienza, and this was also quite recent, like 2017, 2018, demonstrated that you could do the kind of keyboard acoustic attack that I described earlier over a Zoom connection. 209 00:21:16,000 --> 00:21:26,020 So if I'm connected in a video conference with you and I'm typing, but from a recording of that or from the other side, you could decode what is that I'm typing. 210 00:21:28,560 --> 00:21:44,760 This was postulated by Marcus Kuhn, who became the new avatar of this thing in the open 20 years after Van Eck, when he published a huge research tome around 2003, I think. 211 00:21:44,760 --> 00:21:53,300 He's at Cambridge University and his tome is entirely about CRT emissions, but people would kind of use him as a clearinghouse for information. 212 00:21:56,360 --> 00:21:58,700 Kuhn postulated that this would be possible. 213 00:21:58,700 --> 00:22:13,240 A researcher at IBM a year later proved that it would be possible with phone frequencies, because he analyzed the frequency spectrum and showed that the frequencies that were being used to identify the keys would be carried by the telephone. 214 00:22:13,240 --> 00:22:16,380 And now 15 years later, somebody actually has done it. 215 00:22:17,620 --> 00:22:19,840 This is Kuhn's report. 216 00:22:22,840 --> 00:22:32,440 Probably it's going to be the last most important document in this area because the next one is going to be whenever the NSA declassifies something, I suppose. 217 00:22:32,440 --> 00:22:34,740 Plus CRTs are no longer relevant. 218 00:22:36,600 --> 00:22:40,060 Now, here's where it gets really interesting. 219 00:22:40,060 --> 00:22:49,360 Asunor and Argawal, which are the two IBM researchers, wrote a meticulously detailed paper, I think it was 2004. 220 00:22:50,340 --> 00:22:57,240 In their attack, a microphone is placed near a keyboard from half a meter to 15 meters away. 221 00:22:58,040 --> 00:23:05,960 And sound is sampled with a standard sound card of the age, so 44.1 kilohertz, probably a sound blaster, although they don't say so. 222 00:23:06,380 --> 00:23:22,240 A neural network is trained on a sample of these, not gigantic neural network of the kind that we have today, something with a couple of hundred nodes, and something designed to classify, distinguish the voices of people as Federico or somebody else. 223 00:23:22,740 --> 00:23:26,840 And they very methodically do experiments to determine what matters. 224 00:23:26,840 --> 00:23:30,880 So, for example, first they want to prove, can you distinguish two letters on the keyboard? 225 00:23:30,880 --> 00:23:34,620 So they have a neural net trained with just two letters. 226 00:23:34,920 --> 00:23:38,860 And this is the result, 100% success. 227 00:23:39,380 --> 00:23:44,500 For 20 tries, the neural net never failed to tell which key it was. 228 00:23:44,560 --> 00:23:49,520 Then they ran a longer sample, and it was correct 95% of the time. 229 00:23:50,480 --> 00:23:58,020 But we don't know what is the neural network doing, so using their setup, they started researching core questions. 230 00:23:58,020 --> 00:23:59,420 Will the distance matter? 231 00:23:59,420 --> 00:24:03,460 They tried up to 15 meters away with no decrease in recognition quality. 232 00:24:03,520 --> 00:24:06,440 They placed the microphone behind the typist. 233 00:24:06,740 --> 00:24:22,010 In another test with 30 keys and 300 tests, the model guessed the correct key 79% of the time, and the correct key was one of the top three choices 88% of the time. 234 00:24:23,500 --> 00:24:26,900 So they pretty much demonstrated that you could recover the plain text. 235 00:24:29,620 --> 00:24:32,020 Then they tried something that didn't work. 236 00:24:32,020 --> 00:24:38,340 They tried the model trained on one keyboard on another model of keyboard, and that didn't work very well at all. 237 00:24:38,340 --> 00:24:46,320 It wasn't enough to recover the plain text, but it was enough to compromise the entropy of a password if that was desired. 238 00:24:46,320 --> 00:24:50,440 There was some signal there that's not good enough to get back the text. 239 00:24:52,460 --> 00:25:13,660 In another test, the typist applied variable force in striking the keys instead of being consistent, and the fixed force neural net couldn't decode that, but training a network with the variable force, this new network could figure out both fixed force and variable force samples equally fine, 240 00:25:13,660 --> 00:25:21,280 and pretty much the same result as in the fixed force test. 241 00:25:21,280 --> 00:25:23,000 So really good. 242 00:25:23,660 --> 00:25:30,960 In yet another test, they subjected the variable force model to inputs from multiple typists to see if the user would matter. 243 00:25:31,620 --> 00:25:39,260 They were free to type whichever way they wanted, hard, soft, little bit like a piano player, whatever they wanted. 244 00:25:39,300 --> 00:25:50,180 The quality of classification was adversely affected by only slightly by the variance in the typist, showing the applicability of a model trained by an attacker to a potential victim. 245 00:25:50,720 --> 00:26:01,300 Studying the average sound of individual keys, which is here, you can see one is the average of one letter and the other is the average of the other letter, there is a distinct difference. 246 00:26:01,300 --> 00:26:07,820 So they proved that there was actually a signal there that the neural net was working off of. 247 00:26:10,380 --> 00:26:12,780 And then they tried a few things. 248 00:26:16,560 --> 00:26:29,620 So they looked at keyboard units, they looked at keyboard models, typist style, the keys themselves, they moved keys around the keyboard to see is it the key cap, and it wasn't. 249 00:26:29,620 --> 00:26:36,380 And they determined that what mattered was the place in the keyboard where the key switch was. 250 00:26:36,680 --> 00:26:47,880 And then the model that they have is that essentially it's like playing drums, that it makes a different sound depending where you hit the plate of your cymbals or your drum. 251 00:26:49,320 --> 00:26:52,300 That seems to be the most relevant thing. 252 00:26:52,780 --> 00:27:00,580 Now, in 2005, a UC Berkeley team led by Li Zhuang put the final piece in place. 253 00:27:01,080 --> 00:27:08,160 The IBM models were supervised training, the Berkeley model was self-supervised training. 254 00:27:08,160 --> 00:27:11,440 The model could discover itself without training data. 255 00:27:12,660 --> 00:27:17,700 It couldn't discover the whole ciphertext, but it could compromise passwords successfully. 256 00:27:21,420 --> 00:27:33,280 It could break five character random passwords in fewer than 20 attempts, and 80% of 10 character passwords were broken in fewer than 75 attempts. 257 00:27:33,320 --> 00:27:40,340 So it wasn't perfect, but it was close enough that it was a successful password attack. 258 00:27:41,560 --> 00:27:46,140 Now, from there, sound evolved slightly in a different direction. 259 00:27:46,140 --> 00:27:48,640 First with sound. 260 00:27:48,720 --> 00:27:59,460 In 2023, a team, I think these were British researchers, demonstrated 95% accuracy without use of language model constraints whatsoever. 261 00:27:59,460 --> 00:28:02,300 Usually you use some knowledge of the language. 262 00:28:02,300 --> 00:28:03,940 You go and say, 263 00:28:07,120 --> 00:28:11,820 this is English, so these combination of letters have certain probabilities. 264 00:28:14,350 --> 00:28:16,530 They didn't use any of that. 265 00:28:16,530 --> 00:28:24,230 They just did pure matching of the sound of the key, and they got 95%, which is the highest result yet. 266 00:28:25,590 --> 00:28:32,390 Using the microphone of... you put down your phone before typing, that's the scenario. 267 00:28:32,710 --> 00:28:38,590 The phone can read what you're typing entirely without doing any strange tricks. 268 00:28:39,730 --> 00:28:44,310 And they achieved 93% while doing this over Zoom. 269 00:28:45,030 --> 00:28:53,390 So again, I'm going to spare you the jokes about all your keyboards, but... 270 00:28:54,310 --> 00:28:58,270 Now, if I haven't completely crushed your soul yet, I have one more. 271 00:28:59,490 --> 00:29:01,530 And this is the spy phone attack. 272 00:29:01,530 --> 00:29:03,590 This one is a Georgia Tech team. 273 00:29:03,950 --> 00:29:11,490 They did the same thing, but instead of using the microphone of the phone, they used the accelerometer. 274 00:29:12,110 --> 00:29:15,310 So they could get the vibration of the table. 275 00:29:16,370 --> 00:29:20,410 And the thing that's cool here is that to get the microphone on the other phone, you needed permission. 276 00:29:20,410 --> 00:29:25,370 You needed to hack the phone or somehow convince the user, give me permission to the microphone. 277 00:29:25,470 --> 00:29:32,130 Here, you just need a Trojan horse app, because the accelerometer is not privileged. 278 00:29:32,790 --> 00:29:40,590 So you can do this without compromising the phone, which is obviously easier. 279 00:29:42,110 --> 00:29:45,390 Now, don't forget our friend VanEck. 280 00:29:45,610 --> 00:29:47,830 This one actually surprised even me. 281 00:29:47,830 --> 00:29:59,970 I put him in the abstract because he's a cool fellow and I needed him to explain all of these data exfil things, but I didn't think we could do EM out of a keyboard. 282 00:29:59,970 --> 00:30:02,910 I thought the voltages will be too low and I was wrong. 283 00:30:03,910 --> 00:30:08,890 First of all, I should have known because keyboards were PS2, so serial. 284 00:30:09,250 --> 00:30:11,810 That's not super low voltage. 285 00:30:11,950 --> 00:30:13,690 I should have seen that coming. 286 00:30:13,690 --> 00:30:23,990 But so, in 2008, a team in Switzerland extracted the entire signal of both PS2 and USB keyboards. 287 00:30:24,250 --> 00:30:28,910 This is done over GNU Radio, an old version of GNU Radio at that. 288 00:30:29,370 --> 00:30:33,190 They couldn't afford the classified equipment, so they did it on the cheap. 289 00:30:33,350 --> 00:30:40,390 And this is at five meters, but they demonstrated it at up to 20 meters. 290 00:30:40,390 --> 00:30:49,890 And the thing that was interesting of their result besides this is that they demonstrated that they could fingerprint different keyboards in the same room. 291 00:30:49,890 --> 00:30:54,590 So, if you had the 10 teletype scenario or 10 keyboards in the same room, it didn't matter. 292 00:30:54,590 --> 00:30:58,530 They could distinguish the 10 keyboards and follow the signals independently. 293 00:30:59,810 --> 00:31:10,370 So, this is also an interesting paper if you want to learn something about GNU Radio without first getting a degree in EE, which most of us just can't. 294 00:31:12,990 --> 00:31:20,530 Now that I've convinced you that the world is full of uber-smart adversaries and there is really no hope, let's bring us down a little bit. 295 00:31:21,590 --> 00:31:24,330 Let's look at good old-fashioned screw-up. 296 00:31:25,090 --> 00:31:29,710 There was wireless keyboards with no encryption whatsoever about 20 years ago. 297 00:31:29,710 --> 00:31:32,450 That's just plain stupid, so let's not go there. 298 00:31:35,030 --> 00:31:41,890 But then there was this one, which was right on my desk while I was researching this for a year. 299 00:31:43,510 --> 00:31:52,890 And a couple of days ago, while I'm looking at the Bastille security mouse jack exploit, I read the list and I thought that they were all Logitech mice. 300 00:31:52,890 --> 00:31:55,890 And then I see this thing right in front of me. 301 00:31:56,110 --> 00:31:57,530 I'm like, oh, yes. 302 00:31:57,530 --> 00:31:58,370 Okay. 303 00:31:58,870 --> 00:31:59,770 Pwned. 304 00:32:01,710 --> 00:32:05,750 So, I believe that the advisory affected only Logitech. 305 00:32:05,750 --> 00:32:06,470 I was wrong. 306 00:32:06,470 --> 00:32:07,970 The chips are affected. 307 00:32:07,970 --> 00:32:14,090 And for brevity, what mouse jack does is that connection here, it's a Bluetooth connection. 308 00:32:14,090 --> 00:32:20,810 It secured one dongle, mouse, and keyboard to reduce the proliferation of dongles. 309 00:32:20,810 --> 00:32:26,630 Logitech or some VAR-made chip for Logitech has this thing where you can connect things. 310 00:32:27,910 --> 00:32:30,410 The keyboard connection is encrypted. 311 00:32:30,410 --> 00:32:35,090 Mouse connection, probably for speed, this was developed 10 years ago, is not encrypted. 312 00:32:35,590 --> 00:32:40,210 So, if somebody wanted to move my cursor, but who cares, I guess, was the logic. 313 00:32:40,850 --> 00:32:53,430 Researchers discovered that they could create a fake mouse, connect it in, and then once they were connected, this mouse could call the keyboard API in plain text. 314 00:32:53,430 --> 00:32:58,930 So, they could inject commands in plain text and bypass the whole thing. 315 00:32:59,050 --> 00:33:03,590 It was a big issue for Logitech because they were singled out and I thought they were the only ones. 316 00:33:03,590 --> 00:33:06,230 But as you can see, that's not a Logitech mouse. 317 00:33:07,270 --> 00:33:09,410 There were plenty of others. 318 00:33:10,910 --> 00:33:22,350 No, I had funny images of hotel staff being weirded out by things they see at DEF CON over the years. 319 00:33:22,350 --> 00:33:30,190 And I was picturing this happening in my hotel room and they wondering, first, what kind of boring hacker has 20 keyboards in there? 320 00:33:30,190 --> 00:33:34,310 And secondly, what kind of sociopath has all clacky keyboards? 321 00:33:34,330 --> 00:33:37,270 His colleagues must absolutely hate him. 322 00:33:39,430 --> 00:33:41,310 We don't have the time to do this live. 323 00:33:41,310 --> 00:33:45,250 I was going to demonstrate this. 324 00:33:46,930 --> 00:33:50,610 They've been challenging because of the noise, but I wanted to see if we could do it. 325 00:33:51,130 --> 00:33:53,170 But this is how it works. 326 00:33:54,890 --> 00:34:03,270 Gennady Gerganov has posted this Hoping project, which is essentially trying to do this in a very low-tech fashion. 327 00:34:03,270 --> 00:34:08,610 He doesn't use the neural network, which would be an advantage in figuring out what part of the signal is interesting. 328 00:34:08,750 --> 00:34:11,170 But his WebAssembly code is very lightweight. 329 00:34:13,530 --> 00:34:18,150 He does some things like the multiple symbol matching. 330 00:34:18,150 --> 00:34:21,630 So, your input text must be valid English and so on. 331 00:34:22,270 --> 00:34:24,350 But it's very, very lightweight. 332 00:34:24,410 --> 00:34:29,050 And you essentially train it by typing a few sentences. 333 00:34:29,050 --> 00:34:32,590 I think he wants between 100 and 300 characters of valid English. 334 00:34:32,590 --> 00:34:36,330 You cannot make typos, you cannot use backspace, all sorts of constraints. 335 00:34:36,710 --> 00:34:41,470 And then it trains a little pattern matching model, not a neural net. 336 00:34:41,470 --> 00:34:43,150 And then it makes predictions. 337 00:34:43,150 --> 00:34:47,550 And when the prediction, the thing that's cool about this code is that it's visualized this way. 338 00:34:48,470 --> 00:34:55,670 And here, I don't know if you can see at this scale, but it's what you would have seen if I managed to demonstrate. 339 00:34:55,670 --> 00:34:57,930 These are the top three guesses. 340 00:34:58,270 --> 00:35:03,450 So, this was an Annie Pro keyboard, which is very clacky if you don't know what it is. 341 00:35:03,450 --> 00:35:06,250 It's a white keyboard with red bezels. 342 00:35:09,110 --> 00:35:16,690 And after training, I kept addressing the letter H, I believe. 343 00:35:17,250 --> 00:35:24,770 And you can see third guess, H, H, second guess, H, third guess, H, first guess, H. 344 00:35:24,850 --> 00:35:27,930 There are a lot of Hs in this sample. 345 00:35:27,930 --> 00:35:33,790 It's not perfect, but it's in the top three more than 50% of the time. 346 00:35:33,850 --> 00:35:35,210 This is a rookie's code. 347 00:35:35,210 --> 00:35:36,570 He's doing it as a hobby. 348 00:35:36,610 --> 00:35:40,170 So, it certainly demonstrates the thing. 349 00:35:40,170 --> 00:35:43,270 And it's fun to play with if you want to have a shot. 350 00:35:43,270 --> 00:35:50,190 Now, if we had managed to do this here, it would have looked like this, because I wanted to stack the deck in our favor with a good microphone. 351 00:35:50,310 --> 00:35:51,330 But, oh, well. 352 00:35:55,670 --> 00:36:13,850 In closing, so the threat, it's realistically possible for a sophisticated, semi-sophisticated adversary with some resources to read whatever is going on on your keyboard if they can get within, let's say, 30 to 40 feet. 353 00:36:14,630 --> 00:36:17,110 Now, the tools to do this are not in the public domain. 354 00:36:17,110 --> 00:36:25,510 So, you probably have to expect the government to be able to do this, but not a random hacker unless they have some serious time on their hand to finish up the tools. 355 00:36:27,270 --> 00:36:36,830 As I like to point out, until successful security becomes commonplace at the network layer, why would I hack you locally if I can hack you remotely? 356 00:36:36,830 --> 00:36:42,810 So, this is probably not the highest priority, but it's there. 357 00:36:43,570 --> 00:36:47,690 Plus, if you're a pen tester, you can show off big time doing something like this. 358 00:36:49,350 --> 00:36:52,750 I'm going to skip this and just stop there. 359 00:36:52,950 --> 00:36:54,610 You have my contact info. 360 00:36:54,610 --> 00:36:56,310 The slides will be posted. 361 00:36:57,710 --> 00:37:06,810 If you have ideas, feedback, commentary, remember that speakers are Pavlovian devices, let us know what we liked, what we didn't like. 362 00:37:08,470 --> 00:37:20,050 If you are a three-letter agency sponsor or know of one that may be interested in funding a small business looking into this further, I would like to have the conversation. 363 00:37:20,770 --> 00:37:25,110 And, well, you will see from the slides the little bits that I skipped.