00:00:00.000-->00:00:05.272 >>So um, Joe really needs no introduction, but how many people are here for their first 00:00:05.272-->00:00:10.277 time? Yeah, okay. So a little bit of history. Uh back at DefCon 14, there was kind of a a 00:00:13.146-->00:00:19.319 big change, a big shift. First DefCon moved to a real casino and a real big hotel but then 00:00:19.319-->00:00:24.758 also somebody came up with an idea to do an electronic badge. Uh you can blame this guy for 00:00:24.758-->00:00:30.330 all of the blinking and the smashing and the crashing that’s all on your chest. So let’s give 00:00:30.330-->00:00:35.869 uh Joe Grand a big round of applause. [Applause] >>Thank you. >>Have a good time man. 00:00:35.869-->00:00:41.008 >>Cool, thank you. So yeah, I officially retired making badges at DefCon 18 and we didn't know 00:00:41.008-->00:00:45.746 what to expect so it’s come quite a ways. So alright, I like to move around a lot so I’m 00:00:45.746-->00:00:50.083 going to switch between these two mics because I can’t sit still. And this is so exciting 00:00:50.083-->00:00:54.021 to me that it’s hard to stay in one spot. Um yeah, so I’m Joe Grand. We’re gonna talk today 00:00:54.021-->00:00:59.793 about a project called OpticSpy. And OpticSpy is a device that lets you receive data 00:00:59.793-->00:01:03.730 transmitted over light waves. And I’ll go into the history of why this is so exciting to me 00:01:03.730-->00:01:09.836 because it’s not you know a typical kind of security thing but it actually is. So quick 00:01:09.836-->00:01:13.707 little background um I’ve been involved with electronics since I was 7 years old, 1982. Figured 00:01:13.707-->00:01:17.811 out how to make my first free phone call when I was 10. Just loved ma-making mis-mischievous 00:01:17.811-->00:01:21.949 devices of of different kinds. Um and that’s when I realized, oh you can build whatever you 00:01:21.949-->00:01:25.819 want, if you think of something, you can build it. Um and a lot of what I end up building 00:01:25.819-->00:01:30.023 nowadays are open source projects for other people to use as building blocks to create 00:01:30.023-->00:01:33.760 their own projects. Um and that’s, you know that’s more exciting to sort of see what 00:01:33.760-->00:01:37.698 other people do with your stuff. So that’s been fun uh on the engineering side of things. Uh 00:01:37.698-->00:01:41.401 but yeah I worked on a bunch, a bunch of different stuff along the way. Um got in trouble when 00:01:41.401-->00:01:46.239 I was younger and that sort of redirected my passion towards like oh I can share. I can share 00:01:46.239-->00:01:51.745 stuff and maybe not break into buildings and computers and stuff and and do things in a 00:01:51.745-->00:01:55.215 legi - legitimate way so that’s that’s really what got me involved in DefCon even though I 00:01:55.215-->00:02:01.288 sort of you know known about that world I’d been in that world before that. Um I’m gonna 00:02:01.288-->00:02:06.293 switch to this one, hold on. Alright anyone who knows me knows this is really hard to-to 00:02:09.463-->00:02:15.402 do. So I’ll move this one out of the way and no wireless mics at DefCon, which is probably a good 00:02:15.402-->00:02:20.741 idea. So anyway this project OpticSpy, um again I’ll go into the history but it’s a device 00:02:20.741-->00:02:25.445 that I just thought would be really cool to just let people explore a different sort of um 00:02:25.445-->00:02:32.052 uh thi-thing about electronics and about hardware. Oh is this a longer one? Awesome. Hello, 00:02:32.052-->00:02:37.657 check. Is this one on? Oh - okay, not as loud-oh, look at that so I have three microphones 00:02:37.657-->00:02:42.662 now. This is even better. Now I should have someone following me with like boom mic or something, 00:02:47.300-->00:02:50.637 alight. So there’s a bunch of wires up here. So yeah, Optic Spy's a project that will 00:02:50.637-->00:02:55.742 convert light into voltage. An open source project, I’ll go into like the details of it. Um 00:02:55.742-->00:02:59.846 but uh the whole research into this really started with something called Covert 00:02:59.846-->00:03:06.753 Channels. And Covert Channels are methods of communicating in ways that are secret. And that 00:03:06.753-->00:03:11.291 might be a one-way transmission from a computer system uh to the uh outside world saying you’re 00:03:11.291-->00:03:15.395 trying to exfiltrate data. You know we see that a lot on the network side. Uh you know where 00:03:15.395-->00:03:19.633 someone breaks into a computer and just infiltrates 50 gigs of data and nobody in the IT 00:03:19.633-->00:03:23.603 department or security department notices. Um but that’s sort of an old way of 00:03:23.603-->00:03:27.307 like doing it, you can do it using the network. I’m more interested in like what can you 00:03:27.307-->00:03:32.879 do if you compromise the system uh somewhere along the way. How can that then be used to 00:03:32.879-->00:03:38.718 exfiltrate data in a non standard way? So using um other sorts of the environmental 00:03:38.718-->00:03:44.024 conditions. And to implement a-a covert channel, uh there’s a lot of different ways. Uh if you 00:03:44.024-->00:03:48.428 have network access to a device, if you have physical access to a device, somewhere along the 00:03:48.428-->00:03:53.166 supply chain you could load this code in, you can change the design. Uh a lot of times 00:03:53.166-->00:03:58.672 products, especially since we’re dealing with visible LEDs on products, almost every product 00:03:58.672-->00:04:03.577 has visible LEDs anyway. So if you can compromise a device and you’re just changing the 00:04:03.577-->00:04:09.382 twideling of the IO pins to now send data instead of appearing instead of just being on. And 00:04:09.382-->00:04:13.520 the data, the lights still gonna still appear to be solid so there’s lots of stuff you can do 00:04:13.520-->00:04:18.425 along the way whether you know it’s changing modifications or modifying the physical device. 00:04:18.425-->00:04:23.296 Maybe intercepting a device as it’s going from the factory going to the end customer. I 00:04:23.296-->00:04:26.900 know our government’s been really good at doing stuff like that uh and then they complain 00:04:26.900-->00:04:31.805 when they discover other nation’s states doing the same thing. Uh but it this is not you 00:04:31.805-->00:04:37.210 know this is not a theoretical sort of thing. You know, like implanting malicious code, 00:04:37.210-->00:04:42.582 malicious functionality, covert channels, um is real and that’s what got me really excited about 00:04:42.582-->00:04:47.621 it. So different types of ways to exfiltrate data. Um there’s been a lot of work in this area, 00:04:47.621-->00:04:54.327 uh whether it’s changing kind of optical or changing uh RF characteristics through 00:04:54.327-->00:04:59.266 electromagnetic interference. Um patterns from a computer system. So tempest monitoring from back 00:04:59.266-->00:05:05.205 in the day where the CRT um was emanating a whole bunch of different high voltage and noise 00:05:05.205-->00:05:10.143 and spikes like as the, as the, as the raster went across the screen uh you could pick that 00:05:10.143-->00:05:14.648 from far away. Even before then like spark-spark gap transmitters. I don’t remember 00:05:14.648-->00:05:19.819 when, I think maybe World War One. You know Morse Communication over Spark Gap. Um 00:05:19.819-->00:05:24.558 transmitters were generating huge amounts of noise, and everybody else could listen in 00:05:24.558-->00:05:28.161 so maybe not exactly a Covert Channel but it is an unintentional sort of you know, 00:05:28.161-->00:05:34.467 emission. Um you can do things through thermal, through the sound. Um Mordechai Guri gave a 00:05:34.467-->00:05:39.105 great presentation as Black Hat this year. He’s been doing research of kind of Air-Gapped 00:05:39.105-->00:05:44.277 data exfiltration techniques for a long time. And he shows how you can have two machines 00:05:44.277-->00:05:48.281 separate and use Ultrasound to communicate, which is actually what advertisers do a lot of 00:05:48.281-->00:05:52.452 times on television on television sets. They’ll, they’ll uh send Ultrasound on 00:05:52.452-->00:05:57.224 them that we can’t hear but you’ll mobile phone with an app can hear and then they can track 00:05:57.224-->00:06:01.394 what you’re watching and everything. So there’s been a lot of covert data communication 00:06:01.394-->00:06:05.465 stuff going on. BUt the stuff that really excited me are Blinkenlights. Because everybody 00:06:05.465-->00:06:11.171 likes Blinkenlights and they’re on most products and uh I always make this joke that nobody 00:06:11.171-->00:06:17.210 laughs, um so hopefully you will since this is being recorded. Is I always say, that the more LEDs 00:06:17.210-->00:06:22.215 there are on a product the more secure people think it is. [Laughter] Cool. That’s almost 00:06:24.384-->00:06:28.622 like the can you know you press the button and it’s like the audience laughing. Um but it’s 00:06:28.622-->00:06:32.659 true you know, people-people take hardware for granted. They - they don’t really understand 00:06:32.659-->00:06:36.296 what’s going on behind the scenes and if you have a device that has lights, you can’t 00:06:36.296-->00:06:40.900 really tell what’s going on. So this project, that-that’s what inspired me. The original paper 00:06:40.900-->00:06:45.772 actually has information leakage from Optical Emanations from 2002. I read that when it came 00:06:45.772-->00:06:51.111 out and I was like this is so cool ‘cause I’d been interested in-in kind of Optical 00:06:51.111-->00:06:54.748 Communications for awhile. You know like I said I built mischievous stuff as a kid, and 00:06:54.748-->00:06:57.584 one of the things I built was in 7th grade was this laser listener system where I guess an 00:06:57.584-->00:07:04.090 attempt at a laser listener system where I had a laser beam uh sending shining on to a 00:07:04.090-->00:07:08.595 window and then receiving that reflection back from the window. So as thewindow vibrated and 00:07:08.595-->00:07:12.999 talking inside I could spy on them which apparently the government also does that. I was 00:07:12.999-->00:07:16.336 using a visible red laser but probably most governments are using an infrared laser or 00:07:16.336-->00:07:20.206 something you can’t see. Um so it was neat when I read this paper, I’m like wow this is 00:07:20.206-->00:07:26.446 cool. And maybe at the time was shocking but maybe not. What they had discovered is a lot of 00:07:26.446-->00:07:30.984 off the shelf devices without even being modified or compromised, were leaking 00:07:30.984-->00:07:36.723 information through LEDs.As an unintentional side effect or artifact of the way that the 00:07:36.723-->00:07:40.393 designers designed the product. So I’ll show you a demonstration of that later, one of them is 00:07:40.393-->00:07:45.198 this Hey smart modem um from back in the day that’s actually leaking information on the 00:07:45.198-->00:07:48.935 transmit and receive pins. So you don’t have to have direct connection in line with the data 00:07:48.935-->00:07:51.971 you can just see it from the LEDs. So I bought one of those on EBay to demonstrate it 00:07:51.971-->00:07:55.008 because I thought that was really cool. And of course I have a bunch of other demos to 00:07:55.008-->00:07:59.579 show how easy it is to kinda- kind of create your own. But the point is that besides 00:07:59.579-->00:08:06.353 intersec-inter inter in you know um adding your own type of interface, there might be 00:08:06.353-->00:08:11.124 products out there even today that are leaking information through LEDs. Uh we have 00:08:11.124-->00:08:16.396 wireless you know light networking systems now and as IOT gets bigger and network 00:08:16.396-->00:08:21.401 connected things get bigger and as the RF space gets more kind of crowded, we’re gonna see more 00:08:23.470-->00:08:26.539 kind of information being transmitted over light from light bulbs, from other things. 00:08:26.539-->00:08:30.643 Mesh networking through light bulbs, communicating with light. Um and that’s something that’s 00:08:30.643-->00:08:34.681 been going on for that past few years so it is happening. And all this stuff we can now you 00:08:34.681-->00:08:38.418 know, with the with a piece of hardware kind of listen in and sniff around and see what’s 00:08:38.418-->00:08:44.691 going on. With a lot of this work though, I found is there was never like a uh defined 00:08:44.691-->00:08:47.794 here’s how to build a receiver that you can actually experiment with this stuff and I was like 00:08:47.794-->00:08:51.364 Well I want to build a receiver because that’s what I do. I wanna actually try it. Like 00:08:51.364-->00:08:55.735 reading the papers great but doing it is better, and that’s really where OpticSpy came from. 00:08:55.735-->00:09:01.641 So yeah, a little history, there’s been a lot of work with transmitting information over 00:09:01.641-->00:09:05.979 lightwaves um definitely not gonna claim I’m the first. And I always say that we’re standing 00:09:05.979-->00:09:09.749 on the shoulders of giants and we’re building- we’re taking little steps, right? And you’re 00:09:09.749-->00:09:13.653 seeing what somebody else has done and you’re improving it or modifying it uh to do something 00:09:13.653-->00:09:17.457 different and-and this is the same thing. So you know, Graham Bell had the Photophone back in 00:09:17.457-->00:09:22.495 1880, I’m not gonna do the math in my head but it was what like a 100 and 30 something years 00:09:22.495-->00:09:28.568 ago? And uh he was using the sun the reflection of the sun off a mirror to modulate light and 00:09:28.568-->00:09:34.107 then somewhere down the way uh that modulated light would be captured and replicated back 00:09:34.107-->00:09:38.711 into- into voice. But the problem was it was it was very weather specific, so it didn’t 00:09:38.711-->00:09:43.149 work on cloudy days. And people thought that was sort of lame uh so they decided to use the 00:09:43.149-->00:09:46.453 telephone instead. But he had actually says that the Photophone is more important to 00:09:46.453-->00:09:50.890 him than anything else that he had done. Um Fiber Optics have been around for a long time. You 00:09:50.890-->00:09:55.094 know, were basically doing the same thing, where-where we have a light, and we’re modulating 00:09:55.094-->00:09:58.865 and were sending data on it but it’s been around for a long time. Uh laser tag, everyone 00:09:58.865-->00:10:05.038 like laser tag? Yeah. A few people. I think it’s pretty cool. Um did anyone have the 00:10:05.038-->00:10:11.544 Star Trek laser tag from 1979? Yeah, you guys are all too young.Um this is a system that 00:10:11.544-->00:10:17.250 actually the-the way that laser tag works is it’s actually sending data, infrared data so 00:10:17.250-->00:10:22.722 it can receive data and know you know who’s shooting and who’s being-being hit. Um so it’s not 00:10:22.722-->00:10:27.093 just a light, there’s actually data in it. And then like I mentioned, Optical Networking 00:10:27.093-->00:10:30.930 Systems, started in 2011 but they’re coming more popular now and it really is something 00:10:30.930-->00:10:36.336 where, it’s just another kind of medium where data’s being transmitted, right so we know 00:10:36.336-->00:10:41.641 it's’ network and wireless and now it’s optical. Uh and perhaps the other things. Lots of more 00:10:41.641-->00:10:46.379 other projects also as well. I have more resources at the end of the slides. Um Craig Heffner 00:10:46.379-->00:10:51.151 gave a talk a few years ago at DefCon that was a infrared receiver specifically for um it 00:10:51.151-->00:10:55.121 was a high gain infrared receiver for looking at things you know output from mobile 00:10:55.121-->00:10:59.559 phones um proximity sensors and things like that, and I’ll show you uh there-there’s many 00:10:59.559-->00:11:04.631 difference with OpticSpy uh mainly that it will work with visible light but and on and 00:11:04.631-->00:11:07.734 also tunable but there’s been you know people working on this for awhile in-in 00:11:07.734-->00:11:14.641 different-different ways. So the goal like with most of my projects is have something 00:11:14.641-->00:11:19.712 that’s easy to understand theory. So the, the sort of Optical Receive Chain, is very 00:11:19.712-->00:11:24.617 kind of simplistic and you’ll see what I mean as we go through it. So it’s something that’s you 00:11:24.617-->00:11:29.322 know not this super complicated voodoo that um you know kind of black magic sort of thing, it’s 00:11:29.322-->00:11:33.860 like a very simple thing you can mess around with. Uh and solderable, using off the shelf 00:11:33.860-->00:11:39.632 components. And uh I know, some of them are small, um but you can’t really avoid that because 00:11:39.632-->00:11:42.835 sometimes they don’t make them in big sizes. Uh but everything’s hand solderable. 00:11:42.835-->00:11:46.573 And again this whole project comes down to raising awareness of-of their communication 00:11:46.573-->00:11:50.810 methods getting more people involved in hardware, and for me it was a great experience with 00:11:50.810-->00:11:55.782 working with analog electronics. Because the receivers have no microcontroller on them, no you 00:11:55.782-->00:12:00.453 know intelligence, it’s doing everything analog and I typically stay on the digital 00:12:00.453-->00:12:03.189 design side of things ‘cause that’s where I’m most comfortable. So this is a good- 00:12:03.189-->00:12:07.126 a good example of sort of experimenting with amplifiers and comparators and things like 00:12:07.126-->00:12:11.497 that. So just some early versions, I like showing pictures of this stuff. If 00:12:11.497-->00:12:15.268 you’re getting into hardware development, this is a typical process where you start with 00:12:15.268-->00:12:19.872 some sort of bread board system in the upper left uh where you can and the upper right, where 00:12:19.872-->00:12:24.110 you can plug components in and out and sort of fine tune things before you go design a circuit 00:12:24.110-->00:12:28.514 board. Even though nowadays with places like Hodge Park, where you pay 5 dollars a square inch, 00:12:28.514-->00:12:32.352 it’s almost you know some people just go straight to a circuit board because you could just 00:12:32.352-->00:12:36.756 re-revise it and iterate so quickly but i love having that-that chance to you know 00:12:36.756-->00:12:41.094 plug things in. There’s a few other variations of the board, all the stuff is available on 00:12:41.094-->00:12:44.764 the website, these different variations. The first one in the lower left is a digital receiver 00:12:44.764-->00:12:50.670 and that’s just using a toslink type of optical receiver module that’s for like SPDif audio on 00:12:50.670-->00:12:56.175 receivers and and you know stereo equipment. And that’s designed to just receive red 00:12:56.175-->00:13:00.279 light and it has to be certain brightness and it has to be NRZ encoded, which I’ll talk about, 00:13:00.279-->00:13:05.251 which actually Optic Spy is similar. Uh so very simple receiver but there’s like a 00:13:05.251-->00:13:09.789 little in the uh uh in in the little receiver module, that black thing, there’s a little 00:13:09.789-->00:13:13.726 door and you have to shove the light into that door otherwise you’re not gonna be able to see 00:13:13.726-->00:13:17.030 it so it’s a little more intrusive to whatever you’re doing. But that was the first 00:13:17.030-->00:13:20.333 one I built to kind of prove the concept but then I went to an analog version which is 00:13:20.333-->00:13:25.605 ultimately what this one turned into and that has some potentiometers to let you adjust 00:13:25.605-->00:13:30.476 the gain and threshold and really fine tune for particular type of target. And another 00:13:32.845-->00:13:38.618 thing too that’s sort of funny is I originally, ended the project on the lower- the lower, 00:13:38.618-->00:13:42.355 the final version of the lower right, so that’s a prototype of what ultimately was like a kit 00:13:42.355-->00:13:47.093 version that had potentiometers and like a square and you needed a little FTDI USB-C to serial 00:13:47.093-->00:13:51.164 adapter to power it. And I had been using that in some classes and workshops and stuff and that 00:13:51.164-->00:13:55.768 was sort of the end of it but then I ended up meeting with my friend Josh who runs Crowd 00:13:55.768-->00:13:59.672 Supply, who specializes it kind of you know open source hardware, providing open source 00:13:59.672-->00:14:04.310 hardware to the masses. And he saw it a little bit ahead uh and he was like you should make an 00:14:04.310-->00:14:08.181 easy to connect up module so people can just use this to experiment with and we can like 00:14:08.181-->00:14:11.984 hide secret messages in things at our conference and stuff. He was putting on a conference, so 00:14:11.984-->00:14:15.254 he sort of had this vision a little bit ahead, where I was already done I was like alright 00:14:15.254-->00:14:20.793 whatever, but he was right. So it turned into like this streamlined version um that did 00:14:20.793-->00:14:24.564 make it a lot more easy to kind of look around for stuff which was sort of fun. And again all 00:14:24.564-->00:14:28.434 of that stuff is online and you can build your own. So some development process, you know 00:14:28.434-->00:14:32.305 there’s always going to be problems. So the first version I came back with, I was an FT231X 00:14:32.305-->00:14:38.578 for the USB Serial adapter instead of the the typical FT 232 which is what most people 00:14:38.578-->00:14:43.015 use. so it was like the lower cost version of the FTDI part, but newer. And some of the pins 00:14:43.015-->00:14:47.286 were a little bit different so I ended up and you see i the uh um upper left, there’s some blue 00:14:47.286-->00:14:51.257 wires, really small blue wires, I had to reroute some stuff before I went to the production 00:14:51.257-->00:14:56.462 version. UIm but you know, typical sort of testing before you go to production is is 00:14:56.462-->00:15:01.534 highly recommended. Um this one I decided, so I had a hand built the first one to make sure it 00:15:01.534-->00:15:05.571 had worked and then you see in the lower left, I was actually screening solder paste onto the 00:15:05.571-->00:15:11.444 board because hand soldering surface mount parts uh tends to not look as good, as like you 00:15:11.444-->00:15:14.947 know you put it through a reflow oven and you have maybe professional or 00:15:14.947-->00:15:19.485 semi-professional assembly. So I wanted to have one that would that I would be able take nice 00:15:19.485-->00:15:23.790 pictures of and that’s what I used the silk screens for um with the with the solder paste. 00:15:23.790-->00:15:28.227 And that screen you can actually get. So the boards, they’re purple, they were made by 00:15:28.227-->00:15:32.331 OshPark and then there’s a company called Osh Stencils, that will make the sold-make the 00:15:32.331-->00:15:36.302 stencil for you that matches your paste layer for your circuit board and you could just 00:15:36.302-->00:15:40.206 get solder paste and kind of sqeegee it on yourself and make your own. So it’s sort of like 00:15:40.206-->00:15:44.777 do it yourself production manufacturing. Um which sometimes is easier than hand 00:15:44.777-->00:15:50.249 soldering depending on how small your parts are. So here’s the block diagram, um we have our 00:15:50.249-->00:15:55.488 photodiode which is the receiver that’s gonna convert the uh the lightwaves into current. And 00:15:55.488-->00:15:59.025 then we have some amplifiers that are going to amplify 2 stages that i’ll talk, I’ll talk 00:15:59.025-->00:16:04.497 about all of these stages in more detail. Adn the threshold detector that turns the received 00:16:04.497-->00:16:09.902 data into actual ones and zeros and then passes that to a usb to serial adapter that is gonna 00:16:09.902-->00:16:14.807 then connect to your computer and make it easy to decode stuff. BUt you know not-not too 00:16:14.807-->00:16:21.314 complicated which is-which is what I like. Here’s a visual view of the, of the board. 00:16:21.314-->00:16:26.385 Points of interest. And the way the board works, if you start at the left at the photodiode, 00:16:26.385-->00:16:29.989 that’s sort of the received chain. It just you know the light comes in the photodiode 00:16:29.989-->00:16:34.126 and gets processed and goes out the usb port on the other side. And it’s just uh I just like 00:16:34.126-->00:16:38.564 that process, and there’s different test points along the way. So you can check it at 00:16:38.564-->00:16:42.802 different stages, like how’s your recieve going. Um especially in the case of if 00:16:42.802-->00:16:47.306 you’re dealing with signals that are not NRZ encoded, non-return to zero, which again I’ll talk 00:16:47.306-->00:16:51.277 about in a second. If-if there’s somebody that is intentionally creating an optical covert 00:16:51.277-->00:16:55.414 channel, it doesn't want to be detected, they’ll probably create some custom modulation 00:16:55.414-->00:16:59.986 scheme or maybe they’ll put in some error checking, or other sorts of things. Um so if it’s 00:16:59.986-->00:17:06.459 not NRZ, the usb to serial adapter isn't going to be able to process it and show you on 00:17:06.459-->00:17:10.296 the terminal program. So you can tap on at a test point right before it goes to the USB to 00:17:10.296-->00:17:15.034 serial adapter and then connect that up to your logic analyzer, your oscilloscope, your arduino, 00:17:15.034-->00:17:19.105 whatever it is to demodulate whatever modulation scheme it is. You might need to do some 00:17:19.105-->00:17:22.308 reverse engineering but it’s generally you know, there’s ways to break it out if you have some 00:17:22.308-->00:17:28.447 custom thing you're working on. And then to demodulate, you might need to do some reverse 00:17:28.447-->00:17:31.817 engineering. I’m not going to explain the whole schematic here, ‘cause it’s you probably 00:17:31.817-->00:17:36.055 can’t even see it. UIm but you know it is, very sort of simple clean design. So here’s the 00:17:36.055-->00:17:41.494 Photodiode. Most systems that I saw for receiving light and um especially photodiodes are 00:17:41.494-->00:17:46.032 designed to receive infrared light only. Uh so you know we have infrared remote controls 00:17:46.032-->00:17:49.969 and a lot of other things that are running infrared, this particular photodiode mimics the 00:17:49.969-->00:17:54.473 sensitivity of the human eye. Which makes it a lot different than other ones, which is 00:17:54.473-->00:17:58.277 probably why they charge so much for it. [Laughs] I think it’s like 11 dollars a piece of 00:17:58.277-->00:18:03.549 something but totally worth it because now you can capture visible light. And that’s how 00:18:03.549-->00:18:08.854 most status indicators are products are, they’re visible light. Um so it’s really pretty 00:18:08.854-->00:18:14.093 cool. And we’re running it in a photoconductive mode reverse bias um and current flows 00:18:14.093-->00:18:18.864 through uh when we receive lightwaves that’s gonna be proportional, current flow and 00:18:18.864-->00:18:23.703 then we have a load resistor there that’s acting as-as our as our gain and we can adjust that 00:18:23.703-->00:18:29.075 with a potentiometer which ends up being our first-first stage gain which is a very-very small 00:18:29.075-->00:18:34.847 compared to what comes next. And then we have our ampli- amplification stage, that’s the 00:18:34.847-->00:18:39.852 light comes in. We have two basically the same amplifiers um in a row and the reason to have 00:18:42.254-->00:18:47.526 two instead of one. Is if you're amplifying a small signal a lot, you;re gonna end up amplifying a 00:18:47.526-->00:18:52.098 lot more noise with it at the beginning. So if you do smaller amplification, you can amplify 00:18:52.098-->00:18:56.602 it a little bit and then you get more signal less noise and then you do it again more signal less 00:18:56.602-->00:19:02.375 noise. So it’s uh it’s a little trick to uh give you a less overall noise. And there’s 00:19:02.375-->00:19:08.948 potentiometers o both stages of those gains so you can have a pretty giant range of gains if 00:19:08.948-->00:19:13.252 you need to. Generally, the-the way the systems set up, the default values uh are gonna be 00:19:13.252-->00:19:18.090 pretty good for just about any general purpose for any investigations you’re doing. And 00:19:18.090-->00:19:24.397 there are some-some capacitors and some other things in between the stages, to help with-with uh 00:19:24.397-->00:19:29.402 sort of we have compacive coupling in there to-to get rid of the DC offset on the first 00:19:31.704-->00:19:35.241 stage and that brings it down but you run into problems with [laughs] with um relaxation that 00:19:35.241-->00:19:39.311 you then need to deal with. So I’ll show the the screenshot of what that looks like and what 00:19:39.311-->00:19:43.182 these things and what these things do but the whole point is we're trying to get the data, 00:19:43.182-->00:19:48.120 we’re trying to get the light in and then get it to a point that ends up being a 023 point 2 3 00:19:48.120-->00:19:54.193 volts signal. So you have to do some extra analog stuff to bring it down. So once we have this 00:19:54.193-->00:19:59.065 amplified stage, it should hopefully look pretty close to digital data by then, but then 00:19:59.065-->00:20:03.803 we have this comparator which is our threshold that we set that with a - with a potentiometer 00:20:03.803-->00:20:08.908 and that’s going to set the state of whatever’s above that threshold becomes a logic level 00:20:08.908-->00:20:13.045 one. Whatever’s below that threshold becomes a logic level zero. And now we have digital 00:20:13.045-->00:20:18.050 data. And it’s hard to see on the slides but TP TP5 on the crowd supply version is the 00:20:22.121-->00:20:26.725 output stage before it goes to USB to serial adapter. So that's where you can tap on if it’s an 00:20:26.725-->00:20:33.065 unknown modulation scheme. And then the USB interface, this is going to power the device. And 00:20:33.065-->00:20:37.336 also give us that virtual comport on our computer so it's just a much simpler thing than 00:20:37.336-->00:20:41.140 having extra wires and everything. So it’s like just this.Right? Data goes light goes 00:20:41.140-->00:20:46.545 in one side and data goes out the other.Power goes in the same thing. Uh this FT231X is a great 00:20:46.545-->00:20:51.684 part. I know a lot of people don't like FTDI anymore because of the FTDI gate that happened 00:20:51.684-->00:20:55.821 when they uh bricked all counterfeit devices which ended up being many more than they 00:20:55.821-->00:21:01.660 anticipated because the chip was the FT232 was so popular that it ended up being counterfeited in 00:21:01.660-->00:21:05.531 the counterfeits ended up being in legitimate supply chains. SO even if people thought they were 00:21:05.531-->00:21:09.735 buying a legitimate one, they were buying counterfeits and when they updating the driver, 00:21:09.735-->00:21:13.539 it was a big deal. [Laughs] So a lot of people protested and don’t use them but I still like 00:21:13.539-->00:21:17.443 their devices and assuming I don’t get bricked. If I get bricked im gonna come up here 00:21:17.443-->00:21:22.448 again and-and yell and rant. So yeah, that’s sort of the different stages to the 00:21:24.817-->00:21:29.555 electronics design. Here’s what the circuit board looks like. Um, I made it a kind of pen 00:21:29.555-->00:21:34.560 shaped for a few reasons. One of them is I thought it-it would be easier to hold than like the 00:21:34.560-->00:21:40.032 earlier rectangle ones, sort of like a pencil. Uh the other thing is I originally tried to 00:21:40.032-->00:21:44.737 fit it inside of the inside of a standard whiteboard marker because that would have been 00:21:44.737-->00:21:47.239 pretty cool. Because then you have the diode sticking out the end. The width of the white 00:21:47.239-->00:21:50.543 board marker, the internal well the internal diameter of the whiteboard marker was just 00:21:50.543-->00:21:54.980 slightly too small compared to the width of this. And I could have made everything smaller and 00:21:54.980-->00:21:58.851 that would reduce the likelihood of people being able to hand solder it so you have that trade 00:21:58.851-->00:22:03.055 off. So it barely fits. You might be able to maybe sort of mill out or use a lathe or 00:22:03.055-->00:22:08.460 whatever to carve out some space inside a white board marker um to fit it in. The other thing to 00:22:08.460-->00:22:13.432 is that you'll see the range is pretty limited, so you have to be, maybe a few inches away with 00:22:13.432-->00:22:18.737 infrared but much closer a lot of times with visible light. You could adjust the gain and adjust 00:22:18.737-->00:22:23.142 that a little bit but you’re pretty close. So this is a nice size that you could maybe put 00:22:23.142-->00:22:27.112 inside of a rifle scope or use some other optics and fit it inside-inside of some other 00:22:27.112-->00:22:30.683 optical thing to amplify the light from further away and get a better get a better you know 00:22:30.683-->00:22:36.722 get a better capture. Plus it looks cool. Um, on the on the back side there’s test points 00:22:36.722-->00:22:40.426 and those are the ones that you can see each stage but they’re labeled you know with real words 00:22:40.426-->00:22:43.963 so you can actually look at it quickly. And I do this all the time,I’m like what, I wanna look 00:22:43.963-->00:22:47.866 at the second stage it's like just like which one is that? Oh yeah, TP3 so,it’s just an easier 00:22:47.866-->00:22:53.038 thing instead of having to look at your computer or schematic or something. So Bill of Materials, 00:22:53.038-->00:22:58.043 there’s a handle of parts. Um, they end up being about 40 dollars for 100 pieces and the 00:22:58.043-->00:23:02.648 photodiodes the most expensive, actually yeah-yeah 12 dollars single quantity, the Op AMPs 00:23:02.648-->00:23:06.285 were 4 dollars. So you could probably cost reduce this if you wanted to but really that diode 00:23:06.285-->00:23:11.824 I think is the key and those amplifiers are-are really nice. Um, low noise and uh I figured, 00:23:11.824-->00:23:17.263 you know, keep with those. I should mention too, this design is actually based off of a 00:23:17.263-->00:23:22.034 reference design that Maxim Semiconductor made a really long time ago and it’s been modified 00:23:22.034-->00:23:28.140 since then and there should be a link to it somewhere in the slides. So yeah, those are sort 00:23:28.140-->00:23:31.477 of the big ones, everything else are called what like popcorn components so you know the 00:23:31.477-->00:23:36.015 discreates and other LEDs and stuff are pretty cheap. But the ones in red are the-are the 00:23:36.015-->00:23:39.585 costly ones, but still if you’re making one it’s not a big deal right, it’s not like I’m mass 00:23:39.585-->00:23:45.024 producing these or anything. So that’s the receiver side, that’s the OpticSpy side. For 00:23:45.024-->00:23:48.894 transmitting, there’s lots of different ways to control LEDs and different drivers, and I’ll 00:23:48.894-->00:23:53.132 show you some variations of things, but generally a systems gonna have something like this. 00:23:53.132-->00:23:57.870 An IO pin is going to drive an LED, it’s either going to be low to turn on the LED or maybe it’s 00:23:57.870-->00:24:04.143 gonna be driving from the high side. But just a standard LED driver circuit. And for the 00:24:04.143-->00:24:09.715 demos, I was sort of, mimicking like the original paper that I had read, and these modems were 00:24:09.715-->00:24:14.653 using NRZ data because that’s how asynchronous serial data is encoded for modems is non return 00:24:14.653-->00:24:18.757 to zero. So I was just emulating that and saying okay if I’m gonna build demos, I’m just 00:24:18.757-->00:24:22.695 gonna use the UR functionality that exists are various microcontrollers and just send 00:24:22.695-->00:24:27.633 the data the same way, and we’ll be able to capture it. So that’s all my demos, it’s not limited 00:24:27.633-->00:24:33.105 to that, right? Because we can capture any sort of lightwave we want of any modulation um as 00:24:33.105-->00:24:38.110 long as the signals being sent within our 100-100 hertz to 1 point 5 megahertz speed, we’ll 00:24:38.110-->00:24:43.615 be able to capture it. It just so happens NRZ this UR um encoded data um is very common. 00:24:43.615-->00:24:49.154 Asynchronous data. We see it on products all over the place. So that’s-that’s what I’m using to 00:24:49.154-->00:24:52.658 transmit information. Here’s what data stream looks like.So ultimately you want to get to 00:24:52.658-->00:24:57.730 this stage when you’re capturing to have a nice looking you know square wave there. And it it 00:24:57.730-->00:25:02.668 literally is as easy to doing like a printF function. If you want to transmit data through an 00:25:05.671-->00:25:11.677 LED and you have a standard LED driver circuit, instead of printF to a debug console or 00:25:11.677-->00:25:16.448 outputter you know terminal, you just do Printf and point it to an IO pin. And now you’re 00:25:16.448-->00:25:20.786 modulating and you’re sending data over the IO pin. Or over-over the yeah-yeah and then 00:25:20.786-->00:25:26.725 over to the LED. And if your speed is fast enough, then you’re not gonna see it blink 00:25:26.725-->00:25:29.395 and that’s like, I think that’s the coolest part of the whole thing. ‘Cause you’re gonna look 00:25:29.395-->00:25:33.732 at it, you’re not gonna see it, the human eye just doesn’t respond that fast um to-to 00:25:33.732-->00:25:37.469 motion like that so we’re gonna- it’s gonna look like the LEDs on and it’s gonna be sending data. 00:25:37.469-->00:25:42.274 So different ways, there’s like a pick uh example at the beginning, Arduino down at the 00:25:42.274-->00:25:46.912 bottom but yeah, you know Print. Here’s the receiver side and then I’ll show you some demos. 00:25:46.912-->00:25:50.916 Um so first stage is still very noisy. The signals in there somewhere but it’s you know 00:25:50.916-->00:25:56.555 really, really low down in some of that noise. And that’s going to be the first stage and that’s 00:25:56.555-->00:26:00.325 going to be before it goes to the amplifier. So that’s the Photodiode um connected to the 00:26:00.325-->00:26:05.931 resistor that generates voltage. First stage output of the first amplifier, is the signal, you 00:26:05.931-->00:26:11.470 can actually see some-some data on there but it’s up high and it still has a little bit of noise 00:26:11.470-->00:26:17.342 uh on the peaks. So then the second stage is how you know we have the capacitor in there and 00:26:17.342-->00:26:23.615 some other discrete components to bring the signal down and we see some relaxation at the top 00:26:23.615-->00:26:28.587 and bottom, that’s uh uh an effect of the distance we are away from the from the 00:26:28.587-->00:26:32.191 transmitter but also because some of the relaxation effects from the capacitor is in there 00:26:32.191-->00:26:36.128 as things are discarhing if the signals too slow, that happens. So we have to account for all of 00:26:36.128-->00:26:42.000 that and generally what we have is our threshold voltage by default is set to 2 and a half 00:26:42.000-->00:26:45.804 volts. Which looks like it’s a pretty good level where that red line is, anything above that is 00:26:45.804-->00:26:50.075 gonna become a 1 and anything below that is gonna become a 0. Which seems to make, sems to 00:26:50.075-->00:26:54.713 make sense. But depending on which system you’re looking at you might end up seeing-seeing 00:26:54.713-->00:26:58.283 your data in a different way, your voltage might be something different. So you can tweak that 00:26:58.283-->00:27:03.188 and adjust your-your threshold voltage if you need to. It all depends on what you’re 00:27:03.188-->00:27:08.794 encountering thats transmitting light. And here’s the-here’s the ultimate sort of output of you 00:27:08.794-->00:27:12.631 know, nice, NRZ encoded data. And you can see down at the bottom my oscilloscope is 00:27:12.631-->00:27:17.636 encoded that data and it says insert secret message here. So, that’s what we wanna get to. And 00:27:21.073-->00:27:24.743 then yeah, so calibration, besides adjusting you know that target voltage you might want to 00:27:24.743-->00:27:29.348 increase the receive distance by increasing the gain. Maybe you want to reduce ambient noise, so 00:27:29.348-->00:27:33.018 you’ll see up here, it’s pretty bright, there’s some lights up here. Um so we’re going to 00:27:33.018-->00:27:36.889 receiving more noise than a typical environment so I’ll probably have to cover things 00:27:36.889-->00:27:42.261 with my hand to reduce the noise. So if I really wanted to I could have my screw driver and 00:27:42.261-->00:27:46.832 and reduce the noise with by reducing the gain. Um but I’m not going to do that live on 00:27:46.832-->00:27:52.104 stage. And yeah, all of this depends on the brightness of the signal and the wavelength of the 00:27:52.104-->00:27:56.975 signal so the-the-the-the type of light. Um if it’s closer to that center of that band, of 00:27:56.975-->00:28:00.679 the- of the sensitivity of the module, you’re gonna get much better signal to noise than if 00:28:00.679-->00:28:04.683 it’s like right on the edge. But all you know, visible colors I've worked with red, red blue 00:28:04.683-->00:28:10.422 green yellow, like those all work, white um all work fine. And the potentiometers again are 00:28:10.422-->00:28:15.193 for three stages of the gain adjustment, two of the OP AMPs and 1 at the the photodiode 00:28:15.193-->00:28:21.500 stage and then the threshold. Adjustment. Alright, let’s do some demos. So for the demos, 00:28:21.500-->00:28:26.371 I’m going to switch back between my slides and my terminal program. The first one I’m gonna 00:28:26.371-->00:28:33.011 show is just using this Parallax um hackable badge so this was inspired, they had help build I 00:28:33.011-->00:28:38.016 think it was the DefCon 20 and onward for a few years the badges for DefCon. Um so they 00:28:38.016-->00:28:43.288 created sort of a general purpose badge that you can hack on. And this is uh using a 00:28:43.288-->00:28:48.126 Parallax propeller processor for those who know some previous projects I’ve worked on. Um I 00:28:48.126-->00:28:52.998 like this part. So this I’m just gonna turn on, and you know again a very simple proof of 00:28:52.998-->00:28:58.036 concept, this is just a simple microcontroller. Adn there’s a little LED that or LCD on here 00:28:58.036-->00:29:01.840 that’s says what message it’s sending so I’m not going to show you that because then it won’t 00:29:01.840-->00:29:05.544 be very fun when you see it. And there’s an infrared LED on here so, we can visually see what’s 00:29:05.544-->00:29:10.549 going on anyway. Um but I’ll hold up the receiver and you can see. So I’m gonna share the 00:29:14.152-->00:29:20.292 screen. Yeah so you can see like super noisy already because there’s like light everywhere. 00:29:20.292-->00:29:24.029 So I’m not gonna bother trying to fine tune it. See if I can do this while holding the 00:29:24.029-->00:29:29.034 microphone. [Applause] [Laughter] Yeah, hello DefCon 26 and everybody watching at home. 00:29:39.911-->00:29:45.384 Um alright so let’s switch back. And also the baud rate so I have this set you know the bauds rate 00:29:45.384-->00:29:49.087 usually with Asynchronous serial data you-you need to pre agree. The transmitter and the receiver 00:29:49.087-->00:29:52.658 need to agree on the baud rate beforehand. Or you can measure the baud rate by looking at the 00:29:52.658-->00:29:56.795 wave uh the wave form and figure it out. Um but I have some different baud rates set up 00:29:56.795-->00:30:02.100 because different LEDs and different systems um respond differently, or they take more 00:30:02.100-->00:30:06.071 time to start up and slow down. So you can’t always use the fastest but you could go way 00:30:06.071-->00:30:11.076 faster than 9600 baud, which is what I am showing here. So the next one is another LED um 00:30:16.882-->00:30:20.886 example. I wanted to show this because it’s just a cool-cool little device and it’s something 00:30:20.886-->00:30:25.891 called Tomu. And um this is a tiny little USB uh size like literally the USB connector 00:30:29.061-->00:30:35.500 sized. Little microcontroller that has 12 compon-12 components total. And it’s uh EMF32, it’s 00:30:35.500-->00:30:40.505 an arm cortex M0 25 megahertz. It has 8 K of ram, 64K of flash, USB functionality built in and 00:30:42.974-->00:30:46.478 2-2 color LEDS and 2 capacitive touch buttons and it’s actually you can see, that picture on the 00:30:46.478-->00:30:51.550 right side it's shoved into the-the side of the computer. So this could actually be great for 00:30:51.550-->00:30:56.421 like you know turn this into a USB rubber ducky or some sort of offensive red team tool or 00:30:56.421-->00:30:59.257 something like that, where you just plug into someone’s machine and maybe they’re not gonna 00:30:59.257-->00:31:02.994 know. Or if it's like a desktop computer, you plug it in on the back of the computer. But in 00:31:02.994-->00:31:09.367 this case I’m just using item as a way again to send information. So we wrote a little program 00:31:09.367-->00:31:12.637 that has an interactive mode, a little menuing system that we could just set and clear a 00:31:12.637-->00:31:17.109 message and then the red LED on Tomu is gonna turn on. So this one’s a little more interactive 00:31:17.109-->00:31:20.879 but this is a great example of if you have a computer and you want to optically isolate it 00:31:20.879-->00:31:25.317 from other things or create your own air gap this might still be a way that you could send data 00:31:25.317-->00:31:30.322 you know from a computer. So this one, I am connected to Tomu, on a-on a different 00:31:37.129-->00:31:42.134 terminal program so my OpticSPy is here and then Tomu’s here so we can type a message in. Um, 00:31:44.336-->00:31:49.341 alright hold on, I have to put this down. So I typed a message and now the red LED is on and I 00:31:55.046-->00:31:59.885 have it plugged in to the right side of my computer here. So I’m just gonna, I’m essentially 00:31:59.885-->00:32:04.422 connecting one serial port to another serial port through light. Um let’s switch over to 00:32:04.422-->00:32:09.427 the terminal program side. And I think I’ll put this down again. Oh. I’m at 19 200 so I have to 00:32:14.199-->00:32:19.204 change the baud rate here. [Applause] Thanks, so this one actually, this LED is much 00:32:34.886-->00:32:39.791 brighter so I’m probably like 2 inches away or something like that which is pretty cool. I 00:32:39.791-->00:32:45.263 didn’t mention also, that the there's a switch on here to switch between polarities. 00:32:45.263-->00:32:51.469 There’s a data inversion switch. And because sometimes NRZ encoded data or UR data is sent 00:32:51.469-->00:32:55.407 idle high sometimes it’s sent idle low and it sort of depends on the driver um that’s 00:32:55.407-->00:32:58.610 controlling it and how the system is designed. So if it doesn’t work in one way but you 00:32:58.610-->00:33:01.613 see repeatable patterns you might say oh that looks like data. You flip the tog- you flip 00:33:01.613-->00:33:07.319 the slide switch and it inverts the signals and now it, now it will work. Alright, so that’s 00:33:07.319-->00:33:12.324 Tomu. Here’s a cool one. Lasers right? Everyone likes lasers. Um so this is another example of 00:33:15.427-->00:33:20.131 just using a standard type of optical interface where we know we could do it with LEDs and I 00:33:20.131-->00:33:25.503 have another LED example but this one is fun because I have a little laser diode drive module 00:33:25.503-->00:33:31.576 that I made. And this laser diode is an off the shelf diode uh that has the internal APC and 00:33:31.576-->00:33:36.014 other control stuff so you just apply voltage to it and it's gonna turn on. Really small, I 00:33:36.014-->00:33:40.785 used these in a laser range finder project from a few years ago. Um so create-created a 00:33:40.785-->00:33:43.889 little module that-that's open source so everything's on my website and then these circuit 00:33:43.889-->00:33:47.826 boards are linked on the Osh Park link um and that little schematic is there. There’s a 00:33:47.826-->00:33:52.530 little tiny voltage regulator and that and then the uh system powers goes through the voltage 00:33:52.530-->00:33:57.402 regulator and connects to the laser diode, and then the enabled pin of the voltage 00:33:57.402-->00:34:03.141 regulator is what we’re using to modulate on and off. This one, I had to slow it down, I’m at 4800 00:34:03.141-->00:34:09.547 uh 4800 baud because any any faster was too fast for this particular diode to turn on and 00:34:09.547-->00:34:13.518 actually start transmitting. Um and any slower you would be able to see if flicker a little bit 00:34:13.518-->00:34:19.090 so this was a pretty good mid range. And the cool thing about diodes is they go really far so 00:34:19.090-->00:34:22.894 this one in theory, I don’t even remember how what I have on this demo so I’m gonna run it and 00:34:22.894-->00:34:26.898 see. I hope it’s nothing incriminating. Um I’m gonna try to set it, I’ll set it at like 00:34:26.898-->00:34:30.302 the end of the table and see how far it goes and the trick is to align it. Actually you know 00:34:30.302-->00:34:35.707 let’s have a volunteer. Zas, come here. Zas is gonna be my laser control module. [laughs] 00:34:35.707-->00:34:40.712 Uh everyone Zas Brookes. [Laughs] [Applause] Don’t you love you just get roped into a 00:34:44.816-->00:34:48.553 demo ‘cause you- because you’re right there. Okay so, he’ll put it here and I’ll try to align 00:34:48.553-->00:34:53.992 the system um the trick is that if the laser hits the diode exactly right um it’s too 00:34:53.992-->00:34:58.830 strong, it’s gonna overpower it. So we’re going to try to do, I have to try to get it at the 00:34:58.830-->00:35:02.901 edge. And again it’s going to be hard to-to actually see what happens because I might have to 00:35:02.901-->00:35:07.672 cover it a little bit. But we’ll try this out. So we’re at 4800 baud, let’s go back to my 00:35:07.672-->00:35:13.278 terminal program. What’s cool is you can just change the baud rate on the fly, which is really 00:35:13.278-->00:35:19.284 nice. So 4800, and I don't even remember what’s what um what polarity this is so we might 00:35:19.284-->00:35:25.457 have to fiddle around a little bit, but let’s see. [Applause] Cool, that’s awesome, it 00:35:25.457-->00:35:30.462 actually worked. [Laughs] Thanks. What did it say? I’m Arduino speaking through 00:35:52.851-->00:35:57.856 lightwaves. Yeah. Cool. Um alright. Yeah so that one’s sort of fun. So sort of related to 00:36:04.562-->00:36:09.567 the laser thing. I was at TOR camp um and uh [laughs] Will C was there and he’s big into 00:36:13.672-->00:36:19.110 lasers and high voltage crazy stuff. He’s like, hey we should connect an OpticSpy with my 1 00:36:19.110-->00:36:25.617 watt blue laser. Um so to give you an example, this laser diode is 3 millowats. Typically your 00:36:25.617-->00:36:28.787 red lasers are 3 or 5 milliwatts. Like your brighter ones are like maybe 5 or 10 00:36:28.787-->00:36:33.925 milliwatts. And you could see how far this was and this will still hurt your eyes if you look 00:36:33.925-->00:36:39.197 into it. So 1 watt interface. 1 watt blue laser. Um I didn’t know how bright this was but he 00:36:39.197-->00:36:44.202 gave us um goggles to wear and everything. And so I set up a little system and it was hard 00:36:44.202-->00:36:49.707 because he had a battery uh this battery powered supply that connected to this laser. Um so 00:36:49.707-->00:36:53.311 we had to make this little transistor circuit and we were at TOR camp in the middle of you 00:36:53.311-->00:36:59.084 know the middle of Washington. Um on an island and we’re trying to cobble something together. So 00:36:59.084-->00:37:03.221 I made a little interface that would that would take serial data and then hit the transistor 00:37:03.221-->00:37:08.927 that would turn on and off the laser. We got part of it working um but what ended up happening 00:37:08.927-->00:37:13.331 is you could see the laser in the upper part uh [laughs]. So my kids decided to show up like 00:37:13.331-->00:37:18.603 right as I was about to test this laser and I’m like guys you gotta stand behind me. Um and I 00:37:18.603-->00:37:22.474 was wearing the goggles and I wasn’t thinking about you know that they didn’t have goggles on 00:37:22.474-->00:37:26.511 and um and my wife didn’t have goggles on either. So I’m like you have to stand behind me 00:37:26.511-->00:37:29.848 we’re gonna test this thing, I don’t know what is gonna do. So I turn on the laser and it’s you 00:37:29.848-->00:37:35.687 know uh sending it’s doing something and we see the laser uh but I don’t see it much 00:37:35.687-->00:37:39.290 because I have the goggles on that are filtering the wavelength. And um apparently 00:37:39.290-->00:37:44.963 what was happening, is the laser was hitting, imagine like a tent, you know one of the 00:37:44.963-->00:37:48.633 outdoor tents. It was hitting the metal, one of the metal poles, like it just happen, like 00:37:48.633-->00:37:51.936 it was a huge tent and there was one metal pole and it was hitting the metal pole. So 00:37:51.936-->00:37:57.208 reflecting off the pole. So my kids decide to walk in front and then my wife goes after them and 00:37:57.208-->00:38:01.813 looks and the reflection gets her right in the eye. She’s like what the hell are you guys 00:38:01.813-->00:38:07.185 doing? ‘Cause I didn't even tell her that there was a blue laser or anything so. [Laughs] We were 00:38:07.185-->00:38:10.922 really scared about that, her eye was a little bit red for the night but no damage. And uh we 00:38:10.922-->00:38:12.924 thought it’d be a pretty funny story if she actually like burned her eye out with testing 00:38:12.924-->00:38:14.926 OpticSpy stuff but luckily that didn't happen and I’m still married so. Good. I’m gonna aim 00:38:14.926-->00:38:16.928 for that. Um and yeah um we ultimatey didn’t-didn’t weren’t able to test it because Will 00:38:16.928-->00:38:18.930 forgot his charger back at home in Boston uh so the battery ran out and it was like flickering 00:38:18.930-->00:38:20.932 so it probably would have worked. He was here and he offered to do it and I’m like no 00:38:20.932-->00:38:25.937 I don’t want to take the risk. So we ultimately put a box over it to do our testing, because 00:38:31.042-->00:38:36.047 that blocks the laser much better. Um okay so then-then the smart modem is the last uh demo 00:38:40.218-->00:38:45.223 and then I’ll show you a video and we’ll be done. Um this is the original Smartmodem 00:38:47.892-->00:38:53.865 discovered by the guys that wrote this paper and datas leaking through SD on the uh on 00:38:53.865-->00:38:57.869 the input and it's also the received data that is getting through the telephone line and 00:38:57.869-->00:39:02.540 is showing on the other LED. Um and it’s hard to see on the slides, but there’s a direct 00:39:02.540-->00:39:07.745 path, a direct electrical connection from the DB 25 connector to the modem receiver 00:39:07.745-->00:39:12.183 chip but also directly to the LED. And then same thing from the receive side from the modem 00:39:12.183-->00:39:16.721 ship through the LED to the DB25. So it’s you know, a great way to save IO pins. The 00:39:16.721-->00:39:20.658 engineer doesn't have to worry about adding extra status LED ‘cause it’s just showing the 00:39:20.658-->00:39:24.262 data and in appears to be solid because the data’s going so fast anyway. And even if it blinks, 00:39:24.262-->00:39:27.899 it doesn’t matter. It’s a status indicator. It just happens that it’s passing the exact data. So 00:39:27.899-->00:39:33.905 this one I made a little USD u- uh-uh micro SD card to serial interface which is a little 00:39:33.905-->00:39:37.375 board and I have it plugged into the modem and you could use it as a standalone demo board also 00:39:37.375-->00:39:43.214 that has an LED on it for demonstrations and the 3 pin for the laser diode module. We can 00:39:43.214-->00:39:46.851 power it with a 9 volt battery or with the Ac charger from the modem um and it’s gonna read 00:39:46.851-->00:39:53.157 data off of the micro sd card and then transmit it over the-over the lights. [Laughs] 00:39:53.157-->00:39:56.561 I’ve been waiting for this one for a long time, so it’s great for demonstrations and trolling. 00:39:56.561-->00:40:01.566 Um alright so this is at 9600 baud. If this is how I expect, I’ll be very happy. Alright so 00:40:12.143-->00:40:17.148 there’s 9600 and now let’s see if I could do this. [Laughter] [Applause] [Laughter] And the 00:40:38.069-->00:40:44.242 terminal program crashed. Perfect. Could you guys see what that was? No? Did someone say 00:40:44.242-->00:40:49.247 no? I think someone- I think someone said no. So just for that, just for that you get it 00:40:52.483-->00:40:57.488 again.Yeah, never gonna give you up guys. [Applause] And so that’s reading an entire,you 00:41:00.158-->00:41:05.163 know that’s reading a text file so it shows that you could do more than just send you know a 00:41:09.500-->00:41:14.505 silly one-one lined message. And then this-this is a video, but this is showing like okay what 00:41:17.208-->00:41:21.913 if you modify off the shelf consumer device to do something useful. Um this is a TL-WR841N 00:41:21.913-->00:41:26.918 that has that I loaded DD-WRT onto so I could actually control the GPIO pins um which directly 00:41:29.954-->00:41:33.124 connected to the LEDs. So I already have administrator access so this is a little bit 00:41:33.124-->00:41:38.930 contrived but the the you know example is if somebody remotely compromises a device and then 00:41:38.930-->00:41:44.736 turns it into an Optical Covert channel they could do that. This one is going to read the ETSY uh 00:41:44.736-->00:41:48.339 shadow file and then print the password hashes that you could then you know optically receive 00:41:48.339-->00:41:52.643 and then decode and do whatever. But it just sort of shows what you could do on modified 00:41:52.643-->00:41:57.715 hardware other than you know loading DD-WRT, but physically unmodified. And um for this one 00:41:57.715-->00:42:01.652 I’m using a prototype but you could see that I had to basically touch the device 00:42:01.652-->00:42:06.491 because there’s the light wasn’t very bright and there’s a light pipe there. Um so it sort of you 00:42:06.491-->00:42:11.496 know makes-makes the LED not as bright. So what you’re seeing um on the- on the left is the shell 00:42:14.866-->00:42:21.639 from the DD-WRT. And I’m using the uh orange led light, the WAN light to transmit the message 00:42:21.639-->00:42:24.809 and because this is Linux, there’s a whole bunch of overheard that happens. Even if 00:42:24.809-->00:42:28.446 you’re controlling a GPIO pin. You have to go through all these libraries and stuff to actually 00:42:28.446-->00:42:32.717 get to the bare metal um which was super frustrating because I normally deal with bare metal 00:42:32.717-->00:42:36.487 not with Linux. So I had to like figure out, how can I, how can I do this in a way that’s gonna be 00:42:36.487-->00:42:41.492 timing timing accurate. And I’m baidallc y sending characters at 2400 baud every second. So you 00:42:43.594-->00:42:46.097 can see, that’s what I’m transmitting and then on the right is gonna be what I’m 00:42:46.097-->00:42:52.203 receiving. And I’ll speed it up. And it’s just gonna send that, send that entire password over 00:42:52.203-->00:42:56.941 and over again. I think I actually have it set it up to just send only the first line 00:42:56.941-->00:43:00.812 because that’s the only one we care about in their case. So yeah, you know it shows you can 00:43:00.812-->00:43:07.518 do it on real consumer stuff as well. Um what about other sorts of devices? MacBook Pro, I 00:43:07.518-->00:43:09.587 thought it’d be cool if I could um if I could modulate the-the keyboard backlight um I tried to 00:43:09.587-->00:43:11.589 do it on the screen backlight but that was way too slow. Uh so the keyboard backlight thought 00:43:11.589-->00:43:16.594 they modulate their LEDs at a 100 hertz which means, and at 75 percent duty cycle. So you can’t 00:43:24.502-->00:43:28.506 really transmit stuff to turn stuff on, on, and off too fast because it’s gonna blink. So 00:43:28.506-->00:43:32.343 this is the fastest I could get data to transmit, it looks like morse code but its not morse 00:43:32.343-->00:43:36.280 code. Um the signal on the right, it is the it’s what was picking up with OpticSpy so you 00:43:36.280-->00:43:41.986 can see the 100 hertz modulation. And the width that I have there is the actual time 00:43:41.986-->00:43:46.724 per bit. So if you want to look at these slides and recreate that transmission, it’s going to 00:43:46.724-->00:43:52.330 be another secret message that you guys will hate me for. Um so this is an example of it’s not 00:43:52.330-->00:43:57.869 standard modulation you can’t use NRZ encoding so you have to tap on TP5, hook it into some 00:43:57.869-->00:44:02.206 other way to decode it. Here’s one of a remote control, just one that I happened to have at 00:44:02.206-->00:44:06.711 my house. Um most infrared remotes in things that are transmitting infrared are riding 00:44:06.711-->00:44:11.082 on a carrier wave so this is 38 killahertz. the cool thing with OpticSpy is you can adjust the 00:44:11.082-->00:44:15.319 gains and the higher gain you go the slower the response times gonna be on the system. So you 00:44:15.319-->00:44:20.491 can adjust the gain and actually end up demodulating the data. So here we have the carrier all the 00:44:20.491-->00:44:24.595 solid white is the carrier than normally you'd have to filter out, OpticSpy will do it for you 00:44:24.595-->00:44:28.332 which is pretty cool and then you’re just left with the 1’s and 0’s that you can-can go to 00:44:28.332-->00:44:32.670 work on. And here's an iPhone sensor so you know proximity sensors on computers and 00:44:32.670-->00:44:37.375 bathroom stalls and whatever else um are sending signals sending data in some way so I 00:44:37.375-->00:44:43.281 thought it’d be fun to just see what what would happen if I held OpticSpy up to that um to that 00:44:43.281-->00:44:45.883 device. And you can see it’s something, I didn’t figure out what it was, but it’s these 00:44:45.883-->00:44:52.456 pulses um at 30-30 hertz and then you have a little bit of data sent in there. So yeah, 00:44:52.456-->00:44:56.761 ideas for this sort of stuff. It’s like you can create your own interfaces, you can sniff 00:44:56.761-->00:45:00.498 other people's interfaces, I just feel like you never know what you’re gonna find, right? 00:45:00.498-->00:45:04.702 And that’s sort of the fun of hacking in general. It’s like building something like this, 00:45:04.702-->00:45:09.273 really no other purpose except to just learn something new and do something fun. And um of 00:45:09.273-->00:45:15.246 course limitations. If it’s not NZR encoded like we talked about you have to uh tap earlier, the 00:45:15.246-->00:45:18.716 receive range is short so maybe you can amplify that in some way. And the one thing that 00:45:18.716-->00:45:22.920 really gets me is that potentionmeters are mutlturn so you can’t tell what you’re gain 00:45:22.920-->00:45:27.124 settings are because it’s not like this but it’s like this. So you can’t really tell where they 00:45:27.124-->00:45:32.964 are so it makes it you know a little bit trickier. You could take the potentiometers 00:45:32.964-->00:45:36.534 measurements and check the resistances of each one and make notes of that you know that’s 00:45:36.534-->00:45:40.972 your settings for this particular target, depends what you wanna do. Um so future work, 00:45:40.972-->00:45:43.241 I have a question mark here because I'm probably not going to do it, but maybe something 00:45:43.241-->00:45:46.677 will get inspired and do it. But maybe somebody will get inspired to doit um maybe have to 00:45:46.677-->00:45:51.849 additional intelligence uh but I like-I like the simplicity of this probably not. Maybe having 00:45:51.849-->00:45:55.620 automatic gain control though would be cool. So if the signal you know is very weak, it’s 00:45:55.620-->00:46:00.358 going to amplify more uh otherwise you know maybe if its too strong like the laser, it 00:46:00.358-->00:46:03.594 would-it would reduce the amplification which would be kind of cool. And then there’s 00:46:03.594-->00:46:07.331 actually some work that I thought would be awesome, was of so instead of you know 00:46:07.331-->00:46:12.136 transmitting LED data through an LED, you can actually transmit data, into a device through an 00:46:12.136-->00:46:16.073 LED depending on how the system is set up so I thought that would be fun to maybe 00:46:16.073-->00:46:19.310 investigate. Maybe that’s a future talk and not really related to OpticSpy, I don’t 00:46:19.310-->00:46:25.283 know. But that’s another one of like simple device that could like possibly be a problem. Um 00:46:25.283-->00:46:29.587 so then some other resources of you know other things that have been done and of course final 00:46:29.587-->00:46:33.691 slide with the link and all the information linked to Oshpark for stuff. If you wanna get 00:46:33.691-->00:46:38.062 assembled units, Crowd Supply I think has a few left. Uh maybe he’ll do another run it depends 00:46:38.062-->00:46:43.367 but everything you need to build, test, uh example code all of that stuff, even MacBook Pro 00:46:43.367-->00:46:47.738 keyboard thing, stuff that didn’t quite work, it's all on my website. Um so feel free to 00:46:47.738-->00:46:51.442 contact me uh you know if you're building something and you find something cool or have any 00:46:51.442-->00:46:56.447 questions or anything. So that is it. Thank you for coming. And uh do we have any questions? 00:47:03.854-->00:47:08.859 [Applause] No questions. Oh a question! >>[Inaudible question from audience] Right so for the 00:47:15.533-->00:47:18.703 receiver, did I put try to put a-a soda straw on it or something like that to limit 00:47:18.703-->00:47:23.574 the-the uh the kind of area that it’s seeing. I haven’t and that would be a great idea to maybe 00:47:23.574-->00:47:27.111 use like a paper one or something, or maybe some heat shrink or something to narrow it 00:47:27.111-->00:47:30.047 down that rgane. And that would reduce the amount of ambient light also. So I haven’t tried 00:47:30.047-->00:47:35.052 it but yeah, great idea. >>[Inaudible comment from audience] Right so once you have 00:47:45.696-->00:47:49.967 the data coming in, before it goes to the USB toC adapter how hard would it be to detect the 00:47:49.967-->00:47:54.972 baud rate assuming it’s an asynchronous serial NRZ. Super easy. Because to do that you 00:47:54.972-->00:47:58.609 just have to measure the narrowest bit time within the signal and that's gonna 00:47:58.609-->00:48:02.113 determine what your baud rate is because your baud rate is 1 divided by the bit time of the 00:48:02.113-->00:48:05.716 narrowest bit. So yeah, you could do auto baud rate detection, um which would also 00:48:05.716-->00:48:09.487 be good, luckily like most people are just using you know uh uh like at least for these 00:48:09.487-->00:48:12.957 demos all standard baud rates. And if a vendors trying to be sneaky, and they do a non 00:48:12.957-->00:48:16.227 standard baud rate you could measure it but it’s just gonna look like noise, and you might 00:48:16.227-->00:48:19.096 say oh um maybe that's not anything so yeah some auto baud rate would definitely be 00:48:19.096-->00:48:22.133 possible to do for sure. and if a vendors trying to be sneaky. Stick that from tp5 in to a-a 00:48:22.133-->00:48:27.638 Arduino or something. Good? Okay. That is that it. Thanks again and enjoy the rest of the 00:48:27.638-->00:48:28.539 show.