It is now 2.04. Thank you so much for being here at the Packet Hacking Village at DEFCON 24. Again, we cannot thank you enough for all your overwhelming support throughout the whole day. You know, we knew we were going to put together a good product, but we did not ever, ever, ever imagine that. It would just, like, be all the way back to the room. And thank you all so much for all your support, not only just today, but also for all these years. You know, I remember that Jay Beal was saying, Jay was saying, yeah, I mean, back in the days, I mean, it was literally, we just had to scribble username and passwords and put them onto the wall. In fact, it's actually much worse than that. We actually had to use paper plates back in the days. Back at the, yeah, back at the Alexis Park days, it was all done using paper plates. It was all done using paper plates. So, we got a, yeah, we have a never-ending stream of, like, stuff to give away. And I guess while we're waiting for Gray Raven for his talk, I got two mices here, courtesy of F5, to give out. So, I have the dream of a, you got a good question to ask? A trivia question? Something that's technical or something like, like something that, of education? Probably not really, no. Okay. Oh, boy. What does DTLS stand for? Huh? DTLS. Oh, oh, oh. You ask. No, you ask. No, you ask. Go ahead. All right. DTLS. What does the acronym stand for? DTLS. Does anybody know? What is it? Oh, yes. There we go. Right here. Diatagram, is it Diatagram Transport Layer? What? No, no, it's not Bluetooth Low Energy. Okay, here's a good one I like to get. The HTTP protocol. Hypertext Transfer Protocol. HTTP. We all use it, right? We also know that as a plain text protocol, right? Can someone explain how it works? In the shortest form possible. How does HTTP works? Okay, I am looking for, what I'm looking for is if you, okay, it is, I'm looking for two words, fill in the blank, let's start with an R. Oh, it is request respond. There we go. And question. Client server. Okay, I'll get one here. All right, here you go. Courtesy of, whoa, whoa, whoa, I'm not going to, I'm not going to spill, no, I'm not going to spill, oh, no, no, I'm not going to spill, no, I'm not going to spill drinks. We don't want liability here. Okay, also on the HTTP, we're talking about status codes here. Okay. Okay. Okay. Okay. What is the status code? What is the status code for unauthorized? Who said 401? Uh, I've already got something, I know that. So let's be fair. Who said 4-1? Who said it? Okay. Way in the back. Way in the back. Here we go. Okay. So another one. I just want to decide while we're waiting. Yeah, we got two minutes left. We got two minutes left. Okay. So. Oh, we got another one. Okay. We got another projector. You should know this one. I think everyone have encountered this. This one is the internal server error. I heard it in this side. You ready? This is going to be a toss-up. You ready? Ready? Thank you. Okay. So it is. We got a minute left. We have a minute left. Welcome. This talk has been a long time coming. And this gentleman here that we have, he's been a friend of the Wall of Sheep for a little while. You said at the end of last year that you want to give a presentation. You said at the Speaker Workshops. And so here we are. And of course, this is, I guess, one of those things that, you know, you check off as that bucket list. And, you know, I was, like, noticing, I was conversing with this gentleman. I was like, wait, what do you go by? He's like, no, call me Gray Raven. And I was like, okay, okay. All right. All right. So I can tell you right now that this is going to be a little bit of a, let's say, a little bit of a, a little bit of a provocative talk. And it is my pleasure now to introduce to you Gray Raven. All right. Afternoon. You guys having a good DEF CON? Good? Okay. So I actually can't see anybody when I'm right here, which is kind of cool. Because now I think I'm just in a room talking to myself, which is usually how I prepare for all of my talks. Just so no one actually hears the bad approaches. With that in mind, do you guys mind? I know it's the Packet Hacking Village. I know it's DEF CON. You may not want your picture taken. So if you don't, just put your head down for the next second. But no one's going to believe that I was here unless, you know, there's a photo. That's what I keep hearing on the Internet. So I'm going to step out of the light, snap a photo of the room. And if you don't want your face in it, you know, you can either do a thumbs up if you do, or you can put your head down if you don't. But anyway, give me about two seconds. And I will start my talk. All right. So if you want to be in the picture, say, geez. All right. Here we go. Ready? One, two, three. Sweet. Thank you. Okay. So, you know, I could point out that I did just manipulate everybody in the room to letting me take their picture. So back to the title. You are always being manipulated. So before we kind of get into that, this talk came about because I ended up becoming a father about three and a half years ago. Yeah. Very cool. And so, you know. So my name's on the slide. I figured you guys didn't want a three and a half year old running around while I was doing it. So my daughter's not here. And that's okay. But, here, let me do this real quick. Sorry. Getting used to the new layout. I want to say a quick thanks to Tony for loaning me his laptop and mine decided not to work. So as I said, this is my daughter. This was one morning we were just playing around with my cat. And so, this is really a story about her. So I'm not going to tell you guys about me because I'm, you know, I'm like a lot of people out here. I'm an MFSEC nerd. It's really what I do. You guys already know that. I could tell you all that stuff. But so let me tell you about Lena, my daughter. She is the hero of this story because she's the reason why I can then tell you guys the whole plan. And what the plan is is that children are natural social engineers. They have a certain, and I hesitate to say this because I have my daughter. She's a really cool kid. But they have a certain moral flexibility. I think we can all agree about that. They have goals. They go for them. And that's great because, you know, after you kind of give up hope and you realize my own daughter is manipulating me. What hope do I have with strangers out in the real world? You can start to focus on how we can use this. And that's really the important part. So you guys may, half of you probably are like, yeah, I already know I was being manipulated. It happens all the time. The other half, maybe not in this room, but we'll go with that. You guys may be thinking. You may be thinking to yourself, why did he say that? Well, the truth is you're always being manipulated. Some of it is benign. Some of it's malicious. And I didn't really catch a lot of this because, you know, I'm not the smartest guy. It's just kind of I'm very shocked to be standing up here because there's a lot of smart people that are always speaking at DEF CON. So I happened to notice that my daughter was manipulating not only me but other people. And she was doing it in ways that you would, you know, us adults, we pay like thousands of dollars in training to be as good as she is. It's true. You know, we have bounds that we got to stand within. She doesn't. So most of these interactions, like I said, are not malicious. And once I realized that these manipulations are happening all the time, it allowed me to kind of think about things. Now, before we get into like what I actually learned, we got to know all the players that are involved in this new world we're in. I guess I say new, it's probably old. Everything that's old is new again. So let's start with the good guys. Now, on the left, we have... Corporations, advertising. You know, they have billions of dollars. They want you to buy stuff. They spend billions of dollars so that you will buy stuff. It seems pretty straightforward. And I put a question mark because really and truly, good guys? Maybe, maybe not. And then we have friends and family. As you can tell from the picture, my daughter is winning at the moment because I have no idea where I am. And I really have no idea except that she wanted me to go that direction that she's pointing. And I did because I was beat down. And on the right, we have... Pets. Now, I include pets because really and truly, if you have a pet, you've taken in a small, strange animal. You have fed it, cared for it, you love it. And, you know, yeah, it's soft and it's friendly and all that stuff. But I mean, really, with cats, it's kind of a toss-up, right? They may love you. They may not. They're cats. And I will point out that this does meet the requirement for any InfoSec talk of having at least one cat picture in the video. You always got to have one. I now have mine. And I would have more in the talk. I always hate to disappoint some people who are cat lovers in the room, but I could not find any more cat pictures on the Internet. It was weird. They just weren't there that day. I don't know what happened. So then there are the bad guys. And let me point out that when you stumble across a picture of a pirate with a butter knife attacking a computer, you add it to the next presentation that you have because it's a... When do you ever see this in real life? So the bad guys. Let's go through the list of the usual stuff. We have the usual suspects. We have the obvious con artist and scammers. We have, you know, the phishing and vishing attacks that we're all so familiar with. And I do include watering hole attacks in this kind of approach because they're taking advantage of something that you trust, a well-known site, and then they're injecting something bad into it. So still similar. And then coming back to my favorite, advertising. Because once again, really, are they the good guys or the bad guys? So we know who our good guys are. We know who our bad guys are. Now, to explain a little bit about what we're going to get into, the good guys are our training partners. They're the ones who create kind of a low-risk environment where we can realize what's happening, the dynamics of a social engineering attack, kind of in a safe environment. So the bad guys are the ones who want to steal our money, you know, give us, you know, get away with lots of stuff, get us to do things we're not supposed to, compromise our companies. So they're what we're training for. So let's start with the thing that is the basis of all social engineering attacks, trust. So once again, I pointed out, you guys let me take a picture of you. And you guys also have a little bit of trust in me because you're sitting here. If someone left the room, since I can't see that, cool. You know, you may have learned something. But, you know, when you look at the case with my daughter, she has, I mean, I have a ton of trust in her because I've known her since the moment she was born. I've known her since the moment she was born. And so this both works to her advantage and disadvantage. But with any social engineering attack, you have to build trust with the target. Or, you know, in the case the attacker has to build trust with me because I'm trying to defend. So let's look at my daughter's example. Now, here she is. She's adorable. Half the room probably wants to give her a cookie right now just from the picture. And this is a question that I get asked almost on a daily basis. Papa, are you happy with me? And unless she's done something immediately before asking that question, that has made me frustrated or angry, my answer is, of course, I'm happy with you. So this is the thing. She's already started with the ask. You know, Papa, are you happy with me? She's building that trust. She's taking advantage of the rapport between us. And then I respond as a parent favorably because I want my daughter to grow up, you know, healthy and psychologically stable and all that. And so I say, of course, I'm happy with you. And then comes the tail. She doesn't ask this. She tells me this. Then I will have chocolate for dinner. So as you guys can see, this is not overly complicated. This is a complex attack. I mean, she's 3 1⁄2, but it will get better. Trust me. But she's taking advantage of a very basic principle and something that, you know, if you're not in the moment and it's somebody that you do trust or someone that's built trust with you, you could potentially fall for it, especially when it's not quite as, well, let's just say my daughter lacks subtlety at times. So this is what she does. Now let's see how we can defend against this basic attack of trust. You guys are pretty familiar with this be cautious. We are at DEF CON. We are pretty much cautious. I want to say pretty much in our nature. So how can being cautious help us? Well, it makes us slow down a little bit, you know. I'm trying to think of the best way to say this. So like trust is the foundational beginning of any attack, being cautious is the foundational defense. And when we are cautious, we slow down and we think. When we can think, we evaluate the situation and we really see what's going on. So you'll see that caution is kind of like the thing that follows through all of the basic defenses. Next defense, we all are familiar with this phrase, trust but verify. I used to work as a software engineer until about three weeks ago, and then I changed roles. And when I was working through code, you know, someone would say, oh, this is how it works. And you're like, okay, you're a good programmer. I trust you. But I'm just going to go look at it to make sure that's actually how it works. And so this is what we need to do with other people. We trust but verify. And I want to put this in here because I don't want you guys to think that in trying to defend yourself against social engineering attacks, you need to be distrustful. I trust myself. I trust my daughter. I trust the people around me. I trust you guys in the room. You all seem pretty cool. And so it's instinctive. You know, trust is what helped us as humans survive. It's what helped us build civilizations. So we have to have it. But we don't have to just trust blindly. We can actually, you know, verify the things. So we verify by going through independent sources. So in the case of my daughter, returning to her because she's our good example, I usually go to my wife for independent verification. Because, I mean, we can all admit it. My wife is the one who actually knows what's going on. I'm just here and trying to get through day by day, usually with the help of a lot of coffee. So when my daughter asks me for something and I'm not quite sure, I go to my wife and I'm like, hey, do we need to do this? And she usually says, no. What are you, an idiot? And I say, good call. And then I go back and tell my daughter, no. So now we've kind of got this basic example. You guys kind of see where this is going. Now we're going to look at a real world example. And it's my favorite. This is Dan. He's from IT. He's here to help. And so Dan has actually taken advantage of two things that we know and trust. So he's taken advantage of trust in the fact that if you are probably not one of us or not in IT in general, you don't really trust IT a lot. There's always that hesitation because when they say they're there to help, it's usually to stop you from doing something that would be cool and awesome, and they just don't realize that yet. So there's also the actual pushing of authority. And most companies, IT has a certain amount of authority, especially over in the United States. And it works in systems and keeping everybody safe and all of that. So Dan is applying these two things. So he's going to build trust with our target. He's going to say, okay, well, I need you to install some updates. I want to make sure that your system is fully updated because we have reason to believe that we're under attack because that's happening all the time. And then if Dan's done, comes up with a good approach, people will say, well, Dan, I appreciate that. My computer is up to date. I'm pretty on top of that. And Dan will say, excellent, because he wants to continue to build this report. And then he'll say, I just need you to verify through this website X. We'll call it X because we know there's probably some other website. And what you'll see is that this is a little bit more complicated because Dan is actually applying a couple of things. He's trying to create a little bit of an urgency. He's trying to get the person to do something not quite as straightforward as my daughter just saying, I'm going to have chocolate now. So how do we get around this? Well, we first are cautious. We are on the phone. We don't really know who Dan is. He may be from IT. I work for a rather large company right now. So I have no idea who any of the IT people are in my company. So there could be a Dan. Probably is a Dan. But I don't know that. So then I have to trust but verify. So the way you trust or verify, it's pretty easy. You just say, hey, Dan, I appreciate that. I'm in a meeting right now, or I'm really busy. Let me just call back later, and I'll make sure I go to the website and verify. So it could be legitimate. It could not be. We kind of get through it. We're using the tactics that we saw. So the next level my daughter developed was this. So for those of you who don't know this, I'm going to give you a little bit of a review, who may not be familiar with the term reciprocity. It's creating an imbalance, because naturally, as humans, we want to recreate this balance. So you'll give somebody something to kind of make them beholden to you. And when my daughter learned this, it was actually pretty cool, because it showed me that she's evolving in her attack strategy, which, for a crazy person like me, that's awesome. I kind of encourage this. It's like, yes, do this. Keep attacking. And that's the great thing about children. They evolve quickly. They adapt quickly. And so it keeps you on your toes when you're training against them. And let's be fair. My daughter is the trainer. I am just the student in this case. So if anyone has children, you know that they don't clean up anything. We had a clean house, and now there's toys everywhere. I'm not sure how many toys there are in the house, because I step on them like every two footsteps. So one day, my daughter says, Papa, look how good I'm cleaning. And she actually had found a vacuum cleaner, drug it out, and started pushing things around with the vacuum cleaner, as you can see. And so the opening is to give something unexpected to the parent. And this is a great approach, right? We want to give something unexpected to the parent so that they will feel beholden to do something for us later on. And then she reinforces that. And she said, look how clean I made it. I did a good job, right? This is great, because now she's using that trust again, right? And so I should clarify. I'm not making these up. I actually wrote these down when I had the idea for the talk. These all actually happened. And I wrote down word for word what had happened, just so you guys can understand that this is like real world scenarios, even though they're low risk. And then she came up with the ask. Since I did a good job, can I have candy? Hmm. Well, that's a pretty small ask for what, you know, you cleaned up stuff. Okay. So it's pretty easy for that request from my daughter. It's more of a mental exercise of seeing what she did and understanding the attack. So what helps us with reciprocity is the first defense of do I know this person, right? Well, with Lena, once again, I've known her since the moment she was born. This actually is a disadvantage for her in this case, because I know her. I know her motivations. I know all of the attacks she's going to come with me at, or come at me with. However, with most people who are going to try this attack, you don't know them that well, or you may know them just a little bit. So how well can you trust this person? Once again, it makes you want to be cautious. You know, don't just accept that they're giving you something that's good. Keep going. So after you kind of analyze how well you know the person, you want to move on to looking at the actual situation that you're in. Is it more give than take? And so when you add urgency to this, it's a little hard to do this. You know, someone who's going to come with you with a repressive prosody attack is not going to say, you know, I want you to think about this. You know, give it a day. I'll come back tomorrow. They're going to try to like get you to move right now. And that's to interrupt this part of your brain that can actually evaluate, you know, these approaches. So instinctively, we're going to try to seek this fairness and balance in all of our, you know, interactions. And when we like somebody, we kind of want to give in to that. So, you know, if they've built a good bit of trust, they've built, you know, rapport with us, we're going to kind of want to give in to that. And we want to make this balanced. And the key is that the reason why this is very important to practice is that we're not very good at judging that in the situation. We really need time to analyze it. So, yeah. And this is my actual, my favorite real-world example because we're all so familiar with it and it brings me back to my favorite people in the world, advertisers. So everybody. Some people may not recognize this. This is Billy Mays. You may know OxyClean, the product. And you obviously know that phrase, but wait, there's more. So let's go through the attack. There's the opening. You know, I don't know about you guys. I stay up pretty late at night. And if the TV is on, granted, there's probably not that many infomercials anymore if you're, you know, doing Hulu or Netflix or whatnot. But you would see a TV commercial at like 3 o'clock in the morning. And you would think that it was part of a program because it was like, you know, all kinds of things were happening. And the opening. They would show you a product. And it's like, do you need one pound of OxyClean? No. No, I do not. Well, that's not true. I'm a home brewer. So, yes. Yes, I do. But I don't want to pay all the shipping and handling for you guys. So they're going to give me something unexpected, right? I'm watching this. I'm tired. And then they're going to say, but wait, there's more. If you call now, we'll give you three pounds of OxyClean. Oh, hang on. As a home brewer, I really want three pounds of OxyClean because I want to make some more beer. And that seems like a good deal. But, you know, I'm still not sold. So then they're going to reinforce it. You won't find a deal this good. Once again, 3 o'clock in the morning, I may not find a deal this good. And I only have five minutes to act. So let me think about that. Yeah, I'm probably going to buy the OxyClean. And then comes the ask. You know, right after they've told you how good of a deal it is, they're going to say, can you afford to pass up this offer? Well, as a home brewer, probably not. I really want to have lots of beer around me. And I like it when I make it. So I may fall for this one more than I should. I'm not going to lie. But that's, you know, we see the same attack. It's the same thing my daughter did. You know, they are going to give you something unexpected. They're going to kind of balance it out because they only want you to pay shipping and handling. You know, decent deal. So this leads us to the last part of our three kind of primary attacks. Now, if we began with foundation of trust, right, and then we start creating balances, we want to finish with this linchpin of any kind of good social engineering attack, which is we want to create urgency, right? And so I know what you guys are probably thinking. How can a small child create urgency in a situation? I mean, I'm the adult. I kind of dictate the pace of everything, right? Well, children, especially when they're infants and a little bit larger, have a secret weapon. It is biologically wired into your brain that the pitch that a kid makes when they're crying goes to a part of your brain that makes you want to react without thinking. It's instinctive. It's built in and biological. So to explain this story, because obviously there's not a lot of text up here, my daughter had very long hair, and then she wanted to get it cut. And so we cut it, and she asked the stylist if she could put it into an Elsa braid. Now, I know there may be some people out here who have not seen the movie Frozen 9,000 times like I have. Elsa is one of the main characters, and she has this nice braid that comes down the side of her head. So my daughter loves having an Elsa braid because she is a small child who's watched Frozen 9,000 times. And when she was told that she couldn't have it, she cried, Papa. And then there was just a wail of noise after that. I really had no idea what was going on. And as a parent, I rushed over. What can I do? How can I help? And so urgency. Force the parent into immediate action, right? And then after you force the parent into immediate action and I get her to calm down, you want to comfort the parent because you want to reinforce that rapport and the trust, right? So she comforts me. It's okay, Papa. It's okay. The hand gestures are there as well. She has little tiny hands. She puts them out. And then I don't even know what she wanted. But then she said, Can you get it for me, please? So once again, she has, you know, she's calmed down. And then she's asked for something. Now the urgency is there because if I say no at this point, she's in a very fragile emotional state, right? She's going to start crying again. This is what's going to happen. Everyone who is out there, if you've been around small children, you know this. They cry for really no reason at all at times. So this leads us to lesson one in the urgency situation. Follow the process. Now you may be thinking, what process? Okay, good. That's a good first step. Develop a process. And then once you've developed the process, train in the process. Make sure you can say the process in your sleep, especially when dealing with small children and malicious attackers. And then you always want to follow the process, right? Once you've got a process in place, you've trained with it, you're familiar with it, you want to follow it all the time. Do not deviate from the process. For there lies dragons. Lesson number two. Remember lesson number one about always following the process? Seriously, always follow the process. If you don't follow the process even in one instance, that's it. You know, attackers only need one chance. That's all they need. So we have developed our process. We are following our process. Let's take a look at our real world example. All right. So a lot of people in the room laugh at this. So I'm going to kind of tell it from a different point of view, right? And to be honest, I have a psychology major. I could do an entire talk just on the most awesome things that are in this actual attack, this pop-up. So there are a lot of things that draw you to the areas they want to and a lot of ways to get you to do the things they want to, especially, and this is the important part. The people who are going to see this and not immediately go, yeah, right, are really 90% of the companies we work with, right? They're the marketing people. They are the normal, non-tech power users. And when they see this, the first thought that goes through their head if they don't have a process is, oh, my God, I'm the person who just got our company owned. So they think they may have done something bad. Now, they may have actually been doing something bad. We'll save that for another talk. So the first part I want to point out is everything is in red. And that's, you know, why do we stop at stop signs? Because we're trained that red means we stop, right? My daughter at one, when she first learned to talk, knew that red light meant stop. Once again, children are amazing. And so what you want to do is you want to force the target into an immediate action. They create the urgency because the pop-up comes up on top of whatever you were doing, right? So you get scared if you're one of these people. And then they draw you to the things that they want you to see. The virus is all capitalized and underlined whereas everything else is lowercase. Credit card, account, all of these things are underlined. And, in fact, what I love about this is it doesn't even say that your computer has a virus. It just says it may have a virus. But you don't really pay attention to that. You see virus. And you see a phone number. And then comes the best part of this attack. We detected and we can fix the issue. They've reinforced it. They're comforting the target. Okay, cool. I made a mistake. But these nice people on the Internet are going to help me fix it. And then they reinforce it to get the action that they want from the victim. Click here to fix the problem now. Well, in this case, you know, it's call this number and give us your credit card numbers. But it's the same principle, you know. It's this. It's this and this. So, we're starting to draw it from that mindset. Because that's really what we're talking about is that, you know, we're specialized individuals. We kind of know the reality of the world. We dove into the Lovecraftian madness of the realities of information security. We know how dangerous people can be. And we know how bad things can be at times. So, in social engineering, you kind of have to look at it from the other side. This person is really thinking they've just gotten the company owned. And so, they're going to click without thinking. So, we want them to slow down, be cautious, follow the process. So why, you know, I've been sitting up here and I gave you guys some examples, and you guys have very patiently listened to me talk about my daughter, which I appreciate as a parent. That makes me very happy. But I really wanted to teach you guys something here, and so it's this. We pay, you know, lots of money for training for everyone in our companies and to train ourselves to be better at detecting social engineering attacks because, you know, really and truly, you know, we have the wall of sheep, and I love the wall of sheep. It's the most awesome thing that I can think of. But at the same time, we constantly are getting, you know, infiltrated and owned through, like, spear phishing attacks and through, you know, clever manipulations by people because you're always being manipulated. And yet we spend a lot of money on training, but we don't seem to be making any footholds. Actually, and I will say with one caveat, it does seem that some of the phishing attacks have gotten kind of gone down. We're starting to get people to realize because we're changing their behaviors in that way. But in general, we train people in a different way than the attacks are going to happen. You know, it's kind of like this. You have a guy on stage, and I tell you about all this stuff, and you guys are sitting out there, and you're listening, and that's what we do with our company. We tell them about the attacks. We tell them how they're set up. And then we expect them not to be nice, you know, people and hold doors open for the next person coming in. It reminds me, I saw a talk, I think, about a year ago that Jason Street did where he said, you know, I don't focus on the hard stuff because the easy stuff still works. That's really, you know, the downfall. So why do I think this program is different that I've been trying to convince you guys of? Well. It's very simple. In this one, I'm training like I fight. The attacks my daughter is doing on me and the attacks that are kind of around us all, even benign ones, they're exactly the same structure as a malicious attack is going to happen. Now, the malicious attack may combine multiple factors, may be a little more subtle. But if I'm training in the basics and I have a strong foundation, I'll detect and be aware of the things that are happening around me. So what I want to point out is, and I actually don't do Brazilian jiu-jitsu. I do train in other martial arts. But if you look at the guy who's on his back, right, he's in the guard position. The guy on top is trying to get past his guard because he wants to win. But if you'll notice, the guy that looks like he's at a disadvantage because he's on his back and he has this other person on top of him, look at his face. That guy is calm. He is very relaxed. He knows, I've got this. I've trained. I've trained to defend the guard position forever. I'm good at this. So we train like we fight. And it's, you know, it's basic. Basically what I'm trying to do with this thing that I've developed and now I'm just trying to share with you guys, because really the secret is you have to go out and create a personal program for you. You kind of will discover where your weaknesses are and then you can create a low-risk environment to start hardening up those weaknesses. So that's the first part that I wanted to say to you guys is, you know, train like you fight. You know, make sure it's low-risk. You don't want to jump in the, you know, the deep end and start, you know, going out there and finding every phishing email that you've ever gotten sent and be like, okay, I got this. I'm going to just click on things and make sure it's low-risk. I'm going to make sure it's legitimate and we're good. And you don't want to just go find, like, you know, a great con artist and have them pull a con on you because, I mean, you're probably going to lose. You got to train in the shallow end before you can start swimming in the deep end. Second thing I'd like to point out is you want to reward your training partners. So now I've used a lot of examples because my daughter's main motivation is candy, cookies, sweets. You guys see where this is going? There's a theme here. Reward your training partners. And, you know, pets, they're pretty easy. You know, pet them. Continue to feed them, love them. And with my daughter, I do occasionally give her cookies. Actually, what you guys can see right here is that she had pulled a successful attack in the middle of a mall on me. And when I say a successful attack, I should point out it's not like even though I am a sleep-deprived parent that when she said, you know, I want a cookie, I immediately said, okay, cool, let's do this. No, but if – so I should point out with small children, the way that you do this is if your child does something to you or if your training partner, pet, whatever, does something to you and you move without thinking, you lost. They won in that round. So, you know, reward them, point out what they did. And actually, the fun part is now that my daughter is almost four, I'm teaching her what she's doing. So I'm making her more dangerous. I hope to bring her here next year, so you guys watch out. She'll pull things on you. It'll be awesome. Now, I will say there's one caveat to our training partners. Marketing people and advertising people, I've made a couple of jokes about them already. They really don't need any more encouragement. They get paid. I mean, they get huge budgets. And really and truly, they have perfected the art. They're one of the best examples. You can watch. Once you start being aware of the things happening around you, watch commercials. I now actually go out of my way to find commercials and watch and just see if I can identify the different ways they set up their cells. Because that's the way you learn, right? And so now we have to remember we've built a training program. We are going to co-co-opt, you know, small children everywhere, hopefully, in good ways. And use them as training partners with the permission of their parents, if you are not the parent. And we're not going to – And we're not going to encourage the advertisers and marketers, right? Okay. So we have to remember what we're fighting against, right? So once again, this guy is in a full tactical hoodie. He has a laptop and a keyboard with three monitors. You put that in your presentation because I've never seen that before. And somehow it's awesome, right? You guys are thinking to yourselves, that's pretty cool. That's right. Yeah. I only have two monitors as well. Yeah, yeah. Three things go downhill. It's just too much stuff on the screen. But we've got to remember, right? The pressure is constant. You're always being manipulated. I mean, guys, we're in Vegas. You're always being manipulated. Everything from the lights on the casinos to the sound the slot machines make to the way the layout of the casino is made, the advertising all around you, the stuff in your room. The only moment that you get any peace is kind of right now during this talk, unless I'm really manipulating you. And when you're asleep. And even then, you've been. Bombarded, so you're probably having dreams about weird Vegas stuff. I know I am, but, you know, that could just be me. So the good news is everybody in this room is a hacker. Whether you think of yourself as being a hacker or not, you're here, you're playing around with stuff, you're listening, you're learning, you're adapting. That's really the hacker mindset. So the good news is, is we're all very capable of going out and building our own personalized training programs and becoming better and then teaching other people how to become better. So remember the attacker. Hackers are going to apply constant pressure, they're going to create urgency, they're going to build trust, they're going to create an imbalance so you're going to want to move, and they are well-funded and well-researched. They know this stuff better than all of us, really. And they're going to be much more subtle than my daughter's attempts, so remember that. And with that, I'm a little bit early, but that's okay, I've got a couple of things. Does anybody have any questions? I was going to say, if you don't, I do. Oh, we've got one. Yes, sir. Where are the exits? Where are the exits? No clue. So we'll say, to talk about... Oh, right, okay, so there's an exit over there. There's probably one over there, just guessing. No, that's a window, so go over that way. I will say this. When Ming introduced me, he said, you know, I've known him for a while, I did meet him last year, and I hung out for a while. That was my first DEF CON, and now I'm here at a village speaking. So what I would say is that you may think to yourself that you don't have... You don't have ideas, and you may think to yourself, you know, I don't know what I could talk about. The fact that you have a unique experience, I mean, you guys let me sit up here and talk for 30 minutes about my daughter and social engineering, and you're in a packet hacking village in the Wall of Sheep, so somehow this has worked out for us, I think. If you have an idea, put it together, submit it. You never know what can happen, and we need more speakers, and we need more people doing that. So if there aren't any other questions, you know, feel free to reach out to me, contact me. I'll be here through Sunday. Find me. And thank you for letting me speak. Thank you. Thank you so much again, man. Thank you. And yes, 308. So I just want to introduce the... I would like to now introduce the next speaker, Damon Small, also known as Chef. He's a diehard sports fan. And anyone from Louisiana here? Anyone from Louisiana? Anyone? Wow, no one. Anyone a fan of the LSU Tigers here? Okay, he's a fan of the LSU Tigers. He's also a dad, he's a hockey player. Oh, thank you. We'll stop that. And so now it's my great pleasure to introduce... Someone we've known you for a while now, Chef. Thank you, Ming. Very much appreciated. Let me log in. Sorry. All right. Thank you all very much for coming. Thank you to the Wall of Sheep for putting this on. Thank you to all of you for coming every year. This is my second year as a volunteer with the Wall of Sheep. It's a lot of work, but it's a lot of fun. And I'm privileged to not only be a volunteer with this great organization this year, but also here presenting to you. And thank you all for coming. This is where I did a new location here on the 26th floor. We're thrilled that you continue to support us in the way you do. As Ming mentioned, my name is Chef. You can call me Damon as well if you prefer. I do have... I have a son that's a hockey player, as he briefly mentioned. I want to just briefly and selfishly give a shout-out to my son, Ex-Nevis 24, who turned 13. Turned 13 today. So I am the father of a teenager. I am not at all qualified to have that job. Yeah. So shout-out to Ex-Nevis, Brody's his real name. And I want to talk to you today about Eisenhower and the Interstate. And, excuse me, Eisenhower and the Internet and what those two things have to do with one another. So a brief introduction. I need to also thank my employer who is supporting me being in here, being here today, NCC Group. We're a global security firm founded in 99. We're very big, 1,800 employees globally. You can read that. But I'm happy to answer questions if you like. But let's just move on. Enough about them. Let's talk about me. My name... That was a joke. Didn't work this time, did it? All right. My name is Damon, technical PM for the NCC Group. I've been in InfoSec since 2001. I've been in IT since 1995, in InfoSec since 2001. As Ming said, I am a Louisiana native. Been in Texas for 20 years. And as we say in Texas, I'm not from Texas, but I got there as fast as I could. Studied music at Louisiana State. Go Tigers. Don't anyone throw anything at me if you're not a Tiger fan. And I went to grad school in 2005 for information assurance to try and make myself feel like a legit geek, I guess. So I've done a lot of blue team InfoSec and health care for the DOD and aerospace at the Johnson Space Center in Houston and also in oil and gas. So that's a little bit about me. And let's jump into Eisenhower and the Internet. And this whole narrative began years... Years ago, I was having a conversation with a colleague of mine, and he made the comment, we were talking about the myriad problems we have in securing information assets for people. And basically the question was, why didn't they think of that? And it occurred to me that that's a perfectly legitimate question. You know, why do we have these problems and why couldn't we see that these things were going to be problems and why didn't they think of that? It's a simple and honest question. And I think the answer lies with how the Internet came to be. It's an important question because as information security practitioners, we have to understand why the technology is the way it is, how people will use it, and how malicious users will leverage design flaws to steal information. So why didn't they think of that? Let's explore that question a little bit further and try and find that out. Before I start to answer that, though, it is hot. As much as I love my lab coat, yeah, it's a little warm. So we're going to start first by talking about Eisenhower and his interstate system. And bear with me here. I'm going to loop these things together. I trust you. So this is a little bit of a history lesson first. The idea for a national interstate system began in 1919. Then Eisenhower, Lieutenant Colonel Eisenhower. He was involved in a road trip from Washington, D.C. to San Francisco. It involved 80 military vehicles. It covered 3,000 miles. And it took two months. And you can see from one of those pictures there that there were no highways. There were roads that didn't have big shoulders. And the vehicles were constantly getting stuck in ditches and breaking down. And Eisenhower realized that if it takes two months to move military vehicles from one coast to the other, it's going to be difficult. It's going to be difficult to defend the country in the event that there would be any kind of war activity on American soil. So he knew that that wasn't a good solution and that something had to be done. Years later, he was in Europe in the 1930s. If you think of your world history, in the 1930s in Germany in particular, there were some things going on. And he discovered that the Germans being, you know, very efficient, had already built a national interstate system. And it reinforced the idea in Eisenhower's mind that having a national road system was critical to the nation's security, but also to its economy, to be able to move things easily across great distances. So when he became president, he supported the idea of a nationwide infrastructure here in the United States that would not only facilitate military objectives, but also create jobs and boost the economy. So that's what he did. Let's recap that for a minute. The initial requirement was to facilitate the movement of military vehicles around the country easily. But the result was that a private industry was created that helped build the roads, excuse me, and created an entire culture around this new infrastructure. Let me go back there. I forgot a point. All right. You know, it wasn't just building the roads for the military, but once private citizens were able to use these roads, we were able to travel easily from place to place. Entire towns sprung up around where these roads were. And it did have a huge impact on commerce across the entire country. So because of his experiences, he fought hard to get Congress to pass the Federal Aid Highway Act of 1956. So for that reason, today, we do refer to it as the Eisenhower Interstate System. If you've been traveling, perhaps you've seen those signs along the side of the road. So as the father of the interstate system, Congress passed a bill in 1990 that legally changed the name to the Dwight D. Eisenhower System of Interstate and Defense Highways. And it's an important name because that defense word is still in there. It still has an important role should it need to be used in defense. So as I mentioned, we've got a car culture in this country, but also elsewhere. So when you facilitate transportation very well, interesting things tend to happen. For example, in around 1900 in France, the Michelin Guide was published. Michelin as in the tire company. So it's a little non-intuitive. Why would the Michelin Guide for fine dining and restaurants, be published by a tire company? Well, the answer is that the Michelin Company knew if they could publish a book of really nice restaurants that people had to drive to get to, then they would drive their car more and need to buy more tires. And therefore, it would be profitable for them to publish this book to get people to drive. As I mentioned earlier, entire towns existed only to support the interstate. I'm sure we've all seen the movie Cars, right? I mean, it's part of our culture. Route 66, which ran from Chicago to Santa Monica, about 2,500 miles, provided jobs for everyone that lived nearby. Now to be fair, Route 66 is not actually a part of the national highway system. It was built before the highway system existed, but it's a great example of car culture in this country. While I was doing research on this, this is an interesting bit of trivia here. Does anyone know where the middle of Route 66 is? Anyone? Is there anyone else here from Texas, by the way? I know there's no new... Texas. Well, it might be near there. All right, so for the Texans in the room, it's in Adrian, Texas. I'm not even sure I know where that is, to be honest with you. I just thought it was an interesting trivia question. So what's my point? The point is that what started as an infrastructure built for a very specific use case ended up having a profound economic and sociological effect once turned over to the private sector. Does that sound familiar? Does that sound like any other government-based infrastructure or government-funded infrastructure? So let's jump over to the Internet now that I've told that narrative. The DoD wanted to create a system that would allow for geographically dispersed computers to communicate with one another. If there was some sort of catastrophic event that disrupted the largely centralized computer capabilities that they had at the time, they were afraid that they would not be able to share the information they needed to defend this country. So if they could come up with some way for these geographically dispersed systems to communicate with one another, then perhaps they could do a better job at sharing information during disaster or war or whatever. Well, a funny thing happened. In 1958, Eisenhower funded ARPA, the Advanced Research Project Agency, directly in response to the Russians having launched Sputnik. So it was actually the space race that started ARPA. And the Americans were surprised. We had no idea the Russians were doing this. All of a sudden, they've launched a satellite, and we were taken off guard. So Eisenhower knew, okay, we've got to have somebody in the government that's doing scientific research in a collaborative way. So we don't get taken off guard ever again. So shortly, NASA was formed and took over the space race stuff. And ARPA at that time began in the 1960s to focus on computer science types of issues. So that's how ARPA came to be. By the way, in 1972, they changed their name to DARPA, the DoD, Advanced Research Projects Agency. Then in 1993, it was changed back to ARPA. And in 1996, once again, back to DARPA. So not sure why they keep changing the name and rebranding themselves, but just, you know, again, a little more trivia there. So the DoD knew they couldn't do it alone. I mean, they have the ability to get large sums of money and to start programs and those sorts of things. So they had to collaborate with academia and other, you know, academic agencies that could provide research. So there was people, a lot of people in America, but also people all over the world, that were working on the various technologies that would be required to make something like the Internet happen. And by the way, guess who was in charge of starting ARPA? Well, it was Eisenhower again. So I didn't know that at the time when I started, you know, putting the story together. But so the same guy who started the huge infrastructure for the interstate system, also started ARPA. The first four nodes of what was called at the time the ARPA net came online. Oh, excuse me, forgot a point. So in 1958, yeah, that's when it was founded. And the goal was to, you know, come up with the technologies, as I mentioned, that they would need to do the routing and switching. So they came online. The first four nodes were the University of California, Los Angeles, Stanford, Stanford Research Institute, UC Santa Barbara, and the University of Utah. So that, all right, a fan. So this is what the topology map of the Internet looked like in December 1969 with four nodes. That's a pretty straightforward topology map. Has anyone seen a map of the Internet, you know, fairly recently? You know what that one looks like? I mean, it looks like a neural network. I mean, there are so many nodes on there. It may be impossible to really even, you know, understand how many nodes are actually there. So the first message was actually sent on ARPA net on October 29, 1969, at 2230. They were going to type logon. They got the L and the O typed. And then it crashed. I would like to take this opportunity, however, at the packet hacking village, the Wall of Sheep, to start the rumor that the actual message that they had intended to type was, in fact, LOL. It's just a funnier story, but I don't think that's an actual command for anything. So the key concepts involved in getting these four nodes. Oh, and by the way, so that was at, yeah, October 29. The system crashed. A few hours later, the first permanent connection was established on the 21st of November. So they finally got it back up and stable and working. And so we like to think of it, ARPA and ARPA net, as a distinctly American thing. And to be fair, it was Eisenhower and ARPA, and that's where the idea came from. But in my research, I found there were people from all over the world that were involved in the development of the protocols and the routing and switching technology. And so I don't think it's fair anymore to say, well, it's certainly not fair to say that Al Gore invented the Internet. Every time I give the elevator pitch of this presentation, that joke invariably comes up. So there was people from all over the world. It was a big, huge collaborative effort. So I think what we can really conclude is that it was invented by humans in the 20th century. Yet it was a big deal. But not only was it invented by humans in the 20th century, but it was for very specific purposes. The design requirements didn't fully account for unauthorized users and for non-private networks, for example. So if you think about those first four nodes and then any of the nodes that followed that were research organizations and universities that were approved by the DOD to participate in the research, all of the users were pretty well known. You couldn't even access the network unless you were a part of one of those research organizations. So it's not that they didn't think of it, but the thing, the problem they were trying to solve at that time looked nothing at all like the problems we try to solve today as security researchers or as users of global networks. It just wasn't in the design book at all. So as with the interstate, once it was built and private industry started using it, we saw a distinct change in the nature of ARPANET when e-commerce happened. It's interesting to me that up until 1995, ARPANET still had a lot of control over what we could do with the internet. And in fact, e-commerce was specifically prohibited. So UUNet, the first nonprofit internet access company, didn't even exist until around 1988. They went for profit in 1990. The world around that same time in 1989 offered internet access. And they were also the first company that was able to offer full access to non-ARPA approved users by 1992. Now 1992, that wasn't that long ago, at least not for me. Being old and having a teenage son and all that stuff. But before that, you could have access to the internet, but it wasn't necessarily the entire internet. It was just those parts that those companies were able to expose to its end users. So by 1992 was the first time that we could even really access the entire global network. And eBay and Amazon didn't happen until the mid-90s because it was just simply against the law to perform e-commerce on the internet. That kind of blew my mind. I mean, I did have e-mail accounts in school and everything back in the 90s, but it just didn't occur to me that there was in fact a time that we didn't have Amazon and eBay and things. Now, I said that e-commerce didn't exist before the mid-90s. That's not really fair to say. I mean, e-commerce did exist, but it wasn't necessarily above board. I found an interesting article here. The first e-commerce, 71, 72 or so, is believed to have been some weed that drug deal was brokered using ARPANET back then. So you could say that the earliest examples of e-commerce were actually back in the 70s. And, yeah, I thought that was funny. So what's that have to do with us? So the security concept, as I mentioned, is the initial design requirements of an infrastructure are not necessarily what they evolve into. ARPA didn't have any facilities of its own, so it had to engage with academia to help to develop the technology and to design it. Just as America's roads were fueled for America's love for automobiles and exploring cities, the internet allowed people to exchange information across vast distances. And this matured from the first application of simple email to e-commerce to delivery of streaming media and remote control of a variety of devices. And the internet of things, just go over to Sheep City over there, and you can see some things that have IP stacks and can talk on the internet that I'm quite sure the researchers in the 60s didn't think, oh, well, we better put something in the protocol spec to make sure the garage door opener doesn't get attacked, right? I mean, it just wouldn't have crossed their mind. So I think we can all appreciate these concepts that, you know, we far exceeded ARPA's intention from 50 years ago with what they wanted to do with this network. So what are we going to do about it? I mean, there's been, since the first roads were built, it's not only just that the roads are better and more mature, you know, we have smarter vehicles as well, but there is a concept of these so-called smart roads. And I found this on a website. It's a website called adsmartcorridor.org. And you can see it's, you know, it's not, it's no longer just a hard, flat surface, right? I mean, we've got ramp meters that will control the flow of traffic onto roads. We have overhead signs that will give drivers critical information that they need to know about what's going on ahead of them, and local street signs that will change and reroute traffic depending on, you know, conditions on the roads as well. So I've got a series of predictions. I'm not at all going to say that I'm, you know, an authority on this, but I hope if nothing else it starts or continues the discussion of what the, you know, we know what the Internet is like now, you know, what is it going to look like in the future and what do we need to do to prepare for it. So as I mentioned, you know, it started off as a hard, flat surface. We've got adaptive construction materials now that we can use to build roads. We've got toll roads that help pay for things. And by virtue of the fact that people have to pay to use the roads, it might meter the traffic a little bit and the lighting and dynamic lanes. And, again, we've got self-driving cars that are becoming a reality now. Maybe we'll have the cars that will deal with getting us safely where we're going and communicate with one another. So similarly, I think, you know, what we still use, you know, particles to transfer information. And, you know, we're going to see more sophisticated vehicles. We're going to see more sophisticated ways. And quantum computing is one example that comes to mind. But we started off with a simple Internetworking infrastructure, which, by the way, I'd like to mention that that word Internetworking, that was the first verb that they used to describe what they were trying to do. The computers were Internetworking with one another. And that was shortened to Internet. And so the Internet is just a shortened, made-up word for Internetworking. And, of course, now it's a proper noun. And it should always be capitalized, by the way. So we'll have, you know, math-based encryption that will include elements of quantum computing. Broadband will become more and more broad and ubiquitous. And I think one key thing that as we have that more broadband and we're able to protect data more effectively, physical possession of things will continue to lose value. And access to the information is really going to be the currency as we continue through the 21st century. The example I'll give, so my undergrad's in music, right? So if I asked you to guess what my CD collection looked like, you might think it's pretty impressive because I really, really like music. Well, the fact of the matter is I don't own a single CD anymore at all. Now, I have access to lots and lots of music. But it's all through music services or data that's stored in various cloud sorts of things and concepts like that. So I no longer care that I have access. Rather, I'm more concerned that I just have access to the information so that I can consume it in a meaningful way. Infosec challenges seem like they keep moving up the OSI model from layer three. I mean, network-based attacks are certainly still a real thing, and they're going to continue. Excuse me. But I think we're, you know, we obviously, you know, with web applications, testing being a big deal these days, I think we're going to continue to see as we move security models up to the top of the OSI stack that we're going to continue to see attacks against specific applications. So just as we have, you know, smart highways, as I mentioned, and self-driving cars, I think with the Internet 2 project where they're trying to basically replicate the Internet infrastructure, I think we're, you know, redoing that. Using it with modern materials, as it were, and modern protocols is going to be a big part of the solution. But I think it's still up to us to try and think about these things and go through these, you know, thought experiments and try and anticipate what, you know, what are the bad guys going to do next to coerce our users into silly things. And to that point, you know, even with, you know, cars that have autopilot or self-driving cars, do you think that there will still be traffic accidents in the future? Do you think that there will ever be a time where there's never, ever a traffic accident again? I'm cynical enough that I don't think that's ever going to happen because people are still going to be capable of making poor decisions and doing dumb things that will result in equipment malfunctioning and bad things happening. So I think, you know, similarly with even no matter how, you know, many hoops we make our users jump through to authenticate properly or to make sure that their data is protected, you know, all of us, every single one of us, me and everyone in this room, we are capable of making poor decisions and doing silly things. So even as the technology advances, I think the problem is just going to keep, you know, slipping away from us and making us having to work harder to provide that protection. So to sum it up, I think, as security professionals, our charge is not only to understand how the technology works but how people interact with it because very often, it's not that technology is broken as such but we, somebody figures out that it's a good technology that it was implemented poorly or it's a good technology but the users are doing silly things or that they can be tricked into divulging information that's useful to the bad guys. So I guess the good news is, is that we will have jobs certainly for the foreseeable future. But I think if we consider the story of how these companies, these two huge infrastructures started in one place, ended up in a very, very different place, we can see that it's a very similar trajectory that's taking and hopefully that will be useful as this conversation continues as we go back to work and move through our careers. So that's basically what I've got. I certainly appreciate you all showing up and listening to this. I'll be around for a bit after here and of course around the wall of sheep. If anyone wants to get in touch, that's me. My contact information is in that QR code. I promise I didn't put anything malicious in it. This is DEF CON. But yeah, that's me. If there's comments or questions, I'm happy to answer them. Otherwise, enjoy the rest of DEF CON 24. Thank you very much. So it's almost the evening. So thanks for coming. Thanks for hanging in there with us for the Packet Hacking Village. Gee, the whole day. And again, we're very overwhelmed and we are absolutely amazed by your support. So thank you all for being here. Again, yes, I see. So I guess I want to take some time, a quick moment, to introduce the next speaker. Who here was at B-Sides Las Vegas this year? Okay. So you were at B-Sides. You may have seen this talk at Proving Ground. So at the Proving Ground track, you know, one of the talks on the Wednesday was on dorking. And now it is my pleasure to introduce Philippe Risolo, flying in from Sweden. Flying in from Sweden. And he's going to talk about dorking. So without much ado, Philippe. Thank you. So this talk is not going to run for 50 minutes. It might run 15 minutes. When I did this at B-Sides, they started me off 10 minutes early due to a scheduling issue. So I ended up at five past, ten past three. All right. I'm going to introduce a little tool that I built for collecting dorking results. I'll briefly explain what dorking is if someone doesn't know about it. So my name is Philippe Risolo. I'm a security researcher at Recorded Future. I used to be a software engineer in the linguistics department as well as a data scientist for a few years. I'm going to start off by introducing dorking. I'm going to look at a few of the tools that I saw when I wanted to do this. And then I'll introduce Dorky, as it's known. And then some future stuff, like some issues. And what I would like to see in the future. This is an open source project, so it would be great if any of you have a need to collect dorking results. It would be great if you used it. Send me some feedback or help with the code. So search engine hacking is, which is called dorking as well. It's a way of exposing compromised or poorly configured servers. It basically revolves around doing clever Google searches. Looking at the results and then I'll show an example of a dork. As Ming said, it's been around for ages. 2002 was when it sort of took off when Johnny Long started collecting dorks on a website. And this sort of morphed into what's now known as the Google Hacking Database that some of you may have seen. So this is what the Johnny Long page looked like. It also explains why it's called a dork. So a Google dork. An inept or foolish person as revealed by Google. You can see the top one there is SQL data dumps. And that page has turned into this, which is a nice looking website hosted on at exploit DB. New dorks are added every few days. It sort of corresponds with whenever new vulnerabilities are released, people might craft together a good dork just to find vulnerable servers. Here's an example. I don't know if you can see it, but it says a Google search for intitle hamdida x shell backdoor. And this is the type of web shell. And doing this, the search finds 19 results of hosts that are compromised that you can collect through here. I don't know if there's a username and password on these, but you have access to the hosts. So since this has been around since 2002, it shouldn't be an issue anymore, but it still is. There's the Internet of Things. You could be DDoSed by toasters. People put webcams up there. No password, no username. You can find ICS systems on there, industrial control systems. And really nothing has changed. The more stuff we put online, people aren't really paying attention to it. And they're not really paying attention and securing their setups. So I was looking to find a good example of where dorking matters. Here we have an example of Google search technique aided New York dam hacker in Iran. Basically someone gained access to a water plant system, I think. That was cool, I thought. And then I looked at the date it was published. It was a few months ago, March 2016. So it's still an issue. And we haven't fixed anything. So when most people think about dorking, they think about Google. Just to give an example of the sort of differences between Google and Bing. I do a little bit more. I do Shodan as well in this project. I'll get into that. But Google has a great advanced query language. And they don't filter their results as much. Bing filters a ton of results. And you can't search for SQL files, for example, because they filter it out. The flip side, though, is that Google no longer has a search API. So if you wanted to look at Google results, you will have to scrape it and use a thousand proxies. On the other, Bing offers a very good one, a good API. So what I wanted to do when I started this project is, I would like these dorking results in a database that I could use to alert on. Because I want to know if a certain site appears in a dorking result. I want to send out an alert. And the tools that I found, they were all sort of focused on single use. So you input your query and you run it. And you look at the results. And then you take action. And most of them didn't seem to have open source anywhere. There is a cool one. But I can't find any updates to it. And it looks like it's dead. That was closed source. But it's a neat project. That's why I built Dorky. It's a great name. And it's got a great logo. It's basically two components. Oh, sorry. Is this better? Woo! Woo! So Dorky is split into two components talking through a Mongo database. It's a web UI where you manage your dorks. You can look at the results if you wanted to. But that's not the core intention of it. And then there's the runner, which is basically what executes the queries. So in the Mongo database, you store queries of different types. The runner grabs all the dorks that are available. Runs the correct search engine. Saves the results to the Mongo database. And it waits a little bit. And then it does it all over again. It's not rocket science. So architecture-wise, it's built in Python. Mostly because I like Python. It's widely used. A lot of people know it. Mongo, it's very easy to set up. Easy to develop against on pros and cons. It has no schema. So you can sort of... Go wild west while developing, which is a good thing. It might be a bad thing eventually. But for now, it's good. And then for the web server, for the management UI, I used Worksog. Which is basically what powers Flask. It's a lightweight version. And it's very nice to use. So I included... I've included code for scraping Google. Doing the Bing via the API searches. Google custom search, which is something you can set up for... Specific sites. And then they give you sort of a little mini version of Google for specific keywords or sites. And you can configure it through some trickery to search the whole web. But you get very limited results back. And then I also included Shodan. If you guys don't know what Shodan is, it's basically a searchable end map. They scan the web for open ports. They collect the results. And they cache them. So sort of to look a little bit at what the UI looks like. I'll show the UI as well. Adding a dork is quite simple. You add a query. You add a description if you want to. You put it in a category. You can give it a source if you find it on a specific site. And you pick which search engine you use. After you add it, it pops up in this little list down here. And as soon as the run starts... As soon as the runner pulls this query and runs it, you get some results. In this case, it's a webcam query for Shodan. And you can see the IPs and ports as well as the banners being returned. But in the Mongo database, you actually get the full results stored. So you can go back to it later. Let me go through the slides so I can show what it looks like afterwards. As far as configuration goes, it's quite easy to set up. You need a Mongo database. You need to stack with search engines. You want to run API keys if you're going to use any of those. You need proxies. You don't need a thousand, but a handful are good. And as well as filtering, because a lot of the results you get back are not... They won't be perfect. And you need to filter some results out. For example, you don't want to get the Google hacking database returned as a result. That would be pointless. Uncertain keywords, dorking, maybe hacking, et cetera. And as I said, some of the results can be quite noisy. It depends on your query. There's the issue of rate limiting and API costs. If you were to run the Bing API for all the queries that are in the Google hacking database, it would be expensive. And if you have that sort of budget, go for it. But I don't. And I think the big issue is why... The reason why a lot of these tools have sort of sprung up and then they died is because they require continuous maintenance. Because if Google removes their API, for example, then I saw a ton of tools just wham. And if they change their website layout, for example, then I need to update the scraper. But hopefully... I'm using this in my company production system right now. So hopefully it will keep getting updates and won't die. So some of the future work here. I would like to add more search engines. GitHub, VirusTotal, Hybrid Analysis are some examples. There's some need to improve the logging and error handling. I've been working on it. But it's not perfect. Then adding a pipe to Elasticsearch would be very cool. So I pipe this data into my company system so I can set up alerts in there. If you don't have access to recorded future on a developer level, which you don't unless you sign up for a job, you need some other way of alerting. And if you wanted to take a look at it, it's on GitHub. GitHub.com slash recorded future slash dorky. It's MIT licensed. So go ahead and steal the code and use it. And if you have any questions, this is my personal e-mail address. Freeslough at gmail.com. I told you this would be painless and quick. All right. Adjusting the image. So this is what the UI looks like. I have added, I have scripts that pull in the entire Google hacking database and imports it into this database. If you wanted to run all of them. But I do, what I run, this is not the production system. This is my local version running. I'm not on the Wi-Fi, so I won't show you the actual running. I apologize. So, for example, if we wanted to enable one of these queries. For example, some money broker's account. We hit it. It would be enabled. And the next time the runner goes through this, it will execute the query and it will collect the results. And here we have the webcam query from Shodan. It's basically searching for server SQ webcam. I stole it. It was the top webcam query on the Shodan website. We could look at the results. We get a whole bunch of them back. So if anyone wants to look at some webcams. Here you go. Yeah. That was all I had to say. And if you have any questions, please go ahead. So the question was, if Shodan lists these webcams. Can you go to any of these webcams and just look at the images? You can. There are a few that have a username and password protection. But there's a ton of unprotected webcams out there. You can spend a whole evening looking at garages and people's living rooms. Don't do that. But yes. There's a ton of information out there. Especially on Shodan. Anything else? Sorry? Senses? I haven't looked at it, no. Cool. I'll check it out. YS. Senses. Okay. C. Yeah. Okay. I'll check it out. Thank you. Yep. So the question was, or the question was, I said that Bing filters results and Google doesn't. And the question was, why don't they? I think for Bing it's that they, I think they filter results out. They put an effort into it. I don't think Google has the sort of impetus to do it. For Bing it's also a result. They're like worse advanced query language. You can't search for file type SQL, for example. They only support PDF and like the standard formats, like the Office documents and things. Oh, yeah. No, no, no, no, no, no. You have a way to set it towards specific posts or like any sense. But also is there a way to put it out? So the question was if there's a way to put it towards specific hosts. Yeah. I mean, you could update the code to do this. Or you could just add that to your queries. Just search for these sites or this site. Exporting the data out, I use it in the Mongo database. I'm comfortable with using it in the Mongo database. If you would like to write a CSV export or whatever, please do. Anything else? All right. Thank you very much for spending time here with me. Okay. It is now 510. And it is my pleasure to introduce to you the next speaker from Austin, Texas, Garrett Montgomery. Hi. Hello. Thank you. So I'm going to talk about myself for a second. My name is Garrett Montgomery. I'm a security researcher. I work at Breaking Point, now a part of ICSIA. And I focus on the security side of the house. Prior to my work at Breaking Point, I was a signature developer for an IPS company. And prior to that, I worked as a snort analyst for the military. So I have some background. And I'd like to think that I know what I'm talking about. Hopefully by the end you'll agree. Okay. So today we're going to talk about what is a protection device, at least from my perspective. Why people should care about defense in depth. What do you mean my protection device isn't protecting me? Shocker, right? So I'm going to talk about my testing setup because I'm fairly proud of it. I'll talk about some of the initial results we've got. I will cover why we don't have specifics on your particular protection device. But I will talk about how you can get some of those results yourself for those with some budget, limited budget, and no budget. And then I'll summarize at the end in case you guys have all forgotten what we're talking about. So first off, for myself and the work that I do, we're looking at network-based protection devices. These include IPS devices, next generation firewalls, unified threat management systems. Basically anything that sits on the network that is supposed to block bad traffic one way or another, whether it's inline, layer 2, layer 3, layer 4, layer 5 in some cases. And so we're looking at statistics and how well they do what they say they're going to do, which is protect you from the bad stuff. So as an example, we have here IPS. Devices that would sit here, next generation firewall, IPS, UTM, those are the devices that we're covering in this talk today. So. Some of you may recognize some of these. They are lists of vulnerabilities that are claimed to be covered by network protection devices such as an IPS, next generation firewall, UTM. There are various ways to find them. Sometimes you can find them on a company website. Sometimes you have to own the device and you have to know how to go and find it. And so they provide a list of things they claim to protect you against. So what we have done is tried to verify those claims. You say you protect me against a certain vulnerability. I expect you will protect me against all forms of that vulnerability and all exploits that may attempt to target that vulnerability. And that's what the research is all about. So protection is relative. What do you mean I'm not protected against that exploit? If you saw the previous list, you might think, oh, I have a great IPS. They protect me from all these vulnerabilities. And the only difference between them is maybe some devices have more protection. They have more vulnerabilities on their list. So that makes them better. Right? Well, I don't think that's going to be the case. So there's a lot of different ways to exploit vulnerabilities. You may see a public proof of concept which represents one type of exploit for that particular vulnerability. So one of the things that I do at my job is to find all the other ways. To exploit a particular vulnerability. And believe me, it's a super fun job. You spend a lot of time watching things crash, popping calc, and just riding on the coattails of others who do really cool exploit development work. And all I have to do is just find the other hundred ways, a thousand ways that you can target a vulnerability. And then we put that out as a product. So, yes, some devices we'll find are better than others. So my technique. My testing framework is a dedicated security lab environment. And that means I have hardware devices. I have software devices. I have a hardware switch. I've got virtual networking via ESX. We have a traffic generating device, which is where we generate our exploits. Again, Breaking Point is the company that I work for. We make a high throughput device. Not that it's a sales pitch, but that's where I generated all my test data from. So we've got eight of those in hardware. And 12 of those virtualized devices. We've got a layer three management switch for the hardware. And we've got ESX networking where we can change the connections between the devices. And so we have single paths in a virtual environment. So you know where the traffic's going. And you are verifying that the protection devices are seeing that traffic. So what we've done in the hardware. And the reason this is complicated is because I made do with what I have. Many of you will probably have to do the same thing if you want to do some of this testing yourself. You're probably not going to get a lot of budget. Your superiors may say, we have an IPS device. They're a Breaking Point customer. Why should we do our own testing? I'm sure they do all their own testing. And they block everything that Breaking Point has, right? No need to verify anything on your own. So in order to prove the concept of my project, I found an old switch. I have static MAC addresses on the input ports and the output ports. And I use VLANs to segment the traffic. And that's how I can direct traffic from any traffic generation device through a DUT, which is a device under test. Back to the reception port to check whether the traffic got through or not. And then back out if need be because some exploits, they start from the client side. Sometimes they start from the server side. So that's my setup. Now. I have a list of devices you guys are all likely familiar with. These are included as part of our test bed. Not all of them are included as part of the result set. And I will not be talking about specific results because many of them are our partners. And while I don't want to name and shame, I do want to point out that as a general rule or a class, a class of protection device, we are going to point out how well those devices are doing. So that you can go follow up and say, my device falls into a certain class. A class type like enterprise level or open source or it's a next generation firewall. Maybe I should test my own device and check these results myself. One of the things we plan to do is publish the test methodology so that if you are a breaking point customer, you can repeat these same results yourself. So, unfortunately, the test devices in our lab did not perform as well as I would have hoped. This is an initial look at the data. Basically, I ran ten tests. In some cases, 14. I had many older devices that I didn't have the budget to update or I didn't have the time to update in time for this conference. So we have test devices that were older and we only tested up to the age of their previous rule set update. We have some test devices that are newer that had a limited demo license. We couldn't fully test all of their features. But if they're in line and they're claiming to be update, we use those results. And we have some devices that we actually do have licensed. So there is a good mix of results in here. And as you can see, network layer attacks. Those are things that I would say are TCP based, ICP based, maybe even ICMP. Where you're looking at, say, buffer overflows in the option fields or out of bounds values in certain header fields. Infrastructure layer. Those bytes on the wire are basically fixed. The only way to attack that is to have certain bad values in certain places. And that's what a protection device would see on the wire. I would expect a protection device that's network based to do a much better job than that. We've got about a 16% detection ratio. And it's possible I didn't configure it very well. But guess what? Not everybody has perfectly configured devices on their network. If it's difficult to set up, then maybe your protection device isn't set up. These results aren't invalid because I don't know how to set it up. But I'm a customer. And so I think the vendors need to do a better job of making it easier to configure and use their devices. If they have better protection statistics in their own test labs. And I'd like to think that they do have test labs. So browsers. HTML typically being served from a server where you have a client reach out and get it. That's always hard for a firewall. Because the connection comes from inside the network. So this is going to be IPS protection alone. We have a lot of strikes. And these variants. What I mean by that are the different ways that an exploit can target a vulnerability. Some of these strikes which are exploits are they have many, many variations. Hundreds or even thousands. That are just significantly different enough to confuse an IPS. And I'll be showing some examples of that later. User applications. Like Adobe. They make a PDF application that some of you may use. Flash is possibly considered a user application. It may also be considered a browser based attack. Because it typically comes from the browser. Not surprisingly they did quite poorly in that. Infrastructure. What I mean by infrastructure are attacks that can come from somewhere on the network. Or outside of the network. That without having to be passed or interpreted or parsed can directly attack your servers. Denial of service. Or HTTP servers where you overflow a perimeter. Those are things that basically an attacker can do is fire and forget. They don't have to initiate any sessions. They don't have to do much other than send bad stuff to the server. And you crash the infrastructure. These are particularly important for companies that like to keep an internet presence. They want to have hosts that are alive. On the internet. So as you can see again. They did a little bit better. Which is good. You want them to do well. And we all want. Everyone wants your IPS vendor to do well. Because we all want to be secure. So these results that I'm showing aren't to talk bad about a vendor. Or say any particular vendor sucks. Or that the technology is bad. This is an attempt to raise awareness. In the hopes that customers will go tell their vendors. I can do a better job. I saw this exploit being passed by the firewall. Fix it. I have a feeling that many customers will have much more effect. And be heard by their vendors. Than say a test company who makes a product. And doesn't want to anger those partner customers. So I want you guys to do my dirty work for me. Go tell your vendors that they're doing poorly. And you can prove it. That's what we're going to continue talking about in the presentation. How you guys can tell the vendors to get better. So one example. There is a vulnerability. CVE 2015-099. It is a browser based exploit. Rstrike. Which is what we call the attack. 288 variants. And what we mean by that is different combinations of code placed in different places. That fundamentally achieve the same thing. They exploit the vulnerability in the same way. But they show up on the network. They traverse the network in a different way. They are in the file in a slightly different way. And we've lost. It's back. Okay. So in this example. We have browser based exploit. Which was tied to CSS rules. Cascading style sheets. We have these arrows here. They indicate the slight variations between the two exploits. Which are two of the 288 variants. You can see here. There is a percentage value used. And the other one. We used a default value. You have the animation specified below. Versus animation specified in a different way. So these show up on the wire. And are inspected by protection devices in a slightly different manner. But they are in the end interpreted by the browser in the same way. So they hit the same vulnerability. Just using a different attack vector. And unfortunately. They don't do so well. What I found. I posted a blog about this. And that's why when you guys get the PowerPoint. You can go look at my self promotion link. Which is a previous blog post. Where I talk specifically about this vulnerability. In essence. 288 of them were blocked. 144 were blocked. Because they triggered on a rule for JavaScript obfuscation. That's all it looked for. Was. Lots of multiple encodings of JavaScript. And for those of you who have looked at HTML source pages. You will find that encoding JavaScript isn't a bad thing. It's a very common practice. And if you have an IPS where you're relying on JavaScript obfuscation. You will probably find that you're going to get too many false positives. And you're going to have to turn off this rule. So this vulnerability would then be blocked zero times. Because even without JavaScript obfuscation. The IPS didn't block it. Okay. So I know it's very tiny print. But that is the source code behind the Google.com homepage. And that's the example of obfuscated JavaScript that I'm referring to. There's a lot of JavaScript. It's encoded for size. It's also encoded in some cases to protect intellectual property. Making it a little more difficult for somebody to copy your JavaScript. So that's the type of stuff that you'll see on the wire. Because you're looking at source when you're looking at packets that are going across the wire. And it gets interpreted by the browser's nice clean Google page. So obfuscated JavaScript is not a valid detection methodology. Don't rely on obfuscated JavaScript to protect you from attacks. So what about my device? As I said. We're not going to be releasing specific metrics. And statistics on a per device basis. But we will be talking about classes. And that will be included in data that is hopefully going to be released by the end of the year. For this talk. We're going to just be talking about how you can apply some of the same principles that I use in my daily job. To do some of this testing yourself. So we've got direct firewall testing. Demo testing. And virtualized testing. So if you are lucky enough where you have access to your own firewall. You could hook up a couple of ports on each side of the inbound and outbound interfaces. Maybe set up a VLAN. And then use something like TCP replay with split interfaces. And you could send the traffic. You can send it from either side. And you could see if your IPS is blocking it. Not too difficult. And if you had a public proof of concept on your laptop. You can generate a PCAP from it by downloading it from somewhere. If it's say an HTML based strike. Or if it's any other type of exploit. You could send it across the network and get a PCAP. TCP replay that can then be used to send it out either interface. So you can check whether your own IPS or protection device with your own configuration. And you also get the benefit of seeing if next generation firewall type rules. Such as IP block lists and application filtering help in preventing the traffic that's bad from passing through these interfaces. So if you have a ESX host. You might have a little bit more of a budget. Maybe not a whole lot. But you could do some configuration like we have. We have limited budget. But we managed to set up some virtual switches. And then we have a large list of IPS devices. And at this time we're configuring them where one at a time for each interface. We hook it up to one of these switches. And then we pass traffic from a server. That has the bad stuff. In our case these breaking point devices. That can send a lot of bad stuff. So we send traffic from one interface to the other. It gets routed only to that dot. And then it comes back. And then we keep track of whether it blocked it or didn't block it. You could do something similar in your own setups. And Ansible is where we're migrating to. Because I am a fan of automation. And I don't like configuring interfaces myself manually. So the high level concept is. You have a management interface that's out of band. You'd have one virtual switch where you would pass traffic in. And another virtual switch where you would pass traffic out. After it hits the protection device. And you can also set up a third virtual switch that could be in line. If you have any servers that you want to practice beating up. Like the vulnerable bank applications. Set up a target server. Put your protection device in line. See what it does. This is a good use case for demos. Often you can get 30 days free. From a vendor. If you already have a configuration. You may even be able to import it from your own device. And you get a fairly decent replica of what is on your network. And you get a sense of what your protection level is. With a real live device. Just in an isolated environment. So local testing in line. So this is basically something you would do on your own system. Which is what I usually do. Because it's a lot more convenient for me to test this way. The device at the top. Say would be a gateway. Or a routed virtual machine. You can put two interfaces. You create two internal networks. Say a .100 and .200. And you have that be the bridge interface. On the two systems. You set up say a default route. So that they just automatically send traffic to that gateway device. And then traffic gets passed back and forth. What I like to do is have a shared folder on my host. Where I can edit the target. Or edit the exploit. In real time. And I can work on the client. And then request it from the server. And then I can change it. And continue to do so. And I can see if there's traffic getting blocked. And in that case I hope it's the IPS. I hope I configured my device right. I hope it's the protection device that's dropping packets. But then I can also find that if it's not. I know that's a fail. On that particular exploit variant. An easier setup. Which is the one I'm going to demonstrate to you. Is you basically have one internal network. You connect your client device. Your server device. And your IDS type device. You set it up in promiscuous mode. And just have it sniff the traffic. And see what it can get. For this example I've used security onion. Which has snort and bro and surcott. And a bunch of other security tools. Great virtual machine host for testing things. Because you should be able to configure everything on the device. And so yeah. I keep my exploits in a shared folder. That's accessible by the server. And then I can go visit it from my client. Where I'm doing the requests. And where I'm doing the editing. And the server serves it. And usually it's out of the. I don't even have to see it once I verify network connectivity. So here's the demo portion. Fingers crossed. Here I've got a server. You can see the IP address is 10.0.2.4. And security onion. If you'll bear with me one second. I have to re-login. Okay. Now over here you can see that there are some alerts. I just left this up there. Because I wanted to prove to you at some point. That these rules did fire on the exploits. That it's going to be seeing on the traffic. Because shockingly enough they're difficult to detect. And they don't always work. Just as an example. The exploit vulnerability example I'm going to be talking about. Is for CVE 2014 6332. Which is a vulnerability in Internet Explorer. And it has to do with VBScript. So let's see. We had. Oh. Security onion has 23 snort rules from the base distribution. As well as community rules. So they're really trying to catch this vulnerability. Okay. So here's my client. Where I've got the folder open. You can see I have an IP address on the same subnet. It's 10.0.2.15. And here for this vulnerability 2014 6332. I've got eight variations of this. So what I would do is open a new tab. Nothing happens. Right? What if I refresh it? We get a crash. Right? So let's see if security onion caught it. Not this time. Well. Let's try again. Another crash. Security onion still has not caught it. Let's try one more time. Just to make sure. This really gives security onion a chance. Which in this case it's running snort underneath. And that's the rules that it's using to try and find this vulnerability. So we've got another crash. And it still hasn't triggered. So this could go on and on. And we could keep doing it. And sometimes it will trigger. And sometimes it won't. But this is just a way to illustrate my point. There are public proof of concepts. And you can see there's several rules used to try and catch the vulnerability for this. But HTML is very difficult to detect on the wire. Something I learned from my prior experience. So there's 23 versions of this rule. Not one of them caught three different versions of the exploit. This isn't to say that snort is a bad tool. It's an excellent tool. And it's included in a lot of the types. Top of the line products for a good reason. But the point here is that exploits. There's a lot of exploits. And they're difficult to detect. So please, please go do your own testing. And you can do very similar things to this. In fact, I'll show you. I think I had an example up previously. So you can see. Subtle differences. You have an HTML file. And there's a script that's VBScript. And we're not even going to get into what they are. But they're just minor differences in how the script is generated. You have different randomized names for functions. But the point is minor differences. And the rules don't block them. They need to do a better job. So that is basically the point of this demo. So. All right. So that's me wrapping up. What were we talking about? Again, network protection devices are valuable. You should have them. Defense in depth is key. You want to have that. The more chances you give something a chance to protect you from bad stuff, the lower your risk profile. But be aware that just because an IPS says it's going to block something for you doesn't necessarily mean that it will. Verify it yourself, please. And then follow up with your vendor. And each time you can get a network packet capture. They love those. Or if you can get the exploit itself and they have to send it across the wire, they will find a way to do it. If there are enough customers complaining, they may make a change. And if there are enough customers sending the same things with the same simple evasions, maybe they will put the detection logic into all of their rules. And we all get more security that way. So last time. Please take an active role. Verify your coverage claims. And then follow up with your vendor. That is all for my talk. Does anybody have any questions that they want others to hear? I see a hand. How many unique vulnerabilities did you check and how many variants of those vulnerabilities? That's a good question. Let's go back. The question was how many unique vulnerabilities did we check and how many variations of those vulnerabilities did we check? Okay. Okay. So for the test results that I'm showing here, these are initial results. They haven't been categorized. We have individual strikes, which are basically the exploit targeting the vulnerability. And within those, you had many variations. Now you had a follow-up question. And then where did you get that pool of variants to do the test with? What were the pool of vulnerability tests? Well. . Okay. So the exploits and the variants come from the very expensive product that my company makes. So that is the first answer, yes. It's not free. But you can use a tool like Metasploit, ExploitDB. They have public proof of concepts. Go in there. Modify them a little bit. See if you can make your protection device miss. That's what we have found. What we feel that we add a lot of value is we'll even find public proof of concepts that do something one way, and then we'll do it 100 other ways. You guys can do one or two ways. It takes some time and practice, but please do that. And we'll all get more secure or at least lower our risk in some way if we can make our protection devices better. So unless there are any more questions. Oh, I got one down here. Oh, HTML exploits and why they are hard to detect. Well, let's see. Okay. So this is a packet capture. Wireshark. You've got a session that was initiated, typically a get request. And then the server is responding with the HTML file. When you're looking at this on the wire, which is where most of the protection devices operate, you're seeing bytes. So in this case, stored. And those who are familiar with it know that a lot of protection is regular expression based. So you'll look for, say, in this case, you'd want to find key frames followed by perhaps an overly large percentage with a specific opacity. Then you'd want to find that the animation was used. So ordering in this particular variant means you have to write a regular expression that looks for one thing, jumps to another, and possibly captures one thing, and then looks for it further down the line. Now, if I change the order in any way. Which you can do with HTML very easily. You'll basically have to write another version of that regular expression. And now it has to check two different ways. And then over here, you see we did it totally different. We did it within a style tag. They're both done in style tags. But we have a CSS rule rather than HTML attribute on the style. So you have to look for it in a third way. And you don't typically want to write multiple rules for the same thing unless you're snort and you're open source. And so the protection vendors want you to think about that. They want you to think they're doing a very good job. They have one rule. But it could be very performance intensive. And unfortunately, since most of them are in line, performance is still key for them. They are concerned about affecting performance. So detection ratios sometimes lag because of that. Follow up? Rules based on non-regular expressions. There are probably several more people who can speak better to that. But I believe Suricata is a little bit higher up in abstraction and can work on possibly interpreted things at a higher level. I'm not familiar with the tool myself. But I believe there are tools that kind of straddle the line between network-based and host-based where you're looking at the things that have been interpreted. And sandbox tools are great as well because they evaluate things within a safe environment before passing them on. Did I see another question? Yes? I'm not sure this is really a question. I guess I'd like to push back a little bit on the premise that this is a valuable technology. But the rates that you showed of detection were like... 20%. If you add in the overhead of all the false positives, 20% detection rate, is this really a valuable place where you can spend my money? The question was about if IPSs are so bad, then why should anybody spend any money on it because they seem to be really bad. And then you get one high cost typically and you get false positives that have to be chased down or you have to spend a lot of time tuning your IPS. That's a good question. I'm not sure I have a good answer for that. I'd like to think that if I spend some time tuning it, which I hope you guys have all had the vendors come in and help you tune it appropriate to your environment, I would hope that upfront time will serve you well in seeing your own detection rates at least be hopefully higher. I would certainly hope that anything at the network-based layer should be near 100%. And it could just be because I didn't configure my devices correctly. But... Out of the box, testing with a default policy applies to me is a statistical probability that some people somewhere out there have their devices like that. So we should include that as part of our testing. Did that answer your question in any way? It did a little bit. But I guess it sounds like if I tune the thing when I install it, in two weeks that won't help. Because there'll be all these little vulnerabilities that it's not touching anything but the default version. So the question is, if you spend a bunch of time tuning it towards particular vulnerabilities, do you get a better coverage rate? And how does that affect you when new vulnerabilities come out? Well, you shouldn't have to tune for vulnerabilities. You may have to tune a device with a configuration that's appropriate for your network. You may want to block all IP addresses that are based in a foreign country. If you have no foreign customers and you have no foreign business contacts. If you're doing business-to-business networks, you may only want to have those IP ranges that you know communicate with your network. So it's not so much about making your IPS be as good as possible, which it'd be nice if they did. It's about lowering your risk profile and reducing the attack surface. And an inline device can help. And it should, I think, be viewed as a piece of the puzzle. But just by seeing a vulnerability listed as being offered protection, don't take the vendors at face value. So yes, it's a big investment. And ideally, it will help lower your risk profile and reduce your attack surface. So that if your follow-on mitigations have less work to do, you have less manual inspection to do, your host IPS and IDS and your host antivirus should have less work to do. At least that's the goal. So I'm still a big fan of trying to stop things one time at the networks so that you don't have to stop that many times on the host. But maybe that's just my opinion. Any other questions? Right here. I saw a hand. How old were the vulnerabilities that you tested for? How old are the vulnerabilities? Well, in some cases, we went back as far as 2002, which most people should have patched by now. Those shouldn't be things that we care about. But at the same time, the IPS vendors should have had plenty of time to block those. We also had a large number or significant number of IPSs that we didn't have recently licensed. So we tested older vulnerabilities in order to test their older detection logic. So these vulnerabilities are from 2002 through 2016. I see a hand right here. Why do you think you didn't drop your vulnerability? I have to hope it's because I did something wrong. I'm really hoping my IPSs are not this bad and that with a default configuration, they don't do this poorly. I really hope that. I hope all of your results are much higher and that you have tuned interfaces. They sent an engineer out to help you configure it when you first bought it. Hopefully, it's much higher than this. Any other questions? Well then, oh, wait. The question I believe was about performance, hardware versus virtual. Unfortunately, I had no overlap in devices. So I couldn't tell you. But I would imagine if your device is configured for lower throughput, you should have the same detection logic regardless if it's hardware or software. Just from a developer's perspective, you want to develop once. So detection logic shouldn't be different. Yes? . That is the additional research that I want to do because I believe that there are plenty of public proof of concepts. I have a feeling that the vendors are going after the public proof of concepts, blocking them, and claiming coverage. And then we do additional work to see what other ways you can exploit a vulnerability. So at some point, I hope to have statistical data showing public proof of concept versus, say, our variations. Any other questions? No? Well, if that's it, that's all. And it's showtime. Good evening. And this is the final speaker workshop. Talk of the day. Again, thank you so much for spending your day and time with us. We're very grateful. We're very, very grateful. And also, it's amazing to see everyone here. I mean, I guess I'll be honest is that we did not anticipate people to be, like, standing, like, deep, deep, deep, and also standing on the floor for this talk. And as I said earlier a number, a few times, we've saved the world. We've saved the world. We've saved the best for last for today. Because it is our honor. It is certainly our honor and our privilege to have a very, very, very, very special guest, very, very special speaker today, Ryan Mitchell. And before Ryan, before I pass the mic over to Ryan, how many of you here are Python fans, fans of Python? Woo! So, Ryan. Ryan is not only a DepCon alumnae. She spoke last year at DepCon 23. She is also the author of an O'Reilly book called Web Scraping with Python. And we are very honored and very, very privileged to have Ryan Mitchell to give the last talk of the day. And arguably the blockbuster. Without much ado, Ryan Mitchell. All right. Thank you very much. All right. So, my name is up there. My Twitter is also up there, in case you want that later. I think I'll find some safe internet after this and then upload the files to Twitter. So, who am I? I am a senior developer at Hedgester. We are an enterprise, enterprise analytics software management force. For hedge fund, I don't even know. Anyway, I wrote two books, which is what I actually talk about, because no one wants to hear about the first thing. Web scraping with Python in 2015. And instant web scraping with Java. Which isn't quite as good, but, you know, it's packed. I am also teaching web development class at the Boston Public Library in the fall. And a data science course at my alma mater, Olin College of Engineering. Go, Phoenixes! All right. So, who puts about me slides in deaf context? That's super lame. My background is a little different than all y'all's. I am not, like, a network packet hacker networking person. So, I'm, as hopefully you gathered, I am a software engineer and a data scientist and a web scraper. And I do a lot of that stuff. But I was talking to Davin Potts six months ago. I don't know if you know him. He's involved in, ah, there he is, Davin. And we were talking at a conference in Austin. And he said, hey, you know, I really enjoyed your talk about web scraping. Maybe you said that. I don't remember. Eh. You don't have to have enjoyed it. That's fine. But he said, you know, you should do a talk at Wall of Sheep. Maybe about the intersection of wall of sheeping and web scraping. And I thought, I don't even know what that would, what? But I thought about it for a while. And here's what I came up with. So, traditional web scraping. Automated data collection. Generally, when you're scraping the web, you want to get data. Web scrapers tend to behave like humans in a lot of ways. So, they request URLs. They parse HTML data for the most part. If they get really frustrated by just parsing the HTML data, they automate web browsers. They say, fuck it, we'll just automate the entire web browser. They tend to navigate through hyperlinks like humans do. Right? They write requests and they deal with one response at a time. They deal with security if they need to for the goal of data collection. Traditional wall of sheeping, right? So, it passively monitors all traffic across the network. So, you're not just, you know, make a request, get something back. But you're sort of monitoring traffic. Scripts are usually very unhuman-like, right? No one would watch that traffic and say, oh, someone must be browsing around my website. They tend to focus on the transport layer, like relatively lower layer of Internet protocol. And then they focus on data collection. So, they're looking for the goal of security rather than dealing with security for the goal of data collection. So, what's the intersection between those two? So, I'm moving up the Internet protocol stack a bit. And I'm going to focus on the presentation layer. I know it's going to be really weird. But you guys can do it. But still, monitoring all traffic. I really like that concept. I think that's a good one that we can all take from wall of sheep. Monitor all the traffic initiated by a single page load. And focus on data search and extraction. So, why is this needed? I mean, web scraping isn't broke. Why do we need this, right? Here's why. Okay. So, you probably have all seen JavaScript around, right? And it keeps coming. And it keeps coming. There are so many JavaScripts. And everyone puts all their shit in your browser. Right? So, this is how the web used to work. Okay? I made these myself. You have the database. You have your API layer. You have some shit going on on the server. You have your little web service. You have your user. And you have this theoretically impenetrable wall. Right? And I say theoretically because this is DEF CON and that's kind of the point. You know? But theoretically. Happy HTML file. All right. You have jQuery. And fun fact. As of August 26th, jQuery will be ten years old. Yeah. Yeah. I feel old, too. Right? So, then we started having all these little formatting interaction things. You click a thing. A thing pops up. It's so cute. Oh, look at the website. It's so awesome and new. So, but you have your happy HTML file back here. Then you got some little DOM rendering. And the user is happy. You have some happy little Ajaxes maybe eventually. Stuff going on. All right. This is what it looks like today. Right? We have this sad HTML file. It's like HTML. Head. And head. Body. Stuff goes here. And body. And HTML. Oh. And that's all the web scrapers are seeing. Right? Like the user is happy because they're using a browser. And they have the whole fucking server in their browser. And it's taking up five gigabytes of RAM. So, we're happy. Right? I've talked to people who are like, we don't have a content management system. We have a client side web application with an API. It's like, what the fuck do you think a CMS is? Like. Okay. And then you have like a thin layer that we don't have to worry about. Happy little clouds. Oh, yeah. That's the other problem. Then you have like external things going on. And who knows what that is. Oh. The web scraper is so sad now. Because all he's getting is this little HTML file. None of this stuff. He can't see any of it. Ah. This is why we have Selenium. Right? Selenium to the rescue. All right. So, instead of like making a little script. And getting your sad little HTML file. We'll just script the browser. We can use browsers like normal human beings. Human beings. And we'll have the browser go out to the website. And it will be our little server for us. And it will render the DOM for us. And we're so happy. Oh. Oh, no. This is terrible. Because to scrape the web, sometimes you need thousands of page loads. Right? And you need to do them really fast. Because you don't want your computer to be taken over. Your server to be taken over for days and days. Doing this stupid browser that takes up five gigabytes of RAM. Okay? So, here's the data you actually want. See that red thing? That's the data they actually want. That's like a JSON or an XML or something like that. But we still use Selenium. And why do we do this? So, analyzing APIs and server communication is often thought of as the domain of security. Which is why we're all here. But not data collection. I mean, obviously, there are a lot of overlaps. People want to protect their data. They take security measures to protect it. Right? But people who scrape the web. Are usually more like data scientists or researchers. And they have reasons they want to collect all this data. And they're not really like security nerds like we all are. So, they dig around in APIs. They get all like, am I hacking? I don't know. This is weird. It's also difficult to trudge through. Right? Like I kind of implied. Like data scientists are not always programmers. We really like link tags. This is a subtle one. So, since the 90s, this whole Google thing was invented. And what did it do? It crawled through websites. It followed these link tags. These anchor tags. What have we completely ignored? The fact that link tags only link to HTML. Right? Well, now the data's not in the HTML. It's in the other places. But still, whenever we build crawlers. Whenever we build web scrapers. We always base them on finding these anchor tags. These link tags. And then we follow those. And all we get is HTML. And we're really pissed off when that happens. What's up with that? And then the big one is. When you have a hammer like Selenium. Every page looks like an L. Whenever you look at web scraping resources on the internet. People say, oh, I have this JavaScript problem. What should I do? And people are like, just look at Selenium. Just take it. It's fine. Go. You're fine. And we've never really thought past that. Because it works. It's really slow. You know. It takes up a ton of memory. But it works. I'm also guilty of this. All right. No. It's actually. Those are my two worst reviews. It actually has 4.6 stars on Amazon. It's being translated into Russian right now. Which is like its fifth language. It's sold over 20,000 copies. Which apparently is a lot for a technical book. I had no idea. Not a lucrative field. But, yeah. Still doing good. Anyway. Summary of chapter 10. This is what I did when I wrote chapter 10. I mean, there's more to it. But this is basically it. You see. I mean, just really simple things. Let me do the translation. I'm sorry. But I'm going to do the translation. This is going to be a great tip. And I give it a 2.5 stars. So, who not. Better than me. It's not even somebody. So, if you have that. There's somebody who's going to do it. But there is someone who's going to do it. But you're going to need someone to do it. So, we're doing all three. We're going to do over 100. That's the most helpful. This is the demand for this article. sites. Oh, now it popped up. Look at that. This is HTML. It's not some weird flash thing, but these are all SVGs. I would not even know because you have to click down in all of these to even get the thing to pop up. Oh, that's weird. How would you scrape that? Even with the Selenium, it can't be done. Give me a couple weeks and I don't know. But look at this. What is this site? This is kind of screwed up. Oh, there we go. Okay. Oh, look at that. Look at all of these things. Oh, what are all these things? My browser can't even load all of it. There are so many things. Oh, and look at this. Oh, apparently you get the affiliate IDs from over there. Oh, there you go. Oh, there you go. Oh, there you go. Oh, there you you go it turns out you can literally just iterate through all these it starts from zero goes up to like nine thousand something yeah that works way better so why do we keep making web scrapers look like humans right so I give a lot of talks about scraping and web security and I always describe this arms race where we say hey you don't have the right headers you look like a Python script so the Python scripts start putting headers in to look like humans and then the the web scraper say wait a minute you're moving around the website way too fast you filled out that form too quickly so then the scrapers say like oh I'll fill out the form slow or I'll type slow or I'll press the button slower and they're like wait a minute you don't even know what that image says and the web scrapers are like OCR right but sometimes what you really need is this this right this isn't a human but it gets the job done a lot better right so why should we use api's admins that bot add bot protection to the front end because it's really easy it's really easy to do block the scrapers api's take a lot of thought it's it's definitely not impossible it's not even that hard but it takes thought which is a problem for some some web developers the problem is that when you make an eight when your browser makes an api request is essentially a bot making an api request right your browser is a little program and it sends requests off and it gets things back and you know and so it's it's much easier for a script to emulate the actions of just the browser than it is for a script to emulate the actions of a human if that makes sense so security is a little trickier with that sort of thing it's a much lighter load for both servers and clients obviously it's a lot easier to parse right I'd rather just like dump some json and then pick out the thing I want then try to figure out what their templates doing to the front end and why is the title look like that and how do I take off the dollar sign and I don't know a lot more metadata extra information I found this really cool API at Target where you can tell so they have the sell price there and you can tell when the sell price went into effect and when it's gonna be gone which is really cool but they don't tell you that on the front of the website you can only see that in the API that gives you the sales the sell price and scrape once run everywhere ok so here's the thing you have to use selenium to get all the api's in the first place I'll talk about that in a second but once you do that you use selenium a couple of times great now you can do your thousands of requests and then API request of course could be modified in ways that the original site didn't intend right so iterating through ID numbers to get all the pieces of data like in the crossfit example automating pagination you know another obvious one changing parameters to return lots of results instead of just the ones you want again target.com look at stores near me Oh 10 results what if I make it 10,000 results oh look it's all of the targets right I love target because they don't really protect their api's that much so it's a lot of fun ok ok you get it we should use api's we find api's we should stop using selenium so much but how do I do it Ryan? ok you get it we should use api's we find api's we should stop using selenium so much but how do I do it Ryan? all right so this is what I've been working on it's an API scraping tool and you can run it from the command line and you can pass it in these cool little these cool flags so here's your URL U for URL D for directory and then S for search string and you can use any combination of these things that you want so let me do a little example I don't know about the internet right now not because of security but because I tried this last time i am super slow and selenium loads up and it takes forever but I do have a directory full of full of fun things so this is just like put these into HAR files. HAR stands for HTTP archive so selenium loads up a huge stack of things pushes into JSON files and then I parse them alright so it finds all these API responses There are a few methods of printing them out. You can do the browser, you can do one of these things, you can view it as an HTML page, there's also a JSON file that's pretty cool. But you might be saying, wait a minute, this is just the same thing, we can do dumps anywhere, right? But not dumps like this. Okay. So, like I said before, you have a stack of Python, Selenium, Firefox, Firebug, and export bunch of stuff with a layer of Python script on top. Parse the resulting HAR files, the HP archive files for interesting stuff. Then you can format the API call data in a useful way, which I don't think anyone's really done before. And then step two, this is a sort of like run anywhere step, right? Which I am just trying to sort of think about and automate to some extent. But the goal is to find the useful, specific, targeted API call to gather further data. And of course, the big challenge of that is once you find the API call, how do you iterate for the parameters and essentially crawl the site to iterate through those parameters? But I have some thoughts on this. All right. So, here's what it does. It encrypts the API calls with the same path and it records all the parameter values, so you have like, you know, key value, key value, key value. And it records all the key values that it sees and says, like, oh, for this key, here are the array of values that you can put here. Collects key values for both get and post. Post key value pairs are a little bit different. And it determines whether the parameters are necessary or not. So, what it'll do is it'll take an API call and it'll just like one by one take off the parameters and then it'll send the call back and say, like, oh, is the response the same? And then it'll just like take those off and put them in a special little we don't need you anymore group if it turns out that the API response is unchanged. Then obviously several different types of data outputs depending on what you're into, HTML, JSON, or the console. And then the cool thing about this is that they have, I have these in the nice little Python objects and I think there's a lot of flexibility there for more advanced parsing. So, a little more about the unnecessary parameters. So, you might have something like this, which is a real API call from target. And then they have this and I think that this is just like some internal tracking metric. So, it's probably best that we get rid of it. It might be dangerous. All right. Path values is arguments. This is the trickiest one. And so, you have this thing here. At the end. Is that, that's obviously a parameter because we're humans and we can look at that and say, oh, yeah, that's a parameter. But what if it said similar products? Is it the fact that it's numbers? Does that mean it's an argument instead of an important path thing? I don't know. So, I did some best guessing with that. I said, well, if it's at the end and I see a lot of similar API calls and it has a lot of numbers in it, then it's probably a parameter. But that's a really tricky one. That's one I'm still working on. But it does group those the same way it would group them if they were the exact same path with different values. And I keep track of the path parameters in a different way. Okay. So, there are a lot of short-term directions to go in with this. So, obviously, more development with the web-based tool, drill down to explore APIs. And this one is really important for me because I think that it will really allow people who may not have the programming experience to say, oh, wow. This is awesome. There's all my data right there. Done. I don't need to bother with Selenium anymore. Also, some APIs hide their content type. So, they could say, oh, no. This is just plain text. But actually, it's JSON or something. So, you know, that would slow the runtime a little bit to, like, try to parse everything as every single category of response that we might be looking for. But it could also be useful. Also, I'm not doing any cookie tracking right now. I found that it's not that big of a deal. Like, websites don't really seem to care one way or the other. What I found is the front end always cares. Like, the front end of the website, like, super-duper cares what your cookies are and what they say and what your user agent is. But the APIs, not so much, which I thought was kind of interesting. Search for other kinds of result content, CSV, plain text. JavaScript is such a weird thing. I don't know. Sometimes people put data in the JavaScript, and it would be absolutely possible to search for a specific string in JavaScript. So maybe they embed, like, the title of a page that you want in some convoluted, stupid JavaScript text file. Sure. I could do that. As far as actually parsing it as data and putting it in some useful format, that's another stretch. So I've kind of ignored JavaScript. This is the cool thing. So remember when I said earlier about traditional web scraping being lame or web crawling being lame because it only follows, like, the anchor tags? Well, we get all this response content back, and we can actually treat it like data. We can actually look for URLs, not URLs in the DOM and not URLs in the HTML and anchor tags, but any URLs. And we can see if they're internal or external. I don't really bother with external, like, following external URLs so much because then you're out in the wide-open internet, and who knows? But internal URLs, following those, seeing where those lead, that would be pretty cool. And then automating the second step. So this is the one where you get the API that you want. You say, this is my search string, and this is, like, the title of the page or the price of the product or something, and I've entered this, and I get this API back, and apparently this thing has it. But how might you be able to sort of automate the rest of the script and go out and find all of the other prices and all of the other titles and all of the other images and all the things that you want to really build up your database from just one instance? So currently, the user enters a script. It has a complete search string to match on with the page that it's found on. The web scraper automatically identifies two pieces of information. Which API call returns the search string? And this is already done. And where in the response that information is located? So we can tell whether or not it's XML or JSON or whatever, and we can also record, oh, you go this way down the tree, and your search string is here. And we can assume that with all the similar API calls, you go this way down the string, and it's going to be there every single time. Now, here's the trick. You need to find those similar API calls, right? And to find those similar API calls, you need to be able to iterate the parameter values. So we can find the parameter values required for the API call. That's already done. And where those parameter values can be found? OK. This is a little tricky. So you're treating the parameter values as a search string again. And you are searching for them in the content. Then you find other search parameters. So the scraper must identify locations of analogous API calls and their associated parameters. And this can be done by identifying analogous URLs, not necessarily HTML URLs, that link to these required API call parameters. And then as a side note also, some parameters aren't necessarily like lettered number combination product IDs, but they're just like zip codes or, like I showed you before, the incremented IDs. And those are a pretty trivial case. Although recognizing as a zip code and saying, oh, here's a list of zip codes. I don't know how far I want to take it. All right. So here's a more concrete example. Let's say you have a website, a web page in HTML, a piece of HTML that you are searching. Products prod name blarg123. Note that that is not indicative of anything. And you're searching for the string, the product name. You want to collect a list of product names from this website, right? So you go and you do the Selenium thing on this page. And you find that, oh, hey, there's this cool API that returns the product name. OK. So that's probably the one that I want. That is the target, not target the store. Oh, god, this is confusing. Not target the store, but target the goal API call that contains the information we want. So the path is that, and the parameters are that, right? And then you find that there are several different API calls of this exact same format in this second API call. This related products type equals some market segment not related to anything else. Great. Awesome. So now you have a second API. And you're building this thing sort of recursively. Dumb. And the market segment, that parameter, we can use that as a search string. And we can see, has anything we've seen so far in this path had that parameter in it? OK. And then we say, oh, that page does. In practice, maybe this little recursive thing could go down for a really, really long time, right? So then you have this product info page that you use to get the ID, the string search term market segment that you then use to get a list of related products. OK. Now you go to all those related products, product infos page. And then you get another market segment, right? And then you go to all their related product pages. And then you get the product info pages for them. And all of a sudden, you've built this sort of crawler that's not crawling through the HTML website. It's literally crawling through the APIs by doing like a one-time analysis of the network traffic for a single page load. And there's, actually, this is more confusing now than when I wrote it. This kind of goes like this until eventually you can loop it back up around. So that would be cool. All right. This seems really complicated, Ryan. What are you doing? Yeah, it might be complicated. But so are a lot of modern web scraping tools. And I find that a little bit of complexity on the back end, can save people a lot of headache. And maybe help them discover things that they might not have seen otherwise. And discover useful tricks and even some vulnerabilities. Who knows? We also need to stop thinking of web scraping as just scraping front-end pages containing data. Right? And it's really tempting because we see that data in our browser and we're like, oh, I want that one. Right? And then we write the script and we're like, get me that one. But really, we need to be thinking about it as a collection of calls. And increasingly so with all the JavaScript we're seeing now. And we also need to stop thinking about web crawling as traversing anchor tags. We need to start thinking about it as finding addresses for things and finding parameters and figuring out where the information is actually contained and how it links to other pieces of information. And I really think that applying traffic monitoring techniques, string parsing, and a little common sense to get data better, stronger, and faster is a good thing. All right. Any questions? I'm six feet tall. All right. Yes, you there. So have you tried running it through a proxy to see the actual web service calls? And then just try to figure out what the actual... So running it through a proxy to see the actual web service calls? Yes, that's what I'm doing with Selenium. So you fire up the Selenium as a browser automation tool, and then I just record all of the web service calls. But the cool thing is you only need to do that for a couple of pages to sort of get the sense of how the website's put together and then create more generalized approach. Yeah? I'm not sure how good of a question this is, but what do you do when you start getting throttled by certain web services that after you do all these API calls just kind of cut you off? Is there a way to handle that? Slow down. Slow down. No, and there's actually a really good reason for this. It's not just being nice. So when you start to get throttled and things like, so, okay, terms of service and things like that, you browser wrap and click through and, oh, no, I have, like, a thing stuck in my Thunderport. It won't quit. Oh, it's okay. Yeah, so you agree to the thing. It doesn't actually mean anything until they start sending you cease and desist letters and throttling. They're just throttling you and blocking you. Now, if you say, ha, screw them, I don't need to listen to them. I'm just going to, you know, use a different IP address and then go somewhere else and go into a Starbucks and open my laptop, ha, they'll never know it's me. That's where it actually becomes illegal and you can get sued. So don't do that. Thanks. Thanks. What do you do if the entry points are moved all to, what do you do if all the APIs are moved into a single entry point and the parameters are encoded? Well, besides cursing. So if the APIs are moved into a single entry point, like, all the data you want is in that single entry point? That's what the old-fashioned web used to be, right? So we would make this API callback. Right? And we would get back this, like, HTML file that would contain, like, all the data. Right? Okay. Maybe I'm misunderstanding. Well, yeah. Okay. Let's stay with encoded parameters. Okay. I don't think she can hear the first part of the entry point. Do you? Okay. Forget the entry points. But encoded parameters. If they're encoded for security reasons? So, yeah, encoded parameters. Basically, all of them are encoded. So you have, like, a product ID. I can't tell what that means, right? It's just, like, a random string of things. But the thing is you can find that random string of things somewhere else in the vast collection of other information. And at some point, it kind of has to reference it. So you might find that random string somewhere else in the vast collection of other information. And it makes an API call and gets information about the product. Now you know that that product or that piece of information and that random string are related, right? And so you might have to load some things to see what they are. But, you know, the problem with encoding API responses is that at some point they have to be decoded, right? And we're pretty used to dealing with IDs and random strings and things like that. But at some point, humans have to be able to read it. And there may be a very long sort of daisy chain of things until you can attach the encoded thing to the meaning. But at some point it does have a meaning that can be deduced. So I know that's a little hand-wavy, but I hope it answers. Any one question? So you had mentioned the issues. You were running into detecting if a path was a parameter or an input. I was wondering, as you're supplying it, especially with search boxes, if there is something that you automate as part of Selenium to fill in those search boxes and then look back at your paths or other previous API calls to do the looks to see if that path ends up becoming, well, coming from either previous API or your previous provided inputs. All right, so that's a really good question. And a couple things about that. So I am not filling out search boxes or doing anything. So actually, I am moving down the page. I do use the scroll bar to make sure the page sits around there for a little while and everything has a chance to do its thing. And also, there's a lot of new stuff where certain scripts won't be activated until you actually view them in the browser window. But it doesn't automatically click through anything or mess with things or enter information. You can certainly make it do that. That wouldn't be difficult at all. But I haven't done that. And that's a really interesting question. So providing a new path and seeing if the information, if the structure of the information remains the same. And that would be a really good way of doing that. That's certainly something I've thought about. Yeah, I could certainly work that in. The trick is figuring out, like, where are these different parameters? Right? So you have this API call. You have a different ending at the end. It would be helpful to see a lot of different examples of that. So you could sort of compare the different structures. But sometimes you get that and sometimes you don't. So it's a really good idea, though. When are you making a burp plug-in? What is a burp? It's a man-in-the-middle proxy. What? It's a man-in-the-middle proxy for application security testing. It allows for automated buzzing and . Okay. So I'm crawling the web and then there's a man in the middle. And then all of a sudden I'm getting back bad web data? What would I do with this? So burp allows for automated reg expression-based completion and changing of different web requests, as well as keeping the history of the requests so that you can, like, wrap it up into a nice report. And also allows for automated fuzzing of parameters to determine if, for example, SQL injection or other such problems. So with your API calls, it would be really easy to integrate it into something that's like, hey, these are the things you want to fuzz. So that might be useful. A couple thoughts. First, I'm not really trying to attack the servers. I like the servers. They give me useful data. I don't want to inject things into them. And the other thing is generally with web scraping you say, okay, I need this list of 10,000 specific things. I want all of these articles. I want all of these different products. I want all of these SEC filings. It's a very concrete list. So it's not like throw something random at it and see what comes back, for the most part. It's like I want this concrete set of data. So that might have some really useful tools. That sounds really cool. I hadn't heard of it. But I think the application might be slightly, slightly different. But I'll have to check it out. You kind of mentioned cookies but didn't. But I guess the APIs that you're touching right now, like the target API, doesn't really rely too much on that. But have you run into situations where you have to bootstrap the call with, let's say, a cookie value, so that you can make all your subsequent calls? And are you kind of thinking of building that into your script? So that was actually exactly what I said on my suggested or like future development slide. So right now I haven't actually had a problem with cookies and API calls. I've been testing this across a bunch of different sites. And I've used it for a couple practical applications. Haven't run into the cookie problem. But it's absolutely a parameter that is important in the web in general and something that would be good to build in in the future. And it's easy enough to do. Is there any plan for adding this in your book, like a chapter or something? O'Reilly said maybe in 2017 we can start talking about like a second edition. So I got plans. I got plans. We'll see. Yeah, a question. Have you used your scraper on anything that's required authentication or OAuth or anything like that? Or have you thought about putting in another module for authentication? So one of the things you can do pretty easily is log in with Selenium because obviously there's a lot of like crazy stuff going on. And then you can just copy the cookies. I haven't had to. But it's definitely possible. So yeah, it's definitely possible. I haven't done it yet. But it might be something that's necessary. So with Selenium you can detect. You can detect Selenium from JavaScript because it mutates the API. Have you dealt with anyone who does not want. What do you mean it mutates the API? Well, for example, with Firefox driver. They add a web driver property to the navigator element in the DOM. Have you gotten into this cat and mouse game at all with the. I'm not a bot. But I'm going to try and look like a bot. That type of thing. You know, I keep hearing about this Selenium you can always detect it thing. But I never knew exactly why. And honestly, like I've searched for it. I've never been able to find it. And I've never found a website that blocked me because of it. And that's part. You know, to what I said earlier about like security takes some thought. Especially on the API layer rather than like the HTML front end DOM layer. And I've just never seen anyone do it. . Okay. I'll check it out. That makes sense. . Sorry. I guess you can use it to fuzz things. Right? So sort of you identify all the API calls and then identify the data structures that you're using. And then sort of send them some weird values and see how they react and get that stuff back. Would you thinking. So I got two questions. Sort of that. And then. I agree. Are you coming to the DEF CON party? . Yes. So sending them weird values. You mean like weird hacking values? Or like weird I want this different set of data values? Because you could do both. I mean there's nothing stopping you from doing both. But I think one of the things. And maybe this is like the thing that differentiates like hacking from web scraping is what you send at the server. So with web scraping, you generally want to send really great information. Like, you know. Like requests to the server that are perfectly valid and will get you valid useful data back. With hacking, you want to send like totally weird off the wall stuff that you think is going to mess things up or get you into something. And you can absolutely do both. It's up to you. But one of the challenges I'm dealing with is finding those good values to send to the server. Any other questions? Well, I'm going to be around. I'm going to get a drink. All right. Thank you very much.