All right, welcome everyone to Popping Shells with $10 and a bit of Arduino Magic, or AKA, Let's Redefine Physical Access. First off, who am I? I'm Dan Beard. I'm a software engineer at MedCrypt, used to direct MedISO. Previously CTO of Promenade Software, where we worked on medical devices as a contractor, so worked with a lot of different companies. I personally coded on at least 10 different medical devices and collaborated on so many more, mostly in vitro diagnostic instruments, so that's like lab equipment, some implantables, some therapeutic devices, infusion pumps, you name it. The IVD and therapeutic are bolded because that's mainly what this attack is gonna be against, not so much implantables. All views expressed are my own. My company is making me say this. It does not reflect the opinions of current or past employers. I did this all on my own time. It's all open source. Don't get mad at them. Okay. So medical device design 101, especially on those bolded ones, IVD or therapeutic devices in a hospital setting or lab environment. Typically, you're gonna have the embedded board that is gonna be doing the medical thing, whatever it is with the actual medicine. That's gonna be running on something very important, like an RTOS, it's gonna be bare metal. You're gonna have a custom FPGA because it needs to be time critical. You're not gonna be running an operating system on that. However, for anything that has a user interface more complicated than maybe a couple buttons, you're gonna have a main board or user interface board that's typically running Windows or Linux. Good old-fashioned Windows, or unless you're doing something with Yocto, even good old-fashioned Linux, right? These are PCs that are connected via Canvas, Cat6, RS232 to the thing that's actually doing the medical thing. If you can own them, you can pretty much own the device. That's what we're gonna be attacking through this vector. Some more definitions, just to make sure we're all on the same page. What is bad USB? A lot of you probably know what that is, but let's catch some people up. It's, what, two decades old at this point? It's when a USB dongle announces itself as a human interface device. It says, I'm a mouse, I'm a keyboard, I'm a USB ethernet controller, I'm a USB COM port, right? Operating system, there's no signature checks on that. There's no validation that you are what you say you are. It just believes you and goes, okay, cool, you're a keyboard, give me some keys. Oh, you're a mouse, all right, give me some mouse events. COM port, sure, why not? Here's input and output, right? Some examples of this are from our friends at Hack5 and OMG, you got the rubber ducky, you got the OMG elite cable. These are things you can buy right now. So bad USB in my med device, it's not that bad. To exploit it, you'd need physical access for an extended period of time. You'd probably need an internet connection for persistence and we're air gapped or we have a network connection, but it can't reach out to the internet, you can't download payloads. And you'd have to do it to a logged in session and we make people log in and out all the time. So it's really not that big a deal. And you may be looking at this and rolling your eyes, but having been in the industry for 10 years, I saw this on threat models. I heard it at the biohacking village when I was able to like pop a shell by hooking up a keyboard and typing on it. These are things that people say and it's kind of been industry standard for a while now. So last year, after I got told it again, and I got tired of hearing it, I'm like, no, I'm gonna prove you guys wrong. These assumptions, they don't hold. To exploit it does not require physical access for an extended period of time, only for a very short amount of time. It does not require an internet connection for persistence, but we can bring our own internet connection and we can wait and deploy payloads whenever we want. We don't have to do it right when we plug it in, right? We can wait until it's nighttime and we can wait till we see someone log in or using the device. So to prove that wrong, to build a device that would do that, we kind of want three things. We want something that's wireless, so it has a wifi radio. We want something that's cheap, so we can leave it in there and walk away and don't care that we never get it back. And we need something that can actually emulate a USB hit device. So these are kind of the three requirements. Our friends at LilyGo have us covered on all three of those fronts. This is the T-Dongle S3. It's $10.50, thanks inflation, out of China. $15 out of their U.S. warehouse, so if you want to get it just that little bit faster, it's only $5 more. It looks like a USB device. It's got a fancy color screen. It has wifi and Bluetooth, if you want to use Bluetooth. And you can program it in insert language here, C++, MicroPython, or anything the ESP32 can do that you can program it with. So introducing, drum roll please, the software to do it, RadioJack. The red shirt, yeah? All right. So on the T-Dongle S3, I have a whole bag here, flashed, with this open source software. It's open source at RadioJack.io. It emulates a keyboard and mouse. It hosts its own wifi server. You can telnet to it. You can drop payloads. Right now there's pre-programmed a Windows payload for having a PowerShell, a prompt, and I'll go over exactly how that works. But nothing says it couldn't work on Linux. I was just too lazy to put it together. Okay, I didn't have enough time. You can do it too. I await your pull request. Please issue pull requests. It's reflashable, so you can change it over and over. And of course it has a laughing skull animation. What hacker tool would be complete without a laughing skull animation? Anyone want this one? Whee! Hey! All right, so it's programmed in Arduino. Why Arduino? First and foremost, most importantly, the drivers just kind of worked and I didn't have to mess around with them the first try. And again, I'm lazy, so I just went with it. Both the HID and wifi libraries worked out of the box. There was no mucking around. It's real easy. But secondarily, to prove how easy, I'm not doing some complicated thing up here. I'm not releasing an O-Day that took a PhD six months of like intense genius work. High schoolers, they're like, Right? I am dumb. If I can do this, anyone can do this. This is not some out there like government level attack. So how to use that one that you just got. You plug it into the target. You connect to the SSID that's displayed on the screen. Each one is using the serial number of the device. So it has a different SSID. So if you want to go over to the biohacking village right now and connect it up to a medical device, each user should have a different SSID so that you're not, you know, connecting to the wrong one. You don't know which one you're connecting to. The passwords are all the same in the base firmware. The password is the password. All lowercase, real easy to remember. You telnet to the IP that's shown on the screen and you follow the good command line interface. Some of the features that it has out of the box are drop the payload, open a remote PowerShell prompt, type as a keyboard, you can type whatever you want. It'll emulate the keyboard and just type it out. So if you need to do like a password prompt or something before you drop the payload and you know the password, you can do it that way. And as a comport, that's how the payload communicates with you when you get a shell is through a virtual comport. Here's, you know, kind of to visualize what's going on here. Step zero, not shown, is actually plug it into the device. So walk by and just knock it in. Step one is connect to the Wi-Fi, drop the payload. The payload opens up a PowerShell prompt very quickly, types up a whole bunch of PowerShell code, minimizes itself. And what that PowerShell code does is it waits for a connection on the comport, the virtual USB comport, and just pipes text back and forth. So anything you type goes to PowerShell, anything it types goes back to you over telnet. Remember, this is Wi-Fi. So you can be the one room over, right? You don't have to be at the device. You can look like you're really innocent over there with your phone on your SSH you're just texting, but really you're typing on a shell. Let's see if my internet access is gonna break this. So proof of concept, I know everyone POC or GTFO, let's see if this launches. There we go, so here's an example plugged into my Windows gaming PC. Say drop the payload, it just dropped it. I enter into serial mode and now a PowerShell prompt. I can do whatever I want on that computer as the current user. And if anyone's thinking Windows on my medical device, yes, Windows is everywhere in medical. Trust me. Nope. So I did this about October. I was high off DEF CON. I was like, I'm gonna code this thing and approve these people wrong. I'm gonna be so cool. Maybe I'll get a talk out of it at Biohacking Village. Like, yeah, all right, I'm stoked. And not even a week after my first GitHub commit for the POC, OMG Cable released this into their firmware. Wasted. Oh, they did it better than me. Oh no. The StealthLink cable over HITX. HITX StealthLink. So it looks like a USB cable. It's the OMG Cable. It looks amazing. It uses the same kind of backdoor thing where it drops a payload and you can do a backdoor. It does it over HIT packets instead of a COM port, which is more elegant, honestly. It's a great way of doing it. It's got sexy marketing. It's ready to buy today. And it's just kind of way better than my hobby project. I still stand by though that RadioJack is a better name than HITX StealthLink. So Hack5, if you want to like buy the URL off me, call me, you know? So I'm like, I'm going to one-up them. What can I do on my hobby project that's going to be better than this like sexy, polished thing that costs a lot of money and they put a lot of work into, right? Enter LoRa. So LilyGo, same company, makes an almost as cheap, right? 15 to $20, depending on which warehouse you buy it from. The LoRa S3. So it's still cheap. It kind of has its screen, it's not color, but it's still a cool screen. Still has Wi-Fi and Bluetooth, still a program in Arduino, but it's got LoRa, which means we can do things a lot longer range. If you don't know what LoRa is, it's a long distance radio. You don't need a hand license. You can go and use it right now. It's on the consumer bands. Theoretical range of three plus miles. Realistically, I could only test it to a mile and a half before I run into line of sight issues, so I don't know. But theoretically, more than three plus miles. And it does kind of sort of require line of sight. Like, if it's on a device and you have close to a window, you can still kind of get in. It'll reflect off the walls, and it works. You don't need to be in the window. But if you were in, let's say, an MRI lab or radiology lab without any windows in the basement, you're not going to get out. So how to use it on literally this device? Exactly the same. Same SSID, same password, follow the same prompts. You drop it, you drop the payload, and it's just over a LoRa instead of Wi-Fi. So got the same visualization here. Only difference is that if you look, you have to have a LoRa board on the other side talking miles away, and then it's the same interface. I live in Chicago. I'm lucky enough to live in the Loop right here. I'm not going to tell you which building, but one of those. And with a directional antenna, I was able to use a shell from 1.2 miles away. Yeah, how's that for physical access? So I kind of open it up to you. Again, open source, welcome all pull requests. Can we take it further? Can we do a multi-hop Meshtastic network, right? Like in SoCal, they have a Meshtastic network that goes from LA all the way down to Tijuana. Like, could you be in another country and execute shell commands over just this, like, hopping over a Meshtastic network, right? Can we do a Wi-Fi bridge where it hops on, you know, a Starbucks Wi-Fi and now you could be anywhere in the world? You just got to know the IP address. What ideas do you have to make this attack better? The takeaway for anyone who's building a device that's running on, like, a consumer Linux or Windows is you only need a few minutes and a few dollars and you can exploit bad USB. You don't need an internet connection. You don't need extended physical access. Mitigations for anyone building a device. One, cover your USB ports. Like, if you're not using them, cover them. If I need to take a Dremel to your device, then maybe I'll buy, you'd need extended physical access. Someone's going to notice that you were there, right? Okay, someone might notice that. If you do need them for maybe service or something like that, then disable the USB stack until the user does something explicit, until they want to export a report, until they say, hey, I need to flash new firmware on the device or, hey, I'm a service tech and I've logged in with my special service tech password, right? Don't just have it open all the time. Only have it open when you need it. And that's a much smaller attack surface than just someone able to plug it in whenever they want. So that's it. Thank you. Anyone have any questions? And to encourage questions, I will be throwing out more of these to anyone who asks one. And I talked really fast, so I'm a little bit soon. So I have lots of time for questions. What have... The question was, what have I tested it on so far? So, so far, a couple of different Windows devices, mostly PCs. There is one currently plugged into a medical device in the biohacking village that happens to be running a Windows front end. So go ahead and check it out. It's already there. See if I can hit you with it. Ready... Hey, listen up. So the question was, can I access the machine or the boards to do something? Like, do I need to access the machine? Ah, yeah. So here, let me throw you one. Woo! So typically, and this is typically, there are exceptions. On most medical devices, they kind of assume that the physical connection is secure by itself. So if you have, like, control of that main user interface board running Windows, you can issue whatever commands it could issue to the RTOS. So there may be safety bounds. Like, if you try and do something that's obviously not safe, it'll say no. But you got a lot of control that you really shouldn't have. You could dispense more medication than you should. You could raise temperatures higher than you should. Yeah, they assume that we're physically controlled. The only thing that can talk to us is our Windows front end, and let's just secure that. So I didn't measure latency specifically. The Wi-Fi one is near imperceptible. The LoRa one, the latency wasn't bad, but the throughput was, like, a 28.8k modem. So, like, you're going back to the 80s. But, hey, for a shell, that's kind of all you need, right? You can still issue commands. Oh, so, like, kind of, so the question was, have I set up the ESP32 to, like, be a repeater almost and repeat the messages, or...? So that was one of the things I wanted to do, like, that said, hey, what else can we do with this? Right now, it's just point-to-point, but there's no reason you couldn't do that, right? All right, let's see if I can hit you. Whoop! Did I get you there? Sorry. Okay. Sorry, could you ask a little louder? Can I...? Oh, can LoRa go through Windows? Absolutely it can. It does affect the signal strength, but it absolutely can go through Windows. And when I was testing it on my PC, I was just within visual range of a window, and I was still able to access it. Whoop! Have I tried doing it with a Mac? I haven't, but it would absolutely work. The USB stack would be... it's a HID device. You would just need to change the payload, so instead of dropping into a PowerShell, you're dropping into whatever Mac is using, a Z-shell or whatever. Yeah. Any questions? Let's go to this side. How about this side? Have you tried this on a desktop computer? I haven't, just because I have a medical background, but, I mean, if they're running Windows, Linux, or Mac, it's some sort of consumer operating system, it's going to work. Oh, it's on a list. So the question is, if the Windows machine requires authentication, is there a bypass? So, no, there's no bypass, but because you can wait, you can wait until someone logs in to drop the payload. It's not just plug it in and then, like, it starts doing the payload automatically. You can wait until you, from across the room, see them log in and then go, ah, I'm going to, I dropped it. Okay, let's see, let's get someone real far away. Let's, that's where they're with the blue blinky badge. Yeah. What's the oldest OS I found in the wild? Windows XP. Okay, I'm going to, I'm going to check this. No guarantees it gets to you. Nice. All right. You there in the white shirt. So right now it's, it's manual, but once you're connected, you could script, I mean, it's over telnet. So, like, you could make a Python script to wait until something happens. All right. So the question was, once, once you're connected to it, you can use it as a point to get into the rest, excuse me, of the network, because you're right, you do have access as whoever the current user is. I haven't done that, but that's, that's the, beyond just hacking into a medical device, that's one of the reasons you want to protect against this, is that now you have a point where you're, you're in the air gapped network, right. And you are somewhat trusted probably. So yeah, you have, you could use that absolutely as a jumping off point. All right. In the orange shirt. I can't hear you from this far away, sorry. So the question was, wouldn't someone notice you going up to a medical device and sticking the USB stick in? You have a lot of confidence, sorry, so the question was, wouldn't someone notice the, the USB stick sticking out of the medical device? I mean, from my opinion, no, you'd, you'd have to have a lot of confidence in, in, you know, nurses and doctors noticing things to, to notice this little teeny thing sticking out. There's a lot of things that do plug in, you know, in and out of devices. I don't think they're going to notice something small. That being said, this specific device with the firmware that's flashed on it, has a big skull on it. And the reason is, you know, I don't want people using this for evil, right? Like use this where you know, when you have permission and if anyone sees it and has a skull on it, yeah, then they might ask some questions. But you know, you could change that in the firmware to not display a literal skull on a screen. Right, let's see what someone over here. You. I think this is USB 3.0. Oh, USB-C version? They don't have a USB-C version, no. But honestly, email Lily go and say, hey, I want a USB-C version. They might make it. Oh, that was a bad one, sorry. All right, all the way over here. What got me interested? So the question was, what got me interested in developing this? It was one that I heard that quote that I was saying, right, well, it's not that big a deal. Someone would notice and we're air-gapped, so it doesn't really matter. Or we are connected to a network, but you know, the network's protected. You don't actually have internet access, right? Hearing that over and over and over again and kind of scratching my head and going, that doesn't seem right. It seems like someone could bring their own Wi-Fi network, right, and then searching around. And before the OMG cable released HIDAC stealth link, there was nothing that I could find that had that. So, okay, I'll build it. And now you can't say that to me anymore, right? All right, how are we doing on time? Okay, I got one more minute, so I can answer one more question. You there. Are there any limitations on the device? Sorry, I can't hear you over the person talking behind me. Ah, the only limitation is the memory on the device itself? Oh, 128 meg? So yeah, you can have a pretty big payload. All right, thanks everyone. I'll be dropping these off to other people later. So I still have about like 10 and then I can give out.