1 00:00:03,660 --> 00:00:05,420 We're going to get this talk started in just a minute. 2 00:00:10,340 --> 00:00:10,960 We ready? 3 00:00:11,880 --> 00:00:12,320 Alright. 4 00:00:17,040 --> 00:00:22,140 Alright, it is my pleasure to introduce a few guys from Sensepost who are going to give the talk today, 5 00:00:22,240 --> 00:00:27,520 When the Tables Turn, dealing with passive strike back attacker on networks. 6 00:00:27,520 --> 00:00:32,680 First is Raft Hemming, Haroon Mir, and Charo van der Vaal. 7 00:00:33,380 --> 00:00:33,980 Take it away. 8 00:00:42,920 --> 00:00:46,400 Okay, I can see how this is going to become a little bit of a problem. 9 00:00:51,860 --> 00:00:53,260 Alright, excellent, thanks. 10 00:00:54,260 --> 00:00:56,760 Welcome, I'm glad to see we have such a big turnout. 11 00:00:57,140 --> 00:00:57,500 Thank you. 12 00:00:57,520 --> 00:01:05,060 After last night, I thought that nobody would ever be here after a night like last night. 13 00:01:08,180 --> 00:01:12,180 Alright, we're doing a talk today, it's called When the Tables Turn. 14 00:01:13,300 --> 00:01:15,660 This is my beautiful assistant Haroon. 15 00:01:20,520 --> 00:01:21,080 Alright. 16 00:01:22,700 --> 00:01:23,260 Sorry? 17 00:01:25,500 --> 00:01:26,460 Can't hear me. 18 00:01:26,460 --> 00:01:27,860 Should I speak like this? 19 00:01:27,920 --> 00:01:28,480 Is this better? 20 00:01:30,540 --> 00:01:31,340 Gee whiz. 21 00:01:32,620 --> 00:01:35,160 Is there any chance that we might turn this up a bit? 22 00:01:35,420 --> 00:01:38,620 Because I don't know if I can sustain this for this long. 23 00:01:39,980 --> 00:01:40,380 Okay. 24 00:01:41,460 --> 00:01:42,240 Okay, let's go. 25 00:01:43,520 --> 00:01:47,160 So basically, this is the agenda, this is what we're going to go through. 26 00:01:47,960 --> 00:01:50,100 Think about the concept, a little bit of introduction. 27 00:01:50,480 --> 00:01:55,560 We gave this talk at Black Hat as well, and we kind of ran out of time at the last couple of slides. 28 00:01:55,560 --> 00:01:57,960 So I'm not going to spend a whole lot of time on the introduction. 29 00:01:58,300 --> 00:02:01,680 I'd rather get to the interesting bits, which is a demo. 30 00:02:02,660 --> 00:02:08,080 At Black Hat, we didn't actually do the demo because we had some interesting issues with hardware. 31 00:02:08,780 --> 00:02:11,480 This time around, I think we're going to be able to do that. 32 00:02:11,980 --> 00:02:16,000 I've got the screenshots on the presentation as a backup as well. 33 00:02:16,340 --> 00:02:20,320 So if it doesn't work, then we'll just revert back to the screenshots in the presentation. 34 00:02:20,560 --> 00:02:21,600 But I think everything is good. 35 00:02:22,560 --> 00:02:22,960 Okay. 36 00:02:22,960 --> 00:02:32,280 So I'm going to start off by saying, if you don't know this, we're from a small little country at the southern tip of Africa called South Africa. 37 00:02:33,460 --> 00:02:35,300 It is a country, it's not a region. 38 00:02:37,320 --> 00:02:43,640 And in South Africa, we have lots and lots and lots of robberies and crimes and hijacks and those kind of things. 39 00:02:44,100 --> 00:02:46,760 So I want to quickly tell you a story about a friend of mine. 40 00:02:47,300 --> 00:02:49,960 There's a road in Pretoria called Eteburi Road. 41 00:02:50,080 --> 00:02:51,980 There's a big sign up there. 42 00:02:51,980 --> 00:02:55,100 I must actually show you the picture that says hijacking hotspot. 43 00:02:55,460 --> 00:02:55,860 Okay. 44 00:02:55,920 --> 00:02:58,240 It's an official government sign. 45 00:02:58,400 --> 00:03:00,880 It's not a small little poster that someone put on there. 46 00:03:01,040 --> 00:03:04,560 So the government tells you, if you go there, you know, skip the robot. 47 00:03:04,920 --> 00:03:06,420 You don't talk about robot, right? 48 00:03:06,460 --> 00:03:07,900 You talk about traffic light. 49 00:03:08,200 --> 00:03:08,600 Okay. 50 00:03:08,800 --> 00:03:13,100 Skip the traffic light and just, you know, go on because otherwise you're going to get hijacked. 51 00:03:14,140 --> 00:03:15,080 That's for sure. 52 00:03:15,260 --> 00:03:15,500 Okay. 53 00:03:16,340 --> 00:03:17,260 It's not that bad. 54 00:03:17,820 --> 00:03:18,220 Okay. 55 00:03:18,280 --> 00:03:21,560 Anyhow, so a friend of mine actually got robbed over there. 56 00:03:21,560 --> 00:03:25,240 They smashed his window and they took something out of his car, his wallet and stuff. 57 00:03:25,600 --> 00:03:26,900 And they ran into the bushes. 58 00:03:27,100 --> 00:03:28,620 We also have a lot of bushes in there. 59 00:03:29,100 --> 00:03:30,700 It's not like, you know, America. 60 00:03:31,220 --> 00:03:31,620 No. 61 00:03:32,080 --> 00:03:32,480 Right. 62 00:03:32,760 --> 00:03:48,300 So anyhow, so my friend said to me he wished that he had this little C4, piece of C4, attached to his wallet with a remote detonator so that if someone steals his wallet, he can just go, you take it. 63 00:03:48,340 --> 00:03:48,780 There you go. 64 00:03:48,780 --> 00:03:51,660 And pull out his remote and go . 65 00:03:55,640 --> 00:03:56,120 Okay. 66 00:03:56,540 --> 00:04:01,160 You get the same kind of thing if you think about electric fencing. 67 00:04:01,340 --> 00:04:01,500 Okay. 68 00:04:01,640 --> 00:04:05,740 So electric fencing, everybody in South Africa has got electric fencing around their properties. 69 00:04:06,100 --> 00:04:15,900 And the idea there is really that if you don't want to climb over the wall to steal stuff from a house, that electric fencing is not going to bother you at all. 70 00:04:15,960 --> 00:04:16,180 Right. 71 00:04:16,340 --> 00:04:17,920 It's not very pretty. 72 00:04:17,980 --> 00:04:18,200 But. 73 00:04:18,780 --> 00:04:18,960 You know. 74 00:04:19,000 --> 00:04:19,780 That's the idea. 75 00:04:19,900 --> 00:04:24,820 The idea is that this talk is about attacking attackers. 76 00:04:25,100 --> 00:04:25,320 Right. 77 00:04:25,500 --> 00:04:30,360 But doing it in a clever way so that we don't attack the wrong people. 78 00:04:30,440 --> 00:04:33,400 And we attack them by basically throwing them poison out. 79 00:04:34,200 --> 00:04:38,660 You see the same thing in the natural world, in the insect world. 80 00:04:38,800 --> 00:04:41,920 You get these bugs that are very acidy. 81 00:04:42,000 --> 00:04:42,960 Is that what you call it? 82 00:04:43,620 --> 00:04:44,100 Yeah. 83 00:04:44,200 --> 00:04:45,040 They taste like shit. 84 00:04:45,280 --> 00:04:45,760 Okay. 85 00:04:45,940 --> 00:04:46,420 So. 86 00:04:46,420 --> 00:04:51,240 So basically what happens is when something eats this bug, they're like . 87 00:04:51,240 --> 00:04:52,360 That's not nice. 88 00:04:52,600 --> 00:04:52,900 Right. 89 00:04:53,080 --> 00:04:56,520 And you get the electric eel which got the same concept. 90 00:04:56,820 --> 00:04:57,340 You know. 91 00:04:57,360 --> 00:05:00,080 It's minding its own business, swimming through the water. 92 00:05:00,400 --> 00:05:00,960 And. 93 00:05:00,980 --> 00:05:01,280 Hello. 94 00:05:02,860 --> 00:05:03,420 Yeah. 95 00:05:03,920 --> 00:05:04,480 . 96 00:05:06,340 --> 00:05:07,280 His son. 97 00:05:07,400 --> 00:05:08,620 His son is sick. 98 00:05:09,160 --> 00:05:09,720 Okay. 99 00:05:09,780 --> 00:05:10,180 Never mind. 100 00:05:10,320 --> 00:05:10,760 You know. 101 00:05:10,820 --> 00:05:11,840 Private joke in here. 102 00:05:12,340 --> 00:05:13,080 All right. 103 00:05:13,260 --> 00:05:13,720 And. 104 00:05:13,720 --> 00:05:17,040 And the electric eel won't do anything to you unless you touch it. 105 00:05:17,120 --> 00:05:17,300 Okay. 106 00:05:17,340 --> 00:05:21,000 If you start prodding it and agitating it, it's going to shock you. 107 00:05:21,280 --> 00:05:21,720 Right. 108 00:05:22,500 --> 00:05:26,880 We see the same in the information world with disinformation. 109 00:05:27,020 --> 00:05:27,460 Right. 110 00:05:28,500 --> 00:05:30,760 One country feeding the other country shit. 111 00:05:31,120 --> 00:05:31,560 Right. 112 00:05:31,620 --> 00:05:33,260 Saying you should know this. 113 00:05:33,340 --> 00:05:35,020 Actually, you know, it's total bullshit. 114 00:05:36,540 --> 00:05:36,980 Okay. 115 00:05:37,040 --> 00:05:37,260 So. 116 00:05:38,680 --> 00:05:40,320 We're going to quickly go through this again. 117 00:05:40,360 --> 00:05:42,300 Like I said, there's a lot of stuff we want to show you. 118 00:05:42,980 --> 00:05:48,520 What we find at the moment is current trends in the assessment space. 119 00:05:48,700 --> 00:05:52,440 And I put assessment there in brackets because I don't want to say the hacking space. 120 00:05:52,780 --> 00:05:52,960 Right. 121 00:05:54,200 --> 00:05:58,160 We're finding that technology is really getting smarter and smarter and smarter. 122 00:05:59,180 --> 00:06:01,480 Everybody is building a better scanner these days. 123 00:06:02,140 --> 00:06:03,300 People are getting lazy. 124 00:06:03,580 --> 00:06:08,000 In the good old days, you had the concept that a hacker, a good hacker, was really 125 00:06:08,000 --> 00:06:10,160 someone that was technically clever. 126 00:06:10,580 --> 00:06:12,280 These days, you find the problem. 127 00:06:12,300 --> 00:06:15,720 You have the perception that someone is really clever if they have a big toolbox. 128 00:06:16,180 --> 00:06:16,660 Okay. 129 00:06:16,660 --> 00:06:18,580 And they've got lots of tools that sits in this toolbox. 130 00:06:19,620 --> 00:06:23,580 And we find scanners and tools for every possible level of attack. 131 00:06:25,340 --> 00:06:29,880 Also, the other perception that you have is that administrators are dumb and hackers 132 00:06:29,880 --> 00:06:30,320 are clever. 133 00:06:31,520 --> 00:06:35,460 So, you read about something in the paper or you see it on the news when a hacker broken 134 00:06:35,460 --> 00:06:39,780 into a site and everyone goes, wow, you know, that guy must be smart. 135 00:06:40,160 --> 00:06:40,640 Right. 136 00:06:40,640 --> 00:06:44,600 And the rest of the year, nobody breaks into the site and nobody goes, wow, that administrator 137 00:06:44,600 --> 00:06:45,400 must be good. 138 00:06:45,780 --> 00:06:46,260 Okay. 139 00:06:46,380 --> 00:06:48,720 So, it's a little bit unfair towards the administrators. 140 00:06:49,780 --> 00:06:56,200 And what we find is that in many cases, the attacker's network, the guy that's attacking 141 00:06:56,200 --> 00:06:58,200 you, his network is not secure. 142 00:06:58,560 --> 00:07:00,980 And his tools are not patched. 143 00:07:00,980 --> 00:07:02,640 And he's not running the latest service packs. 144 00:07:03,000 --> 00:07:06,840 So, in many cases, the mechanic's car is always broken. 145 00:07:07,100 --> 00:07:09,920 And in this talk, we're going to see how we can exploit that. 146 00:07:09,920 --> 00:07:14,900 We'll make it interesting or create a little bit of paranoia on the side of the attacker's 147 00:07:14,900 --> 00:07:17,020 side before he attacks a site. 148 00:07:17,460 --> 00:07:17,860 Okay. 149 00:07:19,360 --> 00:07:19,760 Okay. 150 00:07:19,820 --> 00:07:23,440 So, let's look at the type of defensive technologies that we have out there today. 151 00:07:24,500 --> 00:07:28,420 And I'm going to kind of map it back to the analogies that I've given you. 152 00:07:30,440 --> 00:07:36,800 So, with the robbery analogy, a firewall would be preventing the attack. 153 00:07:37,000 --> 00:07:37,200 Right. 154 00:07:37,200 --> 00:07:42,160 So, imagine you have this big tank that rolls up to the highway which takes you to your 155 00:07:42,160 --> 00:07:42,460 office. 156 00:07:43,240 --> 00:07:45,880 Someone is not going to smash the windows of this tank. 157 00:07:46,120 --> 00:07:46,380 Right. 158 00:07:46,660 --> 00:07:48,020 So, it's preventing it. 159 00:07:49,100 --> 00:07:55,120 You have the technology called IDS, intrusion detection systems, which is basically a little 160 00:07:55,120 --> 00:07:56,500 bit like the South African police. 161 00:07:56,720 --> 00:07:56,900 Right. 162 00:07:56,920 --> 00:07:58,860 They always arrive at the scene two hours late. 163 00:08:02,900 --> 00:08:04,600 And IDS tends to be like that. 164 00:08:04,660 --> 00:08:06,660 IDS tends to tell you, you've been hacked. 165 00:08:06,660 --> 00:08:07,380 Right. 166 00:08:08,760 --> 00:08:11,680 So, and then we move a little bit a step up, which is IPS. 167 00:08:12,360 --> 00:08:16,400 In IPS, what's basically happening is we're trying to avoid the attack. 168 00:08:16,700 --> 00:08:16,980 Right. 169 00:08:17,180 --> 00:08:21,180 So, when we detect there's something happening, we try to block that. 170 00:08:21,420 --> 00:08:21,780 Correct. 171 00:08:22,340 --> 00:08:25,800 And that can be seen as simply, you know, driving away. 172 00:08:26,180 --> 00:08:29,360 You see someone walking towards you, you just drive away. 173 00:08:30,280 --> 00:08:34,860 Then you have some people that think it's really clever that if they see something in 174 00:08:34,860 --> 00:08:36,640 the IDS logs that seems to be a threat. 175 00:08:36,660 --> 00:08:36,740 Right. 176 00:08:36,740 --> 00:08:37,640 And it seems a little bit strange. 177 00:08:37,940 --> 00:08:39,920 Or they see a machine attacking them. 178 00:08:40,240 --> 00:08:43,220 The next thing that they do is they attack that machine back. 179 00:08:43,440 --> 00:08:43,660 Right. 180 00:08:43,980 --> 00:08:45,920 And we know that that is very scary. 181 00:08:46,180 --> 00:08:50,840 That's a very scary thing because IPS can be spoofed and decoys can be put into NMAP 182 00:08:50,840 --> 00:08:51,600 and that kind of thing. 183 00:08:52,040 --> 00:08:54,500 So, that's a little bit like carrying a gun in your car. 184 00:08:55,260 --> 00:08:58,340 And if someone walks up to your car, you go, right? 185 00:08:58,960 --> 00:09:00,300 And you blast them straight away. 186 00:09:01,900 --> 00:09:03,480 And that's also not a clever idea. 187 00:09:04,360 --> 00:09:06,300 And the fence analogy have the same thing. 188 00:09:06,300 --> 00:09:08,940 The fence, the wall itself is the firewall. 189 00:09:09,340 --> 00:09:11,000 Again, the IDS is the police. 190 00:09:11,460 --> 00:09:13,900 The IPS is a kind of armed response. 191 00:09:14,060 --> 00:09:20,880 And a back hack would be my wife with a shotgun that sits there, you know, quite paranoid. 192 00:09:20,980 --> 00:09:26,380 And when you walk into the house at 3 o'clock in the morning all drunk, she goes, I don't 193 00:09:26,380 --> 00:09:26,640 know you. 194 00:09:27,120 --> 00:09:28,080 And there you go. 195 00:09:30,900 --> 00:09:31,300 Right. 196 00:09:31,440 --> 00:09:36,280 So, what you're trying to do with this is basically saying we want to reduce the amount 197 00:09:36,300 --> 00:09:40,660 We want to raise the cost, the cost of an assessment. 198 00:09:41,120 --> 00:09:46,900 And I have cost in brackets and I have assessment in, not brackets, inverted commas, quotes, 199 00:09:47,140 --> 00:09:50,640 whatever, curly brackets, you know, underscores, whatever. 200 00:09:52,500 --> 00:09:53,680 Raising the cost of assessment. 201 00:09:54,020 --> 00:09:57,280 When I mean cost, I mean a whole lot of different things. 202 00:09:57,360 --> 00:10:01,920 It could be the time that you spend on it, the level of certainty you have about your 203 00:10:01,920 --> 00:10:02,400 own network. 204 00:10:02,820 --> 00:10:05,420 It could be a whole lot of different things that we mean in cost. 205 00:10:05,420 --> 00:10:09,680 We don't mean cost in terms of, you know, real money. 206 00:10:10,000 --> 00:10:14,260 And in assessment, we mean all sorts of attacks, right? 207 00:10:14,320 --> 00:10:15,440 All different kind of attacks. 208 00:10:15,600 --> 00:10:16,960 It's not really an assessment. 209 00:10:17,420 --> 00:10:22,440 And in all of these cases, what we're trying to do is we're trying to attack the technology 210 00:10:22,440 --> 00:10:25,720 and not the person that sits behind the technology. 211 00:10:27,220 --> 00:10:30,740 So, one of the things that you will see that we're doing is attacking automation. 212 00:10:31,340 --> 00:10:35,400 In that case, we just make it so difficult to attack our site. 213 00:10:35,400 --> 00:10:38,880 That a would-be attacker goes, yes, this is going to take a long while. 214 00:10:39,040 --> 00:10:41,440 I can just as well move on to my next target, right? 215 00:10:42,900 --> 00:10:47,800 It used to be, today, it is a thing that says, are you sure when you attack a machine 216 00:10:48,240 --> 00:10:50,240 that you're not sitting on a honeypot, right? 217 00:10:50,320 --> 00:10:52,420 So, you kind of go, well, I'm not quite sure. 218 00:10:53,820 --> 00:10:58,620 But what we want it to be is a situation where you say, before I attack something, I've got 219 00:10:58,620 --> 00:11:05,380 to be sure that the tools that I am using is secure against attacks back into the tool. 220 00:11:05,400 --> 00:11:06,760 And we're going to show you how we're doing that. 221 00:11:07,320 --> 00:11:10,360 We have to worry, is our network safe when we attack something? 222 00:11:12,340 --> 00:11:15,040 Do we have all the service packs installed on our machines? 223 00:11:16,120 --> 00:11:19,120 And what we find is we go to clients and we do it ourselves. 224 00:11:19,340 --> 00:11:23,760 We go to clients and say, you guys should really look at this, this, this, this, and that. 225 00:11:23,960 --> 00:11:27,960 And we think that you didn't do quite a good job in securing your network. 226 00:11:28,160 --> 00:11:31,380 But do we measure ourselves as we measure our targets? 227 00:11:32,180 --> 00:11:35,220 And I find that just about nobody does that, right? 228 00:11:35,700 --> 00:11:39,600 Very quick of the mark to tell someone that he should patch his machines, but you don't 229 00:11:39,600 --> 00:11:40,020 do it yourself. 230 00:11:41,640 --> 00:11:42,040 Okay. 231 00:11:42,140 --> 00:11:44,360 So, I'm going to skip this slide. 232 00:11:45,360 --> 00:11:45,760 Okay. 233 00:11:45,860 --> 00:11:49,600 And so, what we're going to do here is we're going to look at different types of attacks 234 00:11:49,600 --> 00:11:53,640 that we'll be doing and look at different levels where we can do those attacks. 235 00:11:55,720 --> 00:11:57,740 So, the type of attacks, there's four categories. 236 00:11:57,940 --> 00:12:01,880 In the first instance, it's really avoiding or stopping the individual attack. 237 00:12:02,220 --> 00:12:04,600 The second thing would be to create a lot of noise. 238 00:12:05,400 --> 00:12:09,080 And confusion within the results coming back. 239 00:12:10,120 --> 00:12:15,540 In the third section, we're looking at actually stopping the tool or killing the tool itself 240 00:12:15,540 --> 00:12:17,420 that the person is using to attack you. 241 00:12:17,700 --> 00:12:22,060 And if you get really hectic, then you can see if you can attack the attacker through 242 00:12:22,060 --> 00:12:24,580 his own tools and through his own methods. 243 00:12:25,100 --> 00:12:26,900 And we're going to look at that on three levels. 244 00:12:27,200 --> 00:12:31,780 You're going to look at it on a network level, on a network application level, and finally 245 00:12:31,780 --> 00:12:32,860 on an application level. 246 00:12:34,040 --> 00:12:35,300 Now, consider this. 247 00:12:35,400 --> 00:12:42,480 If somebody attacks you, every single bit of information going back into the attacker's 248 00:12:42,480 --> 00:12:45,600 tool or into his network is really under your control. 249 00:12:46,160 --> 00:12:49,420 You control what the attacker is seeing. 250 00:12:49,540 --> 00:12:53,540 You control the data that's being sent back to the attacker. 251 00:12:54,300 --> 00:12:55,100 All right? 252 00:12:56,640 --> 00:12:58,580 So, let's just look at examples of that. 253 00:12:58,700 --> 00:12:59,820 You can look at the packets. 254 00:12:59,900 --> 00:13:04,560 The packets itself that's going back to the attacker plus all its features are under your control. 255 00:13:05,400 --> 00:13:10,560 You control the forward and reverse entries, DNS entries, that the attacker will be seeing. 256 00:13:11,040 --> 00:13:15,080 You control the banners that's spewed back to the attacker. 257 00:13:15,280 --> 00:13:18,740 You control the error codes and the messages within web pages. 258 00:13:18,840 --> 00:13:23,360 You actually control the whole web page itself if you're looking at a web application level, right? 259 00:13:24,240 --> 00:13:32,640 And this data that is under your control that you're sending back to the attacker could be used 260 00:13:32,640 --> 00:13:35,380 where the scanner or the tool actually reads the data. 261 00:13:35,800 --> 00:13:36,200 Right? 262 00:13:37,160 --> 00:13:41,480 Where the tool stores the data when it writes it into a database given into a file. 263 00:13:42,240 --> 00:13:45,740 And when the scanner or the tool renders the data to show it to you. 264 00:13:45,980 --> 00:13:46,380 Okay? 265 00:13:46,380 --> 00:13:48,740 And we're going to look at examples of what we can do with this. 266 00:13:50,020 --> 00:13:51,080 Am I doing it for time? 267 00:13:51,500 --> 00:13:51,900 Okay? 268 00:13:52,100 --> 00:13:52,500 Time? 269 00:13:52,560 --> 00:13:53,220 15 minutes? 270 00:13:53,340 --> 00:13:53,480 Right. 271 00:13:53,700 --> 00:13:59,020 Now, before we start showing you the interesting parts, the demos and that kind of thing, there's 272 00:13:59,020 --> 00:14:01,100 two things that you really must consider over here. 273 00:14:01,440 --> 00:14:04,960 The first is the legal implications of what you are doing. 274 00:14:05,000 --> 00:14:05,360 Okay? 275 00:14:05,380 --> 00:14:10,260 So I'm not an expert in law, and I don't know really how it would work, but I could 276 00:14:10,260 --> 00:14:15,640 guess that, you know, someone would want to look into this and say, well, you know what, 277 00:14:15,820 --> 00:14:20,480 we know that this guy was really out there to get you and he was attacking your network, 278 00:14:20,660 --> 00:14:25,800 but you wiped out his whole, you know, corporate network where he was attacking you from, and 279 00:14:25,800 --> 00:14:28,500 that could lead to some legal ramifications. 280 00:14:28,880 --> 00:14:29,360 Okay? 281 00:14:29,440 --> 00:14:35,060 So before you implement this stuff, speak to someone that's in a suit and a tie and 282 00:14:35,060 --> 00:14:36,980 that knows the law and drives a big car. 283 00:14:37,340 --> 00:14:37,580 Okay? 284 00:14:39,980 --> 00:14:44,660 The second thing is the stuff that we build here, we're not going to give it away. 285 00:14:44,820 --> 00:14:45,500 I'll tell you why. 286 00:14:45,660 --> 00:14:48,060 It's a little bit sucky in terms of its implementation. 287 00:14:48,820 --> 00:14:49,260 Okay? 288 00:14:49,280 --> 00:14:55,200 We're not hardcore programmers, so the stuff that we build is only meant for a demo, and 289 00:14:55,200 --> 00:15:02,520 before you start deploying this or this kind of idea on your corporate network, look at 290 00:15:02,520 --> 00:15:04,520 it a little bit in more detail technically. 291 00:15:04,520 --> 00:15:04,940 Right? 292 00:15:05,320 --> 00:15:08,480 Because the stuff that we build is not made to be robust. 293 00:15:08,860 --> 00:15:10,820 That's why we don't want to give it out. 294 00:15:13,360 --> 00:15:13,760 Okay. 295 00:15:13,840 --> 00:15:15,100 So I'm going to quickly go through here. 296 00:15:16,580 --> 00:15:17,760 Let's look at examples. 297 00:15:18,560 --> 00:15:22,120 First of all, in the first part of our assessment, what we're going to do is we're going to 298 00:15:22,120 --> 00:15:23,720 try to do a footprint of this company. 299 00:15:23,860 --> 00:15:24,040 Right? 300 00:15:24,240 --> 00:15:28,360 And you all know that Sensepost is very passionate about footprinting, so we looked at ways 301 00:15:28,360 --> 00:15:30,440 that we can break our own footprinting tools. 302 00:15:32,000 --> 00:15:34,000 Avoiding, we can really go into DNS. 303 00:15:34,160 --> 00:15:34,500 Right? 304 00:15:34,520 --> 00:15:40,160 We can do some obfuscation to hide ourselves away, which can actually be done quite nicely. 305 00:15:40,860 --> 00:15:47,800 You can have MX records that's offsite with split DNS between you and that MX record. 306 00:15:48,040 --> 00:15:53,000 You can hide away your website to put it totally off your network so that nobody can 307 00:15:53,000 --> 00:15:56,240 actually get the IP numbers where your network is located. 308 00:15:56,800 --> 00:16:01,120 It's not that hard, especially when you don't offer services that need to interact 309 00:16:01,120 --> 00:16:02,260 with your internal network. 310 00:16:03,200 --> 00:16:09,280 If we want to create noise, one of the things that we do is we create a zone file, which 311 00:16:09,280 --> 00:16:12,600 we allow people to do a zone transfer from our network. 312 00:16:12,920 --> 00:16:17,200 And in this zone, we put a whole lot of IP numbers and names in there. 313 00:16:17,840 --> 00:16:23,960 At one stage, we had something like 25,000 entries within our zone file, pointing to 314 00:16:23,960 --> 00:16:27,220 all sorts of interesting places which you don't want to attack. 315 00:16:28,080 --> 00:16:28,600 Okay? 316 00:16:28,760 --> 00:16:30,840 So someone gets our zone file. 317 00:16:30,840 --> 00:16:32,620 They basically go through all the IPs. 318 00:16:32,660 --> 00:16:34,840 They say, well, yes, look at this network. 319 00:16:34,940 --> 00:16:36,000 It's rather large. 320 00:16:36,800 --> 00:16:38,820 Let's attack all of these machines automatically. 321 00:16:39,100 --> 00:16:40,460 Remember, we want to attack automation. 322 00:16:41,060 --> 00:16:44,060 And they'll be attacking very interesting machines around the world. 323 00:16:44,300 --> 00:16:44,800 Okay? 324 00:16:45,160 --> 00:16:47,720 You do not want to attack the FBI, for instance. 325 00:16:49,880 --> 00:16:57,080 In terms of stopping footprinting, what we can do is we can build a name server that 326 00:16:57,080 --> 00:17:00,440 basically sends back an endless loop. 327 00:17:00,440 --> 00:17:03,360 A loop of entries when you do a zone transfer. 328 00:17:03,500 --> 00:17:03,600 Right? 329 00:17:03,700 --> 00:17:04,420 It never stops. 330 00:17:04,920 --> 00:17:06,380 It always keeps on going. 331 00:17:07,360 --> 00:17:09,620 Now, manually, you would detect that it never stops. 332 00:17:09,820 --> 00:17:13,340 But if you have something that runs automatically, that will just run forever. 333 00:17:14,620 --> 00:17:20,260 And in terms of killing, we can control, like I said, the forward and reverse entries, 334 00:17:21,020 --> 00:17:22,160 DNS entries for our zone. 335 00:17:22,360 --> 00:17:22,600 Right? 336 00:17:22,920 --> 00:17:26,980 So with the forward entries, we are a little bit limited in terms of what our IP numbers 337 00:17:26,980 --> 00:17:27,700 should look like. 338 00:17:27,860 --> 00:17:28,260 Correct? 339 00:17:28,260 --> 00:17:36,380 But in the reverse entries, if we build our own DNS server, we can be very creative with 340 00:17:36,380 --> 00:17:39,680 the kind of entries that we give for our reverse DNS. 341 00:17:39,880 --> 00:17:41,040 I'm going to show you an example of that. 342 00:17:43,720 --> 00:17:44,240 Okay. 343 00:17:44,320 --> 00:17:47,540 That's a name server that's basically running... 344 00:17:48,680 --> 00:17:50,700 It's kind of an evil name server. 345 00:17:51,020 --> 00:17:56,940 And if you look at the reverse entries that we have there, if we start doing a host command 346 00:17:56,940 --> 00:17:58,100 and piping it through... 347 00:17:58,100 --> 00:18:02,720 Something like set or awk or grep, you can see that there's... 348 00:18:02,720 --> 00:18:06,720 To start off with some HTML in there for rendering, when we start rendering this stuff. 349 00:18:07,320 --> 00:18:10,140 Well, we can just do backtick and see if we... 350 00:18:10,140 --> 00:18:10,720 Not backtick. 351 00:18:10,800 --> 00:18:11,200 Single quotes. 352 00:18:11,280 --> 00:18:14,200 See if we can break the actual query. 353 00:18:14,380 --> 00:18:14,940 Not query. 354 00:18:15,100 --> 00:18:15,900 The actual command. 355 00:18:16,120 --> 00:18:18,460 Break out of that command and start executing stuff. 356 00:18:18,620 --> 00:18:23,240 So that LS, for instance, pipe LS, could be interesting when someone just runs it on 357 00:18:23,240 --> 00:18:23,520 a... 358 00:18:23,520 --> 00:18:24,560 From a command line. 359 00:18:24,700 --> 00:18:26,340 Do the host lookup from a command line. 360 00:18:26,480 --> 00:18:28,080 And we can get really creative. 361 00:18:28,080 --> 00:18:33,640 Like, you know, maybe rn minus rf slash, you know, those kind of things. 362 00:18:35,580 --> 00:18:41,720 Now, what we've done is we've implemented the very large zone files on our domain. 363 00:18:42,280 --> 00:18:48,660 And then just to see how the tools would react to it, we used a tool called the... 364 00:18:48,660 --> 00:18:56,900 It's actually the trial kind of free demo of the Qualys network discovery tool to see 365 00:18:56,900 --> 00:18:58,060 how Qualys works. 366 00:18:58,060 --> 00:18:59,040 And then just to show our network. 367 00:18:59,200 --> 00:19:03,700 Now, before I show you this picture, keep in mind that we have one class C network. 368 00:19:03,960 --> 00:19:06,080 And we've got about 25 machines in there. 369 00:19:06,580 --> 00:19:07,060 Okay. 370 00:19:07,080 --> 00:19:08,280 So it's not a big network. 371 00:19:09,180 --> 00:19:09,980 When you... 372 00:19:09,980 --> 00:19:14,920 When you let Qualys run on it, however, it looks like this. 373 00:19:16,100 --> 00:19:16,600 Okay. 374 00:19:16,680 --> 00:19:19,020 So it thinks we've got a hell of a big network. 375 00:19:19,720 --> 00:19:26,420 And eventually, it starts saying, your discovery has exceeded the time limit to view your entire 376 00:19:26,420 --> 00:19:26,800 map. 377 00:19:26,800 --> 00:19:28,260 And then it says, map, sign up for Qualys Guard. 378 00:19:28,720 --> 00:19:28,940 Okay. 379 00:19:29,040 --> 00:19:34,940 So you can see that just by looking at the reverse entries, this thing thinks we're everywhere 380 00:19:34,940 --> 00:19:35,740 around the world. 381 00:19:37,480 --> 00:19:37,920 Okay. 382 00:19:37,940 --> 00:19:43,500 So that's about what we can do on our footprinting side. 383 00:19:43,960 --> 00:19:45,940 So I'm going to go on to network level. 384 00:19:46,780 --> 00:19:47,480 What's the time? 385 00:19:47,880 --> 00:19:49,000 We're doing good for time. 386 00:19:50,580 --> 00:19:51,320 You want to go? 387 00:19:51,440 --> 00:19:51,900 You want to take? 388 00:19:51,980 --> 00:19:52,200 Okay. 389 00:19:52,300 --> 00:19:56,740 So on network level, what we can do is avoiding the stuff is obvious. 390 00:19:56,780 --> 00:19:57,160 Right? 391 00:19:57,280 --> 00:19:58,320 We put a firewall in there. 392 00:19:58,500 --> 00:19:59,500 It's as easy as that. 393 00:20:00,500 --> 00:20:03,320 When we want to create noise, we can play with interesting stuff. 394 00:20:03,420 --> 00:20:04,260 We can play with... 395 00:20:05,500 --> 00:20:08,220 We can play with the HoneyD kind of configurations. 396 00:20:08,600 --> 00:20:14,620 I've played with the transparent reverse proxy just because I found it to be a little bit 397 00:20:14,620 --> 00:20:15,660 easier at the time. 398 00:20:16,780 --> 00:20:19,440 And what we can do is we can take random IPs. 399 00:20:19,440 --> 00:20:21,920 We put random IPs up to be alive. 400 00:20:23,140 --> 00:20:26,320 We can have random ports open on those machines. 401 00:20:26,320 --> 00:20:29,280 This is not a big deal. 402 00:20:29,900 --> 00:20:33,080 We can have fake network broadcasts. 403 00:20:33,240 --> 00:20:33,720 Okay? 404 00:20:33,980 --> 00:20:39,380 And the nice thing that we can do is we can do a traceroute interception in this direction. 405 00:20:39,600 --> 00:20:41,980 And if you look at traceroute, what does it actually do? 406 00:20:42,040 --> 00:20:43,000 It sends a packet, right? 407 00:20:43,120 --> 00:20:46,900 And it accepts back ICMP TTL expired. 408 00:20:47,440 --> 00:20:47,920 Correct? 409 00:20:49,340 --> 00:20:56,300 Now, that IP address that's sending out the ICMP TTL expired can obviously be spoofed. 410 00:20:57,320 --> 00:21:03,660 And if we spoof that IP address, our traceroute engine at the other side is going to think 411 00:21:03,660 --> 00:21:08,720 that's the next hop, which means we can basically control the next hop or where we are going. 412 00:21:10,680 --> 00:21:11,600 We'll show you that. 413 00:21:11,680 --> 00:21:12,600 We're going to show you that live. 414 00:21:13,400 --> 00:21:14,720 Are we going to do it now? 415 00:21:14,920 --> 00:21:16,080 Okay, let's do it now. 416 00:21:20,340 --> 00:21:26,020 Okay, what we used here is just to visually show it, we brought up, again, a demo version 417 00:21:26,020 --> 00:21:26,820 of visual route. 418 00:21:27,280 --> 00:21:32,820 Okay, and visual route at this point tracing to some host behind a gateway that we control. 419 00:21:33,600 --> 00:21:36,820 We're not going to get name resolution here because we're not live on the net. 420 00:21:37,320 --> 00:21:43,140 But what we should see is once it tries to get its name resolution going, if the demo 421 00:21:43,140 --> 00:21:50,680 gods are kind to us, just give it a few seconds, we hope. 422 00:21:51,340 --> 00:21:54,680 Okay, at this point, there's no packets actually going out on the network. 423 00:21:54,680 --> 00:21:57,180 We should be seeing it come up on TCP dump. 424 00:21:59,020 --> 00:22:04,340 Okay, what you're seeing here is ICMP packets getting to our gateway, and here you've got 425 00:22:04,340 --> 00:22:09,040 our gateway picking random hosts, sending results back to the traceroute server. 426 00:22:10,820 --> 00:22:16,520 Okay, as it gets a packet, it just repackages it, sends it back, at the moment using a list 427 00:22:16,520 --> 00:22:20,560 of IPs that we picked from random three-letter agencies around the world. 428 00:22:21,940 --> 00:22:22,460 Okay. 429 00:22:23,240 --> 00:22:24,660 So at this point, it's gone. 430 00:22:24,680 --> 00:22:25,840 It's going to keep going. 431 00:22:26,620 --> 00:22:30,460 Unfortunately, we're not live on the internet, or you'd see interesting lines as this thing 432 00:22:30,460 --> 00:22:33,500 bounces around trying to figure out where in the world you are. 433 00:22:33,780 --> 00:22:36,700 We got that on a screenshot, so I'm going to show you that on this side. 434 00:22:36,940 --> 00:22:38,500 But that's pretty much what this does. 435 00:22:38,640 --> 00:22:40,760 Okay, the first hop, you see it hitting our gateway. 436 00:22:41,440 --> 00:22:46,860 Okay, and after that, it's literally taking the IPs from our list until it decides to 437 00:22:46,860 --> 00:22:47,340 stop trying. 438 00:22:48,220 --> 00:22:53,100 Okay, the IPs we can pick, you can make it as believable as you want so you don't have 439 00:22:53,100 --> 00:22:54,660 to go Russia or Mongolia. 440 00:22:54,680 --> 00:23:00,340 You could bounce it around in the UK, bounce it around a little more just to add to effect, 441 00:23:00,900 --> 00:23:02,400 and it should be pretty good. 442 00:23:02,600 --> 00:23:06,960 The interesting thing that we thought about there was actually, you know, showing the 443 00:23:06,960 --> 00:23:09,180 route going back into the attacker's network. 444 00:23:13,860 --> 00:23:19,480 So I'm going to show you what the slide looks like when we actually show we've done it at 445 00:23:19,480 --> 00:23:20,100 the other side. 446 00:23:20,280 --> 00:23:21,460 And it looks like this. 447 00:23:24,180 --> 00:23:24,620 Okay. 448 00:23:24,620 --> 00:23:31,100 So we got it going through the Russian information agency, the Bulgarian government network, 449 00:23:31,380 --> 00:23:35,980 and all sorts of interesting places where you wouldn't expect it to go, correct? 450 00:23:38,700 --> 00:23:39,260 Okay. 451 00:23:39,500 --> 00:23:47,520 Like I said, what we can do as well is basically intercepting all the basically putting random 452 00:23:47,520 --> 00:23:51,400 machines live on this network as we wish. 453 00:23:51,520 --> 00:23:53,000 We actually have it in a CronDrop. 454 00:23:53,140 --> 00:23:54,600 That will change this every time. 455 00:23:54,600 --> 00:23:55,200 It will change every five minutes. 456 00:23:55,420 --> 00:23:57,620 So it shuffles the whole network around a little bit. 457 00:24:03,380 --> 00:24:03,900 Okay. 458 00:24:03,980 --> 00:24:07,820 So for now we're just going to kick off a port — a ping scan against the subnet. 459 00:24:08,440 --> 00:24:09,480 Pretty straightforward. 460 00:24:10,240 --> 00:24:15,620 What we're looking for here as Rilof mentioned is also just how most tools will interpret 461 00:24:15,620 --> 00:24:16,680 broadcast addresses. 462 00:24:17,220 --> 00:24:17,640 Okay. 463 00:24:17,700 --> 00:24:22,260 There was recently a whole long thread on one of the security-focused mail lists on 464 00:24:22,260 --> 00:24:24,140 how to determine a subnet of a company. 465 00:24:24,140 --> 00:24:30,940 Okay, just about everyone uses broadcasts as a good indication of where networks are subnetted. 466 00:24:31,340 --> 00:24:37,700 In this case, the tool randomly picks subnets and decides to return multiple replies for that. 467 00:24:37,960 --> 00:24:43,540 So at this network, you've got, I think, about 15 different subnet broadcast addresses 468 00:24:44,140 --> 00:24:46,940 and random hosts that appear to be up at any given time. 469 00:24:47,740 --> 00:24:51,540 Yeah, and we can do this easily if you look on this screen. 470 00:24:51,540 --> 00:24:53,500 Sorry, we're going to take you from here to there to there. 471 00:24:54,400 --> 00:24:55,280 It's like tennis. 472 00:24:55,940 --> 00:24:59,920 You can see here's a simple postscript that does that. 473 00:24:59,980 --> 00:25:07,300 We say we want seven web servers, three FTP servers, and 20 generic ports spread across 12 IPs with five broadcasts. 474 00:25:07,960 --> 00:25:13,520 This results into a whole lot of IPFW rules to set up the transparent proxies. 475 00:25:13,860 --> 00:25:18,060 And then we have specialized listeners that gets those ports. 476 00:25:18,120 --> 00:25:20,800 We're going to show you some of those just now. 477 00:25:22,760 --> 00:25:25,080 Okay, that was for if the demo didn't work. 478 00:25:27,360 --> 00:25:31,660 Okay, so we move on to the next level, which is your network application level. 479 00:25:32,220 --> 00:25:34,200 Avoiding, you just need to install your patches. 480 00:25:35,120 --> 00:25:37,940 When you do noise in the system, that can get interesting. 481 00:25:38,060 --> 00:25:41,920 We do fake banners, which is also not that, you know, cool. 482 00:25:42,180 --> 00:25:44,920 But we can also start to play with combined banners. 483 00:25:45,000 --> 00:25:50,540 A combined banner is basically a thing that says, I'm a WFTP 4.2.2 server. 484 00:25:50,540 --> 00:25:53,840 And I'm a Microsoft FTP server. 485 00:25:53,980 --> 00:25:55,840 And, in fact, I've got a big identity crisis. 486 00:25:56,020 --> 00:25:58,480 I'm all of the servers in the world that I can be. 487 00:25:58,680 --> 00:26:05,560 Now, if you look at a Nessus plug-in and how they determine that banner, and some of the plug-ins look at it for the beginning of the stream, right? 488 00:26:06,460 --> 00:26:10,220 But a lot of the plug-ins actually looks at it anywhere within the stream. 489 00:26:10,600 --> 00:26:16,140 And those plug-ins, if they look at the banner, they're all going to fire up now and say, well, you're running a bad version. 490 00:26:16,820 --> 00:26:20,520 They can, in fact, go as far as saying, we want to build a nasal reversing technology. 491 00:26:20,520 --> 00:26:28,000 So, we've got an interpreter which says, if you see, normally how the nasal stuff works is we send this and we accept that. 492 00:26:28,160 --> 00:26:30,400 And we're waiting for this kind of output. 493 00:26:30,560 --> 00:26:32,040 If that output is there, we're going to trigger it. 494 00:26:32,180 --> 00:26:34,540 In this case, what we can do is we can do it the other way around. 495 00:26:34,700 --> 00:26:42,800 And so, when you see this kind of request respond in such a way so that all the plug-ins is going to trigger on that thing, right? 496 00:26:43,540 --> 00:26:45,400 If you haven't built it, it's a little bit difficult. 497 00:26:45,960 --> 00:26:48,620 In killing network application level scanners, 498 00:26:48,620 --> 00:26:53,440 we can look for buffer overflows within the scanner itself. 499 00:26:53,540 --> 00:26:55,020 See if there's a buffer overflow in there. 500 00:26:55,240 --> 00:26:57,460 We can look where it renders data. 501 00:26:57,600 --> 00:27:00,000 And a lot of the scanners actually render data in HTML. 502 00:27:00,820 --> 00:27:01,980 So, how cool is that? 503 00:27:02,120 --> 00:27:04,780 As soon as the scanner renders stuff in HTML, 504 00:27:05,100 --> 00:27:10,960 what do you think happens when I put a HTTP redirect to a porn site within my banner, right? 505 00:27:11,760 --> 00:27:13,320 Okay, the scanner's going to pick it up. 506 00:27:13,400 --> 00:27:15,680 It's going to display that banner at some stage. 507 00:27:15,820 --> 00:27:18,260 And if my application that's displaying that data, 508 00:27:18,620 --> 00:27:21,040 is not escaping the HTML, 509 00:27:21,340 --> 00:27:24,040 I can basically put anything into the report. 510 00:27:25,100 --> 00:27:25,660 Okay? 511 00:27:26,540 --> 00:27:31,040 We can look at where the scanner actually puts data into a database. 512 00:27:31,880 --> 00:27:34,880 So, we've all played with SQL injection, correct? 513 00:27:35,200 --> 00:27:38,320 And we love playing with SQL injection on our victims. 514 00:27:38,460 --> 00:27:41,980 Well, imagine if someone is now playing with SQL injection on... 515 00:27:41,980 --> 00:27:43,380 I don't want to say on your tool. 516 00:27:43,520 --> 00:27:44,280 That just sounds wrong. 517 00:27:44,860 --> 00:27:46,580 Where someone is actually... 518 00:27:46,580 --> 00:27:49,660 But actually using SQL injection on your scanner. 519 00:27:49,980 --> 00:27:52,840 Now, you've got to look at how you parse your input. 520 00:27:53,160 --> 00:27:56,040 Your input being the output of the banners, right? 521 00:27:56,160 --> 00:27:57,980 We're going to look at an example of that just now. 522 00:27:59,520 --> 00:28:01,780 And then, of course, scanners that use other scanners. 523 00:28:01,920 --> 00:28:03,340 Everybody's going to scatter these days. 524 00:28:04,100 --> 00:28:07,180 And basically, we only have a couple of real good scanners. 525 00:28:07,320 --> 00:28:08,800 But people build a scanner, 526 00:28:08,920 --> 00:28:10,140 and then they take... 527 00:28:10,140 --> 00:28:13,520 They use Nmap or Nessus within their scanner to actually do the work. 528 00:28:14,040 --> 00:28:16,460 So, you've got to be careful when you're getting the data. 529 00:28:16,580 --> 00:28:19,400 of your actual scanner, okay? 530 00:28:19,560 --> 00:28:21,340 We're going to go into examples of that. 531 00:28:22,120 --> 00:28:24,340 Let me just see what I have in here. 532 00:28:24,640 --> 00:28:26,560 Those are just some of the tools. 533 00:28:28,920 --> 00:28:32,460 Okay, what we've got here, quickly, just to set up a concept, 534 00:28:32,500 --> 00:28:36,300 is an example of a bad banner running on an FTP server. 535 00:28:36,760 --> 00:28:39,580 Okay, in this case, the FTP server is a generic listener. 536 00:28:40,440 --> 00:28:44,020 An FTP to it gives back a whole bunch of meta characters. 537 00:28:44,560 --> 00:28:46,560 Okay, but one of the things that's really interesting 538 00:28:46,580 --> 00:28:51,080 is a concept that we borrowed from a paper written by H.D. Moore 539 00:28:51,080 --> 00:28:53,900 on terminal security. 540 00:28:54,700 --> 00:28:57,060 Okay, in this case, the Xterm that we're running it 541 00:28:57,060 --> 00:28:59,040 allowed the banner that came back 542 00:28:59,520 --> 00:29:01,620 to inject characters into the title bar. 543 00:29:02,100 --> 00:29:03,760 Okay, so as soon as the guy connects, 544 00:29:04,040 --> 00:29:05,420 what he's got up here is, 545 00:29:05,460 --> 00:29:08,120 messing with sense posts you are, owned you will become. 546 00:29:08,580 --> 00:29:12,280 Okay, we're going to borrow that again in a few minutes. 547 00:29:12,800 --> 00:29:14,420 But also, what you see is, 548 00:29:14,520 --> 00:29:15,480 at this point, we're just 549 00:29:16,580 --> 00:29:16,960 playing and playing. 550 00:29:17,120 --> 00:29:19,820 Okay, we've got a pipe RM minus RF in there. 551 00:29:20,120 --> 00:29:22,480 We've got a HTTP redirect in there. 552 00:29:22,620 --> 00:29:23,880 So pretty much we're saying, 553 00:29:24,020 --> 00:29:27,000 let a scanner hit this and let's see what results come out of it. 554 00:29:27,880 --> 00:29:29,140 You want to go onto the... 555 00:29:29,140 --> 00:29:30,040 No, no, just hang on. 556 00:29:30,120 --> 00:29:33,700 Okay, so for the people that can't see over there, 557 00:29:33,860 --> 00:29:35,560 I've got a little bit enlarged over here. 558 00:29:35,760 --> 00:29:37,140 So you see the banner over there. 559 00:29:37,260 --> 00:29:40,500 You see we're trying A-scale injection just with a simple one equals one. 560 00:29:40,820 --> 00:29:43,140 We've got the RM minus RF on template. 561 00:29:43,780 --> 00:29:45,660 And it's just a nasty thing. 562 00:29:45,660 --> 00:29:49,420 When we run a Nessus against this particular 563 00:29:49,420 --> 00:29:49,780 um, 564 00:29:50,620 --> 00:29:51,540 FTP server, 565 00:29:52,920 --> 00:29:53,440 okay, 566 00:29:54,340 --> 00:29:54,860 um, 567 00:29:55,620 --> 00:29:57,160 oh no, no, I don't have that. 568 00:29:57,300 --> 00:29:57,600 Sorry. 569 00:29:57,720 --> 00:29:58,240 Sorry. 570 00:29:58,600 --> 00:29:59,120 Okay. 571 00:29:59,860 --> 00:30:00,380 Okay. 572 00:30:00,500 --> 00:30:01,900 Um, yep. 573 00:30:02,020 --> 00:30:04,080 Um, the second thing we want to go through, 574 00:30:04,200 --> 00:30:05,940 um, pretty much in the same term, 575 00:30:06,020 --> 00:30:07,600 or in the same issues, 576 00:30:07,840 --> 00:30:09,520 again, terminal server security, 577 00:30:09,740 --> 00:30:13,660 is actually a strike back at people running Metasploit 578 00:30:13,660 --> 00:30:14,940 on insecure terms. 579 00:30:14,940 --> 00:30:16,720 Okay, I'm not sure how many of you caught it, 580 00:30:16,820 --> 00:30:18,460 but Metasploit's absolutely killer. 581 00:30:18,660 --> 00:30:21,000 The guys gave a really good demonstration yesterday. 582 00:30:21,580 --> 00:30:23,720 In this case, we've got a fake, um, 583 00:30:23,780 --> 00:30:25,360 web server sitting up here. 584 00:30:25,780 --> 00:30:27,860 Okay, and what we've got up here at the moment 585 00:30:27,860 --> 00:30:30,840 is the web server running in invisible mode. 586 00:30:31,000 --> 00:30:32,120 Sorry, I'm just going to kill that, 587 00:30:32,220 --> 00:30:33,620 and instead run it invisible. 588 00:30:37,320 --> 00:30:38,840 Okay, screw it. Let's just go invisible. 589 00:30:39,400 --> 00:30:43,480 Okay, basically, um, I've got the MSF, um, CLI here. 590 00:30:43,480 --> 00:30:45,540 Okay, so I'm just running Metasploit, 591 00:30:45,640 --> 00:30:47,940 picking an IIS printer overflow, 592 00:30:48,240 --> 00:30:50,280 and asking for it to bind to port 80. 593 00:30:50,880 --> 00:30:52,740 Okay, as the connect goes through, 594 00:30:53,800 --> 00:30:55,920 okay, you should see it get a return connection, 595 00:30:56,640 --> 00:30:57,960 and then what it does, 596 00:30:58,040 --> 00:30:59,720 okay, if you're quick enough, 597 00:30:59,760 --> 00:31:01,860 you would have seen the title bar change briefly 598 00:31:01,860 --> 00:31:03,120 to LS minus AL. 599 00:31:03,900 --> 00:31:07,020 Okay, and then it goes and drops LS minus AL 600 00:31:07,020 --> 00:31:08,100 on the command line. 601 00:31:08,300 --> 00:31:10,500 Okay, this example, taken straight from 602 00:31:10,500 --> 00:31:12,640 HTML's terminal server security paper, 603 00:31:13,060 --> 00:31:15,320 okay, and basically the thinking here is, 604 00:31:15,500 --> 00:31:18,000 what do you do the moment you get a remote shell pop up 605 00:31:18,000 --> 00:31:19,440 once you run an exploit? 606 00:31:19,780 --> 00:31:21,920 Okay, just about everyone, the first thing they do 607 00:31:21,920 --> 00:31:22,600 is hit enter. 608 00:31:23,080 --> 00:31:25,380 Okay, so if we're feeling particularly evil, 609 00:31:25,800 --> 00:31:27,200 um, we could kill this, 610 00:31:27,620 --> 00:31:29,860 and instead, okay, I'm just going to drop the mic 611 00:31:29,860 --> 00:31:32,220 for a second, or if my assistant holds it for me. 612 00:31:34,460 --> 00:31:35,840 Okay, we're going to run the same, 613 00:31:35,860 --> 00:31:37,560 we're going to run the same command again. 614 00:31:39,700 --> 00:31:41,480 If you get that out of my face. 615 00:31:41,480 --> 00:31:42,920 Okay, we're going to run the same thing again, 616 00:31:43,020 --> 00:31:44,400 run it on port 80, 617 00:31:44,640 --> 00:31:47,080 this time we tell it to run in invisible mode, 618 00:31:47,260 --> 00:31:49,100 and this time we tell it RM minus, 619 00:31:49,280 --> 00:31:51,720 no, okay, let's just do LS minus AL again. 620 00:31:53,240 --> 00:31:55,080 Okay, so I'm going to run that, 621 00:31:55,200 --> 00:31:57,160 you got it listening in invisible mode, 622 00:31:57,320 --> 00:31:59,800 the exact same command that we just ran, 623 00:32:00,420 --> 00:32:01,480 okay, and this time, 624 00:32:03,380 --> 00:32:05,480 you see, get its reverse connection, 625 00:32:06,040 --> 00:32:08,220 okay, and drop you into what looks like a shell, 626 00:32:08,360 --> 00:32:10,320 except this time it also includes 627 00:32:10,320 --> 00:32:13,120 the escape meta characters to make your text invisible. 628 00:32:13,880 --> 00:32:16,540 Okay, so what you're sitting with at your command line now 629 00:32:16,540 --> 00:32:18,500 is the command that we decided to inject, 630 00:32:18,780 --> 00:32:20,560 okay, you hit your enter, 631 00:32:20,700 --> 00:32:22,920 and that's the results of the LS minus AL 632 00:32:22,920 --> 00:32:24,680 running on your invisible term. 633 00:32:25,160 --> 00:32:27,500 Okay, so the next time you get a remote shell 634 00:32:27,500 --> 00:32:28,520 pop up on your machine, 635 00:32:28,600 --> 00:32:30,020 you want to make sure that it's a shell, 636 00:32:30,140 --> 00:32:32,940 and not something like screw term coming back at you. 637 00:32:33,300 --> 00:32:36,780 Okay, again, um, it's not a problem with Metasploit. 638 00:32:42,680 --> 00:32:44,120 Okay, just to confirm again, 639 00:32:44,200 --> 00:32:45,820 it's not a problem with Metasploit. 640 00:32:45,960 --> 00:32:47,760 Um, what we are saying is, 641 00:32:47,860 --> 00:32:49,720 it's cool if you want to use tools, 642 00:32:49,860 --> 00:32:52,280 now secure your term before you decide to tell me 643 00:32:52,280 --> 00:32:53,240 my network's insecure. 644 00:32:53,680 --> 00:32:56,560 Okay, so start, um, this is genetic X term, 645 00:32:56,740 --> 00:32:58,460 um, nothing special done to it. 646 00:32:59,700 --> 00:33:02,040 Okay, so let's look at, 647 00:33:02,840 --> 00:33:04,600 this was if our demo didn't work, 648 00:33:05,240 --> 00:33:05,900 okay, which it did. 649 00:33:06,820 --> 00:33:08,760 Okay, now let's look at application level. 650 00:33:08,760 --> 00:33:11,320 Okay, so I'm going to look at application level, 651 00:33:11,540 --> 00:33:15,160 and generally at web, um, server, um, assessments. 652 00:33:16,940 --> 00:33:18,440 Well, if we want to avoid it, 653 00:33:18,480 --> 00:33:20,240 we need a application level firewall, 654 00:33:20,440 --> 00:33:22,640 which is beginning to become a reality nowadays, 655 00:33:22,960 --> 00:33:23,780 which is quite cool. 656 00:33:24,220 --> 00:33:26,180 Um, you're on the live, 657 00:33:26,420 --> 00:33:27,400 you're on there now. 658 00:33:28,040 --> 00:33:29,120 Okay, um, 659 00:33:30,860 --> 00:33:32,460 and what you can do there, 660 00:33:32,540 --> 00:33:34,020 I don't know if you've seen, um, 661 00:33:34,020 --> 00:33:37,020 Samuel Shah's talk on, um, PHP Guard. 662 00:33:37,240 --> 00:33:38,580 Did anyone see it at Black Hat? 663 00:33:38,760 --> 00:33:41,780 Um, if, if you haven't, then wait for the paper to come out. 664 00:33:41,840 --> 00:33:42,880 It's, it's really kick-ass. 665 00:33:43,540 --> 00:33:45,500 Um, okay, what we're going to do there, 666 00:33:45,560 --> 00:33:47,920 I'm going to briefly explain to you what we're going to do there. 667 00:33:48,200 --> 00:33:49,680 Basically, what we can do is, 668 00:33:49,800 --> 00:33:52,760 um, we can return, um, random 404s, 669 00:33:54,620 --> 00:33:56,080 302s, 500s, 200s, 670 00:33:56,080 --> 00:33:58,760 um, on any of, of, of the listeners 671 00:33:58,760 --> 00:34:00,320 that we have on that firewall, correct? 672 00:34:01,700 --> 00:34:03,380 Now, we wanted to do it in two ways. 673 00:34:03,440 --> 00:34:04,920 We actually have two versions of these. 674 00:34:05,260 --> 00:34:07,160 The, the one version, um, 675 00:34:07,160 --> 00:34:09,880 just don't return enough results 676 00:34:09,880 --> 00:34:12,120 for, um, a tool like Netto 677 00:34:13,340 --> 00:34:16,200 to actually realize that it's getting too many, 678 00:34:16,260 --> 00:34:18,620 um, fake 404s coming back, right? 679 00:34:18,720 --> 00:34:20,360 So it basically shows you a report, 680 00:34:20,560 --> 00:34:22,500 um, and all of those things are, 681 00:34:22,560 --> 00:34:24,140 are just about, um, 682 00:34:24,460 --> 00:34:25,760 are just nonsense. 683 00:34:26,140 --> 00:34:27,900 They're not really there, right? 684 00:34:27,940 --> 00:34:30,160 Because we can control exactly the error code 685 00:34:30,160 --> 00:34:30,980 that we're sending back. 686 00:34:31,780 --> 00:34:33,620 Um, if you look at Nessus, 687 00:34:33,720 --> 00:34:35,940 they've got this plug-in that they call, you know, 404. 688 00:34:35,940 --> 00:34:36,720 Right? 689 00:34:37,100 --> 00:34:39,860 Um, what basically happens with no 404 plug-in 690 00:34:39,860 --> 00:34:42,620 is that we test for a couple of files 691 00:34:42,620 --> 00:34:44,740 that we know will never exist on the system. 692 00:34:45,020 --> 00:34:45,500 Okay? 693 00:34:46,200 --> 00:34:48,980 Um, and if we find that for those files that we, 694 00:34:49,160 --> 00:34:50,740 that does not exist on the system, 695 00:34:50,920 --> 00:34:54,980 um, if we find that there's a 200 coming back for those, 696 00:34:55,120 --> 00:34:57,940 then we say, well, these guys are actually doing something, 697 00:34:58,120 --> 00:35:00,580 um, they're not really returning a, 698 00:35:00,580 --> 00:35:02,280 a nice 200 or a 404, 699 00:35:02,420 --> 00:35:04,180 so we better be careful what we do. 700 00:35:04,420 --> 00:35:05,520 But in our case, 701 00:35:05,520 --> 00:35:06,600 we can know exactly, 702 00:35:06,760 --> 00:35:09,380 we know what the string is that Nessus tests for. 703 00:35:09,520 --> 00:35:13,020 It's called capital N, Nessus test, capital T. 704 00:35:13,240 --> 00:35:16,540 So when we see Nessus test coming through on the system, 705 00:35:16,700 --> 00:35:19,700 we send it a nice, gently formed 404, 706 00:35:20,240 --> 00:35:21,780 and for anything else, 707 00:35:21,920 --> 00:35:23,680 we just give it bogus information, 708 00:35:24,100 --> 00:35:26,600 which means that plug-in, the no 404 plug-in, 709 00:35:26,640 --> 00:35:27,440 never triggers. 710 00:35:28,700 --> 00:35:30,820 And now we can control all, all of the rest. 711 00:35:31,100 --> 00:35:32,800 I'm gonna show you what it looks like. 712 00:35:33,100 --> 00:35:35,160 Um, and within the application, 713 00:35:35,560 --> 00:35:35,940 in itself, 714 00:35:36,040 --> 00:35:37,620 we can go crazy, right? 715 00:35:37,720 --> 00:35:39,860 We can have bogus forms, bogus fields, 716 00:35:39,940 --> 00:35:42,240 as soon as we detect that someone is in there trying to, 717 00:35:42,240 --> 00:35:44,180 to, um, to scan us, 718 00:35:44,320 --> 00:35:45,320 and we can do that, 719 00:35:45,400 --> 00:35:46,500 and Samuel did it nicely, 720 00:35:46,600 --> 00:35:47,480 we didn't do it like that, 721 00:35:47,600 --> 00:35:48,540 but he says, 722 00:35:48,660 --> 00:35:51,260 let's put an invisible pixel on the screen, right? 723 00:35:51,560 --> 00:35:53,900 A user's never gonna click on that invisible pixel, 724 00:35:54,300 --> 00:35:55,320 because he can't see it. 725 00:35:55,820 --> 00:35:56,980 But a trolling tool, 726 00:35:57,100 --> 00:35:58,580 a kind of a spider tool, 727 00:35:58,620 --> 00:35:59,220 that kind of thing, 728 00:35:59,300 --> 00:36:00,540 is gonna click on it, correct? 729 00:36:00,660 --> 00:36:01,900 Because it's a link that's there, 730 00:36:01,960 --> 00:36:03,180 and as soon as you see that, 731 00:36:03,180 --> 00:36:04,800 um, tool clicking on that link, 732 00:36:04,800 --> 00:36:06,120 a troller clicking, 733 00:36:06,220 --> 00:36:07,220 clicking on the link, 734 00:36:07,220 --> 00:36:07,900 or mirroring site, 735 00:36:08,040 --> 00:36:08,720 mirroring tool, 736 00:36:08,840 --> 00:36:11,180 then we know that it's a machine on the other side 737 00:36:11,180 --> 00:36:12,440 that's trying to attack us. 738 00:36:12,780 --> 00:36:13,180 Okay? 739 00:36:14,780 --> 00:36:15,180 Um, 740 00:36:16,080 --> 00:36:17,520 if we wanna stop this, 741 00:36:17,660 --> 00:36:19,740 if we wanna stop, um, automated, uh, 742 00:36:19,840 --> 00:36:21,420 application level tools, 743 00:36:21,580 --> 00:36:23,660 uh, we can build what we call a spider trap. 744 00:36:24,180 --> 00:36:26,500 Um, and it also works for spiders, of course. 745 00:36:26,780 --> 00:36:28,720 Um, and, and a spider trap is basically 746 00:36:28,720 --> 00:36:31,120 a page that contains links. 747 00:36:31,740 --> 00:36:32,900 When you click on a link, 748 00:36:32,980 --> 00:36:33,920 you get another link. 749 00:36:33,920 --> 00:36:35,660 And if you click on that link, 750 00:36:35,760 --> 00:36:36,640 you get another link, 751 00:36:36,740 --> 00:36:37,740 and so forth and so on. 752 00:36:37,820 --> 00:36:39,060 I'm gonna show you a screenshot of that. 753 00:36:41,040 --> 00:36:43,220 Um, what we can also do is we can build in there 754 00:36:43,220 --> 00:36:45,180 what I call, um, human detectors, 755 00:36:45,420 --> 00:36:46,580 or browser detectors, 756 00:36:46,700 --> 00:36:48,300 which we're gonna go into just in a bit. 757 00:36:49,820 --> 00:36:52,240 Um, and what we can do in, in, in the killing bit, 758 00:36:52,300 --> 00:36:53,140 this is the stopping bit. 759 00:36:53,240 --> 00:36:55,080 If we, if we wanna go in to kill, actually, 760 00:36:55,140 --> 00:36:55,620 the application, 761 00:36:56,000 --> 00:36:57,160 or attack that application, 762 00:36:57,800 --> 00:36:59,140 um, I don't know how many of you 763 00:36:59,140 --> 00:37:00,680 have seen that page that says, 764 00:37:00,840 --> 00:37:02,080 you are an idiot, 765 00:37:02,420 --> 00:37:03,620 ha, ha, ha, ha, ha, ha. 766 00:37:04,160 --> 00:37:04,560 Right? 767 00:37:04,620 --> 00:37:05,120 You've seen that. 768 00:37:05,460 --> 00:37:07,480 It's a, it's a small little, um, flash 769 00:37:07,480 --> 00:37:09,000 that runs within a browser, 770 00:37:09,160 --> 00:37:11,680 um, and we can't ever stop that. 771 00:37:11,740 --> 00:37:12,980 If we try to kill that window, 772 00:37:13,060 --> 00:37:14,920 it spawns off another seven windows 773 00:37:14,920 --> 00:37:17,020 that starts bouncing around on the screen. 774 00:37:17,180 --> 00:37:17,860 You've seen it, right? 775 00:37:18,200 --> 00:37:20,900 Now, what we can do is we can take code like that, 776 00:37:20,940 --> 00:37:22,880 or any other kind of malicious HTML code 777 00:37:22,880 --> 00:37:24,460 that we would wish to want, 778 00:37:24,600 --> 00:37:26,640 and we can put that into our listener 779 00:37:26,640 --> 00:37:28,880 that's basically listening on random IPs. 780 00:37:29,820 --> 00:37:30,220 Okay? 781 00:37:30,800 --> 00:37:32,600 Um, the other thing that we can do, 782 00:37:33,020 --> 00:37:33,420 um, 783 00:37:33,920 --> 00:37:35,780 is we can simply, um, 784 00:37:35,940 --> 00:37:39,260 take a file that's a very nasty virus, 785 00:37:39,440 --> 00:37:39,980 or, uh, 786 00:37:40,040 --> 00:37:42,600 let's say a very nasty denial of service attack tool, 787 00:37:42,720 --> 00:37:44,640 create a directory in our, 788 00:37:44,760 --> 00:37:46,020 on our website called 789 00:37:46,020 --> 00:37:47,040 slash admin, 790 00:37:47,280 --> 00:37:48,660 or slash secret, 791 00:37:48,880 --> 00:37:49,960 or something like this, 792 00:37:50,140 --> 00:37:50,760 right? 793 00:37:50,860 --> 00:37:52,080 Take that exe, 794 00:37:52,080 --> 00:37:53,960 call it admin tool dot exe, 795 00:37:54,060 --> 00:37:55,320 and copy it in there. 796 00:37:55,640 --> 00:37:57,880 Now, a normal user will never see that, 797 00:37:57,980 --> 00:37:58,180 right? 798 00:37:59,220 --> 00:38:01,460 But someone that's scanning your net with, 799 00:38:01,520 --> 00:38:01,840 with, 800 00:38:01,840 --> 00:38:02,800 with something like, 801 00:38:02,800 --> 00:38:02,940 uh, 802 00:38:03,140 --> 00:38:03,980 Nicto or Nasus, 803 00:38:04,100 --> 00:38:04,500 gonna say, 804 00:38:04,580 --> 00:38:06,760 there's an interesting directory called secret. 805 00:38:08,120 --> 00:38:11,060 And we make that slash secret indexable 806 00:38:11,600 --> 00:38:12,900 so that the guy can search to it, 807 00:38:12,940 --> 00:38:14,960 see there's a tool that says admin tool, 808 00:38:15,100 --> 00:38:16,020 or don't run this, 809 00:38:16,140 --> 00:38:17,320 or secret dot exe. 810 00:38:17,500 --> 00:38:18,580 What do you think they're gonna do? 811 00:38:18,680 --> 00:38:19,420 They're gonna pull it down, 812 00:38:19,520 --> 00:38:20,700 run it on the local machine, 813 00:38:20,860 --> 00:38:22,140 and take out the whole network. 814 00:38:22,400 --> 00:38:22,700 Okay? 815 00:38:23,100 --> 00:38:25,840 Again, remember the legal implication, 816 00:38:26,360 --> 00:38:26,800 okay? 817 00:38:28,660 --> 00:38:29,320 All right. 818 00:38:29,460 --> 00:38:29,740 So, 819 00:38:31,260 --> 00:38:32,620 so this is a, 820 00:38:32,620 --> 00:38:35,280 this is a screenshot of what Nasus looks like, 821 00:38:35,400 --> 00:38:37,280 the output of Nasus WX, 822 00:38:37,420 --> 00:38:37,880 um, 823 00:38:38,000 --> 00:38:39,080 when you run it against, 824 00:38:39,260 --> 00:38:39,500 um, 825 00:38:39,620 --> 00:38:40,280 one of these, 826 00:38:40,460 --> 00:38:40,720 um, 827 00:38:40,960 --> 00:38:42,740 when you run it against one of these, 828 00:38:42,840 --> 00:38:43,000 uh, 829 00:38:43,020 --> 00:38:43,420 sites, 830 00:38:43,580 --> 00:38:49,060 and you'd find out that it's basically triggering on just about any plugin that you can find. 831 00:38:49,480 --> 00:38:49,940 Um, 832 00:38:50,060 --> 00:38:53,620 the idea would be that if someone sees there's a thing called, 833 00:38:53,700 --> 00:38:54,420 what is this, 834 00:38:54,540 --> 00:38:56,980 VS set cookie dot exe, 835 00:38:57,560 --> 00:39:00,500 if they actually go to that page and search to that page, 836 00:39:00,660 --> 00:39:01,180 um, 837 00:39:01,180 --> 00:39:03,340 we know that there's no such web server in there. 838 00:39:03,400 --> 00:39:04,220 It's one of our listeners. 839 00:39:04,620 --> 00:39:04,960 Um, 840 00:39:05,120 --> 00:39:06,480 and that's gonna result in, 841 00:39:06,540 --> 00:39:09,000 in a page like that on the right-hand side. 842 00:39:09,400 --> 00:39:09,800 Okay? 843 00:39:10,020 --> 00:39:10,420 Um, 844 00:39:10,480 --> 00:39:12,120 we wanted to show you this live here, 845 00:39:12,720 --> 00:39:15,200 but there were some issues with the internet connectivity. 846 00:39:15,740 --> 00:39:16,140 Okay? 847 00:39:16,600 --> 00:39:17,000 Um, 848 00:39:17,080 --> 00:39:18,080 and on the left-hand side, 849 00:39:18,180 --> 00:39:18,880 what you see is, 850 00:39:18,940 --> 00:39:19,320 you see, 851 00:39:19,480 --> 00:39:19,720 um, 852 00:39:19,860 --> 00:39:21,800 what a spider trap typically looks like. 853 00:39:22,140 --> 00:39:22,540 Okay? 854 00:39:22,560 --> 00:39:23,360 So you've got lots of, 855 00:39:23,400 --> 00:39:23,860 lots of links, 856 00:39:23,940 --> 00:39:24,460 random links, 857 00:39:24,560 --> 00:39:26,560 basically just points into other links. 858 00:39:27,100 --> 00:39:30,840 And if you have automated web assessment tool that basically crawls the site, 859 00:39:31,380 --> 00:39:32,580 it's gonna run into this, 860 00:39:32,820 --> 00:39:34,380 and it's never ever gonna stop. 861 00:39:36,020 --> 00:39:36,420 Okay, 862 00:39:36,460 --> 00:39:40,280 so the very last section we want to tell you about is a thing that we call armpits. 863 00:39:40,600 --> 00:39:41,000 Um, 864 00:39:41,160 --> 00:39:43,540 it was like we thought about tar pits, 865 00:39:44,260 --> 00:39:45,360 and then we thought about, 866 00:39:45,400 --> 00:39:45,760 you know, 867 00:39:45,780 --> 00:39:47,120 something that's smelly and nasty, 868 00:39:47,300 --> 00:39:48,360 so we thought about armpits. 869 00:39:48,820 --> 00:39:49,220 Um, 870 00:39:49,340 --> 00:39:49,840 okay, 871 00:39:49,920 --> 00:39:50,180 and, 872 00:39:50,280 --> 00:39:51,900 and armpits we use against, 873 00:39:51,960 --> 00:39:52,320 uh, 874 00:39:52,400 --> 00:39:52,900 automation, 875 00:39:53,360 --> 00:39:54,780 really worms and that kind of thing. 876 00:39:55,360 --> 00:39:57,100 So let me tell you how we got about that. 877 00:39:57,280 --> 00:39:57,680 The, 878 00:39:57,820 --> 00:39:58,240 um, 879 00:39:58,660 --> 00:39:59,680 on our website, 880 00:39:59,780 --> 00:40:00,520 we had this, 881 00:40:00,840 --> 00:40:04,120 the marketing people decided we need to have this flash intro to our website. 882 00:40:04,660 --> 00:40:05,100 Okay? 883 00:40:05,260 --> 00:40:07,880 And it had a little thing in there that says skip intro, 884 00:40:08,340 --> 00:40:09,840 which everybody clicks on always, 885 00:40:09,960 --> 00:40:10,060 right? 886 00:40:10,460 --> 00:40:10,820 Um, 887 00:40:10,920 --> 00:40:13,660 so what I've done is I looked at that flash intro, 888 00:40:13,780 --> 00:40:16,760 and I basically took away the link that says skip intro. 889 00:40:17,760 --> 00:40:18,200 Um, 890 00:40:18,400 --> 00:40:20,380 and then if you try to mirror the site, 891 00:40:20,540 --> 00:40:25,160 you find that you can't mirror it because your mirroring tool can't understand flash, 892 00:40:25,380 --> 00:40:30,640 and it can never get to the end of the movie that redirects the spider into the actual site. 893 00:40:31,040 --> 00:40:31,740 So I thought, 894 00:40:31,820 --> 00:40:31,840 hey, 895 00:40:31,900 --> 00:40:32,240 that's, 896 00:40:32,240 --> 00:40:32,840 that's interesting. 897 00:40:33,120 --> 00:40:34,180 I spoke to the developer. 898 00:40:34,380 --> 00:40:34,700 I said, 899 00:40:34,720 --> 00:40:37,960 can you make me a movie that's one pixel big, 900 00:40:38,140 --> 00:40:39,860 and that's zero seconds long? 901 00:40:40,320 --> 00:40:40,960 He was like, 902 00:40:41,160 --> 00:40:41,700 eh? 903 00:40:42,180 --> 00:40:42,700 You know? 904 00:40:44,200 --> 00:40:44,760 He said, 905 00:40:44,760 --> 00:40:44,820 well, 906 00:40:44,880 --> 00:40:45,440 just do it, 907 00:40:45,520 --> 00:40:46,400 and give me the, 908 00:40:46,420 --> 00:40:46,740 uh, 909 00:40:46,820 --> 00:40:48,700 the redirect into the site. 910 00:40:48,800 --> 00:40:49,560 So we started playing, 911 00:40:49,740 --> 00:40:51,800 we started to playing with flash stuff. 912 00:40:52,060 --> 00:40:52,360 Okay? 913 00:40:52,700 --> 00:40:56,440 And basically what we build is a small little thing that runs on a network level. 914 00:40:57,040 --> 00:40:58,420 It runs on a session level. 915 00:40:58,700 --> 00:40:59,100 Um, 916 00:40:59,180 --> 00:41:00,320 and it acts as a proxy. 917 00:41:00,420 --> 00:41:00,620 Okay? 918 00:41:00,620 --> 00:41:03,760 And it sits between you and your website. 919 00:41:04,280 --> 00:41:08,640 And basically what happens is it uses flash to create a session ID. 920 00:41:09,400 --> 00:41:12,600 Dynamically it builds up a flash that creates a session ID, 921 00:41:12,720 --> 00:41:13,280 um, 922 00:41:13,400 --> 00:41:14,180 in terms of, 923 00:41:14,300 --> 00:41:14,480 uh, 924 00:41:14,480 --> 00:41:16,160 as a request to the site. 925 00:41:16,360 --> 00:41:16,820 Okay? 926 00:41:17,200 --> 00:41:17,720 Um, 927 00:41:17,860 --> 00:41:19,340 when we see that request, 928 00:41:19,640 --> 00:41:20,580 a valid request, 929 00:41:20,620 --> 00:41:22,080 with a valid checksum coming through, 930 00:41:22,160 --> 00:41:23,220 we generate a cookie. 931 00:41:23,400 --> 00:41:25,300 We send that cookie back to the browser. 932 00:41:25,880 --> 00:41:29,520 The browser now makes a new connection with that cookie, 933 00:41:29,640 --> 00:41:30,600 and if the cookie is there, 934 00:41:30,600 --> 00:41:31,980 and the cookie's checksum is good, 935 00:41:32,200 --> 00:41:33,160 we say that's right. 936 00:41:33,240 --> 00:41:34,880 You can relay through the site. 937 00:41:35,000 --> 00:41:35,620 I'm going to show you, 938 00:41:35,640 --> 00:41:37,460 I'm going to show you what that looks like. 939 00:41:37,540 --> 00:41:38,660 It looks a little bit like this. 940 00:41:38,880 --> 00:41:40,280 So we've got incoming connection. 941 00:41:40,900 --> 00:41:41,260 Um, 942 00:41:41,460 --> 00:41:42,520 is it a valid cookie? 943 00:41:42,760 --> 00:41:43,800 If it's not a valid cookie, 944 00:41:43,920 --> 00:41:45,420 the first request will never be a valid cookie. 945 00:41:45,680 --> 00:41:46,220 We say, 946 00:41:46,280 --> 00:41:47,560 is it a valid request string? 947 00:41:47,580 --> 00:41:49,060 Is the checksum correct? 948 00:41:49,840 --> 00:41:51,120 If the checksum is correct, 949 00:41:51,200 --> 00:41:52,160 we build the flash page. 950 00:41:52,320 --> 00:41:53,660 We send it back to the client. 951 00:41:54,640 --> 00:41:55,640 Now it says, 952 00:41:55,660 --> 00:41:56,520 do we have a valid cookie? 953 00:41:56,620 --> 00:41:57,240 Now we don't. 954 00:41:57,240 --> 00:41:58,500 Is it a valid request string? 955 00:41:58,740 --> 00:41:59,100 Yes. 956 00:41:59,520 --> 00:41:59,880 Okay? 957 00:42:00,220 --> 00:42:00,580 We send it back to the client. 958 00:42:00,580 --> 00:42:03,160 We send a cookie to the user with the checksum in. 959 00:42:03,380 --> 00:42:04,780 Now the user's got the cookie, 960 00:42:04,880 --> 00:42:05,820 makes a connection again. 961 00:42:06,280 --> 00:42:07,320 Does he have a valid cookie? 962 00:42:07,520 --> 00:42:07,860 Yes, 963 00:42:07,860 --> 00:42:08,580 he's got a valid cookie. 964 00:42:08,780 --> 00:42:10,440 And now we can relay this. 965 00:42:11,460 --> 00:42:12,980 So what Arun's going to do, 966 00:42:13,060 --> 00:42:13,680 no, no, no, no, no. 967 00:42:13,760 --> 00:42:16,260 What Arun's going to do is he's going to simply tell it, 968 00:42:16,420 --> 00:42:16,920 um, 969 00:42:17,060 --> 00:42:17,380 to, 970 00:42:17,560 --> 00:42:18,020 um, 971 00:42:18,120 --> 00:42:19,500 a site that's running that. 972 00:42:19,940 --> 00:42:20,340 Um, 973 00:42:20,440 --> 00:42:21,260 if we, 974 00:42:23,680 --> 00:42:28,160 if we tell it to that IP address that we're running that site on, 975 00:42:28,160 --> 00:42:28,780 one, 976 00:42:28,860 --> 00:42:30,420 one, two, one, six, eight, one, 977 00:42:30,420 --> 00:42:30,540 two, 978 00:42:30,540 --> 00:42:30,700 two, 979 00:42:30,700 --> 00:42:30,860 ten, 980 00:42:31,020 --> 00:42:31,120 eh? 981 00:42:32,980 --> 00:42:33,500 Let's go. 982 00:42:34,220 --> 00:42:34,700 Okay. 983 00:42:36,660 --> 00:42:37,140 Um, 984 00:42:37,140 --> 00:42:37,660 we're going to, 985 00:42:37,660 --> 00:42:39,840 can you just do a control L? 986 00:42:40,720 --> 00:42:41,200 Okay. 987 00:42:43,320 --> 00:42:47,780 Basically what you're going to see is before he even starts to send stuff in there, 988 00:42:48,420 --> 00:42:48,900 okay, 989 00:42:50,680 --> 00:42:53,080 we immediately get back a flash page, 990 00:42:53,260 --> 00:42:54,020 right? 991 00:42:54,100 --> 00:42:56,400 That's a flash page that we dynamically build. 992 00:42:57,460 --> 00:42:57,940 Okay? 993 00:42:58,120 --> 00:43:00,340 So it doesn't matter what it puts in there on the network. 994 00:43:00,340 --> 00:43:02,420 We're always sending him back this flash page. 995 00:43:02,920 --> 00:43:05,180 And in order to actually go to the site, 996 00:43:05,280 --> 00:43:06,560 he needs to interpret the flash. 997 00:43:07,120 --> 00:43:09,560 So you don't get a lot of guys coding an exploit going, 998 00:43:09,780 --> 00:43:10,180 well, 999 00:43:10,300 --> 00:43:10,560 you know, 1000 00:43:10,600 --> 00:43:11,260 this exploit, 1001 00:43:11,400 --> 00:43:13,420 we need to make this exploit flash-aware. 1002 00:43:14,200 --> 00:43:14,600 Okay? 1003 00:43:15,060 --> 00:43:15,460 Um, 1004 00:43:15,520 --> 00:43:16,000 and that's, 1005 00:43:16,000 --> 00:43:17,000 and this is the whole idea. 1006 00:43:17,140 --> 00:43:19,200 The idea is that we can identify our browser. 1007 00:43:19,720 --> 00:43:20,120 Uh, 1008 00:43:20,240 --> 00:43:22,460 we can identify that the user is using a browser. 1009 00:43:22,720 --> 00:43:23,380 We can, 1010 00:43:23,380 --> 00:43:24,680 we can combine that, 1011 00:43:25,460 --> 00:43:25,860 okay, 1012 00:43:25,900 --> 00:43:27,140 that's just what it looks like. 1013 00:43:27,360 --> 00:43:28,620 We can combine that, 1014 00:43:28,620 --> 00:43:29,100 um, 1015 00:43:29,160 --> 00:43:30,320 with a firewall that only the user can access. 1016 00:43:30,320 --> 00:43:31,700 And then it allows this stuff into our relay, 1017 00:43:31,900 --> 00:43:32,460 um, 1018 00:43:32,620 --> 00:43:33,480 in different ways. 1019 00:43:33,640 --> 00:43:34,840 We can do it either with, 1020 00:43:34,840 --> 00:43:35,040 uh, 1021 00:43:35,520 --> 00:43:35,820 um, 1022 00:43:35,840 --> 00:43:36,680 human-detective air. 1023 00:43:36,900 --> 00:43:38,360 We can have it running on port 80, 1024 00:43:38,380 --> 00:43:40,080 and our real site running on port 81, 1025 00:43:40,280 --> 00:43:41,900 which is exactly what we're doing over here. 1026 00:43:42,200 --> 00:43:42,640 And, 1027 00:43:42,760 --> 00:43:43,560 and lastly, 1028 00:43:43,680 --> 00:43:44,480 what we can do, 1029 00:43:44,560 --> 00:43:46,780 is we can start combining that, 1030 00:43:47,000 --> 00:43:47,340 see, 1031 00:43:47,460 --> 00:43:48,820 this slide doesn't come up nice. 1032 00:43:49,020 --> 00:43:50,580 We can combine this with the, 1033 00:43:50,580 --> 00:43:51,640 with the IPS, 1034 00:43:52,100 --> 00:43:52,360 okay? 1035 00:43:52,580 --> 00:43:53,160 Which is, 1036 00:43:53,220 --> 00:43:55,420 we basically now have a bad cookie jar over there. 1037 00:43:55,660 --> 00:43:58,040 And if we see someone doing something wrong, 1038 00:43:58,240 --> 00:43:59,700 we just send the guy, 1039 00:43:59,820 --> 00:44:00,140 um, 1040 00:44:00,180 --> 00:44:00,300 a, 1041 00:44:00,300 --> 00:44:01,160 we close the connection, 1042 00:44:01,340 --> 00:44:02,520 we mark the cookie as bad, 1043 00:44:02,640 --> 00:44:03,820 and we basically now track, 1044 00:44:04,620 --> 00:44:06,280 bad cookies and not good cookies, 1045 00:44:06,420 --> 00:44:06,560 right? 1046 00:44:07,240 --> 00:44:07,600 So, 1047 00:44:07,620 --> 00:44:08,560 what we're gonna do on this side, 1048 00:44:08,760 --> 00:44:10,100 is I'm always gonna show you, 1049 00:44:10,200 --> 00:44:11,260 when he goes through the site, 1050 00:44:12,080 --> 00:44:12,900 what's gonna happen. 1051 00:44:13,300 --> 00:44:13,480 Now, 1052 00:44:13,540 --> 00:44:15,220 we're running two VMware images in here, 1053 00:44:15,280 --> 00:44:16,480 so it's gonna be a little bit slow. 1054 00:44:17,120 --> 00:44:17,480 Um, 1055 00:44:17,520 --> 00:44:17,840 but what, 1056 00:44:17,860 --> 00:44:19,500 what you will see is a quick flash there, 1057 00:44:19,620 --> 00:44:20,640 in the right-hand corner, 1058 00:44:21,240 --> 00:44:23,260 which is the flash that's actually executing. 1059 00:44:24,100 --> 00:44:24,740 And then, 1060 00:44:24,780 --> 00:44:25,540 there you saw it. 1061 00:44:26,220 --> 00:44:28,140 And then you see it coming back to the, 1062 00:44:28,200 --> 00:44:29,160 to the actual page. 1063 00:44:29,360 --> 00:44:29,640 Now, 1064 00:44:29,660 --> 00:44:29,860 remember, 1065 00:44:30,000 --> 00:44:30,200 this, 1066 00:44:30,300 --> 00:44:30,660 at this stage, 1067 00:44:30,840 --> 00:44:32,040 he's got the cookie. 1068 00:44:32,200 --> 00:44:32,380 So, 1069 00:44:32,440 --> 00:44:34,160 he can basically surf into the site, 1070 00:44:34,240 --> 00:44:35,400 as he wished for now, 1071 00:44:35,560 --> 00:44:36,620 and the cookie never expires. 1072 00:44:38,100 --> 00:44:41,260 And he doesn't have to go through the whole flash exercise again. 1073 00:44:41,480 --> 00:44:43,420 It's only the very first time that it connects there. 1074 00:44:44,120 --> 00:44:44,480 Okay, 1075 00:44:44,540 --> 00:44:44,720 so, 1076 00:44:44,780 --> 00:44:46,200 that's an interesting thing on a, 1077 00:44:46,240 --> 00:44:47,120 on a network, 1078 00:44:47,280 --> 00:44:47,600 on a, 1079 00:44:47,660 --> 00:44:48,740 on a web application level. 1080 00:44:49,160 --> 00:44:49,580 Um, 1081 00:44:49,720 --> 00:44:51,780 when he puts in something bad in there, 1082 00:44:51,920 --> 00:44:52,480 okay, 1083 00:44:52,680 --> 00:44:53,880 we can detect it. 1084 00:44:54,420 --> 00:44:54,860 So, 1085 00:44:54,920 --> 00:44:56,420 if he puts in a single quote, 1086 00:44:56,640 --> 00:44:57,200 um, 1087 00:44:57,780 --> 00:44:58,520 let's just do, 1088 00:44:58,580 --> 00:44:59,180 xp command, 1089 00:44:59,280 --> 00:44:59,400 so, 1090 00:45:00,440 --> 00:45:00,980 um, 1091 00:45:01,080 --> 00:45:02,140 signatures in there, 1092 00:45:02,200 --> 00:45:02,580 we basically, 1093 00:45:02,700 --> 00:45:03,900 we don't want to build the IPS, 1094 00:45:04,120 --> 00:45:04,300 right? 1095 00:45:04,880 --> 00:45:04,940 Um, 1096 00:45:05,100 --> 00:45:05,820 not right now. 1097 00:45:15,020 --> 00:45:15,720 When it says, 1098 00:45:15,760 --> 00:45:16,280 you are naughty, 1099 00:45:16,480 --> 00:45:17,800 I will blacklist your cookie. 1100 00:45:17,960 --> 00:45:18,280 Right? 1101 00:45:18,340 --> 00:45:18,680 Now, 1102 00:45:18,740 --> 00:45:19,540 that cookie is destroyed. 1103 00:45:19,680 --> 00:45:20,540 If the cookie is destroyed, 1104 00:45:21,860 --> 00:45:24,000 he's got to go through the flash exercise again. 1105 00:45:24,780 --> 00:45:25,140 Okay? 1106 00:45:25,160 --> 00:45:25,360 So, 1107 00:45:25,420 --> 00:45:25,840 a scanner, 1108 00:45:25,900 --> 00:45:28,000 is going to trigger that every time. 1109 00:45:28,960 --> 00:45:29,320 Okay, 1110 00:45:29,360 --> 00:45:29,820 lastly, 1111 00:45:29,900 --> 00:45:30,280 what we're going to do is, 1112 00:45:30,280 --> 00:45:30,720 we're going to look at, 1113 00:45:31,680 --> 00:45:32,820 is on content level, 1114 00:45:32,920 --> 00:45:34,380 I'm just going to spend a minute on this. 1115 00:45:34,600 --> 00:45:36,120 This is basically when you think, 1116 00:45:36,160 --> 00:45:37,780 someone is sniffing your traffic, 1117 00:45:37,860 --> 00:45:38,760 and reading your email. 1118 00:45:39,020 --> 00:45:41,480 And you can do a whole lot of interesting things with them then. 1119 00:45:41,620 --> 00:45:42,860 You can throw them bait, 1120 00:45:43,040 --> 00:45:43,280 right? 1121 00:45:43,480 --> 00:45:45,320 I can send a mail to Arun saying, 1122 00:45:45,520 --> 00:45:46,040 dude, 1123 00:45:46,200 --> 00:45:46,680 you know what? 1124 00:45:46,920 --> 00:45:49,800 There's lots of secret stuff on this website. 1125 00:45:50,240 --> 00:45:50,640 Okay? 1126 00:45:50,720 --> 00:45:51,340 There's no such, 1127 00:45:51,480 --> 00:45:52,140 there is a website, 1128 00:45:52,320 --> 00:45:53,300 nobody ever looks at it. 1129 00:45:53,460 --> 00:45:55,140 We basically just look at the logs, 1130 00:45:55,620 --> 00:45:56,020 and, 1131 00:45:56,040 --> 00:45:59,060 and we put some very nasty malicious HTML code in there, 1132 00:45:59,180 --> 00:46:00,260 and we see if something is wrong. 1133 00:46:00,260 --> 00:46:00,480 So, 1134 00:46:00,480 --> 00:46:01,420 if someone hits that site, 1135 00:46:01,600 --> 00:46:02,220 ever. 1136 00:46:02,660 --> 00:46:03,180 Now, 1137 00:46:03,220 --> 00:46:04,760 if anyone hits that site, 1138 00:46:04,860 --> 00:46:06,240 hit that site, 1139 00:46:06,400 --> 00:46:08,320 we know it's someone reading our email. 1140 00:46:08,460 --> 00:46:08,740 Correct? 1141 00:46:09,600 --> 00:46:11,700 We can do the same thing with, 1142 00:46:11,800 --> 00:46:15,420 with basically creating traffic that bites back. 1143 00:46:15,960 --> 00:46:16,480 Like, 1144 00:46:16,480 --> 00:46:17,400 we know there's, 1145 00:46:17,400 --> 00:46:19,680 there's some issues in some of the sniffing technologies, 1146 00:46:20,020 --> 00:46:22,820 which means if I send a particular string through there, 1147 00:46:23,040 --> 00:46:24,600 it's going to break the sniffer. 1148 00:46:24,740 --> 00:46:25,000 Right? 1149 00:46:25,080 --> 00:46:27,340 It's going to cause a buffer overflow in the sniffer itself. 1150 00:46:27,980 --> 00:46:29,640 And we can start looking at, 1151 00:46:29,640 --> 00:46:29,940 at, 1152 00:46:29,940 --> 00:46:30,180 at, 1153 00:46:30,260 --> 00:46:34,980 putting our offensive kind of technologies into, 1154 00:46:36,480 --> 00:46:36,920 well, 1155 00:46:37,380 --> 00:46:39,320 we can put our offensive technologies there, 1156 00:46:39,520 --> 00:46:42,500 where our sniffer is actually going to read our stuff. 1157 00:46:42,740 --> 00:46:42,820 Right? 1158 00:46:42,900 --> 00:46:45,160 So we send you data all the time, 1159 00:46:45,200 --> 00:46:47,180 that's basically causing the sniffer to, 1160 00:46:47,240 --> 00:46:47,800 to break. 1161 00:46:48,040 --> 00:46:48,800 And in that case, 1162 00:46:48,860 --> 00:46:52,400 in some cases we might even attack the guy that's sniffing our traffic. 1163 00:46:53,040 --> 00:46:54,440 So that on a content level, 1164 00:46:54,680 --> 00:46:57,000 and I think they want to throw me off the stage by now. 1165 00:46:57,340 --> 00:46:57,780 So, 1166 00:46:57,880 --> 00:46:59,320 if there's any questions, 1167 00:46:59,540 --> 00:47:00,240 we're going to answer them. 1168 00:47:00,260 --> 00:47:00,740 We're going to be outside, 1169 00:47:00,980 --> 00:47:01,400 basically, 1170 00:47:01,400 --> 00:47:02,300 at the pool area. 1171 00:47:03,280 --> 00:47:04,860 But I think we need to get off here. 1172 00:47:04,920 --> 00:47:05,280 Thanks for, 1173 00:47:05,300 --> 00:47:06,140 for your attention. 1174 00:47:06,720 --> 00:47:07,820 And I hope you enjoyed it.