So got the, got to talk about freaking blinky lights today. Going to be talking a little bit about how to do something kind of off the wall, network monitoring with Arduino. I always want to play with electronics and get some stuff going with blinky lights, and I've always been just real fascinated. I'm kind of one of those people that sit there and stare at the switch and watch the lights kind of turn off and on and just kind of get mesmerized. I don't know what the deal is with me, but stoplights, whatever, you can pretty much just get me to stop what I'm doing if you put something in front of me that's turning on and off. My name's Steve Osepik. No Steve. So this is my talk. Just a quick note, the quality of some of the images in the presentation are of the homemade variety because of some legality reasons. We're not allowed to use the copyright images and things of that nature, so I do apologize in advance for some of the quality here. So just kicking right off. So this is kind of where I came from, right? The idea of modeming, and there used to be kind of this concept that you could kind of see what the heck you were doing while you were online. You had RD and SD. My kind of original blinky, my favorite blinky lights in the world, which meant actually RD was always the best because it meant you were downloading something. So there was this kind of visual cognition, tactile feedback, probably tactile is the wrong word because I think it's like physical whatever, but it's like a feedback kind of, like I do something, I push something on my keyboard, I see it on the screen, and then I know what's going over my serial port going off the phone line, because I see this kind of blinky light thing happening, right? So then a lot of stuff happened from then. So progressing through time, I kind of just took arbitrary things out of the history of networking. So I think like there was like 56K, and then NetSplosion. Thank you. I think there was like an explosion of internet stuff. And then YouTube was somewhere in there and a bunch of other stuff. And then mobile, and now there's a cloud. And I think he's like smoking a cigarette. I got one of these like disclaimers here about that. You shouldn't do that. But it's like a, it's, so it's kind of like this, a lot of stuff's happened, right? The whole idea of this slide, I think, I think what I was thinking was basically stuff's a lot faster, TCPIP, protocol diversity. It's not just as simple as RD and SD. Because you're talking about a lot of different protocols, a lot of different hosts, a lot of different stuff going on at the same time. It's a very, very chatty thing we got going on. Somewhere along the line we sort of lost track of what our machines are doing. It's just, and so we've got this, you know, this idea, this link light. We also have like connection pools, longer sessions, stuff like that. I don't know what the hell my machine's doing anymore, right? And yeah, my, you know, like my net stat hurts. I'm actually thinking about getting up there. Bumper sticker says that. But I guess the bad sign is when a two-minute PCAP file is larger than a two-minute MP3. I think we have some serious stuff going on in the wire. So it all comes down to the fact that, dude, the activity light is solid, man. It's just not, basically, we have one LED, right? It's like a total missed opportunity. Because you've got like this one LED and it says something's happening. And so you, anything you do, it's like, is something happening? It says, yeah, something's happening. It's like solid. It's like that's all we can ask. That's all we can, that's all we really know. So, again, I really apologize to this, especially, for this, especially like whoever's involved. Because apparently whoever takes pictures of these guys copyrights their images too. But the, basically, it comes down to this. Richard Baitlick and Bruce Schneier, if you want to, you know, if I want to legitimize what I'm doing up here, the industry experts are saying monitoring first. Monitoring first on the grassroots most lowest level is what we're talking about here, which is the little blinky lights in the front of the modem. You know, monitoring first, if you take it to its extreme, is kind of knowing what the hell your machine's doing at any time. The actual quote from Bruce, by the way, those are muscles. I want to make sure you knew he had a shirt on. But basically what Bruce Schneier said in cryptogram, actually 2001, about ten years ago, monitoring should be first step in a network security plan, something an administrator can do today to provide immediate value. So that makes me feel a little more legitimate in this talk. But basically that's the concept, right? If you know what the hell's going on, you can do something about it. And I think we skip monitoring. We go right to enforcement. I know that's what happens. You know, with network access control, I was in that business for a long time, and we would come into networks and say, hey, we're going to kick everyone's ass. And that's not supposed to be here. We're going to kick everybody off. And you get them all fired up, and people would come up with these really cool rules that sounds really nice, like, hey, if they're transferring this much data, this data rate at this time of day, then kick their butt. And then the CEO would come in, be on his way out of town at 9 p.m., try to copy the presentation down for the boardroom, and get kicked off. And everybody would get fired, and we'd lose the account. So the idea is that why is that? Why did that happen? Why do people want to enforce before monitoring, right? That's kind of goofy. Because if you were monitoring, you'd know that that kind of stuff happens. You'd know that that rule's crazy, right? But we try to create this kind of big brain that says, oh, we're going to feed this brain all this data, and then the data, it's going to learn, and it's going to understand your network better than you do. And then it's going to make these kind of interesting rules. You know, if you take it a step farther and you're talking about some of this, you know, the learning mode and things like that. Don't get me wrong. I mean, we need that stuff. We need to make it better. But we need to also understand what the heck's going on. So you start talking about monitoring, and it's like, well, wait a minute. We have all this cool stuff. And I, you know, on the side, I like to write these little miniature screenplays and throw them in the trash so you get to see one. So basically you mean, like, IPS, IDS, NAX, sniffers, scrapers. Yeah, okay. And then. No, I mean, like, what the, you know, okay, yeah, WTF, the box is doing, right? And then, yeah, but try Wireshark, newbie. And then it just kind of devolves from there. I don't really know what happened after that. But there's something about the fact that Wireshark is for analysis. And then I don't think that has any value at all. But basically, yeah, so the idea is that Wireshark, the takeaway is that Wireshark is for analysis. Okay? And not for the kind of thing I'm talking about, which is this real-time kind of tactile, I keep misusing that word, but this sort of real-time feedback that you're getting from the thing. So like the old days, right? Something, it's a good excuse for Arduino. It sounds good on a DEF CON schedule. Freaking blinky lights. It's. . . . . . And of course something gives you visibility. So now I'm going to start butchering some other words, okay? Visibility versus visualization. I don't know. There's no, this is me talking about trying to figure out how to do, like, the differentiation. It's not that these words totally, you're going to look them in the dictionary and they have this difference. This is just me kind of trying to express something. But I'm going for something that's peripheral. Okay. I'm talking about something that is going to tap into your cognition, cognition, talk about that in a little bit here, I'm making up my own distinctions, but visualization I'm thinking of as like the wire shark, right? I'm thinking of visualization as maybe even these beautiful graphs that do stuff and they're like big pie charts and top kind of looking things and all sorts of beautiful things you do with static data sets because you have a lot of computational time to kick these things, but you have a big bunch of data and you have all these cycles and you can visualize something statically. I'm trying to go for something a little different on the other end of the spectrum which is like the real time stuff, okay? So it's more tactical, military term, visibility is thinking about, I used to, I think my closest stint with the Navy was playing Secret Service on the Converse 64, so it was like, it said visibility low, visibility poor, and then like battleship would sneak up on you and kill you and then I'd load the trainer and kill everyone else. But the ‑‑ The thing was that there was this idea that you only have a certain amount of visibility, you only have a certain amount of ability to react to what's happening based on what you can see, right? So visualization taps into our ability to reason, right, to figure things out. It answers questions. Visibility might ‑‑ or visualization, excuse me, might like cause us to ‑‑ it might answer questions. Visibility is more like it taps into our cognition, okay? And maybe it causes us to ask questions. I only sort of know what I'm talking about, real time cognition, but examples are driving like video games and like things like sports. And I just kind of realized it's probably like a really bad thing to bring up at DEF CON. But the ‑‑ but basically, yeah, so it's like the real time kind of like why are you good at sports? And it's not because, well, I sit down, I get the basketball. And I sit down, I project the arc, and I'm going to exert the right amount of force to get it in the basket. It's because, I don't know, man, I just ‑‑ that's what I do, right? I just ‑‑ whatever it is they do in basketball, I just like slam on those guys all day or something. It's like the one where they ‑‑ yeah, okay. So direct connection between the senses, right? So it's because you're able to like react to something. You're able to see it. It's out of the corner of your eye, but you're able to do something about it, right? It's the same with video game, little sniper, you know, whatever. You can get really good at that, but you're not thinking about it. You're just doing it. It's acute perception of sight variances and stimuli, which sounds like freaking awesome. Here's the scholarly reference that I think this means what I think I'm talking about, which is real time cognition is best described not as a sequence of logical operations performed, discrete symbols kind of hanging in there on that one, but as a continuously changing pattern of neuronal activity. So what I take away from that, this poor Michael Spivey who got cited at DEF CON and Rick Dale of University of Memphis and Cornell University, there you go, what I take away from that is it's a flow. It's not so much that you stop doing something. It's not like chunked up like general analysis is. It's more like this flow. It's like this tie in to human stuff. So with that, that's enough of that crap. Let's play with electronics. All right. So this whole USB thing. So it's going to light up here in a minute, I'll show you. The idea of these peripherals. I thought, well, if you have things like, you know, USB nerf shooters and ninja detectors and LED Christmas trees, this huge market. Like, ThinkGeek makes a lot of money on this stuff. If you have all this stuff that's hanging around your desk, maybe that's the place to put this. I started off this idea actually a while ago thinking that I was going to put it in some little window in the side, like you could put it maybe in a little square or something somewhere on the screen. And that's all well and good except every stinking application just is like a ‑‑ it'll just grab focus from you all day long. If you ever try to preserve something on the screen. Unless you tap into some sort of OS call like stay on top or, you know, whatever, you're not going to be able to do that. It's going to get thrown away. There's also like the dashboard icons and stuff. Like you could flip to dashboard. But that's not always there. Right? You have to hit the dashboard button. Dashboard pops up. And I don't want this big flashing thing that says, you know, you got owned like 20 minutes ago. You know? I'd rather have something ‑‑ there's also like little widgets in the system tray where you have about five pixels to work with. So I thought, you know, I want something on the desk. Because look, there's a lot of room around the desk where the laptop sits. Okay? There's actually a lot of room there. So that's a good reason, another good excuse to do something with Arduino. The crazy idea is I want to render network data on LED matrix in real time. Okay? I want to use things like color, motion, stuff that I can do, any creative whatever thing I can somehow put together to actually show what's happening. I want to get a feel for it. I want to tap into this pattern matching. People are real good at this. I mean, it's like that thing where something's wrong with the car. I'm terrible at this stuff. I'm not a mechanic by any stretch of the imagination. But I know that, you know, if something's going on and I turn the wheel a certain way and I get this little bit of vibration, I get this little bit of feedback, I notice that it's different. You know? Maybe there's some cars that move a certain way and you kind of get just ‑‑ you just naturally sort of take in. And you start driving around, you know, whatever, and then it starts vibrating, you know, hey, that's different. I think it goes back to the cavemen. It's like they came out and there's like seven buffalo out there. And then they came out the same time next year and it's like there's two buffalo out there. And it's like, dude, it's time to get the hell out of here. You know? We got to find more buffalo. It's like this pattern matching. It's actually based on our ability to survive. I think it's a survival mechanism, to be honest with you. So cereal box is the name of this thing. No cute name or anything. The word cereal box, like the cute version with S-E-R-I-A-L was taken by some, I don't know, something out of the 90s, some other program. So I was just like, well, hell, I'll just call it cereal box. And the reason I call it that is because, I don't know, how many people in here, like, have read the back of cereal boxes? I mean, do you guys kind of know what I mean? I see some fans are like nodding, yeah, I know what you mean. I mean, it's just the most inane bullshit on the back of those things, you know? It's like, why the hell am I doing the maze? To get, like, you know, the cocoa bird or whatever to the freaking, you know, so he can get his hook up at the end of this. I don't get it, you know, but I do it. Why? Why? Do I do this to myself? And the reason is, honestly, the reason is because it's there. That's why. I wish I could tell you something smarter than that. I wish it was, I wish I could actually say that it's because, I don't know, something to do with my childhood. And, and. It's not to do with, you know, market analysis, but it's just because it's there, okay? And the thing is that we're big on that. If it's there, we'll play with it. And that's what I want. I want this thing to be there, right? I want it to be in the background. I want it to be something we can kind of see out of the corner of our eye. That's why I call it, by the way, cereal box, in case, you know. So pattern detection, it lets us see the variances without digging in. It's just enough. It's just enough information. I can't, I mean, I got, you know. I'll show this. I'll show this here in a minute when I get it doing stuff. But I've got this much space to work with, okay? I've got a tiny, tiny little bit of space to work with. So I can't do all the things I would want to do. I can't see all the things I want to see. But maybe that's good. Maybe that's going to force me to think, well, what do I really need to see, right? So I based it on the Arduino Uno, which is real cool. It's a little board. It's based on a chip called the Atmel Atmega 328. I'm not a hardware hacker. I have any stretch of imagination. These tools are really nice. Makes it really easy to do this stuff. It's a nice little thing. It's an 8-bit CPU. It's 16 megahertz. So pretty powerful. But I'll tell you, it's got 32K of flash, which means that's how big your program can be once it's compiled. But it's only got 2K. It's got 2K of SRAM, which is a real, real interesting thing, especially if you're going to do anything, you know, kind of higher end. You definitely will push that pretty much with any project you do. 2K SRAM, what that means is, you know, that's how much space you actually have to actually do your stuff, right? That's where you store your dynamic data structures. Your static data structures, those can sit in flash, you can access those at run time. But your dynamic data structures, which, of course, network data is anything, you know. If anything, it's dynamic. You have to store that in your SRAM. USB powered. There's serial communication with a chip. It's the Atmega U2. The only reason I bring that up is there's no hardware handshaking. thinking. So those of you who go back to the modem days, it's like I'm sitting here in 2001 and I'm talking about this hardware and RTS CTS would be like a feature. I almost had to write X on X off on this thing. But as you know, you can't ‑‑ I mean, I would have to flash the thing and I don't know how to do that. So basically I just made it run kind of slow. I decided well, at that point I remember 9600 was pretty good. That's the speed that it's kind of rated at or comes at by default. So I just figured well, anything I do, I'm going to keep it inside of this window. One of my limitations is 9600 baud. You can get that for about 30 bucks. There's also something called a color shield. This is a really cool little thing. This is something that ‑‑ the things for Arduino are called shields. So when you see the word shield, that means that's an add‑on board for the Arduino. And this one is a shield that has a chip on it to control LEDs. So it makes it very easy. You'll see a lot of ‑‑ if you go on to YouTube, I've got a bunch of YouTube and you type in Arduino, LEDs, you'll see a lot of wire wrap and bread boards and stuff where people are doing a lot of cool stuff, but they're having to do it all manually and hook all this stuff up together. This makes life a lot easier if you're going to play with LEDs, with blinky lights. IT Studio sells it for $15. And they also sell a multicolor LED matrix for about 21. So at the end of the day, we're at about 66 bucks for this. So not too bad. I mean, if someone is going to pick this up and start making a whole bunch of them, mass producing will probably get down really cheap, probably produce something like this for 10 bucks or something. But for hobbyist electronics, you know, that's not too bad. And you can do a lot of other stuff with this is the nice thing. You're not just stuck with whatever this is. So the design goals have to be simple, have to ‑‑ I'm going to send stuff from the host. The host, of course, it can't sniff. It's just USB. So I have to have a sniffer on the box, on my own box. But then the sniffer is going to send that data, whatever data I'm interested in, over the serial link, and it's going to render it on the Arduino. Serial box, the code that's running on the Arduino is in charge of rendering that to the screen. That's its job. Its job is to render anything I send it to the screen. I have 2K SRAM, minimal data processing, should be easy. I want you guys to be able to play with this. The source code, you already have it. This is kind of fun. I don't know if you know this. You already have this. It's on the ‑‑ the source code for it is on the DEF CON DVD. So you actually have it. You have it right now. So I was hoping ‑‑ I'm kind of glad that not everybody got up and left. I thought maybe that was going to do it. So I saved it to the middle, but I think we're okay. So data points, here's what I'm sending, MAC address, IP address, TCP or UDP port and country code. Here's what it looks like. So I can say I wrote my own protocol, but really all I did was I just took, like, one was open, two was closed, and then I just put a bunch of stuff in there. And then I just put a bunch of other stuff in hex, separated by commas. So if you could call that a protocol, yeah, then ‑‑ so when I'm trying to show off in front of the girls, I say I wrote my own protocol. But really, you guys know the truth. It's just ‑‑ it's just nine ‑‑ it's just that many characters, however many characters that is across Serialink. All that stuff's already there. By the way, basic C, good enough. I know you guys are getting antsy to see some stuff. So by the way, text processing in C, this is the kind of thing that ‑‑ where I'm kind of a purist, and I always think, well ‑‑ or I think of myself as a purist, which is probably completely false. But I think of, like, man, why do we have all these high‑level languages like Java and Ruby and all this stuff when I could just be programming C, and it was like the good old days, and I really, really want to, like, just take advantage of every little register on my processor and do everything, like, super fast. And you kids these days and all that kind of curmudgeoning stuff. But then you actually sit down, it's like, okay, rock star, now you have to process a string in C, right? And it's like, oh, son of a bitch. So the ‑‑ so this is the thing. I mean, you just see a lot of this kind of stuff. It's probably full of God knows what security ‑‑ you know, somebody's going to, like, totally pwn your cereal box. But it's a ‑‑ yeah, you know, it's basically just taking one character in at a time, going through the ASCII table. I have the ASCII table. I have the ASCII table.com or whatever in my bookmarks now, and just staring at it. So this is the cool stuff. Coloredunio library. It's huge help in dealing with the LEDs. Setting an LED. So for those of you trying to figure out how to do this, it's very simple. There's some basic code there to do it. If I want to set coordinate 3, X3, Y8 to blue, I'm going to do set pixel directly, or I could do it using a pointer and do increment. I didn't write this. This is by the ‑‑ this is by the this dude, Linko Matic, and he's awesome. I sent him an e‑mail and let him know I'm going to be doing this talk, so I sent him a recording of this. But I was just very impressed with it. It's a very, very cool library. This is something I did. This was kind of my contribution, right, where I had this problem where I couldn't ‑‑ I only have 32K of flash and 2K of RAM. I didn't want to store a big static table in memory to convert country code. You're going to see why this is important here in a minute. But I didn't want to store a big static table in a minute to RGB values. So what you're going to see is one of the views. There's two views I'm going to show you. One view is going to show you all the connections that are on. It's going to fill up the matrix, the LED matrix with all the different country ‑‑ all the different sessions that are being done by the machine, and it's going to color code them according to what country using GOIP, what country I'm talking to. Okay? How I did that was I went to the browser, basically took the country code and using the random thing that's inside of C, I just kind of made up a color on the fly. The random is pseudo random. So it's not really random. It's always going to be the same. So once you learn the color for a country ‑‑ and oddly enough, U.S. was green. So I thought that was kind of interesting. But some other countries were red. And you'll find those out on your own. But it was kind of apt, I'm just saying. So it just ‑‑ the way I did it, I mean, the way that it worked, you just sort of realize how ‑‑ that basically, yes, that's U.S. because I've memorized that. I don't even have a list. I couldn't give you a list. I would have to actually send all the country codes to this thing to give you a list of all the colors. It's going to do it on the fly. But it's always going to be the same. And then ‑‑ so, yeah, the first letter turns to green, the result in green, turns into blue and all that stuff. So now is the part of the talk where I try to show you how this works. First, what I'm going to do is I'm going to show you how this works. So here's the challenge. As you can see, I was wearing a shirt there. Don't let them fool you, okay? It's just V‑neck or something. It was ‑‑ it was late at night, you know. But here's my main problem. You can't tell what the hell is going on there, right? I mean, the whole thing is that there's ‑‑ it's all blown out. So this was the challenge. I was like, how am I going to go from a DEF CON, how am I going to show these guys how this works? So I'm going to do two things. One is I'm going to do two ways. I'm going to show it on there and just kind of do the little hold it up, like show and tell in front of the school thing. And then I've got a movie that will show up on the big screen where I had a ‑‑ I found this old camcorder. It's like the only way I could do this. The old camcorder had like an exposure switch and I could turn the exposure way down. It actually looked real good. So let me ‑‑ now this ‑‑ I worked this out with the AV guy. We'll see if this works here. Okay, cool. So let me jump over here. Here's what I'm doing. Basically, this is a Perl script that comes with it. It's also on the DVD. I'm doing Perl ‑‑ let me make this a little bigger. Perl CB PL. It gives you usage if you don't know how to do it. The interface, the IP, the source IP, and the actual serial port that it's going to talk to. So this is going over serial. It's actually serial emulation over USB. I guess it's not really emulation. It's actual serial. So Perl CB PL, blah, blah, blah. Get that going. And then from there, down here, I'm just ‑‑ this is ‑‑ I'm doing the TCP replay thing. So what should happen if we're lucky and the demo gods don't frown on us. There we go. Okay. So what's happening here is I'm doing a TCP replay from some ‑‑ some PCAP stuff I recorded. And what's happening is every time something comes up, it's going to render it to the screen. Actually, I think I picked the wrong one. But you can kind of get an idea of what this looks like. Actually, I think this is about to freak out. I picked the port scan one. I think I picked the port scan one. Yeah, I picked the port scan one. So it just kind of ‑‑ well, okay. Now, so you spend $66 on this thing and everybody comes by your desk and like, really? Seriously? Yeah. So let's try another one that's not quite as crazy as that. Actually, I stopped the wrong thing. I work through this stuff, like, 20 million times and then I get up here and crap all over myself. Let's do browsing. Browsing sounds good. So, let's start ‑‑ start up our daemon again. It's real simple. It will reset itself if you stop it. It just gives you a feel for playing around with this stuff and how this works. So don't worry. Guys in the back, we're going to show it on the big screen here in a minute. But just to give you sort of a feel, right? Again, it's going to be much better on the screen because on the screen you can see what I'm doing and there's this analog. Remember, this is all about comparing and pattern matching. But what's happening is as I connect to different websites, the lights are turning on, lights are turning off, as connections open and close, they're turning, here we go, here's some more, some more, and it's just kind of floating around like that. So that's view number one. This is on your desk. You have 128, actually. It's two screens out of 64. So if you go over 64 what will happen is and I hope I'm not under-cerving anyone here, there's kind of a wide room. But the lights will, if it goes over 64, it will switch back and forth using a timer. So I just set that there and let it sort of just, see, it's kind of active right now like I was doing a whole webinar raise, and it really just didn't make bunch of stuff there. There's some blue. There it flipped over to the other screen. Okay. So you see I get really excited about that. I have a hard time setting it down. So now we'll show the movie and the movie will help. Let me see here. So first one is the session. This is we're doing the session view. So again, very similar to what you just saw in real code in real time. So zooming in here, this is the Arduino IDE. Okay. So this is going to this is where you type the code if you want to write code. I mean you can type in whatever you want. But this has the upload button. It's actually handy. You push the upload button, you send it over to serial and then it flashes the Arduino with the code from the thing. So then coming over here, there's our Perl script thing. So we're going to go ahead and do that. So we're going to go ahead and go ahead and set up our Kubernetes. Again you just fire that off. Really the only argument is just getting it set up. And then from there I'm going to pan down, and this is much easier on the eyes. You can see the little guy start to fill up there. So there's some stuff going on. So if your network card was a giant modem and it had LEDs on it, I think this is something like what it would look like. And so then I zoom out a little bit and you can start seeing where I'm browsing the Web I've been doing other stuff. I'm trying to be cognizant that this is being presented at DEF CON, so I'm going to, like, kind of unoffensive sites and things that don't have my session key in the URL. I also cleared out the Google search window ahead of time. And so, yeah, pretty much pretty boring stuff here. But there is something coming up that is particularly interesting as far as, like, the country code. You notice everything is green. This is all the stuff I've been going to is in the U.S. So here in a second it's going to go to another country and we'll see how the lights kind of change. So you notice that as it's just sitting there, nothing is happening. This is kind of interesting, interesting to me anyway, that, you know, these connections stick around as long as they do, oh, they all went away. That's just the way the web servers work, right? They have that connection open thing. You're connecting to Apache. It's leaving the session open for a while. It's preserving its connection pools. Here we go. Some blue. Some blue. You're going to tell other people I was talking to be, like, there was this part and he hit something and it was blue. It was awesome. And so that's because I went to BBC UK. So you see there's still a smattering of other things. It was, like, green and blue. And Tiger Woods on there. And then there's a guy with a frowny face so I had to click on him. And so that wasn't at all what I was expecting, by the way. So. Basically, this is the thing, right? This is the session thing. Okay. Okay. So that's cool. Now. Back to. Let's see if I can get back here. This is going to be the trick. All right. Cool. Good. Okay. So data storage. So how am I doing all that? Well, I do store it in array. I do. It does have to know. See, I was trying to make it as stupid as possible. I was trying to make the Arduino as stupid as possible. I was trying to make Perl script as stupid as possible. I just want everything to be stupid. Right? I was just trying to make everything stupid. So I couldn't do that because the Arduino had to be smart enough to know when I say close where it's at. Right? I have to be smart enough to know that I'm going to close the session. So how did I do that? I store the IP in the port and array. There's nine bytes per array. I had to do the math. It came out to, like, 1.2K. I was like, oh, my God. I took up 1.2K. That's such a beast. It's like bloated ware, you know? So there's the array, multidimensional. Isn't that awesome? Say multidimensional. It's different positions of the LED matrix and then I've got a little two hex command I wrote in there, a function to convert this stuff over. So that's some code there. Meter mode. So I said there's two views. Meter mode is the next one. Let me go ahead and show you that. Think about ‑‑ so this is the other thing I was thinking, and, again, the main thing here is just try to get you being creative. The whole idea of this talk is, okay, I did the session view, I did the meter mode. I want you guys thinking ‑‑ or somebody smarter than me saying, hey, what about this mode? What about this view? What about this view? It's all kind of stuff we could do. So this is ‑‑ and this is still on here. This is ‑‑ you know, I just realized this is still running, right? So I probably lost most of you probably staring at that thing. It's just distracting. Oh, here we go. So meter mode. All right. So now we're going to upload the meter code. There's two different programs. I originally had them combined into one program. One thing was that when I combined them in the same program, I think I ran out of SRAM. You don't know. You don't know. When the blinky lights start doing some kind of strobe-y, nasty thing, I think is the scientific term, and it just, like, I'll tell you, when this thing freaks out, it freaks out hard. It's kind of cool. Because I want to go back and just see all the different ways to freak it out. Okay. What this is, what my recording self is trying to show you here is that the different ‑‑ the different things you're going to see ‑‑ think about an equalizer view, out of like the ‑‑ out of, like, the‑‑. the 80s or something like your old stereo system. You know, it was really cool when you got a stereo system and all of a sudden it shows up and it's like, wow, I can see the notes. I can see the bass and I can see all the treble and I can see the notes and they're jumping up and down. Of course, that was a whole other stage of my life, right, where I sat in front of one of those all day. So this was where I kind of took it, which is this stuff here, we've got eight. So if we've got an eight by eight matrix, we've got eight lines to work with. So I'm going to define web, DNS remote, mail file. So these are different things. So web traffic, 80443, DNS traffic, remote protocols like RDP, SSH, mail stuff, like POP3 and SMTP, file protocols. I also put like Kerberos and things you would use to get logged into your domain controllers or whatever in there. So enterprise file sharing, whatever stuff. And then if it doesn't match, you can match that. It's an under 10. Under 10 is exclusive with those other things. If it's some other port under 10, thousand, other 10,000, I don't mean under finger or whatever it was, but under 10,000 is, I'm completely wrong. Somebody like, no, it's not 10. Somebody do it. So under 10, under 10,000 and then over 10,000 is going to be the other one. And then local is the only one that will pop up in addition to the other ones because it's going to be the other one. So if it's on local link, then it'll fire up there. So that's that. And actually, you know what I'm going to do? I'm kind of getting out of my own rule here. What I'm going to do before I do that is upload the, yeah, I'm going to upload it to the board we're playing with here. So I'm going to control C that. I got to get off of the serial before I upload the code there. Or bad things happen. So this is my other program. Originally, I had them both. Like I said, originally I had them combined. There actually is a way to combine these. You can do that. It's possible. It's definitely possible. The thing is that the, I didn't like the fact that my session view was getting clobbered by my meter view. So here's the meter view, okay, to give you an idea. Each of these being a different color. The colors we just looked at, you can define them however you want in the code. But basically, those little guys are going to jump up and down based on the kind of traffic you see. So let me run same, really, it's the same, I could do the same TCP replay thing. Let's fire this up again. It's going to reset, turn on, load up, and then I'm going to replay that. Okay. And so what you're going to see is stuff start jumping up and down. So you notice web is jumping up and down there. Don't worry, I'm going to show this on the big screen, too. Web is jumping up and down a lot. You're going to see DNS. A number of things just sort of, actually, I think I turned off DNS. This is something that's important about this program. I actually made DNS an option. There is one more little option here because I noticed that if you put DNS in the session view, you're just going to get flooded with DNS in there because DNS is, you know, your machine just fires those off like crazy. So actually, I'm going to do a redo here and add the flag DNS so that you can actually see the DNS. There we go. And you know, notice that the white thing is jumping up and down, too, as the DNS is jumping up and down. Well, that's because the DNS server is on my local network. So anything that's a DNS session is also going to be a local session. Okay. So let's show it on the big screen here. All right. So let's see. So there. See, my recording self is a lot smarter than DEF CON self because he remembered to put DNS in there. And actually, he's kind of, he's kind of, flaunting it because he highlighted it. You see that? That guy's kind of a bastard. So here's the meter. And there we go. So we're rocking out to DNS. We're rocking out like this. You know, the bass is hitting and, you know, somebody's just wailing the guitar. So then you hit the different stuff. Like I'm showing my kind of friendly web browsing here. There we go. So you notice. Now, remember that this is session based. If I send every single packet over this link, it would be a fire hazard. Right? So I can't send every packet. I have to send over 9600 bot. I have to send the link data, the session data. So you might be browsing and be opening up a bunch of pages on the same site. You'd be stupid. No, Steve, this shit doesn't work. And it'll be like, no. And then you've got to remember that I said this, that it's only when you open up a new session. So if you go to another page, then it'll start working again. And hopefully I'll be off the hook. So there's just, like I said, a lot of generic browsing going to different sites. So that's kind of fun. And then I think here somewhere I start to get into another protocol. So, again, now at this point, let's see. So there's some stuff. You know what that probably is? That's probably Skype. Skype is actually a really chatty son of a gun. What you'll see, too, this was actually kind of fun while I was working on this. I actually had it going a lot of times as I was working. I just sort of have it going on the desk. And actually I got really attached to it. So I'm going to show you a little bit of that. I go to bed with it at night now. But the thing is that what you'll see is we have a dispersed team. And somebody over from Sao Paulo, my friend Rodrigo, will send me a message. Oh, there's me doing ‑‑ there it is. Remote desktop. I know you guys would appreciate this. There's no CA, right? I thought you guys liked that. So, look, there's some other colors. You know? And then I think that one was purple. So then you can say then after it was purple, you can say then after it was blue, it was purple. So then it goes to remote desktop. So you get the picture. You get different file sharing stuff. You get different colors based on what you're doing. So the whole thing is it was fun with the session view. What I would see is if Rodrigo was about to send me a message, it's that thing that says Rodrigo is typing on Skype. And so before I even knew Rodrigo was sending me anything, I would see the color for Sao Paulo, for Brazil, which is magenta, it would show up. And I would be like, ah, Rodrigo is going to send me a message. And bam, Rodrigo sent me a message. It was really cool. And then it was like my other buddy Tom McKenzie over in the U.K. says he's going to send me a message. And all of a sudden I see blue. I'm like, ah, Tom McKenzie is going to send me a message. So that was kind of fun. It's kind of cool. You actually learn a lot about how your different protocols work. Oh, here we go. I didn't show you this. I should have been talking about this. This is the whole thing, right? This is the whole ‑‑ this is why this is kind of interesting. Security. This is why this is kind of interesting. Security. This is the security application. What I'm doing here is I'm going to actually launch a port scan. So it didn't really zoom in. I probably should have zoomed in there. Maybe I did. No. So I did an end map. Up there in the corner in the left‑hand corner is an end map. And check it out. Holy crap, the thing is pegged. This is that part where it's like I turn the car and it makes a funny noise and I don't know what the hell is going on and something is wrong and you start talking about warranty and you look at the fine print and you realize you're out $1,000. But this is that part, right, where you know something is different, the pattern matching thing. It doesn't usually do that. If I was in a call center and I had no idea about computers, I had no idea about networks, I could stand up and say something is effed up. Something is wrong. The blinky lights, they're doing weird shit, man. So now we get to the fun part. Now we get to see ‑‑ okay. We get to see something cool here in a minute. This was my thing about no handshaking. Message size 32 bytes, 37 messages per second is probably about the most we can get. There is another thing. The great thing about embedded, the great, awesome, wonderful thing about embedded is, you know, any time you have a really, really difficult computer science problem or whatever, you talk to people and they're like, disks are cheap. Processors are cheap. Computers are cheap. They're cheap. They're cheap. They're cheap. They're cheap. They're cheap. Computers are cheap. Let's just solve it by, like, throwing just a whole bunch of really, really heavy instructions at it and it gives a crap so I can go, you know, make it a happy hour. So that's not the case here, right? You actually ‑‑ it's almost like playing Sudoku or something. You actually ‑‑ it's a puzzle. You have to figure out from the beginning you're screwed, right? You have to ‑‑ you know that you have to be very, very careful and you have to be performance conscious from day one. So you have to do the math, do the nice 600 baud, two bytes, and I have nine ‑‑ you know, you have to be very, very careful. Nine bytes or whatever. I did the math. I could get about top end 37 messages per second, probably realistically only about 32 messages per second. So the other thing was in session mode I had this thing that this concept that you're going to hit a ceiling and the problem is you're going to fill up 128 lights and then you're not going to know if you're getting port scanned. I really want that whole thing about, oh, man, something screwed up, right? I want that concept. So I made something called inferno mode. Inferno mode is this meter ‑‑ that needs to ‑‑ that basically keeps track of how many connections are coming in and I preferred ‑‑ you know, I was thinking preferably something kind of psychedelic, you know, to like ‑‑ at least if you're getting, like, totally owned, you could be like, whoa, cool, look, man. My blinky lights are like, oh, fucked up. So overload detection, right? Define overload 90. You can define this whatever you want. That's conservative. This is a very conservative number. If the number of commands are over overload, mode nine, you can define is the bad one, right? So ‑‑ so I'm down to ‑‑ I'm down to five here. So I think this is actually going to work out just about right. Here comes inferno mode. Port scan. Just going to end map ourselves. You know, it's a good example. It's reconnaissance. Somebody is doing reconnaissance. Okay. So, yeah, just one, three, six, five, five, three, five. . So I will let you know, I didn't do the plasma effect, but I did the frowny face. Okay. Yeah, so that's the whole thing, right? So I think ‑‑ I think that's kind of the international symbol of you're screwed, right? Actually I tried to put ‑‑ it's pretty sad because you don't have a lot to work with. You know you're kind of screwed when you don't even have enough room to write LOL. So that is the high point. From there, just so you know, the little thing about the Perl script I'm running on here, it does work on Snow Leopard, which is cool. It does work on off course Linux, BSD, whatever. It's just Perl. Had a little bit of trouble getting it to work on Windows. I think I'm going to take another stab at that because I think, you know, to make it universal, we've got to get Windows in there, too. So I'll probably be putting something on the website about this. All open source, of course. Fairly good stuff. So I'm going to stop there. We're going to go to the next one. It's fairly simple. It's using GLIP. I tried to keep it to a minimum on the requirements of Perl scripts, so hopefully it's not too hard to get going. There's only two messages, open and close. You can make your own. You don't have to use my Perl script. All it's doing is it's doing what ‑‑ you know, you can do this in Ruby, Python, you can hook up SCAPI to this thing, you can do whatever you want as long as you can talk to the serial port over an i600 bot and send those funny little messages that we were talking about earlier. Heck, you can take the serial box code, figure out how it works, how a network engineer would approach this problem. And change some stuff. The other ideas I had were, like, maybe you could make an Ethernet version of this. There is such a thing as Ethernet shield. It would eliminate the whole USB thing, but honestly, I think it would probably be really, really poor performance, so I don't know about that. Maybe there's better host site programs. Of course, the most important one is bigger LEDs, right? That would be the big feature add there. And there's some links. So what do you think? Pretty cool. So that's what we have.