[00:00.000 --> 00:05.420] When you come into the contest area and you see a vending machine like this, it's not to buy water. [00:05.440 --> 00:10.620] And this one doesn't sell water, it sells shells. [00:10.620 --> 00:14.380] Like Susie sold two shells down at the seashore. Wow, I can actually do that. [00:14.380 --> 00:21.100] You buy shells on this vending machine. And this is not a vending machine. What is this? [00:21.100 --> 00:24.180] This is our shell-on-demand appliance. [00:24.180 --> 00:28.560] This vending machine has been heavily modified to provide a service here at DEF CON [00:28.560 --> 00:33.060] for attendees to be able to come up anonymously to be able to buy a virtual machine [00:33.060 --> 00:38.580] that they can access over the DEF CON network or over Tor at a cheap price. [00:38.580 --> 00:46.080] We have $0.25, we have $1, we have $5 for Kali or Windows as well. [00:46.200 --> 00:50.940] So, hold on, I can throw a coin in here and it's real money. [00:50.940 --> 00:52.460] I actually have a real quarter in here. [00:52.460 --> 00:57.120] Yep, throw a quarter in there and you'll see that the lights will change to which ones you can afford. [00:57.120 --> 00:58.780] So select the second green one. [00:58.780 --> 01:05.960] I want to buy a Diet Open WRT. [01:05.960 --> 01:08.360] And it's going to spit out your shell down here. [01:08.820 --> 01:10.080] Oh my gosh. [01:10.080 --> 01:13.980] And so there's your login information. It will be valid until Sunday at 1pm. [01:13.980 --> 01:16.120] And how long does this buy me for? [01:16.620 --> 01:20.740] Anyone who wants this, who's watching the video, it is available. [01:20.740 --> 01:22.600] Yep, you can access it over Tor. [01:25.440 --> 01:28.880] So it's available until Sunday at 1pm. [01:28.880 --> 01:31.820] That's when we close everything down, that's when contests close. [01:33.480 --> 01:35.020] This is so cool. [01:35.020 --> 01:36.760] So I put money in. [01:36.840 --> 01:40.100] I want to hear about the hardware inside right before we did. [01:40.100 --> 01:44.820] I put money in, I push the button, and I have a shell on demand. [01:44.820 --> 01:46.180] Let's go ahead and open it up. [01:46.180 --> 01:47.800] What is in here? [01:54.060 --> 01:57.020] So you open it up like a standard soda machine. [02:02.040 --> 02:05.740] And then we open to the glorious land inside. [02:05.920 --> 02:07.340] Oh my gosh. [02:07.340 --> 02:08.980] Hi, there's the staff in here. [02:09.440 --> 02:12.380] So this is all new. [02:12.380 --> 02:15.040] There is, well the coin stuff looks new. [02:15.040 --> 02:16.980] No, this is the original from the Dixie Metro. [02:16.980 --> 02:21.980] Which is original, but there's also like Raspberry Pis in here and Arduinos. [02:22.460 --> 02:25.940] Walk me through. I stick a coin in, what happens? [02:25.940 --> 02:30.820] Okay, so when you stick a coin in through the front, it actually will drop down through this chute here. [02:30.880 --> 02:33.100] And into the coin acceptor. [02:33.140 --> 02:37.520] The coin acceptor then has a data bus, very similar to CAN bus, it's called MBD. [02:37.520 --> 02:39.300] It's used in vending machines. [02:39.480 --> 02:41.840] And it talks to this little controller here. [02:42.140 --> 02:46.100] This controller then talks over USB to the Raspberry Pi. [02:46.900 --> 02:54.600] The Raspberry Pi is also connected to the Arduino as well, which handles the button front and the button matrix. [02:55.960 --> 02:59.500] So it's also for the bill acceptor, comes in through the same bus. [03:01.120 --> 03:05.600] So you can see Dual D has done a very nice job on all the wiring here. [03:05.960 --> 03:09.740] I'm going to get a flashlight in here, so we can see it a little bit better. [03:09.740 --> 03:11.160] Gaur, you want to come on in? [03:11.680 --> 03:15.080] So you can see, that's the OLED display up front. [03:15.200 --> 03:16.860] That's an IR blaster we haven't really used yet. [03:16.860 --> 03:19.340] So we can do custom displays in this thing. [03:19.340 --> 03:19.880] Yes. [03:20.240 --> 03:24.560] And then if we look down here, this is behind the buttons. [03:25.280 --> 03:29.080] This is all the NeoPixels that Zorro wired up. [03:29.260 --> 03:32.260] And then obviously you have to do custom labels for everything. [03:32.260 --> 03:33.960] Yes, you can see how they're just paper. [03:33.960 --> 03:36.820] And we've got brand new labels for it from Dixie Narco. [03:36.820 --> 03:37.620] Okay. [03:37.860 --> 03:39.460] So I've put coins in. [03:39.460 --> 03:41.540] It registers a button click. [03:41.540 --> 03:44.820] Yes, and so then that goes to... [03:44.820 --> 03:46.420] The button click goes where though? [03:46.420 --> 03:48.460] I hit the button, where do we go? [03:48.460 --> 03:50.740] So it goes to the Arduino. [03:50.740 --> 03:53.000] It goes through to Arduino to recognize a button click. [03:53.000 --> 03:53.340] So it's... [03:53.340 --> 03:57.320] And then that gets talked to the Pi, which then is even more complicated. [03:57.320 --> 03:59.060] And we'll show you this here real fast. [03:59.060 --> 04:06.980] This is a printout of the PHP being used to detect the coin acceptor and the bill acceptor. [04:10.120 --> 04:12.920] Wow, do you have this like open source or anything like that? [04:12.920 --> 04:14.400] We will release it after the con. [04:14.400 --> 04:15.480] Oh, that is so cool. [04:15.480 --> 04:17.440] This is the PHP you wrote? [04:17.440 --> 04:18.060] Yes. [04:18.060 --> 04:19.160] This is not... [04:19.160 --> 04:21.600] There's no libraries in here, it's all my functions. [04:21.600 --> 04:23.600] This is so cool. [04:23.960 --> 04:25.940] Alright, so it goes to the Raspberry Pi. [04:25.940 --> 04:28.600] The Raspberry Pi looks like it's connected to two... [04:29.460 --> 04:31.760] Oh no, it's more complicated than that. [04:31.780 --> 04:33.320] Hold please. [04:34.080 --> 04:36.460] So we're going into the data center here now. [04:36.460 --> 04:38.760] You might want to get some good light in here. [04:38.760 --> 04:41.640] So this is the data center inside the soda machine. [04:42.160 --> 04:47.460] So this has four Dell R630s in it and a management unit. [04:47.460 --> 04:50.980] This management unit is I think a 430 or 460. [04:51.620 --> 04:56.740] And so it actually contains the code that's running the PHP that I showed you. [04:56.740 --> 04:59.040] It's handling everything for management. [04:59.120 --> 05:01.860] Hey, Gary, really quick, were you able to see this with the light? [05:01.860 --> 05:02.080] Yeah. [05:02.080 --> 05:02.720] Excellent. [05:02.720 --> 05:05.000] So it's all connected over the network. [05:05.280 --> 05:08.380] So the Raspberry Pi is just a serial relay. [05:08.380 --> 05:12.400] I'm talking from the management over TCP to the serial devices. [05:12.940 --> 05:14.900] So really all the code is ran on here. [05:14.900 --> 05:18.020] Raspberry Pi comes on in, it comes into here. [05:18.260 --> 05:19.820] And then, what is this? [05:20.840 --> 05:22.920] It's a Dell 430, I think. [05:23.340 --> 05:26.020] It's lower than the Pi. [05:27.600 --> 05:31.280] And that's all handled through this dumb switch here for management. [05:31.520 --> 05:33.960] You can actually see the primary tether from the door. [05:33.960 --> 05:37.540] This is the main Ethernet and then the power for it. [05:37.600 --> 05:39.640] We do have a switch on the inside. [05:42.920 --> 05:46.620] And that switch is right here. It's a four-port switch that handles everything. [05:46.620 --> 05:47.940] Yep, right down here. [05:47.940 --> 05:52.620] All right. [05:52.960 --> 06:00.580] Once management decides that your payment is valid and you've pressed your button, [06:00.580 --> 06:04.240] it will print it through the thermal printers here. [06:04.240 --> 06:06.160] These are networked as well. [06:06.400 --> 06:09.640] This is dual-star TSP 650s. [06:09.940 --> 06:12.680] Pretty standard restaurant thermal printers. [06:13.960 --> 06:17.080] And they're just kind of Velcroed in and there's a little guard on them [06:17.080 --> 06:19.780] to kind of prevent people from tampering with them. [06:20.600 --> 06:22.500] And so, that's pretty much it. [06:22.580 --> 06:28.720] We pre-warm the virtual machines, so whenever you request one, [06:28.720 --> 06:32.780] it's already been running for several hours, just waiting for somebody to buy one. [06:32.780 --> 06:34.180] We jumped a ton of steps. [06:34.180 --> 06:38.560] I mean, you walk through each individual step, but there's so much more to this. [06:38.560 --> 06:42.700] So, like, I have now put a coin in, I provisioned it, [06:42.700 --> 06:44.900] Raspberry Pi has recognized a serial connection, [06:44.900 --> 06:47.020] we've come back over to this, we've come into this, [06:47.020 --> 06:51.000] this now says to these servers, there's like four servers here, [06:51.000 --> 06:56.300] it's backwards, so these spin up the VMs whenever they say that there's many more idle ones, [06:56.300 --> 06:58.020] and pushes it to the database. [06:58.020 --> 06:59.300] Oh, it pushes it to the database. [06:59.300 --> 07:01.420] Yeah, so they're already running on here, [07:01.420 --> 07:04.040] and then when you buy one, you're selected one that's already been running. [07:04.040 --> 07:05.200] So, how are these running? [07:05.200 --> 07:09.100] These VMs are like, are they full-blown VMs? Are they Docker images? [07:09.100 --> 07:16.240] So, they're QM, KVM virtual machines with no management engine around them, [07:16.240 --> 07:21.200] so no libvert, no, you know, any of the other main ones. [07:21.240 --> 07:24.800] I'm literally launching the processes by hand with switches. [07:25.040 --> 07:28.980] And I'm running them on as an unprivileged user, re-niced, [07:28.980 --> 07:31.040] and so that way they are well-behaved, [07:31.040 --> 07:33.440] and they're directly joining to the bridges that I want them to. [07:33.440 --> 07:38.320] Alright, so it's now, database picks up on the fact that someone's ordered one, [07:38.320 --> 07:41.060] go do it, go connect this one, or it's in the database. [07:41.060 --> 07:42.440] And it gathers the credentials. [07:42.440 --> 07:45.360] It gathers the credentials, and then it sends it where? [07:47.300 --> 07:50.260] This server brings it right back to the printer directly? [07:50.260 --> 07:50.840] Yes. [07:51.040 --> 07:52.540] And then it prints out. [07:52.540 --> 07:54.600] Alright, we've talked about the technical details. [07:54.600 --> 07:57.120] Let's get it shut, because I know there's, there's like, [07:57.120 --> 07:58.880] the other thing we haven't even mentioned here. [07:58.880 --> 08:02.980] Obviously, with everything at DEF CON, you need good art. [08:03.080 --> 08:05.100] You need good hardware. [08:05.100 --> 08:08.400] You need good software and PHP code and all of this. [08:08.400 --> 08:12.260] But you also need, like, hardware hacking and manufacturing skills. [08:12.260 --> 08:17.700] The airflow I know had to be cut all the way through this to get good airflow through all these servers. [08:17.700 --> 08:17.960] Yeah. [08:17.960 --> 08:22.340] How many of these have been bought, even though we're early in the CON? [08:22.760 --> 08:26.180] So, we're at 250 virtual machines right now. [08:26.820 --> 08:33.580] And so, we've made north of $500 for a donation, [08:33.580 --> 08:37.260] that'll all be donated to the National Upcycling Cooperative, [08:37.260 --> 08:41.860] which is kind of a research slash institute that does a lot of dumpster diving and scavenging [08:41.860 --> 08:44.300] to be able to give out to others. [08:44.300 --> 08:48.340] This is Dual D's NUC. This was built using NUC equipment. [08:48.340 --> 08:51.360] Yeah, everything in this sort of machine was dumpster dived. [08:51.560 --> 08:55.500] This is amazing. All of this was dumpster dived. [08:55.700 --> 08:57.280] Even the vending machine? [08:57.280 --> 09:00.080] Yeah, we got it for free from a contact from Skull. [09:00.080 --> 09:02.420] I think it was in, like, a Mason Lodge or something. [09:02.420 --> 09:04.380] I mean, we even saw the squirt in it when we got it. [09:04.380 --> 09:07.780] We talk about dumpster diving, and again, this is a whole story in and of itself. [09:07.820 --> 09:11.640] And I need to talk to Dual D at one point about his adventures in dumpster diving. [09:11.640 --> 09:17.420] But never does anyone consider you could build something like this just from dumpster diving. [09:17.420 --> 09:18.440] Oh, yeah, for sure. [09:19.800 --> 09:24.200] At this point, you've kicked it out, but what I was talking about is you had to do custom cutting, [09:24.200 --> 09:28.080] you need to do custom airflow, but now all of that is done. [09:28.080 --> 09:30.140] But we haven't even turned to the right yet. [09:30.140 --> 09:35.020] The moment we go over to the right, we get to see all of the different... [09:35.020 --> 09:37.860] We call it the Leaning Tower of Visa. [09:37.880 --> 09:38.880] Oh, goodness. [09:38.880 --> 09:43.960] Okay, so what we have here on the top is the web UI for it. [09:44.260 --> 09:46.960] So, for instance, if I push a button on the front of it... [09:52.090 --> 09:53.650] Let me give it a second. [09:53.650 --> 09:56.030] It'll tell you the VM specs. [09:57.030 --> 10:05.290] So you can see here we got Dyed OpenWrt, Sugar-Free BSD, Debian 0. [10:05.290 --> 10:09.630] When you're pushing these buttons, this was new functionality you also had to build in [10:09.630 --> 10:14.550] because when each one of these buttons are pressed, not only does it need to detect has there been money in it, [10:14.550 --> 10:20.750] but if there isn't money in it, to go all the way through the process to then show this information on screen. [10:20.770 --> 10:21.850] Oh, yeah, for sure. [10:21.850 --> 10:23.390] This was very, very cool. [10:23.450 --> 10:27.470] It's six daemons that are currently running, six separate PHP scripts. [10:27.510 --> 10:33.030] They're all running in separate processes, and they synchronize through the database. [10:33.190 --> 10:38.410] So the web UI is just pulling states back out from the database. [10:38.410 --> 10:44.450] So when the button daemon says, hey, a button was pushed, it doesn't know that there's no money in it. [10:44.450 --> 10:46.310] It just says a button was pushed. [10:46.550 --> 10:50.910] Processor, which is a huge, I printed it out, it's like this thick, process, [10:50.910 --> 10:53.790] is the one who actually handles the receipt and VM capture. [10:54.330 --> 10:59.290] And so it's the one who kind of handles the money a little bit, the payment logic a little bit more. [10:59.290 --> 11:02.310] So here's really where it comes down to. [11:02.310 --> 11:04.650] I have seen many projects at DEF CON. [11:04.650 --> 11:11.250] This incorporates physical, it incorporates fabrication and software and art. [11:12.110 --> 11:15.950] This may be, this is hacking at DEF CON. [11:15.950 --> 11:18.890] This is what I envision hacking at DEF CON. [11:19.350 --> 11:22.010] This is, I'm kind of just flabbergasted. [11:22.010 --> 11:26.350] With that, though, if you are at DEF CON, check this out. [11:26.350 --> 11:30.890] Check what else the NUC has figured out and what they've been building. [11:30.890 --> 11:32.990] I'll leave links in the video description. [11:32.990 --> 11:38.110] Because the NUC, if they can build something like this from dumpster diving, [11:38.110 --> 11:41.930] we need to find out what else could be built. [11:42.010 --> 11:44.930] After DEF CON, where is this going? [11:44.930 --> 11:50.110] So after DEF CON, this soda machine will be exhibited at the Rochester Institute of Technology [11:50.110 --> 11:54.170] Global Cybersecurity Institute and the Experience Center. [11:54.170 --> 11:58.590] We have a little museum that's open to the public of different hacker things. [11:58.590 --> 12:00.910] And so we're going to bring this up there and make it live, [12:00.910 --> 12:04.110] available for students and staff or anybody else around, [12:04.110 --> 12:06.030] be able to get Shells at will. [12:06.270 --> 12:08.750] And then we'll bring it back to DEF CON next year. [12:08.970 --> 12:11.770] And so RIT is going to pay to bring it back next year. [12:12.550 --> 12:16.830] And so it's going to be great so it can continue to live on forever. [12:17.370 --> 12:20.190] And this is Shells. [12:20.190 --> 12:22.370] And what does Shells stand for again? [12:22.530 --> 12:23.410] Oh, no, soda. [12:23.410 --> 12:25.370] Soda. This is the soda machine. [12:25.370 --> 12:27.610] Yeah, for the Shell on-demand appliance. [12:27.610 --> 12:29.790] The Shell on-demand appliance. [12:29.790 --> 12:31.730] We be popping Shells over here. [12:31.730 --> 12:34.450] Thank you so much for sharing this with us. [12:34.450 --> 12:38.030] Thank you just for building something so cool. [12:38.030 --> 12:39.890] Thank you for watching. [12:39.890 --> 12:42.550] And as always, hack on!