1 00:00:00,000 --> 00:00:04,140 All right, as usual, just like last year, I can't believe people actually come to watch me talk. 2 00:00:04,880 --> 00:00:10,480 Last year, it was, what, 10 in the morning on Sunday, and I figured, like, fuck, I'm hungover. 3 00:00:10,540 --> 00:00:16,780 Who's going to be here to watch me? And then Sunday at 4, I'm like, fuck, dude, I wanted to 4 00:00:16,780 --> 00:00:21,780 fly home today. But hey, for everybody who did come out, thanks. I really appreciate it. 5 00:00:21,920 --> 00:00:27,100 And just like last year and every year I've been coming to DEF CON, I fucking love this, man. So 6 00:00:27,100 --> 00:00:32,200 I appreciate everybody who came out. All right, so this year's talk is you spent all that money and 7 00:00:32,200 --> 00:00:36,820 you still got owned. So I've been doing a lot of pen testing, and I'm going all over to all these 8 00:00:36,820 --> 00:00:41,020 different countries and pen testing, and I'm running up against all these different defensive 9 00:00:41,020 --> 00:00:48,660 things. You know, application firewalls, WAFs, and IPSs, and NAC solutions, and we're still giving 10 00:00:48,660 --> 00:00:55,100 them the beat down, like pretty freaking bad. And then in a lot of cases, I roll out and I get into 11 00:00:57,100 --> 00:01:03,700 incident response. It's like, dude, you're already fucking owned. Fuck. You know, so that was kind of 12 00:01:03,700 --> 00:01:10,060 the topic of this, so let's do it. So who am I? Network, application pen tester dude, trainer, 13 00:01:10,620 --> 00:01:14,620 aka the black guy at security conferences. Everybody who always wants to know, I'm like, 14 00:01:14,720 --> 00:01:23,380 dude, that's me. Yes, that's me. All right, and then how do I do my thing, man? I hack, I curse, 15 00:01:23,480 --> 00:01:25,960 I drink. The order changes, but... 16 00:01:27,220 --> 00:01:31,540 It's all the same. So if you don't like people who say the word fuck, you might want to get up 17 00:01:31,540 --> 00:01:37,800 and leave. Okay? All right, so I always do this because, you know, it's that nostalgia, especially 18 00:01:37,800 --> 00:01:41,800 since I'm here at DEF CON, man. Let me take you back, all right? So this is 10 years I've been 19 00:01:41,800 --> 00:01:47,680 doing this DEF CON thing, man, and for me, back in the old days, man, pen testing was easy. So we 20 00:01:47,680 --> 00:01:51,680 would just tell the customer, hey, dude, we're security people. And the customer would be like, 21 00:01:51,800 --> 00:01:56,920 oh, okay. Whoa, damn. The security people are here. And then, like, we would break 22 00:01:57,100 --> 00:02:02,960 out our open source tools like Nessus. Who remembers when Nessus was free? Shit. So we would 23 00:02:02,960 --> 00:02:07,380 break out our shit, man, and it would be like, yo, they're coming in here with Nmap and Nessus and 24 00:02:07,380 --> 00:02:15,080 all this open source stuff. And then we would go out, hit our websites like rootshell.be, 25 00:02:15,880 --> 00:02:20,420 packetstorm. Anybody? Who's with me? That's what I'm talking about, right? The good old fucking 26 00:02:20,420 --> 00:02:24,120 days when you would just yank down your shit, fucking compile it, and be like, yo, fuck, I need 27 00:02:27,100 --> 00:02:31,660 to fucking plan it, and just, like, drop shells every fucking where. So then we would, like, 28 00:02:31,680 --> 00:02:36,760 take screenshots and be like, yo, man, we gave your network the fucking beatdown. Here's the report. 29 00:02:44,140 --> 00:02:50,580 Right? And then after that, it was like this. Remember that shit? Remember that shit? Your 30 00:02:50,580 --> 00:02:56,540 network fucking sucks. Pay me. Well, today, man, everybody's a CISSP. 31 00:02:57,100 --> 00:03:00,440 And then, like, do you guys go through this? Like, the dude who hires you thinks he knows more than 32 00:03:00,440 --> 00:03:05,660 you. And, like, sometimes he actually does, but, like, fuck, why'd you hire me then? So he's like, 33 00:03:05,720 --> 00:03:09,100 well, you know, we're doing this, we're doing this, we've got the IDS, we've got the IPS, 34 00:03:09,300 --> 00:03:14,060 we've got the NAC, we've got the WAF, we've got the this, we've got the that. So I'm rolling out 35 00:03:14,060 --> 00:03:19,740 there, and I'm like, this is some bullshit. So let me walk you through a little story. Now, 36 00:03:19,740 --> 00:03:25,280 anybody who does my talks knows that I always got a story. So, story. I'm pit testing this client 37 00:03:26,020 --> 00:03:30,160 about a year and a half ago. I get out there, and the customer's like, okay, Joe, well, you've 38 00:03:30,160 --> 00:03:34,700 already been auditing these subnets. Can I get you to go over to this subnet and do a VLAN ACL audit? 39 00:03:35,360 --> 00:03:41,660 Okay, now, have any of you ever done a VLAN ACL audit? Okay, well, you guys are smarter than me, 40 00:03:41,700 --> 00:03:46,740 because I had never done one. So I'm back there, I'm like, what exactly do you want me to audit? 41 00:03:46,880 --> 00:03:51,240 He was like, well, audit the VLANs. So, all right, I go over, and I look at the config, 42 00:03:51,600 --> 00:03:54,320 and I'm sitting with the network admin, and they've got, 43 00:03:54,740 --> 00:03:55,260 for three minutes, I'm like, what the fuck? I'm like, what the fuck? I'm like, what the fuck? I'm like, 44 00:03:55,260 --> 00:04:04,560 300 users, 90 VLANs. Now, I'm having a moment. I'm like, how the fuck you got 90? I mean, 45 00:04:04,600 --> 00:04:09,480 you ain't even got, so I'm like, all right, cool. I'll tell you what. Let's get a little piece of 46 00:04:09,480 --> 00:04:13,160 paper, and I just walk from person to person. I was like, hey, man, do you need this VLAN? 47 00:04:14,960 --> 00:04:21,240 But, yo, do you need this VLAN? How about this one? So, I went through this VLAN ACL audit, 48 00:04:21,600 --> 00:04:24,960 and then I go through all these VLANs that aren't being used. I'm like, okay, you're not using this 49 00:04:24,960 --> 00:04:28,220 one, you're not using this one, you're not using this one, you're not using this one, and this is 50 00:04:28,220 --> 00:04:35,440 like a big, big fucking company. So, we go through, and we audit all these VLANs. We do some network 51 00:04:35,940 --> 00:04:41,760 resegregation shit, move some shit around, and now, I audit one of their DMZs. Company's got 52 00:04:41,760 --> 00:04:46,300 four DMZs. So, I audit one of the DMZs, and I'm like, yo, man, these boxes, you got a couple of 53 00:04:46,300 --> 00:04:51,840 boxes out here that, like, really need some patch updates. So, I go over, and I tell the deputy CIO, 54 00:04:51,980 --> 00:04:54,940 I'm like, yo, you got these boxes that need to be patched. 55 00:04:54,940 --> 00:04:59,220 You're missing some MySQL patches, you're missing some PHP patches, got a lot of stuff that needs 56 00:04:59,220 --> 00:05:04,440 to be cleaned up. So, they have a meeting, because everything's a fucking meeting. They have a 57 00:05:04,440 --> 00:05:11,880 meeting, and then, one of the developers stands up and goes, oh, no, no, no, no, no, we can't patch 58 00:05:11,880 --> 00:05:24,160 those. Those are our development servers. And I'm like, is this shit passing the common sense test? 59 00:05:24,240 --> 00:05:24,860 You got your fucking... 60 00:05:24,940 --> 00:05:35,420 And dev servers in the DMZ? Like, it gets better. So, I'm out there, and I'm working with the client 61 00:05:35,420 --> 00:05:40,100 a little bit more, and I start to do my little pen test thing, and I drop a couple shells. I'm like, 62 00:05:40,140 --> 00:05:44,460 yo, man, this network is fucked up, because it's too easy to drop shells. Client says, well, how 63 00:05:44,460 --> 00:05:50,980 come our IDS didn't catch you? And I was like, there's an IDS? So, he goes, yeah, we're being 64 00:05:50,980 --> 00:05:54,400 monitored by... I can't say the name, because some of y'all have probably worked for him. 65 00:05:55,660 --> 00:06:02,040 So, the company had hired another company to outsource their IDS, right, to do the management 66 00:06:02,040 --> 00:06:07,380 reports and all that kind of bullshit. So, we go over, and we go look at the box. I'm like, well, 67 00:06:07,400 --> 00:06:11,000 yo, man, do I have creds on the box? Mind if I just take a quick look? So, to give me creds on 68 00:06:11,000 --> 00:06:14,400 the box, I try to log into this fucking thing, and this thing takes, like, fucking two minutes 69 00:06:14,400 --> 00:06:24,920 to log in. Over SSH. I'm like, what the fuck? So, I log in, and I'm like, this bitch is going to log in. 70 00:06:24,940 --> 00:06:31,180 This bitch is slow as hell. So, I run check rootkit. This motherfucker's got four rootkits on it. 71 00:06:38,760 --> 00:06:44,220 Pin testing at its finest. Okay, so, what do I do when I'm up against these big companies? People 72 00:06:44,220 --> 00:06:47,280 are like, dude, you audit all these fucking banks, you audit all these big fucking companies, 73 00:06:47,420 --> 00:06:53,980 and really, I just ask Google to help me. That's it. So, first thing I do is I do a bunch of quick 74 00:06:54,940 --> 00:07:02,280 for SQL errors. I look for remote file includes. Anything that's going to give me a quick shell, 75 00:07:02,860 --> 00:07:06,400 okay? Always go for the quick shell. Go for the fucking jugular when you're on a pen test, dude. 76 00:07:06,740 --> 00:07:12,280 Don't do all that bitch scanning shit. Go for the fucking jugular, okay? So, I always look for 77 00:07:12,280 --> 00:07:16,700 SQL injection. Always look for RFIs. Always look for cross-site scripting. You know, try to find 78 00:07:16,700 --> 00:07:22,460 that stuff right away. Then, after that, start trying to do your passive recon stuff. So, I try 79 00:07:22,460 --> 00:07:25,960 try to figure out, like, okay, well, what subnets do they have? Where's all their stuff 80 00:07:25,960 --> 00:07:32,940 located? I use this fucking unbelievable tool called Firefox. Fucking unbelievable, man. 81 00:07:33,020 --> 00:07:36,980 You would be amazed at what it can do. So Passive Recon is one of the tools that I use, 82 00:07:37,060 --> 00:07:40,740 something you really got to try out. I'm sure most of you guys are already using it. Definitely 83 00:07:40,740 --> 00:07:47,660 got to try that out. Maltigo, definitely the shit. Definitely got to use that. And then 84 00:07:47,660 --> 00:07:52,100 the next thing I do is go look for load balancers. I run into load balancers on probably 85 00:07:52,840 --> 00:07:58,460 30% of my pen tests now. It's getting real common, okay? So biggest deal for me, figure 86 00:07:58,460 --> 00:08:03,660 out if the box is load balanced, figure out if it's DNS or HTTP load balancing, because 87 00:08:03,660 --> 00:08:07,300 like I said, if you're shooting packets at it and then, you know, the fucking load balancer 88 00:08:07,300 --> 00:08:10,960 is sending you packets every which way, well, it kind of makes the testing a little hard. 89 00:08:12,380 --> 00:08:16,880 So definitely got to figure that out first. And then once again, we have that amazing 90 00:08:16,880 --> 00:08:20,820 tool called Firefox that helps us find that out. 91 00:08:20,900 --> 00:08:22,020 So throw on live. 92 00:08:22,100 --> 00:08:27,540 HTTP headers and make some generic requests to the web server. See if anything within 93 00:08:27,540 --> 00:08:33,340 the HTTP header changes. So if your first packet you send, when you get the response, 94 00:08:33,520 --> 00:08:38,580 it comes back and says IIS 5, you send another packet to the same box, it comes back and 95 00:08:38,580 --> 00:08:47,800 it says IIS 6, dude, it's probably load balanced. Same thing with the dig command and NetCraft. 96 00:08:47,980 --> 00:08:51,400 NetCraft is freaking awesome. You'll often see stuff, it'll tell you right there in it, 97 00:08:51,440 --> 00:08:51,880 you know, 98 00:08:52,100 --> 00:08:56,800 F5, big IP and all of that. And you can also get the IP addresses of the load balancer itself. 99 00:08:57,420 --> 00:09:02,240 So that's been a real big deal for me when I'm pen testing. Load balancer detection is a shell 100 00:09:02,240 --> 00:09:07,500 script that does it. Halbert is a Python script that does the same thing. So these are some real 101 00:09:07,500 --> 00:09:12,680 good things to help you figure out what is the real IP of the host that you're trying to attack 102 00:09:12,680 --> 00:09:20,140 if it's behind a load balancer. All right. Next thing I run into is IPSs. So it seems like 103 00:09:20,140 --> 00:09:21,420 everybody has an IPS. 104 00:09:22,800 --> 00:09:29,460 However, the overwhelming majority of my customers have it in IDS mode. Does anybody else have 105 00:09:29,460 --> 00:09:33,740 this issue where you're like begging, turn the fucking thing on, dude, let's block some 106 00:09:33,740 --> 00:09:40,020 traffic. Really. We'll see what happens. Okay. Who's of the belief that if we block 107 00:09:40,020 --> 00:09:45,160 some legitimate traffic, we'll make note of it and then we'll allow that. So fuck it. 108 00:09:45,180 --> 00:09:49,280 Let's block all the rest of the shit. Who's with me? Okay. I'm just making sure that I'm 109 00:09:49,280 --> 00:09:51,800 not the only one who thinks this shit, right? So, okay. 110 00:09:52,460 --> 00:09:57,420 So what I'm trying to figure out if I'm up against an IPS, I do some real simple things. Okay. 111 00:09:57,520 --> 00:10:02,540 I'm a Linux guy. I'm using Windows right now and I feel a little dirty. So please bear with me. 112 00:10:03,180 --> 00:10:09,020 Okay. So first thing I break out is I break out curl. And you see that I go for a win NT system 32 113 00:10:09,020 --> 00:10:16,540 CMD.exe. Now guys, this attack has not worked since Jesus was walking the earth. Let me inform you 114 00:10:16,540 --> 00:10:21,780 if you do not know. Okay. The only reason that you're doing this is you're just trying to see if you're 115 00:10:21,800 --> 00:10:25,420 going to be able to see if something blocks your IP address or sends you reset packets to your 116 00:10:25,420 --> 00:10:32,060 connection. So if this thing sends you a reset packet, when you ask for CMD.exe, well, it's 117 00:10:32,060 --> 00:10:39,020 probably an IPS. If it blocks your IP address, it's probably an IPS. It's like unbelievable 118 00:10:39,020 --> 00:10:44,980 deductive reasoning here, right? So some guys from purehacking.com came up with a tool that does 119 00:10:44,980 --> 00:10:50,400 this active filter detection, the Aussies in the house. So they got this figured out really good 120 00:10:51,800 --> 00:10:55,740 stuff in Python to kind of change it up and enhance it a little bit. So, you know, for those of you 121 00:10:55,740 --> 00:11:02,260 guys who support Python, fuck Ruby. If any of you guys support Python, come holler at me. We're working 122 00:11:02,260 --> 00:11:14,400 on some shit. Yo, fuck Ruby. Whatever. Okay. By the way, did I mention I curse? Okay. So oftentimes I do 123 00:11:14,400 --> 00:11:19,940 run into IPSs. What I generally do is I just shoot, you know, for three or four IPs. So I shoot from a 124 00:11:21,800 --> 00:11:26,380 reset packet. I get reset packets or if I get my IP blocked. So once I know I'm up against an IPS, the 125 00:11:26,380 --> 00:11:34,820 next thing I try to do is see if the IPS can handle SSL. So, again, that's why we use Linux. Just go 126 00:11:34,820 --> 00:11:41,940 ahead and create an XINED file. I call it SSL test. So you see that I open it up on port 8888 127 00:11:41,940 --> 00:11:48,980 and then any data that I pipe into local host 8888 goes into this little shell script. You see 128 00:11:51,800 --> 00:11:55,560 Now, here you can see my mad, mad shell scripting capability. 129 00:11:55,860 --> 00:11:57,800 Look at that one-liner shell script, baby. 130 00:11:58,160 --> 00:11:58,720 What? 131 00:11:59,540 --> 00:12:04,160 So, the traffic goes straight into OpenSSL and then makes the connection to the target 132 00:12:04,160 --> 00:12:09,180 and then sends all that same active filter detection or, you know, cmd.exe, 133 00:12:09,200 --> 00:12:13,800 again, trying to see if my IP gets blocked, okay? 134 00:12:14,040 --> 00:12:18,020 The overwhelming majority of clients that I have that do deploy an IPS 135 00:12:18,020 --> 00:12:25,300 and do deploy it in blocking mode do not decrypt the SSL traffic prior to it passing the IDS or IPS. 136 00:12:25,960 --> 00:12:27,940 So, that's one of the things that I really look for. 137 00:12:28,280 --> 00:12:31,320 If you guys are running into that, try to get your client to spend the money. 138 00:12:32,040 --> 00:12:33,420 Hey, man, get an SSL accelerator. 139 00:12:34,160 --> 00:12:37,900 Terminate the SSL in front of the IPS and then let's actually start trying to decrypt it. 140 00:12:39,560 --> 00:12:40,860 Okay, attack through Tor. 141 00:12:42,040 --> 00:12:43,040 I do this a lot. 142 00:12:43,180 --> 00:12:46,240 So, I fire up Tor, push all my stuff through Tor and PrivOxy 143 00:12:46,240 --> 00:12:47,700 and then that same thing. 144 00:12:47,700 --> 00:12:51,900 Where I just push all my attacks to local host and it pipes out through Tor, same thing. 145 00:12:52,120 --> 00:12:58,640 So, for this one, the recommendation is get your clients to block Tor exit nodes, okay? 146 00:12:59,220 --> 00:13:03,740 Most companies don't have a valid reason for needing people to connect to them through privacy. 147 00:13:03,860 --> 00:13:07,000 Sorry, I know we give a shit about privacy, but fucking companies don't. 148 00:13:07,260 --> 00:13:09,900 So, tell everybody, block Tor exit nodes. 149 00:13:10,340 --> 00:13:12,660 That's the big thing that I'm doing with a lot of my customers. 150 00:13:12,820 --> 00:13:17,540 I don't have Glip proxies in here because the hangover was really affecting my ability 151 00:13:17,540 --> 00:13:20,240 to do slides this morning, okay? 152 00:13:20,820 --> 00:13:25,260 And then the last thing that I've been running into is WAFs, web application firewalls. 153 00:13:25,340 --> 00:13:31,240 So, because I do a lot of PCI pen testing and some genius over at the PCI council figured 154 00:13:31,240 --> 00:13:35,340 that, hey, if you have a web application vulnerability and you don't want to fix it 155 00:13:35,340 --> 00:13:40,920 and you deploy a WAF, you are somehow now PCI compliant, for some reason, I'm pen testing 156 00:13:40,920 --> 00:13:42,260 a lot of WAFs now. 157 00:13:42,600 --> 00:13:47,200 So, things with the WAFs, they're actually not that difficult to identify. 158 00:13:47,200 --> 00:13:53,200 Pretty much, just throw any frickin' character at it and this thing fucking gives up the 159 00:13:53,200 --> 00:13:53,320 bit. 160 00:13:53,380 --> 00:13:54,560 She's like, yo, okay, I'm a WAF. 161 00:13:56,280 --> 00:13:59,720 Really fucking difficult to figure out if you're attacking a host that's behind a WAF. 162 00:14:00,140 --> 00:14:04,100 So you send it any special character and then the thing fucking gives you all kinds 163 00:14:04,100 --> 00:14:04,740 of weird things. 164 00:14:04,880 --> 00:14:14,060 So, if you request cmd.exe and you get a method 501 instead of a 404, file not found, you're 165 00:14:14,060 --> 00:14:15,800 probably up against Apache mod security. 166 00:14:16,180 --> 00:14:17,180 Now, newer versions are better. 167 00:14:17,180 --> 00:14:19,320 Newer versions of mod have changed this. 168 00:14:20,520 --> 00:14:23,100 But who the fuck really upgrades their WAF, really? 169 00:14:24,300 --> 00:14:26,200 So, I run into this a lot still. 170 00:14:26,880 --> 00:14:29,780 Also, another one that I run into, Actronix Webknight. 171 00:14:30,080 --> 00:14:37,780 You see that in the HTTP response header, it gives a response code of 9999 and no hacking. 172 00:14:40,200 --> 00:14:41,340 So, I run into this. 173 00:14:43,400 --> 00:14:47,160 If you're seeing that you're not up against one, you know, just start acting. 174 00:14:47,180 --> 00:14:52,280 I'm adding things to it to see what it does and see if it gives you a 404 for a file that 175 00:14:52,280 --> 00:14:53,100 it should not have. 176 00:14:53,360 --> 00:14:59,240 You know, I request joe.exe and then I request netcat.exe, nc.exe and I just look at the 177 00:14:59,240 --> 00:15:00,260 differences between them. 178 00:15:00,540 --> 00:15:01,140 I mean, that's it. 179 00:15:01,300 --> 00:15:03,480 If you send a good request, it gives you a 200 okay. 180 00:15:03,660 --> 00:15:09,200 You send a bad request for a file that doesn't exist and then it gives you a 404 and then 181 00:15:09,200 --> 00:15:13,160 all of a sudden you insert something for cross-site scripting and it gives you a completely different 182 00:15:13,160 --> 00:15:13,460 error. 183 00:15:13,640 --> 00:15:15,640 You're up against some sort of defensive mechanism. 184 00:15:16,020 --> 00:15:16,560 Make sense? 185 00:15:17,840 --> 00:15:18,520 All right. 186 00:15:18,560 --> 00:15:22,300 So, based on that, start playing the encoding game. 187 00:15:22,560 --> 00:15:28,400 So if you figure that you're up against a WAF, see if this thing handles hex. 188 00:15:28,780 --> 00:15:34,980 See if it handles UTF-7, UTF-8, UTF-16, base-64 or mixing of them. 189 00:15:35,660 --> 00:15:37,580 See how it handles the multiple encodings. 190 00:15:37,720 --> 00:15:43,400 Most WAFs cannot handle encoding very well, okay, especially if you start mixing the encodings 191 00:15:43,400 --> 00:15:43,720 together. 192 00:15:44,240 --> 00:15:44,760 Okay? 193 00:15:44,760 --> 00:15:47,580 So it's a good way to try and see if you can get by the WAF. 194 00:15:49,060 --> 00:15:49,500 Okay. 195 00:15:49,640 --> 00:15:55,440 A good buddy of mine, Sanjo Gachi in Wendell, they wrote a tool called WAF roof and I started 196 00:15:55,440 --> 00:15:56,760 contributing to it last year. 197 00:15:56,960 --> 00:15:59,100 I think it's the shit and it's in Python. 198 00:15:59,900 --> 00:16:04,900 So the cool thing that we're doing here is we're fingerprinting the HTTP response headers 199 00:16:04,900 --> 00:16:09,020 and we're identifying web application firewalls and I fucking love it. 200 00:16:09,080 --> 00:16:14,280 So right now we've got a pretty good list, about 10 or 12 WAFs and the list is getting 201 00:16:14,280 --> 00:16:14,900 bigger and bigger. 202 00:16:15,140 --> 00:16:19,020 The next thing that we're working on is called WAF fun where we're going to work on a tool 203 00:16:19,020 --> 00:16:23,420 that actually brute forces web application firewall rule sets and it's in Python. 204 00:16:27,080 --> 00:16:28,900 So I'm real excited about that, guys. 205 00:16:28,960 --> 00:16:32,900 I really wish that we had made more progress with it, but, you know, working, drinking, 206 00:16:33,660 --> 00:16:37,000 working and drinking, it was kind of hard to get the tool done so that I could have 207 00:16:37,000 --> 00:16:41,000 a working demo, but hopefully, you know, the next couple of conferences and next year 208 00:16:41,000 --> 00:16:42,420 we'll have a working demo of WAF fun. 209 00:16:42,420 --> 00:16:44,800 So you can see the brute force and WAF rule sets. 210 00:16:44,920 --> 00:16:45,920 I think that's going to be the shit. 211 00:16:46,800 --> 00:16:47,200 Okay. 212 00:16:47,240 --> 00:16:47,620 All right. 213 00:16:47,660 --> 00:16:48,920 So quick thing that I use. 214 00:16:49,140 --> 00:16:54,400 Gary O'Leary Steele, he wrote a tool called Unicode fun and it's great for, it's Ruby, 215 00:16:54,540 --> 00:16:56,700 I know, but fuck Ruby. 216 00:16:57,920 --> 00:17:01,500 So we're going to get that shit moved over to Python and my tool is going to be in Python. 217 00:17:01,780 --> 00:17:04,980 So we're putting that in Python and we'll do the different encoding. 218 00:17:05,100 --> 00:17:09,260 We want to make a tool specifically for web application attacks that's going to be part 219 00:17:09,260 --> 00:17:10,440 of the WAFit framework. 220 00:17:10,600 --> 00:17:12,260 WAFit framework will include WAF fun. 221 00:17:12,260 --> 00:17:18,720 And we'll specifically be working on multiple encodings and proxy awareness so that it can 222 00:17:18,720 --> 00:17:22,980 jump on Tor and it can jump on Glip proxies while it's doing all these different things. 223 00:17:23,220 --> 00:17:24,480 So that's really what we're looking for. 224 00:17:25,560 --> 00:17:26,040 Okay. 225 00:17:26,180 --> 00:17:28,320 We already talked about attacking websites through Tor. 226 00:17:28,780 --> 00:17:30,740 I talked about this a little bit last year. 227 00:17:31,020 --> 00:17:34,600 I don't know if anybody here works for .NET Defender or whatever fucking company makes 228 00:17:34,600 --> 00:17:35,280 .NET Defender. 229 00:17:37,600 --> 00:17:41,220 We found that their ability to defend against SQL injection. 230 00:17:41,680 --> 00:17:42,240 I don't know. 231 00:17:42,260 --> 00:17:43,200 How do I articulate this? 232 00:17:43,380 --> 00:17:44,120 Fucking sucked. 233 00:17:45,620 --> 00:17:49,260 So if you throw like right here, this is a generic cross-site scripting attack. 234 00:17:49,460 --> 00:17:53,720 So it's a script alert XSS and the fucking thing is like, danger, Will Robinson, danger. 235 00:17:54,280 --> 00:17:55,900 We've run into cross-site scripting. 236 00:17:55,920 --> 00:17:59,320 Then it gives you this big message that says, dude, we fucking blocked you. 237 00:18:00,740 --> 00:18:10,340 So now here I'm trying SQL injection with no encoding at all and .NET Defender doesn't 238 00:18:10,340 --> 00:18:10,540 care. 239 00:18:13,700 --> 00:18:18,660 So they block some SQL injection, specific statements like the word select. 240 00:18:20,680 --> 00:18:23,420 This is the height of IDS and WAF technology, right? 241 00:18:23,960 --> 00:18:26,300 I'm going to block the word select. 242 00:18:27,780 --> 00:18:32,020 So if you encode it in Unicode, you walk right by it. 243 00:18:32,500 --> 00:18:34,920 So they decided to fix this last year. 244 00:18:35,840 --> 00:18:38,020 But they didn't fix any other encoding. 245 00:18:39,700 --> 00:18:42,180 So if you use any other encoding. 246 00:18:42,200 --> 00:18:42,240 Okay. 247 00:18:42,260 --> 00:18:43,680 If you use any other encoding, you still walk by the thing. 248 00:18:44,660 --> 00:18:46,020 Does anybody work for this company? 249 00:18:46,160 --> 00:18:50,060 If you do, please holler at me like when I get off stage because I don't get it, dude. 250 00:18:51,560 --> 00:18:51,960 Okay. 251 00:18:52,020 --> 00:18:57,820 And yeah, that's still me dumping the admin password hash with no encoding at all against 252 00:18:57,820 --> 00:18:59,040 .NET Defender. 253 00:18:59,720 --> 00:19:00,340 Sorry, dude. 254 00:19:01,220 --> 00:19:01,920 Fix your shit. 255 00:19:02,960 --> 00:19:03,360 Okay. 256 00:19:03,400 --> 00:19:08,660 So biggest things that I'm doing now, getting into the land from the web, it's getting harder. 257 00:19:09,160 --> 00:19:11,500 It's getting harder, but it's still possible. 258 00:19:11,500 --> 00:19:17,700 So SQL Ninja, the dude, iSurfer, who wrote this tool, it's in Perl, but I'm not hating 259 00:19:17,700 --> 00:19:22,400 him for that because I was a Perl monkey, but I've seen the light, which is Python 3. 260 00:19:23,220 --> 00:19:24,140 I am gone. 261 00:19:24,300 --> 00:19:24,900 I am gone. 262 00:19:25,020 --> 00:19:25,460 I am gone. 263 00:19:25,720 --> 00:19:27,540 But his tool works really well. 264 00:19:27,680 --> 00:19:32,380 You can upload Netcat, Meterpreter, DNS Tunnel, great, great, great support for that. 265 00:19:32,500 --> 00:19:34,280 So I really think that's a good project. 266 00:19:34,420 --> 00:19:36,480 And then he just released an upgrade not too long ago. 267 00:19:38,060 --> 00:19:38,460 Okay. 268 00:19:38,660 --> 00:19:40,880 SQL Map, especially since it's in Python. 269 00:19:41,120 --> 00:19:41,480 Fucking hell. 270 00:19:41,500 --> 00:19:41,700 Fucking rocks. 271 00:19:42,580 --> 00:19:43,000 Okay. 272 00:19:43,100 --> 00:19:49,040 It allows you to upload Meterpreter shell, and it has its own OS shell that you can fucking 273 00:19:49,040 --> 00:19:49,360 drop. 274 00:19:49,500 --> 00:19:50,180 It's freaking awesome. 275 00:19:50,460 --> 00:19:55,140 So you can just go right at it, and it drops to where it says OS shell, and you can just 276 00:19:55,140 --> 00:19:59,920 do your operating system commands, IP config, netstat, or whatever, or you can go straight 277 00:19:59,920 --> 00:20:00,720 to a Meterpreter shell. 278 00:20:00,840 --> 00:20:01,880 I use this a lot. 279 00:20:02,000 --> 00:20:02,620 Still works. 280 00:20:03,800 --> 00:20:04,220 Okay. 281 00:20:04,260 --> 00:20:04,700 All right. 282 00:20:05,300 --> 00:20:07,120 We have to focus on the important stuff. 283 00:20:08,660 --> 00:20:10,660 The important stuff is not getting caught. 284 00:20:10,860 --> 00:20:11,080 Okay. 285 00:20:11,500 --> 00:20:14,500 I'm officially going to title this section of the talk, Don't Be a Tiger. 286 00:20:15,660 --> 00:20:16,120 Okay. 287 00:20:17,020 --> 00:20:20,020 The goal when you're doing this is not to get caught. 288 00:20:20,240 --> 00:20:20,680 I don't know. 289 00:20:20,720 --> 00:20:22,100 Who thinks tigers are punk? 290 00:20:23,420 --> 00:20:24,520 Tigers are fucking punk. 291 00:20:25,120 --> 00:20:25,580 Okay. 292 00:20:25,640 --> 00:20:26,420 Help me here. 293 00:20:27,520 --> 00:20:34,620 If I'm worth a billion dollars, and you're a porn star, you fucking know I'm going to 294 00:20:34,620 --> 00:20:36,300 have some people kill you if you talk, right? 295 00:20:37,000 --> 00:20:37,460 Okay. 296 00:20:40,760 --> 00:20:41,160 Okay. 297 00:20:41,160 --> 00:20:41,860 I'm just making sure. 298 00:20:42,000 --> 00:20:43,300 Raise your hand if you would. 299 00:20:43,380 --> 00:20:43,720 Yeah. 300 00:20:45,980 --> 00:20:47,160 She ain't fucking talking. 301 00:20:47,600 --> 00:20:48,080 All right. 302 00:20:48,160 --> 00:20:49,920 So biggest things that I run into. 303 00:20:50,100 --> 00:20:50,800 Filter evasion. 304 00:20:50,880 --> 00:20:53,100 You have a lot of people who try to do all types of things. 305 00:20:53,300 --> 00:20:55,480 So the first thing is client-side filtering. 306 00:20:55,640 --> 00:20:56,540 This is bad. 307 00:20:56,780 --> 00:20:57,680 This is bad. 308 00:20:57,860 --> 00:20:58,560 This is bad. 309 00:20:58,620 --> 00:20:59,320 This is bad. 310 00:20:59,400 --> 00:21:00,460 Did I say that this is bad? 311 00:21:00,680 --> 00:21:01,740 This is bad. 312 00:21:01,960 --> 00:21:07,360 Do not use JavaScript or VBScript or anything client-side to try to filter input to your 313 00:21:07,360 --> 00:21:07,440 client-side. 314 00:21:07,440 --> 00:21:08,020 This is a very critical application. 315 00:21:08,680 --> 00:21:13,320 Or if you're using a framework like J2EE where your frameworks create this JavaScript for 316 00:21:13,320 --> 00:21:18,580 you, you're going to have to write server-side code that checks to verify what's coming in 317 00:21:18,580 --> 00:21:19,220 from the client. 318 00:21:19,420 --> 00:21:19,540 Okay. 319 00:21:19,560 --> 00:21:21,040 You just got to freaking deal with it, man. 320 00:21:21,260 --> 00:21:24,120 Anything that's happening on the client's machine is his. 321 00:21:24,320 --> 00:21:26,360 So I have to do these little lessons for developers. 322 00:21:26,460 --> 00:21:29,400 I'm like, okay, developer, I want you to think about this. 323 00:21:30,300 --> 00:21:33,760 You're going to put all the security on the hacker's laptop. 324 00:21:36,700 --> 00:21:37,420 What do you think? 325 00:21:37,420 --> 00:21:37,780 Right? 326 00:21:39,260 --> 00:21:41,940 So, guys, don't use client-side filtering. 327 00:21:42,140 --> 00:21:43,700 Do not use client-side filtering. 328 00:21:44,280 --> 00:21:44,440 Okay? 329 00:21:45,200 --> 00:21:45,840 All right. 330 00:21:46,140 --> 00:21:47,120 Restrictive blacklist. 331 00:21:47,400 --> 00:21:50,580 I oftentimes run into people who now restrict special characters. 332 00:21:50,700 --> 00:21:54,560 Well, you can't send an equal sign, can't send a greater than sign, less than sign or 333 00:21:54,560 --> 00:21:55,200 something like that. 334 00:21:55,420 --> 00:22:00,020 But especially with SQL syntax, you don't necessarily have to say that one equals one 335 00:22:00,020 --> 00:22:02,380 because isn't one kind of like one? 336 00:22:06,420 --> 00:22:07,400 Two kind of like one. 337 00:22:07,420 --> 00:22:12,340 Like two, rum and coke, kind of like, rum and coke, just a thought. 338 00:22:13,900 --> 00:22:18,780 So SQL injection actually does work without special characters in a lot of cases. 339 00:22:19,640 --> 00:22:20,060 Okay? 340 00:22:20,060 --> 00:22:21,560 And then the IDS. 341 00:22:21,600 --> 00:22:23,080 Now, how many of you have this as your mouse pad? 342 00:22:25,140 --> 00:22:25,760 Come on. 343 00:22:25,800 --> 00:22:26,540 I'm with the nerds. 344 00:22:26,540 --> 00:22:27,340 I'm with the nerds. 345 00:22:27,340 --> 00:22:28,080 I'm with the nerds. 346 00:22:28,080 --> 00:22:32,900 So you got to have your ASCII decimal chart, hex chart, break it out as your mouse pad, 347 00:22:33,000 --> 00:22:37,040 or what I just learned the other night while unbelievably drunk. 348 00:22:37,140 --> 00:22:37,400 I don't know. 349 00:22:37,400 --> 00:22:40,300 Drop to a shell and type man ASCII. 350 00:22:41,620 --> 00:22:43,500 That shit fucking worked. 351 00:22:44,140 --> 00:22:45,800 I was like, damn. 352 00:22:47,240 --> 00:22:50,620 Drop to a shell and type man ASCII and the shit is right there? 353 00:22:50,760 --> 00:22:51,380 Fuck, dude. 354 00:22:51,460 --> 00:22:51,920 That's cool. 355 00:22:53,860 --> 00:22:59,800 So when dealing with the IDS, okay, so we've got alert, TCP, any IP coming from any port, 356 00:22:59,880 --> 00:23:03,960 going to our web servers on our web server ports, we're looking for specifically tick 357 00:23:03,960 --> 00:23:05,380 or one equals one. 358 00:23:05,640 --> 00:23:06,120 Okay? 359 00:23:06,120 --> 00:23:09,180 How many hackers are we really going to catch with this one? 360 00:23:10,000 --> 00:23:11,100 So let's think about it. 361 00:23:12,300 --> 00:23:13,320 Does two equal two? 362 00:23:17,440 --> 00:23:18,660 Forty ounce equal 40 ounce? 363 00:23:21,100 --> 00:23:22,260 Most definitions of. 364 00:23:23,320 --> 00:23:26,280 Okay, so a lot of what I'm running into, when you actually take the time to sit down 365 00:23:26,280 --> 00:23:29,580 and read a lot of these IDS rules, you're like, good God, man. 366 00:23:29,720 --> 00:23:31,840 So yes, this is my opinion of IDS. 367 00:23:32,740 --> 00:23:33,140 Okay? 368 00:23:33,660 --> 00:23:34,060 Okay. 369 00:23:35,160 --> 00:23:35,560 Okay. 370 00:23:41,240 --> 00:23:41,660 Okay. 371 00:23:41,820 --> 00:23:43,920 And you're starting to see that it really doesn't matter. 372 00:23:44,140 --> 00:23:48,320 I mean, you know, as people do like this and and or and they're looking for still one equals 373 00:23:48,320 --> 00:23:51,660 one or nine equals nine or, you know, anything like that, you're going to find that, man, 374 00:23:51,700 --> 00:23:53,280 it's just a losing cause. 375 00:23:53,660 --> 00:23:59,020 And thank God, SQL map does all this obfuscation that I'm showing you up here by default and 376 00:23:59,020 --> 00:23:59,600 it's in Python. 377 00:24:03,280 --> 00:24:03,700 Okay? 378 00:24:03,820 --> 00:24:03,900 Okay? 379 00:24:03,900 --> 00:24:11,280 So the same thing that I'm showing you here, where I did my OR1, or excuse me, OR2 in select user, where in this case I put the entire thing in hex. 380 00:24:11,640 --> 00:24:15,500 You can do this in Unicode, you can do it in UTF-7, UTF-8, UTF-16. 381 00:24:15,740 --> 00:24:18,660 All these different encodings, it doesn't matter. 382 00:24:18,740 --> 00:24:19,840 Base64, it doesn't matter. 383 00:24:20,240 --> 00:24:21,420 This stuff works. 384 00:24:21,460 --> 00:24:24,280 It works at getting by a lot of IDSs and WAFs. 385 00:24:26,240 --> 00:24:27,320 Okay, last thing. 386 00:24:27,820 --> 00:24:33,300 The one product in the PHP space that I think is absolutely the shit is PHP IDS. 387 00:24:33,900 --> 00:24:35,520 I think it's fucking cool as shit. 388 00:24:35,800 --> 00:24:38,620 Now, they've got something on their website. 389 00:24:38,820 --> 00:24:43,560 So if you go to demo.phpids.net, they've got a smoke test. 390 00:24:43,960 --> 00:24:53,140 Where with the smoke test, you can put in all of your SQL injection, cross-site scripting, or web application attacks, and it shows you what signatures it flags. 391 00:24:53,720 --> 00:24:56,500 So you can keep practicing your Kung Fu right here. 392 00:24:56,560 --> 00:24:59,120 Like, okay, well I tried it this way, it got flagged. 393 00:24:59,140 --> 00:25:02,380 I tried it this way, the number of signatures it flagged was less. 394 00:25:02,580 --> 00:25:03,820 And you just keep working. 395 00:25:03,900 --> 00:25:04,580 And keep working. 396 00:25:04,740 --> 00:25:05,260 And keep working. 397 00:25:05,420 --> 00:25:09,040 Until that bad boy finally tells you, it's good! 398 00:25:11,240 --> 00:25:12,500 Okay, that's what you gotta do. 399 00:25:12,680 --> 00:25:18,640 So you just keep working on your Kung Fu and working on your Kung Fu until you find something that's gonna bypass most of the rules. 400 00:25:18,860 --> 00:25:23,440 Now, ModSecurity has teamed up with PHP IDS, and they've got their own smoke test. 401 00:25:23,600 --> 00:25:26,080 And again, I was a little hungover, so I didn't add it to my slides. 402 00:25:26,360 --> 00:25:33,640 But they've got their own smoke test where it actually loads the ModSecurity CRS core rule set and PHP IDS. 403 00:25:34,400 --> 00:25:35,480 And snort rules. 404 00:25:36,300 --> 00:25:37,560 All in one web interface. 405 00:25:38,040 --> 00:25:42,820 So you just keep throwing it in there until it bypasses all of those, and fucking smooth sailing. 406 00:25:45,640 --> 00:25:48,080 Alright, so, signature IDS, it's a fucking joke. 407 00:25:49,960 --> 00:25:52,360 IPS and WAF, it's a fucking joke. 408 00:25:52,560 --> 00:25:58,580 And then, at least what I'm running into, I don't really have clients who really look at it anyway. 409 00:25:59,180 --> 00:26:03,700 So they bought it, but looking at it. 410 00:26:03,900 --> 00:26:04,520 That's a different story. 411 00:26:04,760 --> 00:26:10,120 Now, for those of you who are IDS analysts and WAF people, where you actually man the thing all fucking day, 412 00:26:10,300 --> 00:26:13,600 I know I talk a lot of shit, but I feel your pain because I used to do your job. 413 00:26:13,860 --> 00:26:18,440 And there's not enough alcohol in the world for the job that you do. 414 00:26:20,540 --> 00:26:25,640 Alright, so, right now, the overwhelming majority of stuff that I'm doing is what I just showed you. 415 00:26:25,680 --> 00:26:26,540 Getting in through the web. 416 00:26:26,860 --> 00:26:31,160 So, like I said, you deal with the IDS, you deal with the IPS, and then pretty much it's web shit. 417 00:26:31,360 --> 00:26:32,340 Remote file include. 418 00:26:32,340 --> 00:26:33,980 War file upload. 419 00:26:34,200 --> 00:26:36,580 Who's been giving JBoss the beat down with the war file upload? 420 00:26:36,900 --> 00:26:38,140 That shit fucking rocks. 421 00:26:38,880 --> 00:26:45,640 So, war file uploads with JBoss, SQL injection, just encoding, some sort of way so that I can get into it. 422 00:26:45,900 --> 00:26:50,260 That usually gives me a shell, either in the LAN or in the DMZ, and I try to work from there. 423 00:26:50,540 --> 00:26:53,760 After that, I do the unbelievable thing and send the client email. 424 00:26:55,480 --> 00:26:56,680 Because it fucking works. 425 00:26:57,140 --> 00:26:58,560 So, I send the client email. 426 00:26:58,780 --> 00:27:00,360 You know, client side with Metasploit, it's beautiful. 427 00:27:00,640 --> 00:27:02,140 So, you just choose whatever the latest. 428 00:27:02,780 --> 00:27:05,660 Browser, PDF, ActiveX, or file format exploit is. 429 00:27:05,800 --> 00:27:08,500 Make sure it's reverse TCP shell. 430 00:27:08,700 --> 00:27:11,380 And now, the Metasploit has reverse HTTPS. 431 00:27:12,680 --> 00:27:13,420 Frickin' beautiful. 432 00:27:13,740 --> 00:27:16,020 The only bad thing about it is it's fucking written in Ruby. 433 00:27:17,880 --> 00:27:21,820 Okay, so, a Python tool is set. 434 00:27:22,080 --> 00:27:24,620 So, to me, set is some next level shit. 435 00:27:24,720 --> 00:27:29,020 I think, man, Relic is doing some unbelievable shit with set. 436 00:27:29,180 --> 00:27:32,240 So, guys, for me, round of applause to Relic. 437 00:27:32,340 --> 00:27:33,440 This is what we need. 438 00:27:36,420 --> 00:27:39,840 This is what we need so that we can illustrate the point of what's going on. 439 00:27:39,900 --> 00:27:42,480 The hacker community does not port scan your networks anymore. 440 00:27:42,920 --> 00:27:45,680 And if they are port scanning your networks, those are fucking busters anyway. 441 00:27:45,880 --> 00:27:47,380 They're probably not going to get a real shell. 442 00:27:48,100 --> 00:27:54,920 Real hackers are pushing everything with these drive-by downloads and frickin' email type stuff. 443 00:27:55,060 --> 00:27:55,900 This is where it's going. 444 00:27:56,240 --> 00:27:59,340 So, setting up fake websites, spear phishing, and all that kind of stuff. 445 00:27:59,400 --> 00:28:01,600 That's the kind of thing that we've got to get clients to understand. 446 00:28:01,600 --> 00:28:04,120 It needs to happen in your pen test, okay? 447 00:28:04,540 --> 00:28:07,500 If you deal with the same client that I had who just stood up and says, 448 00:28:07,560 --> 00:28:11,980 Joe, well, I'm not going to pay you to tell me I need user training, okay? 449 00:28:12,180 --> 00:28:12,780 No, man. 450 00:28:13,060 --> 00:28:15,200 No, you have to replicate the real threat. 451 00:28:15,320 --> 00:28:16,360 This is what hackers are doing. 452 00:28:16,500 --> 00:28:17,840 We have to replicate that threat. 453 00:28:18,100 --> 00:28:20,540 So, client-side pen testing is where it needs to go. 454 00:28:22,620 --> 00:28:23,920 Okay, pivoting into the land. 455 00:28:24,080 --> 00:28:29,500 Well, since the overwhelming majority of my attacks are client-side after my web stuff, 456 00:28:29,880 --> 00:28:31,240 pivoting into the land is important. 457 00:28:31,600 --> 00:28:33,260 So, Metasploit supports the pivot. 458 00:28:33,380 --> 00:28:37,180 If not, I have a whole cab file upload thing where I upload some cab files 459 00:28:37,180 --> 00:28:41,360 that have all of my executables statically compiled so there's no install. 460 00:28:41,640 --> 00:28:44,640 And I just use that as my workshop to pivot into the land. 461 00:28:44,820 --> 00:28:47,640 So, jump right into the land and start moving around from there. 462 00:28:48,340 --> 00:28:52,380 Next thing that I look for is common land security solutions. 463 00:28:52,540 --> 00:28:54,940 So, things that I run into. 464 00:28:55,160 --> 00:28:59,280 No DHCP, DHCP MAC reservations, port security, and NAC. 465 00:29:00,500 --> 00:29:01,460 So, K. 466 00:29:01,600 --> 00:29:02,200 Get on the network. 467 00:29:02,440 --> 00:29:04,300 And I'm kind of tying this together. 468 00:29:04,480 --> 00:29:08,600 So, you've pivoted into the land via client-side or you're on the internal assessment 469 00:29:08,600 --> 00:29:10,260 and you have to try and get on the land. 470 00:29:10,700 --> 00:29:16,740 So, my kids taught me these because they're unbelievably ineffective. 471 00:29:18,280 --> 00:29:21,800 So, static IP addresses, I hope you don't have a client who actually says 472 00:29:21,800 --> 00:29:24,540 they're going to stop people by using static IPs. 473 00:29:24,820 --> 00:29:27,320 So, we all know steal the MAC address, we get on, right? 474 00:29:27,900 --> 00:29:30,820 DHCP MAC reservations, we know that we're going to steal a valid MAC 475 00:29:30,820 --> 00:29:31,500 and get on them. 476 00:29:31,600 --> 00:29:35,220 Port security, you know that we're going to steal a valid MAC and get on the network. 477 00:29:35,460 --> 00:29:39,200 Now, who does what I do where you walk by and you like lift up the computer and you read the MAC address? 478 00:29:40,640 --> 00:29:42,920 You're like, cool, and now I'll go get on the network, right? 479 00:29:43,760 --> 00:29:48,120 MAC solutions, the biggest thing that I've been doing is look for 802.1X exceptions. 480 00:29:49,320 --> 00:29:54,240 Things that can't support 802.1X like printers, copiers, CD-ROM towers. 481 00:29:54,520 --> 00:30:00,760 All that kind of stuff is generally excluded from the NAC solution and voice over IP phones. 482 00:30:01,240 --> 00:30:03,460 Hint, hint, wink, wink, nudge, nudge. 483 00:30:03,940 --> 00:30:06,960 So, for me, that really works with getting by this stuff. 484 00:30:08,020 --> 00:30:11,740 Voice over IP is, to me, the best. 485 00:30:11,860 --> 00:30:15,920 I'm running into a lot of clients, especially since I used to work for a switching company. 486 00:30:16,380 --> 00:30:21,760 I'm running into a lot of clients who use automatic provisioning where they plug in a VoIP phone 487 00:30:21,760 --> 00:30:27,180 and then based on the MAC address and VLAN tag, they automatically migrate the phone 488 00:30:27,180 --> 00:30:28,280 into the voice VLAN. 489 00:30:28,600 --> 00:30:30,740 So, you can make your voice. 490 00:30:30,740 --> 00:30:36,140 You can make your Linux box look like a voice over IP phone and get bumped into the voice VLAN. 491 00:30:36,400 --> 00:30:38,580 So, this is great for getting past NAC solutions. 492 00:30:39,020 --> 00:30:43,820 And then generally, you know, since most of your clients, all of your phones need to talk 493 00:30:43,820 --> 00:30:47,980 to the call manager, you can talk straight into the internal DMZ where all the servers are 494 00:30:47,980 --> 00:30:50,640 because the call manager's right with all the other servers. 495 00:30:50,760 --> 00:30:51,620 It works beautifully. 496 00:30:52,020 --> 00:30:54,680 Okay, there's a tool called VoIP Hopper that automates this. 497 00:30:55,000 --> 00:30:58,000 So, if you guys are liking that, just jump right on VoIP Hopper. 498 00:30:58,920 --> 00:31:00,160 VoIPhopper.sourceforge.net. 499 00:31:00,160 --> 00:31:01,300 Jump you right into the LAN. 500 00:31:02,640 --> 00:31:03,120 All right. 501 00:31:03,240 --> 00:31:09,000 Once I'm on the LAN, things that I generally do, I need to figure out who's the domain admin. 502 00:31:09,300 --> 00:31:11,220 Remember, we go for the fucking jugular, right? 503 00:31:11,700 --> 00:31:13,840 Figure out who's the domain admin. 504 00:31:14,040 --> 00:31:15,560 So, that's what all these net commands are. 505 00:31:15,860 --> 00:31:17,620 So, see my environment variables. 506 00:31:17,900 --> 00:31:18,880 That's what the set's for. 507 00:31:19,280 --> 00:31:24,340 And then do the net view, net view domain, net user, net local groups. 508 00:31:24,660 --> 00:31:29,940 Figure out who's in what groups within the network so that we can try to attack his machine. 509 00:31:30,160 --> 00:31:33,920 Now, if we're able to get local admin or local system, that's even better 510 00:31:33,920 --> 00:31:39,760 because the next thing that I do is I look around the network for that specific user on that machine. 511 00:31:40,100 --> 00:31:43,720 So, you just script all these different things to look around the network 512 00:31:43,720 --> 00:31:46,240 to figure out where that domain admin's box is, 513 00:31:46,420 --> 00:31:49,080 especially if you've already got local admin or local system. 514 00:31:49,240 --> 00:31:52,220 So, you find where his box is and then jump on his box. 515 00:31:52,440 --> 00:31:56,140 Once you jump on his box, you can also use PSExecShell. 516 00:31:56,400 --> 00:31:59,900 So, once you jump on his box, that's when I start looking. 517 00:31:59,960 --> 00:32:00,140 Okay. 518 00:32:00,160 --> 00:32:02,040 So, we're going to escalate privileges. 519 00:32:03,240 --> 00:32:06,280 So, escalating privileges is one of the things that I think is really hot. 520 00:32:06,460 --> 00:32:08,700 On Windows XP, the old at trick still works. 521 00:32:08,860 --> 00:32:11,000 Even up through Service Pack 3, who uses that? 522 00:32:11,700 --> 00:32:13,920 At slash interactive CMD to hit. 523 00:32:14,700 --> 00:32:15,140 Beautiful. 524 00:32:15,500 --> 00:32:16,740 So, that works. 525 00:32:16,980 --> 00:32:19,020 And I ran into this on a bank pen test. 526 00:32:19,240 --> 00:32:21,620 So, you're seeing that I had to kill McAfee. 527 00:32:21,720 --> 00:32:26,300 I had to turn off the hips, turn off intercept agent, turn off fire PM. 528 00:32:26,560 --> 00:32:30,060 And then I had to use all this PS kill to unhook. 529 00:32:30,160 --> 00:32:32,040 All of this other stuff that's running. 530 00:32:33,260 --> 00:32:36,240 Last thing that I didn't get on my slide, someone asked me about, 531 00:32:36,380 --> 00:32:38,400 because they were like, well, when you do that with McAfee, 532 00:32:38,420 --> 00:32:41,000 the first thing you need to do is escalate to system, right? 533 00:32:41,320 --> 00:32:43,440 Same thing works for semantic endpoint protection. 534 00:32:43,740 --> 00:32:47,300 You have to escalate to system so that you can start trying to kill all this stuff off. 535 00:32:47,660 --> 00:32:49,440 So, you kill all this stuff off. 536 00:32:51,740 --> 00:32:53,900 And after a while, it restarts. 537 00:32:54,400 --> 00:32:58,960 So, you'll have to unhook the DLLs that are in memory to stop that. 538 00:32:59,220 --> 00:32:59,620 Okay. 539 00:32:59,620 --> 00:33:00,080 And I didn't put. 540 00:33:00,160 --> 00:33:00,780 I didn't put that in my slide. 541 00:33:00,900 --> 00:33:04,100 But if you holler at me later, I'll give you the syntax to do that. 542 00:33:04,600 --> 00:33:04,720 Okay. 543 00:33:04,820 --> 00:33:10,880 Another trick that I just learned about McAfee was there are names of excluded files, 544 00:33:11,100 --> 00:33:14,200 specifically by name, not by hash or anything like that, 545 00:33:14,260 --> 00:33:17,360 of files that are excluded from McAfee antivirus. 546 00:33:17,540 --> 00:33:20,160 So, they won't be protected by the buffer overflow protection. 547 00:33:20,440 --> 00:33:23,080 And the whole bit, I thought that was freaking beautiful, man. 548 00:33:23,120 --> 00:33:24,080 I can't wait to use that. 549 00:33:24,660 --> 00:33:27,620 So, holler at me if you guys want that, because I thought that was fucking sweet. 550 00:33:28,740 --> 00:33:29,100 Okay. 551 00:33:29,160 --> 00:33:30,100 So, killing the hips. 552 00:33:30,160 --> 00:33:33,680 With Metasploit, now they've got something called Git System. 553 00:33:34,420 --> 00:33:35,200 Fucking rocks. 554 00:33:35,600 --> 00:33:39,700 So, you can just write on Metasploit, say Git System, and it'll pop you straight to system 555 00:33:39,700 --> 00:33:44,960 using one of the four methods, that name pipe, token duplication, or KitRotPod. 556 00:33:47,600 --> 00:33:48,040 Okay. 557 00:33:48,100 --> 00:33:51,840 And then the last thing that for me has just been the best is owning the domain. 558 00:33:52,120 --> 00:33:56,820 So, as soon as I can get to the admin's box, then I'll use that token stealing and just 559 00:33:56,820 --> 00:33:58,100 try to take his creds. 560 00:33:58,260 --> 00:33:59,740 So, impersonate the domain. 561 00:33:59,740 --> 00:34:02,920 You'll see me create a domain admin, and then you'll see me create a user group and 562 00:34:02,920 --> 00:34:04,300 add him to the domain admin's group. 563 00:34:04,440 --> 00:34:06,580 So, for me, that's been working great. 564 00:34:07,980 --> 00:34:08,300 Okay. 565 00:34:08,400 --> 00:34:08,720 Defense. 566 00:34:09,240 --> 00:34:09,680 All right. 567 00:34:09,700 --> 00:34:13,920 So, everything I talked about today, I've got these like one-page or two-page walkthroughs 568 00:34:13,920 --> 00:34:16,360 of how to do the attack and how to defend against it. 569 00:34:16,440 --> 00:34:18,440 So, if you guys want that, just holler at me. 570 00:34:18,480 --> 00:34:19,040 I'll give you that. 571 00:34:19,120 --> 00:34:21,600 A lot of customers have been asking me for a lot of that kind of stuff. 572 00:34:21,820 --> 00:34:22,620 Just let me know. 573 00:34:22,660 --> 00:34:23,220 It's too easy. 574 00:34:23,280 --> 00:34:24,200 I'll hook you up with that. 575 00:34:24,640 --> 00:34:27,780 And then if you want to get in touch with me, holler at me. 576 00:34:28,500 --> 00:34:28,820 Okay. 577 00:34:28,880 --> 00:34:29,500 That's all I got. 578 00:34:29,740 --> 00:34:30,480 Does anybody have any questions?