1 00:00:00,000 --> 00:00:05,920 So, I'm Val Smith. I run attack research. I do a lot of stuff with the Metasploit guys. 2 00:00:06,700 --> 00:00:07,500 Woo, Metasploit! 3 00:00:09,100 --> 00:00:13,720 Spent a lot of time researching attack techniques, what real attackers are actually doing. 4 00:00:14,540 --> 00:00:18,180 Do some breaking into computers and developing exploits and all that kind of stuff. 5 00:00:18,460 --> 00:00:19,860 You might have seen a few of my talks before. 6 00:00:21,680 --> 00:00:26,860 I pretty much talk about a completely different topic every single time, and this is going to be no different. 7 00:00:28,140 --> 00:00:30,220 Is this on? Oh my gosh, it is. 8 00:00:30,360 --> 00:00:32,240 I'm Colin Ames. I work with this character. 9 00:00:32,720 --> 00:00:38,480 Do security research, hopefully Metasploit development a little more, and general nonsense. 10 00:00:40,200 --> 00:00:42,440 Hi, I'm Dave. 11 00:00:42,680 --> 00:00:47,060 So, I've done security research for the past ten years on various things, bouncing around, 12 00:00:47,280 --> 00:00:54,820 everything from writing installation for drivers to doing malware reversing. 13 00:00:58,480 --> 00:01:05,660 All right, so, we're going to talk about spear phishing and a few tools that we developed to do that for pen testing, basically. 14 00:01:06,960 --> 00:01:12,560 Working on some standardized tools to run on top of or in conjunction with Metasploit to do this sort of thing. 15 00:01:13,000 --> 00:01:18,620 So, we're going to start off with some file phishing stuff, talk about some web things that we've been working on, Tor. 16 00:01:19,680 --> 00:01:20,460 It's going to be crazy. 17 00:01:20,620 --> 00:01:22,760 All right, so, why spear phishing? 18 00:01:22,920 --> 00:01:25,560 Well, this is the way that people are actually getting in now. 19 00:01:26,860 --> 00:01:33,620 You know, back in the day, people got in with buffer flows, you know, remote exploits, they'd find some port, they'd send their payload at you. 20 00:01:33,780 --> 00:01:39,660 And really, with firewalls and everything else that people have implemented, that's not as prevalent. 21 00:01:39,840 --> 00:01:43,440 People are sending emails, or they're directing you to websites, it's all client-side type attacks. 22 00:01:44,340 --> 00:01:47,000 And they're blending a whole bunch of different types of attacks together. 23 00:01:47,400 --> 00:01:53,880 Like, they'll have a malicious website combined with a malicious document, which then sends you off to some malware, 24 00:01:54,080 --> 00:01:56,840 and the social engineering component to trick you into doing these things. 25 00:01:56,860 --> 00:01:58,480 So, they're blending these attacks together. 26 00:02:00,740 --> 00:02:05,600 So, those of you in the audience that are pen testers, how often do you get to do phishing attacks against your customers? 27 00:02:05,760 --> 00:02:06,720 Anybody who does it frequently? 28 00:02:08,540 --> 00:02:11,240 A couple. All right. All right. That's better than none. 29 00:02:12,220 --> 00:02:14,780 If you're not doing this, you're really missing a major vector. 30 00:02:15,000 --> 00:02:19,600 Like, one of the big threats to your customers is that they're going to get hit by spear phishing. 31 00:02:19,760 --> 00:02:22,640 And so, if they're not letting you do this, then you're missing out. 32 00:02:23,080 --> 00:02:23,480 So, 33 00:02:25,720 --> 00:02:29,940 it's because of this kind of thing that I think that the security industry as a whole is sort of failing right now, 34 00:02:30,000 --> 00:02:33,880 because we're not actually testing what real attackers are doing. 35 00:02:35,260 --> 00:02:39,060 You know, we're sitting there in the boardroom, we're doing our little pen test and our scans, 36 00:02:39,280 --> 00:02:41,720 and the attackers are, like, hitting it up. 37 00:02:45,900 --> 00:02:50,280 You know, we're going to hand them a checklist of, here's your highs and your lows and your mediums, 38 00:02:50,280 --> 00:02:52,160 and this is what you should do, and what you've got to patch, 39 00:02:52,160 --> 00:02:54,740 and the attackers are blowing them, you know, blowing them up. 40 00:02:54,900 --> 00:02:59,420 Now, Val's a very calm person, but we really want to hit this home. 41 00:02:59,600 --> 00:03:02,580 This is what you should be doing. This is how bad guys get in. 42 00:03:02,680 --> 00:03:03,980 This is how you hack things. 43 00:03:06,680 --> 00:03:10,480 All right. So, one of the things that we've been seeing that's pretty prevalent out there 44 00:03:10,480 --> 00:03:13,740 is that there's a lot of these web kits that are designed to do this sort of attack. 45 00:03:14,380 --> 00:03:16,140 Russians are doing it, a bunch of people are doing it. 46 00:03:16,840 --> 00:03:22,140 MPAC, Tornado, LuckySploit, these are really sort of common web kits that deploy exploits to the client. 47 00:03:22,160 --> 00:03:22,920 to the clients in the browsers. 48 00:03:23,940 --> 00:03:27,160 Now, if you're a pen tester, you could go try to find these or download these, 49 00:03:27,300 --> 00:03:29,460 but who knows what's in them? I mean, it could be anything. 50 00:03:30,720 --> 00:03:31,820 It's an uncontrolled environment. 51 00:03:32,320 --> 00:03:37,120 A lot of these are backdoored, meaning that you get a shell, somebody in Russia gets a shell, too. 52 00:03:37,660 --> 00:03:42,860 So, you know, you don't want to be introducing that into the networks that you're trying to test on the up and up. 53 00:03:44,160 --> 00:03:48,700 The other thing is that there's a lot of file format exploits coming out, especially, like, PDF exploits, 54 00:03:48,700 --> 00:03:54,040 and these are sometimes getting built into the frameworks that already exist in the Metasploit or Core Impact or whatever, 55 00:03:54,420 --> 00:04:02,320 but a lot of them sort of have the same problems that web kits have in the sense that it's not really well understood what's in them. 56 00:04:02,400 --> 00:04:04,940 A lot of times they just pop up a blank PDF that crashes. 57 00:04:05,880 --> 00:04:07,060 It's hard to target those. 58 00:04:07,240 --> 00:04:10,520 And there's not a lot of knowledge out there about reverse engineering file formats. 59 00:04:10,840 --> 00:04:14,980 And so, you know, our solution to this was we're going to go out and we're going to figure out what bad guys are really doing. 60 00:04:15,180 --> 00:04:16,440 We're going to reverse engineer it. 61 00:04:16,540 --> 00:04:17,500 We're going to take those techniques 62 00:04:17,940 --> 00:04:18,680 and put them out there. 63 00:04:18,700 --> 00:04:23,780 We're going to put them together in a sort of standardized, modular way that people can use and trust and know what's in it, open source. 64 00:04:26,460 --> 00:04:31,800 So the sort of workflow that we've come up with to do this kind of work is that we thoroughly recon the target first. 65 00:04:32,100 --> 00:04:36,920 You know, we figure out everything we can about who they are, what they do, what their business is, how they communicate, 66 00:04:37,600 --> 00:04:42,660 and then build a legend for our tech, meaning, you know, what are we going to pretend to be? 67 00:04:42,820 --> 00:04:46,460 Are we going to pretend to be a vendor sending them spec sheets for whatever they're trying to buy? 68 00:04:46,640 --> 00:04:48,680 Are we going to pretend to be their editor for their newsletter? 69 00:04:48,680 --> 00:04:52,060 So we want to look for documents that are plausible from them. 70 00:04:52,460 --> 00:04:55,660 We're going to build our vector, meaning, is it going to be a PDF we're going to send them? 71 00:04:56,260 --> 00:04:58,800 Are we going to redirect them to a malicious website, email? 72 00:04:59,200 --> 00:05:01,340 Whatever the vector we're going to choose for this attack. 73 00:05:01,640 --> 00:05:03,380 And then we're going to send it off and see who we get. 74 00:05:05,920 --> 00:05:07,940 So, you know, that's on the attack side. 75 00:05:08,140 --> 00:05:11,740 On the backend side, we've got to have sort of our own infrastructure to handle this stuff. 76 00:05:11,860 --> 00:05:16,580 We're going to need a server-side exploitation system, something that can handle all these clients coming in. 77 00:05:16,640 --> 00:05:17,780 Because when you send out a phish 78 00:05:17,780 --> 00:05:20,200 or, you know, you send 10,000 people to a website 79 00:05:20,200 --> 00:05:22,260 and you're going to get a bunch of shells. 80 00:05:22,360 --> 00:05:23,300 And how do you handle all that? 81 00:05:23,400 --> 00:05:25,460 You can't just manually do one at a time. 82 00:05:27,060 --> 00:05:29,860 And also, one of the things that attackers have to worry about is 83 00:05:29,860 --> 00:05:32,180 if they have a firewall, how are we going to bypass it? 84 00:05:32,280 --> 00:05:33,260 Are they doing egress filtering? 85 00:05:33,480 --> 00:05:35,500 What ports are they allowed to, you know, send out? 86 00:05:35,700 --> 00:05:37,340 And so there's some upfront work to do there. 87 00:05:38,400 --> 00:05:43,060 You know, for example, inject your payloads into browsers that are already authorized to get out through the firewall 88 00:05:43,060 --> 00:05:44,400 or get out through the proxy. 89 00:05:45,160 --> 00:05:46,500 And then you're going to want to automate stuff. 90 00:05:46,500 --> 00:05:49,120 Because when you're dealing with hundreds or thousands of shells, 91 00:05:49,400 --> 00:05:50,920 you don't want to have to, you know, 92 00:05:51,460 --> 00:05:53,200 okay, this shell, I'm going to type my commands. 93 00:05:53,320 --> 00:05:55,300 This shell, I'm going to type my commands and dump my passwords. 94 00:05:55,540 --> 00:05:56,460 You'll never get done. 95 00:05:56,820 --> 00:06:00,600 A lot of times on pen testing engagements, you've got two days or a week or two weeks. 96 00:06:01,000 --> 00:06:04,400 So all this stuff is kind of complex and needs sort of a framework to work in. 97 00:06:07,400 --> 00:06:10,860 So, you know, I talked a little bit that client-side is sort of the new paradigm. 98 00:06:11,080 --> 00:06:12,740 You're hearing a lot about frameworks these days. 99 00:06:13,460 --> 00:06:15,180 This is sort of the direction people are going. 100 00:06:15,180 --> 00:06:18,240 And phishing is really the client-side attack facilitator. 101 00:06:18,440 --> 00:06:22,520 You know, that's the way you get, drive people, if you're doing targeted stuff, 102 00:06:23,020 --> 00:06:24,540 to whatever your exploit is. 103 00:06:26,340 --> 00:06:28,900 There's a lot of tools out there, but a lot of them are manual or stand-alone, 104 00:06:29,020 --> 00:06:30,360 with the exception of, like, Browser Autopone. 105 00:06:31,260 --> 00:06:34,420 You could go get Core Impact, which has some of this stuff in it, but that's a lot of money. 106 00:06:34,480 --> 00:06:35,460 Not everybody can afford that. 107 00:06:36,220 --> 00:06:39,040 But pen testers really need something that's standardized, 108 00:06:39,160 --> 00:06:42,740 that they can control and understand and prove to their customers that it's safe, 109 00:06:43,240 --> 00:06:44,180 that they can automate. 110 00:06:44,180 --> 00:06:46,160 And, you know, customize their attacks. 111 00:06:46,780 --> 00:06:50,600 And really, one thing that's left out in a lot of these tools is the concept of targeting. 112 00:06:50,880 --> 00:06:54,560 You know, how do you target who you're going after and make it look plausible? 113 00:07:00,640 --> 00:07:01,240 All right. 114 00:07:03,660 --> 00:07:07,260 So, targeting specifically, I mean, you have to break it down into a lot of different pieces. 115 00:07:07,380 --> 00:07:12,640 And most of this is heavily influenced on the talk that Val and HD gave a while back, Tactical Exploitation. 116 00:07:12,980 --> 00:07:14,740 And it sort of goes back and forth to that. 117 00:07:14,840 --> 00:07:17,920 And it's very, very focused on social engineering. 118 00:07:18,080 --> 00:07:19,400 It's driven by social engineering. 119 00:07:19,520 --> 00:07:24,260 You know, how do we socially engineer that user, that weak link on that network to get us in? 120 00:07:24,420 --> 00:07:26,160 And that's really where, you know, we're going to push it to. 121 00:07:26,320 --> 00:07:27,580 And it requires a lot of steps. 122 00:07:27,700 --> 00:07:28,260 And you have recon. 123 00:07:28,820 --> 00:07:32,540 You have to take that recon and, you know, derive it down and distill it into something that's useful 124 00:07:32,540 --> 00:07:35,020 that you can then reimplement and use to actually get in. 125 00:07:36,740 --> 00:07:41,400 So, you know, the first thing that's really, really useful that we're going to talk about and get into more depth here 126 00:07:41,720 --> 00:07:45,340 is, you know, file harvesting, file hunting, that sort of thing. 127 00:07:45,440 --> 00:07:50,300 And this is really as simple as, you know, Googling, creative Googling a company's website 128 00:07:50,300 --> 00:07:51,840 and finding out, well, what PDFs you got? 129 00:07:51,900 --> 00:07:52,620 What docs you got? 130 00:07:52,780 --> 00:07:53,480 You know, let's see. 131 00:07:53,580 --> 00:07:54,700 Let's see what you're putting out there. 132 00:07:55,040 --> 00:07:57,300 You know, or is your, you know, quarterly statement there? 133 00:07:57,420 --> 00:07:58,960 Is your biweekly newsletter there? 134 00:07:59,060 --> 00:08:03,960 Is, you know, something that will give me insight into your network, into the way that you do things there available? 135 00:08:04,160 --> 00:08:07,620 And so, you know, of course, the first thing is to find all these documents the best way you know how. 136 00:08:07,760 --> 00:08:10,080 I mean, so Googling is always a good bet. 137 00:08:10,260 --> 00:08:11,280 There are other search engines. 138 00:08:11,400 --> 00:08:12,160 We like to use as well. 139 00:08:12,280 --> 00:08:13,300 So that's useful. 140 00:08:13,640 --> 00:08:15,680 And then, you know, you have to step it down. 141 00:08:15,740 --> 00:08:19,380 Like, the first part of file harvesting is, well, hey, why don't you read the document? 142 00:08:20,060 --> 00:08:21,840 There's amazing things you can find in documents. 143 00:08:22,820 --> 00:08:26,560 There's, you know, scans every once in a while that we get, usernames and passwords, I believe. 144 00:08:28,320 --> 00:08:32,720 But more importantly, you get a feel for the, you know, the social engineering aspect behind it. 145 00:08:32,780 --> 00:08:33,940 Like, what are these users expecting? 146 00:08:34,320 --> 00:08:36,360 You know, do you see a lot of newsletters coming out? 147 00:08:36,380 --> 00:08:39,440 Do you see a lot of product, you know, discussion? 148 00:08:39,640 --> 00:08:41,380 Do you see, you know, forums? 149 00:08:41,380 --> 00:08:41,620 Do you see forum posts? 150 00:08:41,840 --> 00:08:42,300 This sort of thing. 151 00:08:42,460 --> 00:08:50,640 And so the documents that you can grab from their network openly from the Internet gives you great insight into all of this. 152 00:08:50,760 --> 00:08:53,660 And then, of course, you can dig a little deeper and start scraping metadata. 153 00:08:54,600 --> 00:08:57,000 You know, Word documents are great at this stuff. 154 00:08:57,060 --> 00:08:58,300 They store everything under the sun. 155 00:08:58,740 --> 00:09:00,980 You know, and even PDFs are pretty good at this as well. 156 00:09:01,060 --> 00:09:04,120 So you can get names, e-mail addresses, numbers. 157 00:09:04,600 --> 00:09:09,380 In fact, even operational details such as what OS are they running, what software, what patch level. 158 00:09:09,380 --> 00:09:11,580 And so that's how you kind of dig deeper and deeper. 159 00:09:13,360 --> 00:09:18,020 So as Tactile Exploitation talks about specifically, you know, you need to understand the infrastructure that you're attacking. 160 00:09:18,160 --> 00:09:22,240 You need to understand what your scope is, what the paradigm that you're shifting towards. 161 00:09:22,520 --> 00:09:29,300 And really, how you do this is enumeration first once you're out there on the Internet and you're pushing forward and you want to see everything that you can find. 162 00:09:29,400 --> 00:09:33,680 And there's a couple of different ways in VowelCover, I think, a bunch of it here in fairly good light, I hope. 163 00:09:34,440 --> 00:09:37,080 And, you know, you just sort of step through it, step through it. 164 00:09:37,080 --> 00:09:45,080 Now, the good stuff that Vowel will get into here shortly is bots versus browsers and other proxy logs and that sort of stuff. 165 00:09:45,160 --> 00:09:46,260 And it's just great information. 166 00:09:51,460 --> 00:09:51,980 All right. 167 00:09:52,000 --> 00:09:57,340 So, you know, one of the things when you're going after your clients is how do you know what their internal addresses are? 168 00:09:57,520 --> 00:10:01,780 How do you know where their web traffic is coming out of if you're going to target it? 169 00:10:02,560 --> 00:10:05,800 You know, you need to gather as much information about the target as you can. 170 00:10:05,800 --> 00:10:09,340 A lot of times you want to do this in a passive way so they don't know you're coming, they don't see you. 171 00:10:10,080 --> 00:10:18,860 One of the things that we've been looking at is the fact that a lot of sites out there have proxy analysis logs which are sort of the reverse of web server logs. 172 00:10:19,240 --> 00:10:24,900 These track all the stuff that clients are doing as they come out of a network and provide a web interface so that you can look at that data. 173 00:10:25,440 --> 00:10:33,640 And, you know, for example, up here, it's hard to see, but essentially this gives us a list of internal behind-the-net IP addresses and a couple of hosts. 174 00:10:33,920 --> 00:10:34,020 Okay. 175 00:10:35,320 --> 00:10:37,920 This is another example of a proxy analysis logging tool. 176 00:10:38,780 --> 00:10:44,920 This is some Russian site, and it gives you the user IDs of the users and the traffic from when they're surfing the web. 177 00:10:45,140 --> 00:10:46,660 So now we've got some users to target. 178 00:10:46,800 --> 00:10:48,220 We know their internal IP address range. 179 00:10:48,480 --> 00:10:51,060 We haven't done any scans on their network or sent them anything. 180 00:10:52,820 --> 00:10:54,480 You can find cool stuff like this. 181 00:10:54,600 --> 00:10:55,920 I think this is in the Ukraine. 182 00:10:56,560 --> 00:11:02,600 This basically tells us what antivirus they're using and the fact that they update it and how often they update it and the dates of when they update it. 183 00:11:02,680 --> 00:11:03,380 So we know. 184 00:11:04,020 --> 00:11:09,780 If we're going to target these guys with a phish, we better be able to bypass Kaspersky because they're running it and it's up to date. 185 00:11:10,560 --> 00:11:15,960 So some of the cool things that you can also look for in these logs is crutches of individuals who are on a network. 186 00:11:16,260 --> 00:11:19,700 So it's been once or twice that we've seen there and seen them going to porn sites. 187 00:11:20,100 --> 00:11:21,900 It gives you an idea of what they're looking for. 188 00:11:22,020 --> 00:11:23,720 Every once in a while you can find them clicking on spam. 189 00:11:24,100 --> 00:11:27,700 So you can go find the spam and know these guys are nice guys to go phishing after. 190 00:11:28,240 --> 00:11:28,600 Yeah. 191 00:11:28,640 --> 00:11:33,700 If you see a guy that goes to Suicide Girls every day, then you know, okay, I'm going to send them a Suicide Girls update email. 192 00:11:33,700 --> 00:11:36,100 You know, with, hey, here's some new pictures or whatever. 193 00:11:36,580 --> 00:11:43,400 And then you see stuff like this in these logs that tells you, oh, they're running Windows because they're going to Windows update and, you know, they update rather frequently. 194 00:11:45,360 --> 00:11:56,020 The next thing is like, okay, well, if we're going to target people, we need to know what IP ranges that we're dealing with and which ones are their, you know, web-hosted company IPs and which are their internal network IPs for their company. 195 00:11:56,340 --> 00:11:59,760 And one of the ways to do this is, well, you start off and you look at, you know, the domain name. 196 00:11:59,800 --> 00:12:01,960 We pick some random Chinese domain to play with. 197 00:12:01,960 --> 00:12:03,520 You get one IP address. 198 00:12:03,940 --> 00:12:14,900 So if you go searching through news groups and mailing list for people posting from that domain, you'll actually find other IP addresses in the headers which are often their corporate internal network. 199 00:12:15,200 --> 00:12:16,340 You know, it's where their network is. 200 00:12:16,700 --> 00:12:18,780 So attacking their web host may not get you far. 201 00:12:19,040 --> 00:12:21,620 But attacking their actual network may be what you want to do. 202 00:12:21,860 --> 00:12:23,600 So this helps you target that a little bit better. 203 00:12:23,680 --> 00:12:25,740 And you look it up and, you know, it's owned by the same people. 204 00:12:25,960 --> 00:12:27,600 It's in the same country and all that stuff. 205 00:12:27,880 --> 00:12:29,640 It's just an IP that you may not have known about. 206 00:12:31,060 --> 00:12:31,880 Bots versus browsers. 207 00:12:31,880 --> 00:12:32,920 Browsers is awesome for this, too. 208 00:12:33,100 --> 00:12:42,820 Once you get these kind of IP ranges from proxy logs or from mailing lists or whatever, you know, go look them up and you can see the user agents without ever having to get them to your site. 209 00:12:42,960 --> 00:12:48,120 You just go and see, okay, well, they're running, you know, Firefox on Windows XP or whatever. 210 00:12:55,260 --> 00:12:58,440 So the next piece, you know, we briefly spoke on it earlier. 211 00:12:58,540 --> 00:13:01,860 And then we've covered a lot of this targeting for, you know, network information and that sort of guy. 212 00:13:01,860 --> 00:13:08,960 Now we're going to dig a little deeper into the network and find specifically for files that we're looking for, files that will get us access, things that are useful. 213 00:13:09,100 --> 00:13:12,580 So here's, you know, a newsletter for a phishing site that talks about phishing. 214 00:13:12,680 --> 00:13:13,240 We like this. 215 00:13:13,420 --> 00:13:21,460 But in general, when you're looking at these or targeting these networks in general, there's a lot of information to be gleaned. 216 00:13:21,460 --> 00:13:28,300 And the useful stuff that you see oftentimes is, oh, well, we just went to this conference or we published at this conference or you have speakers or you're hosting this conference. 217 00:13:29,120 --> 00:13:30,960 So updated slides, always good. 218 00:13:31,340 --> 00:13:31,840 You know. 219 00:13:32,280 --> 00:13:32,640 Newsletters. 220 00:13:36,060 --> 00:13:36,780 Eerie vibrations. 221 00:13:39,140 --> 00:13:44,060 And, I mean, and so when you dig through these things, that's what you're looking for. 222 00:13:44,140 --> 00:13:46,380 I mean, and it's, you know, you dig, dig, dig. 223 00:13:46,880 --> 00:13:48,540 And now we get to the good stuff. 224 00:13:49,620 --> 00:13:54,580 So what we really want to do is we want to find a PDF in our particular case here. 225 00:13:54,660 --> 00:13:57,340 We picked PDFs for specific reasons that we'll get into here shortly. 226 00:13:57,720 --> 00:13:58,900 And we want to infect it. 227 00:13:58,980 --> 00:14:01,580 We want to create it as our payload to get into their network. 228 00:14:02,900 --> 00:14:04,540 And there's lots of reasons for this. 229 00:14:04,600 --> 00:14:08,640 PDFs are probably the most prolific document format there is out there right now. 230 00:14:09,400 --> 00:14:18,380 And I think you can take all the others and add them together and they still don't equal up to how many PDFs you can find just by doing a simplistic file type search on Google. 231 00:14:18,560 --> 00:14:19,160 You know. 232 00:14:19,380 --> 00:14:21,420 I'm not really, really big into that sort of number. 233 00:14:21,540 --> 00:14:24,080 But that's how I've based a lot of this. 234 00:14:24,200 --> 00:14:25,960 And people generally seem to trust them. 235 00:14:26,100 --> 00:14:28,560 They also have lots and lots of features. 236 00:14:30,120 --> 00:14:31,360 So first, you know. 237 00:14:31,360 --> 00:14:32,280 We have to find a PDF. 238 00:14:32,460 --> 00:14:33,720 So here's some general stuff. 239 00:14:33,860 --> 00:14:37,340 Now there's an interesting thing and, you know, a little Easter egg in the corner here. 240 00:14:37,480 --> 00:14:38,800 Can we see something that's wrong? 241 00:14:40,080 --> 00:14:41,120 Val's a good guy and all. 242 00:14:41,220 --> 00:14:45,000 But sometimes he forgets to log himself out of Gmail when he's, you know, searching for things. 243 00:14:45,100 --> 00:14:48,300 Now this doesn't necessarily tip them off that you're looking. 244 00:14:48,460 --> 00:14:50,260 But, you know, that's leakage. 245 00:14:50,520 --> 00:14:53,180 That's information leakage that you didn't need to do. 246 00:14:53,260 --> 00:14:55,240 So be careful when doing this sort of thing. 247 00:14:55,440 --> 00:14:55,780 Yeah. 248 00:14:55,860 --> 00:14:59,620 You might hit some site that's already been hacked by somebody else and then screw your Gmail account. 249 00:14:59,620 --> 00:15:01,020 So here we are. 250 00:15:01,040 --> 00:15:02,040 We're kind of going through. 251 00:15:02,520 --> 00:15:04,500 And, you know, we come across this PDF. 252 00:15:04,600 --> 00:15:05,580 This one looks fairly interesting. 253 00:15:05,740 --> 00:15:09,300 It's a newsletter and it's about a conference that's ongoing and so forth. 254 00:15:10,600 --> 00:15:18,940 And here's another thing that we want to point out here specifically is, again, Val has done something wonderful that I always love to see is people opening PDFs in their web browsers. 255 00:15:19,180 --> 00:15:20,160 This is great. 256 00:15:20,320 --> 00:15:25,600 I love it when you do this because it elevates my PDF to run with full access. 257 00:15:25,840 --> 00:15:29,520 I don't have to ask you permission anymore to, you know, launch cmd.exe. 258 00:15:29,520 --> 00:15:33,600 Or, you know, do all those other fun things that I really like to do that we'll talk about a little later. 259 00:15:35,320 --> 00:15:38,180 So as we keep going down, we go down to, you know, your reading. 260 00:15:38,320 --> 00:15:38,700 Here we are. 261 00:15:38,760 --> 00:15:39,760 We're just reading now. 262 00:15:40,240 --> 00:15:45,320 And, you know, we can see here that we have the person that writes this newsletter and distributes it. 263 00:15:45,380 --> 00:15:46,480 And, you know, we can follow it up here. 264 00:15:46,560 --> 00:15:51,680 And you can see in the corner we have another follow-up Google search that shows you who it is, who the editor is. 265 00:15:52,780 --> 00:15:54,200 So now we're getting a good target list. 266 00:15:54,720 --> 00:15:56,560 And now we want to find, you know, cross-correlation. 267 00:15:56,620 --> 00:15:58,240 We want to see sites that trust this. 268 00:15:58,700 --> 00:15:58,980 Leveraging. 269 00:15:59,520 --> 00:15:59,940 What do we... 270 00:15:59,940 --> 00:16:01,060 Who reads this? 271 00:16:01,160 --> 00:16:02,040 Who's interested in this? 272 00:16:02,120 --> 00:16:03,080 Who are they partnering with? 273 00:16:05,520 --> 00:16:09,960 And, you know, because this could give us more attack structure, more vectors to enter from. 274 00:16:12,080 --> 00:16:15,760 And so, you know, continuing on and just digging a little deeper, looking for e-mail addresses. 275 00:16:16,000 --> 00:16:16,820 These are good targets. 276 00:16:16,900 --> 00:16:17,320 Good targets. 277 00:16:17,380 --> 00:16:17,720 Keep going. 278 00:16:19,660 --> 00:16:26,520 And, you know, continue and look for those relationships that can maybe be leveraged at a higher level than ones you've already found. 279 00:16:26,640 --> 00:16:29,420 And so you just sort of keep structuring it further and further. 280 00:16:29,840 --> 00:16:30,240 Yeah. 281 00:16:30,360 --> 00:16:38,100 So this helps you decide, okay, well, I want to send this newsletter from organization A to organization B because I know they have a relationship and they're using the same content. 282 00:16:38,300 --> 00:16:40,080 And this is something you might expect or trust. 283 00:16:42,040 --> 00:16:45,700 So the actual, you know, specifics of PDF infection. 284 00:16:46,000 --> 00:16:48,160 Now, so, I mean, I'm talking about infection. 285 00:16:49,740 --> 00:16:58,640 I'm going to take ready-made PDFs that are valid information, your information, information you read, information you provided to us, and I'm going to infect it with a payload. 286 00:16:58,640 --> 00:16:59,840 This doesn't destroy the information. 287 00:16:59,960 --> 00:17:01,120 In fact, the information is still there. 288 00:17:01,300 --> 00:17:05,320 And there's some wonderful features about PDF that makes this amazingly easy. 289 00:17:07,680 --> 00:17:11,960 So as you've heard, I'm sure, in the news and other things, you know, PDF has got tons of features. 290 00:17:12,080 --> 00:17:13,460 Adobe, I love them for this. 291 00:17:13,620 --> 00:17:14,820 They love features. 292 00:17:15,180 --> 00:17:18,040 Gosh, everyone wants to have Flash in their documents. 293 00:17:18,300 --> 00:17:20,400 Everyone wants to be able to view a web in their documents. 294 00:17:20,640 --> 00:17:22,900 Hey, why not have a document launch commands? 295 00:17:23,240 --> 00:17:23,980 That's wonderful. 296 00:17:24,340 --> 00:17:28,240 So, you know, we have just tons of vectors in PDFs that we can leverage. 297 00:17:28,240 --> 00:17:32,680 And these are allowed, this is a feature of the document format itself. 298 00:17:33,060 --> 00:17:34,940 Not even a vulnerability or an exploit. 299 00:17:35,200 --> 00:17:38,500 This is just what's built there, given to us, say, hey, go ahead and use this. 300 00:17:39,040 --> 00:17:39,820 Functionality is great. 301 00:17:40,280 --> 00:17:42,540 You know, and again, PDFs work all over. 302 00:17:42,640 --> 00:17:43,640 You know, they work on Linux. 303 00:17:43,800 --> 00:17:44,800 They work on OSX. 304 00:17:44,840 --> 00:17:45,500 They work on Windows. 305 00:17:45,760 --> 00:17:49,920 So you have a wide range of targets that you can use with just one file format. 306 00:17:50,640 --> 00:17:52,640 And again, we like to believe that they're trusted. 307 00:17:53,040 --> 00:17:56,360 We'll see how much people continue to trust them as we go on. 308 00:17:56,400 --> 00:17:57,820 As things, we keep to. 309 00:17:57,820 --> 00:18:00,020 Keep picking on PDFs quite a bit, so. 310 00:18:01,200 --> 00:18:03,560 But so, you know, there's been a lot of good research out there. 311 00:18:03,640 --> 00:18:05,000 I want to, you know, throw up some of these names. 312 00:18:05,060 --> 00:18:08,640 These are good people to go looking for if you want to learn more about PDFs, 313 00:18:08,660 --> 00:18:10,580 about the structure of them, about attacks on them. 314 00:18:10,800 --> 00:18:13,180 You know, and so these are good places to go. 315 00:18:13,280 --> 00:18:17,200 And there's some great code out there that does a lot of what we're going to be talking about. 316 00:18:18,340 --> 00:18:23,360 And most of the stuff is structured at how do we analyze PDFs for malware and that sort of thing. 317 00:18:23,460 --> 00:18:25,400 And that's kind of where we're going to try and set ourselves apart. 318 00:18:25,640 --> 00:18:27,560 Because we're interested in attacking with PDFs. 319 00:18:27,820 --> 00:18:31,900 So a byproduct of this, of course, is that, yes, I can take apart a malicious PDF 320 00:18:31,900 --> 00:18:36,160 and tell you, you know, what shell code is it using, where is it beaconing to, so on and so forth. 321 00:18:36,260 --> 00:18:38,060 But that's not really our primary goal. 322 00:18:38,580 --> 00:18:42,800 So the attack basics specifically for PDFs, you know, we have vulnerabilities. 323 00:18:43,060 --> 00:18:44,620 And we want to turn those vulnerabilities into exploits. 324 00:18:44,660 --> 00:18:45,440 You know, you've got JavaScript. 325 00:18:45,640 --> 00:18:47,060 Those are prolific. 326 00:18:47,140 --> 00:18:53,960 There's, I think, six or seven at least, you know, overflows in the actual JavaScript interpreter for Adobe. 327 00:18:54,040 --> 00:18:55,560 And specifically in Adobe Reader. 328 00:18:56,020 --> 00:18:57,280 And, you know, you've got Flash. 329 00:18:57,820 --> 00:18:58,920 There's just fully featured things. 330 00:18:59,100 --> 00:19:03,460 I mean, if you fuzz this, you can get information and you can get, you know, good results. 331 00:19:03,680 --> 00:19:04,680 And, you know, of course, JBIG. 332 00:19:04,720 --> 00:19:05,260 These are filters. 333 00:19:05,340 --> 00:19:10,100 A filter, you know, in a PDF is just a way of displaying information or translating it from one median to another. 334 00:19:10,320 --> 00:19:14,860 I think Puskat was telling me that she fuzzed for about ten minutes to find the JBIG exploit. 335 00:19:16,000 --> 00:19:21,200 And so then you start leveraging design features on top of, you know, vulnerabilities for your attack. 336 00:19:21,380 --> 00:19:25,020 And that's what we're going to actually do specifically for, you know, our infector. 337 00:19:26,560 --> 00:19:27,520 So, you know. 338 00:19:27,820 --> 00:19:32,520 The deep mechanics of this is when a PDF is opened, it parses through lots of objects. 339 00:19:32,620 --> 00:19:36,400 And of these objects, you can get, you know, varying results of what you can and cannot do. 340 00:19:37,140 --> 00:19:38,560 Useful ones are open actions. 341 00:19:38,680 --> 00:19:41,840 Open actions take you to other object groups that can do things. 342 00:19:42,000 --> 00:19:48,600 Open actions are always associated or not always, but mostly associated with malicious PDFs and so forth. 343 00:19:48,660 --> 00:19:50,100 But they're actually also legitimate uses. 344 00:19:50,300 --> 00:19:55,940 If you have an index of, you know, 40 pages and actually page number one is number 41, 345 00:19:56,220 --> 00:19:57,800 you have to use an open action to hide it. 346 00:19:57,800 --> 00:20:01,620 You have to hop to page 41 if you want to open page one when you view your PDF. 347 00:20:01,740 --> 00:20:06,900 So this is controlling content the way the content is driven and viewed by the actual PDF reader. 348 00:20:07,180 --> 00:20:08,600 And so we want to use this. 349 00:20:08,660 --> 00:20:12,340 We're going to leverage this to kind of point it to where we have bad things to go. 350 00:20:12,400 --> 00:20:14,900 Next is you have additional actions, which is AA here. 351 00:20:15,060 --> 00:20:18,880 And these are all object types in PDF, which can then go further on. 352 00:20:19,000 --> 00:20:22,940 And the open action that we're using, you know, we're going to use something that calls CMD. 353 00:20:23,060 --> 00:20:24,600 And it's very, it's interesting. 354 00:20:24,600 --> 00:20:31,840 So you go through and you have all of these features that you take, you basically overload and use to base your attack. 355 00:20:32,260 --> 00:20:37,820 And so the most important feature here is PDFs have a wonderful thing called incremental updating. 356 00:20:38,260 --> 00:20:42,900 Incremental updating is that you leave all content in the PDF in place. 357 00:20:43,120 --> 00:20:46,940 And anything that you want to change, you just add to the end of the file. 358 00:20:47,100 --> 00:20:47,840 You just append it. 359 00:20:48,020 --> 00:20:49,000 You just put it at the end. 360 00:20:49,020 --> 00:20:52,260 At the end of, you know, a PDF file, you have end of file as we see here. 361 00:20:52,400 --> 00:20:53,760 And then you just start adding new objects. 362 00:20:53,760 --> 00:20:55,380 Or overwriting objects. 363 00:20:55,600 --> 00:20:59,420 I don't have to change anything on the PDF to infect it. 364 00:20:59,460 --> 00:21:00,160 This is wonderful. 365 00:21:01,080 --> 00:21:04,840 So this leads us to our, you know, our actual Metasploit module. 366 00:21:05,000 --> 00:21:09,700 And so what our Metasploit module does is you pass it a PDF that you found that you want to infect. 367 00:21:10,180 --> 00:21:14,420 It then will infect it with a Metasploit payload. 368 00:21:14,760 --> 00:21:15,880 And it will launch it. 369 00:21:16,360 --> 00:21:21,120 So let's see how the demo gods like us today. 370 00:21:30,320 --> 00:21:31,720 . 371 00:21:33,580 --> 00:21:34,980 . 372 00:21:45,360 --> 00:21:46,760 Good. 373 00:21:47,120 --> 00:21:48,440 . 374 00:21:50,760 --> 00:21:51,520 . 375 00:21:51,520 --> 00:21:51,700 . 376 00:21:54,140 --> 00:21:55,540 . 377 00:21:55,540 --> 00:21:56,680 . 378 00:22:08,500 --> 00:22:09,200 . 379 00:22:09,900 --> 00:22:11,120 . 380 00:22:11,120 --> 00:22:11,220 . 381 00:22:11,220 --> 00:22:11,420 . 382 00:22:27,440 --> 00:22:28,360 All right. 383 00:22:28,400 --> 00:22:32,620 So what he's doing is loading up two console, Metaswitch consoles with resource files that 384 00:22:32,620 --> 00:22:36,400 do the multi handler which is going to catch the cells coming in and then his PDF stuff. 385 00:22:38,880 --> 00:22:40,640 So if we can show it here. 386 00:22:44,340 --> 00:22:50,140 So we're showing the PDF that we saw earlier, this SDIAP v2 and 4. 387 00:22:50,480 --> 00:22:56,240 Now an important feature of the actual module in this particular case is that we want the 388 00:22:56,240 --> 00:23:01,400 file name that we're going to create here to be very, very similar but not the same. 389 00:23:01,620 --> 00:23:03,140 And I'll explain this in a second. 390 00:23:03,420 --> 00:23:06,280 And this is more or less, you know, we could make 391 00:23:06,280 --> 00:23:07,000 it a random file. 392 00:23:07,100 --> 00:23:08,600 But random files are strange looking. 393 00:23:08,820 --> 00:23:10,660 Normal users don't open random files. 394 00:23:10,900 --> 00:23:12,040 So well, that's not true. 395 00:23:12,160 --> 00:23:17,960 But we're trying, we're really trying to, you know, play to their side of the coin here. 396 00:23:18,180 --> 00:23:20,880 So make sure you name it exploit.pdf so they open it. 397 00:23:21,140 --> 00:23:22,840 They love exploit.pdf. 398 00:23:27,000 --> 00:23:31,760 And another thing that I want to point out here is this is not a vulnerability. 399 00:23:32,320 --> 00:23:35,420 This will work on every single version of Adobe till the end of time. 400 00:23:36,020 --> 00:23:39,640 Unless they change functionality of PDF, which I don't actually see them doing, to 401 00:23:39,640 --> 00:23:39,980 be honest. 402 00:23:54,620 --> 00:23:56,100 We don't have it in temp. 403 00:23:56,320 --> 00:23:56,680 Hmm. 404 00:24:04,100 --> 00:24:05,240 So Val told me. 405 00:24:05,420 --> 00:24:06,120 He had set this all up. 406 00:24:06,180 --> 00:24:07,260 But he lied to me. 407 00:24:07,420 --> 00:24:09,480 He did not move it to temp to make our life easier. 408 00:24:09,860 --> 00:24:10,720 But it's okay. 409 00:24:10,940 --> 00:24:11,200 It's okay. 410 00:24:25,860 --> 00:24:28,280 I wish tab complete worked on Val's VM. 411 00:24:28,600 --> 00:24:28,860 Hmm. 412 00:24:34,000 --> 00:24:34,720 All right. 413 00:24:34,740 --> 00:24:35,620 Maybe now it will work. 414 00:24:37,480 --> 00:24:39,300 If you spell re-exploit correct. 415 00:24:40,480 --> 00:24:40,840 Ha. 416 00:24:41,280 --> 00:24:41,640 Huzzah. 417 00:24:41,920 --> 00:24:44,680 So as it goes through here, we just see it, you know, we picked a payload. 418 00:24:44,780 --> 00:24:46,060 We used a Maturpa reverse TCP. 419 00:24:46,360 --> 00:24:47,020 Nothing fancy. 420 00:24:47,740 --> 00:24:49,660 And it just, it spit out a new one in temp. 421 00:24:50,960 --> 00:24:52,080 Which is our other one. 422 00:24:52,920 --> 00:24:56,660 And that loaded up into a, we have a web directory for that. 423 00:25:18,960 --> 00:25:21,760 Let Val log in here so I can own him. 424 00:25:22,740 --> 00:25:23,220 . 425 00:25:23,220 --> 00:25:23,800 . 426 00:25:25,660 --> 00:25:26,140 Bye. 427 00:25:26,180 --> 00:25:26,260 . 428 00:25:28,360 --> 00:25:29,660 Actually, do you want to own yourself? 429 00:25:29,800 --> 00:25:30,580 Do you want to click through it all? 430 00:25:30,720 --> 00:25:30,900 Sure. 431 00:25:32,700 --> 00:25:33,480 I'll own myself. 432 00:25:39,920 --> 00:25:40,240 Hopefully. 433 00:25:43,100 --> 00:25:43,420 Hopefully. 434 00:25:53,980 --> 00:25:55,360 It'll eventually log in, I promise. 435 00:26:00,360 --> 00:26:01,160 You know what? 436 00:26:01,260 --> 00:26:01,680 This is wrong. 437 00:26:05,460 --> 00:26:06,480 Let's own Root. 438 00:26:06,480 --> 00:26:07,360 Val Smith's a wuss. 439 00:26:08,500 --> 00:26:10,460 Because Val Smith's a good guy. 440 00:26:11,500 --> 00:26:13,800 He uses, you know, user privilege separation. 441 00:26:13,880 --> 00:26:15,200 He never runs his administrator. 442 00:26:36,000 --> 00:26:36,540 All right. 443 00:26:36,600 --> 00:26:38,600 So what we're going to do is we're going to connect to our, you know, 444 00:26:38,620 --> 00:26:41,800 we're going to assume that you're connecting to a web server that's hosting up this PDF, 445 00:26:42,640 --> 00:26:44,820 and we're going to hopefully launch it. 446 00:26:45,000 --> 00:26:48,260 And you can, of course, attach this to an email that you're sending in, 447 00:26:48,340 --> 00:26:50,300 which is the more traditional vector that we use. 448 00:26:52,300 --> 00:26:53,320 So here we see it. 449 00:26:53,360 --> 00:26:56,240 It opens the PDF, and it immediately asks him to send it. 450 00:26:56,240 --> 00:26:57,900 Save the same PDF he just opened. 451 00:26:58,040 --> 00:26:59,220 That seems a little odd. 452 00:26:59,520 --> 00:27:03,380 So actually what it's asking him to save is our actual payload. 453 00:27:03,920 --> 00:27:06,020 And then the next thing it kicks up, that's CMD. 454 00:27:06,200 --> 00:27:07,660 It asked him to call CMD. 455 00:27:09,220 --> 00:27:12,940 So let's go check other VM and see what happened. 456 00:27:15,060 --> 00:27:15,780 Hopefully something. 457 00:27:17,520 --> 00:27:18,460 We got a session. 458 00:27:19,000 --> 00:27:19,540 All right. 459 00:27:19,580 --> 00:27:24,740 So basically what happened when we opened that PDF is that we got owned. 460 00:27:28,780 --> 00:27:29,380 All right. 461 00:27:33,860 --> 00:27:34,980 Do a hash dump. 462 00:27:39,440 --> 00:27:40,640 Say what? 463 00:27:43,400 --> 00:27:44,000 Actually. 464 00:27:44,140 --> 00:27:45,220 It's all the same. 465 00:27:45,600 --> 00:27:49,280 The newer versions of AcroRead on Linux, 466 00:27:49,400 --> 00:27:51,140 I haven't checked it recently on OSX, 467 00:27:51,180 --> 00:27:55,200 but Linux will not call commands directly anymore since version after, 468 00:27:55,660 --> 00:28:00,380 After, I think, 7, the 8 version will only call the default web browser, which is generally Firefox. 469 00:28:00,840 --> 00:28:05,560 So, of course, you can do other interesting things like call Firefox exploits through Adobe. 470 00:28:05,780 --> 00:28:07,520 But we'll get to that later, maybe. 471 00:28:07,700 --> 00:28:11,300 All right, we're going to crank because we want to make sure that there's time for all the other Metasploit track people. 472 00:28:11,500 --> 00:28:13,920 So we're going to jump into the next piece, which is web phishing. 473 00:28:14,180 --> 00:28:18,200 Now, the idea behind this is that you want to direct your targets to your website with some means, 474 00:28:18,340 --> 00:28:22,120 whether it's an email or you hack their website and put your stuff on it. 475 00:28:22,940 --> 00:28:26,560 And then Egypt gave a great talk about target enumeration, 476 00:28:26,760 --> 00:28:29,140 and we're going to talk a little bit about that from a more basic point of view. 477 00:28:29,220 --> 00:28:32,140 This is stuff you can take home and play with and figure out how to do yourself. 478 00:28:33,000 --> 00:28:36,000 And then the next thing you want to do is social engineer the target into believing that everything's okay, 479 00:28:36,800 --> 00:28:41,980 nothing bad's happening to them, and then execute code on them using some social engineering techniques we're going to talk about. 480 00:28:42,660 --> 00:28:44,960 Then you've got to handle your access just like we did with the PDF, 481 00:28:45,180 --> 00:28:47,540 and then automate your post-exploitation activities. 482 00:28:48,800 --> 00:28:51,420 All right, so I sort of have some really general stuff. 483 00:28:51,420 --> 00:28:55,240 And a lot of this is taken straight from how real attackers do their web kits, 484 00:28:56,040 --> 00:28:58,940 but I did it in such a way that at least you can understand the code. 485 00:28:59,080 --> 00:29:04,160 It's fairly simple, and you can use it without thinking I'm going to, you know, backdoor it. 486 00:29:04,940 --> 00:29:09,360 So we want to do OS detection and IP detection, figure out what browsers they're running, 487 00:29:09,460 --> 00:29:12,920 and then make a decision on, okay, well, if they're running this OS and this browser, we want to send them over here. 488 00:29:13,020 --> 00:29:15,120 Similar, along the same lines as browser Autopom. 489 00:29:15,900 --> 00:29:18,940 We've got some decloaking stuff, and then some signed job applets. 490 00:29:19,320 --> 00:29:19,680 So... 491 00:29:20,860 --> 00:29:24,960 In general, what we do is we sort of built some little modules to do client-side enumeration, 492 00:29:25,900 --> 00:29:28,860 and you can extend these to do all kinds of crazy stuff. 493 00:29:29,640 --> 00:29:33,300 And I'm not going to read all the code, but I'll just sort of show you a little overview of each thing. 494 00:29:33,960 --> 00:29:37,560 So the first thing we want to do is generate the header for our page, whatever it's going to be. 495 00:29:39,120 --> 00:29:42,880 In this case, we're going to check and see if they have JavaScript enabled, 496 00:29:43,140 --> 00:29:48,420 and if not, we want to bounce them out to some safe URL, you know, maybe their company site, 497 00:29:48,500 --> 00:29:49,660 or whatever we're trying to iframe in. 498 00:29:50,880 --> 00:29:54,200 The next thing we want to do that's sort of important, especially to pen testers, 499 00:29:54,280 --> 00:29:56,980 is we want to verify that the target IP is in scope. 500 00:29:57,460 --> 00:30:03,080 We've been on pen tests where we've done phishing and accidentally owned random people's home boxes, 501 00:30:03,280 --> 00:30:04,600 so you don't want that to happen. 502 00:30:04,840 --> 00:30:09,500 You want to make sure that the only IPs that you're hitting are in the scope of whatever your engagement is, 503 00:30:09,600 --> 00:30:13,060 and if they're not, bounce them off to some innocuous site that's not going to hurt them. 504 00:30:13,780 --> 00:30:15,980 So, you know, we just have some code to help you do that. 505 00:30:16,240 --> 00:30:17,900 We want to verify that they have Java installed, 506 00:30:18,140 --> 00:30:19,660 because this particular text is not going to work. 507 00:30:19,660 --> 00:30:20,360 The attack requires Java. 508 00:30:21,620 --> 00:30:24,240 So we just have a really simple, this is like simple, easy stuff, 509 00:30:24,460 --> 00:30:28,760 but we have them in a modular way that you can just go grab these things for your own attacks 510 00:30:28,760 --> 00:30:31,820 if you're trying to build a phishing thing for client-side engagements. 511 00:30:32,560 --> 00:30:34,080 Then we want to know what OS they're reading. 512 00:30:34,700 --> 00:30:37,880 This particular function is really based on user agent stuff. 513 00:30:38,320 --> 00:30:43,620 Egypt's got some really targeted, reliable ways of finding about OS and patch level and service pack level, 514 00:30:43,800 --> 00:30:45,240 which you should definitely check out. 515 00:30:46,760 --> 00:30:48,700 Then gathering information about the browser. 516 00:30:48,700 --> 00:30:53,180 You know, are they running Opera, or Internet Explorer, Safari, or Firefox, or what have you. 517 00:30:54,400 --> 00:30:56,420 All right, another thing that can be useful while you're, 518 00:30:56,500 --> 00:30:59,520 I mean, if you've got them as a captive audience and they're hitting your web page, 519 00:30:59,680 --> 00:31:01,700 you might as well gather information about their internal IP. 520 00:31:02,060 --> 00:31:03,660 And so there's a couple of ways to do this. 521 00:31:03,720 --> 00:31:10,080 We have a JavaScript method, which allows us to get their internal behind the NAT IP address. 522 00:31:10,700 --> 00:31:12,200 We also have a Java applet. 523 00:31:12,480 --> 00:31:16,720 There's a guy out there, regulus.de, who released an applet to do this, 524 00:31:16,760 --> 00:31:18,680 and we sort of maybe reverse engineered it. 525 00:31:18,680 --> 00:31:21,020 And added some bling to it. 526 00:31:21,920 --> 00:31:24,880 You can go to his site and get more info about what this class exactly does, 527 00:31:25,060 --> 00:31:28,620 but it'll essentially do some stuff to get you their internal IP address. 528 00:31:30,080 --> 00:31:32,840 And if you're really interested in decloaking internal IPs 529 00:31:33,260 --> 00:31:35,060 or finding out if someone's coming through a proxy or Tor, 530 00:31:35,440 --> 00:31:37,040 check out hdsdecloak.net. 531 00:31:37,700 --> 00:31:41,020 It's got all kinds, you know, just a hundred different ways of doing this same kind of thing 532 00:31:41,680 --> 00:31:43,340 that go way beyond what we have here. 533 00:31:44,060 --> 00:31:45,640 Then you might want to log all this stuff. 534 00:31:45,720 --> 00:31:47,880 You want to know, okay, this IP hit me at this date and time, 535 00:31:47,880 --> 00:31:51,340 and they're running this stuff in case, you know, your customer says, 536 00:31:51,480 --> 00:31:54,380 hey, you guys didn't really own me or you did own me and something bad happened. 537 00:31:54,440 --> 00:31:56,260 You want to know if that was you or somebody else. 538 00:31:56,780 --> 00:31:58,320 It's very helpful to log this stuff. 539 00:31:58,600 --> 00:32:01,740 So we just have an example of what this sort of little front end will do. 540 00:32:02,000 --> 00:32:04,620 Normally you wouldn't output this to the user because obviously it looks weird, 541 00:32:04,760 --> 00:32:06,260 but send it to a database. 542 00:32:07,660 --> 00:32:12,100 Okay, so, you know, the social engineering aspect of all this is having a Java applet 543 00:32:12,100 --> 00:32:16,080 that you can distribute your payloads in a similar way to the PDF stuff 544 00:32:16,080 --> 00:32:17,420 that Colin was talking about earlier. 545 00:32:18,340 --> 00:32:19,520 You know, we love Meterpreter. 546 00:32:19,580 --> 00:32:22,140 That's sort of our favorite thing, so we're going to distribute that in this case. 547 00:32:22,860 --> 00:32:24,680 The idea behind this is the client's going to hit a page. 548 00:32:24,880 --> 00:32:28,580 They're going to get a Java applet window pop up that, you know, asks them to run an applet. 549 00:32:28,660 --> 00:32:32,620 They're going to hit run, and it's going to cause the client to, in the background, 550 00:32:32,740 --> 00:32:36,040 download Meterpreter and execute it and then send you a shell. 551 00:32:37,860 --> 00:32:40,920 So we have some really, really simple applet code for doing this. 552 00:32:41,020 --> 00:32:43,920 It basically just goes and gets the Meterpreter and executes it. 553 00:32:44,320 --> 00:32:45,860 You can play with this and make it better. 554 00:32:46,360 --> 00:32:47,680 You know, it's just some example code. 555 00:32:48,160 --> 00:32:53,940 Now, how to make this really deadly is if you cryptographically sign the Java applet as your target, 556 00:32:54,140 --> 00:32:58,860 most users are going to go, oh, look, my website has a little signature thing asking me to run something. 557 00:32:59,000 --> 00:33:02,040 They're going to trust that because it's from their site, signed as their company. 558 00:33:02,500 --> 00:33:03,820 You know, why would they question it? 559 00:33:03,980 --> 00:33:05,700 They're going to hit run, and they're going to get owned. 560 00:33:07,760 --> 00:33:11,480 So, you know, we usually change up these file names to reflect the target's infrastructure. 561 00:33:11,860 --> 00:33:17,420 If they're running WordPress or some other content management system, we want to make sure our stuff matches that. 562 00:33:17,420 --> 00:33:21,420 So it's not just some random, you know, Java applet file that they never heard of before. 563 00:33:22,960 --> 00:33:24,600 We've got the commands for doing this here. 564 00:33:24,760 --> 00:33:28,800 If you want to do it by hand to show you how to sign, cryptographically sign these Java applets. 565 00:33:29,540 --> 00:33:36,380 By the end, you know, once you run through all those commands, you'll end up with a series of files, including the class file and a certificate and a key store. 566 00:33:36,760 --> 00:33:38,720 And then you're going to need a web page to launch this. 567 00:33:39,060 --> 00:33:40,040 And I've got an example. 568 00:33:40,880 --> 00:33:47,000 Typically, you would throw this into an iframe or something like that and also display the target's real website. 569 00:33:47,000 --> 00:33:49,020 So they think nothing bad is going on. 570 00:33:49,380 --> 00:33:51,460 And they're going to get a little pop-up that looks like this. 571 00:33:51,920 --> 00:33:53,680 In this case, we signed it as Metafish. 572 00:33:53,820 --> 00:33:58,740 We could sign that as anybody, you know, Microsoft or target ABC or whatever it is. 573 00:33:58,860 --> 00:34:02,040 It's literally a text string, whatever text string you want. 574 00:34:04,520 --> 00:34:04,900 Okay. 575 00:34:04,980 --> 00:34:10,680 So some of the automation sides, Metasploit has the capability to handle n incoming sessions, essentially. 576 00:34:11,520 --> 00:34:16,980 So you want to be able to automate a bunch of functions like all your post-exploitation stuff that you don't want to do. 577 00:34:17,000 --> 00:34:26,920 You can do it by hand if you're getting hundreds of shells coming in, like getting your passwords, adding users, updating or uploading other types of backdoors that go beyond what a interpreter might be doing. 578 00:34:27,740 --> 00:34:30,100 And, you know, keep cognizant of what egress ports are allowed. 579 00:34:30,720 --> 00:34:36,900 So I've got just some basic examples on how to create your interpreter binary so it will work. 580 00:34:37,000 --> 00:34:37,720 I'm not going to go into that. 581 00:34:38,020 --> 00:34:39,440 You can read it on the slides later. 582 00:34:40,320 --> 00:34:43,300 And then your basic commands for setting up the multi-handler session. 583 00:34:45,400 --> 00:34:47,020 And then on the automation script. 584 00:34:47,500 --> 00:34:48,840 You can use any script you want. 585 00:34:48,940 --> 00:34:52,020 We've got an example, but, you know, there are a whole bunch out there. 586 00:34:54,800 --> 00:35:06,920 So you want to deploy an interpreter to your target using whatever means you can, whether it's an effective PDF, a malicious website with a Java app like we're going to show in a minute, or whatever exploits, or just email it to them. 587 00:35:07,040 --> 00:35:09,200 A lot of people will just click on an interpreter executable. 588 00:35:09,940 --> 00:35:12,360 And then watching, you know, for your session coming back. 589 00:35:12,360 --> 00:35:13,340 And success. 590 00:35:14,080 --> 00:35:22,920 So in this case, the demo we're going to do, there will be an automated scraper that will go and grab all this kind of information, generate a directory with timestamps and IP and all that. 591 00:35:23,180 --> 00:35:27,180 And then you'll end up with a bunch of files that have hashes and network neighborhood and whatever. 592 00:35:28,020 --> 00:35:29,660 Darker operator's got some scripts out there. 593 00:35:31,300 --> 00:35:32,020 HD's making... 594 00:35:32,520 --> 00:35:35,980 Oh, he's going to talk right after this on the types of scripts he's doing. 595 00:35:36,080 --> 00:35:37,340 So check that out. 596 00:35:38,680 --> 00:35:39,180 All right. 597 00:35:39,220 --> 00:35:40,960 So briefly, before we get to the demo of this. 598 00:35:40,960 --> 00:35:42,260 I'm going to talk about obfuscation. 599 00:35:42,500 --> 00:35:47,960 One thing a lot of attackers are doing are obfuscating their iframes or the ways that they're getting these payloads to you. 600 00:35:48,080 --> 00:35:54,420 Because people are having host-based intrusion detection systems or AV or whatever detect these things and block them. 601 00:35:54,660 --> 00:36:03,420 And this is an example of iframe obfuscation where they essentially write a JavaScript that breaks up the word iframe into different variables and then reassembles it later. 602 00:36:03,660 --> 00:36:10,640 And a lot of your tools that would look for iframes in the HTTP request won't see this kind of thing. 603 00:36:12,200 --> 00:36:13,320 There's other stuff you can do. 604 00:36:13,440 --> 00:36:21,700 We see this all over on, like, Chinese and Russian web kit sites where they encode their URLs and commands and whatever they're loading with, you know, just, like, character encoding. 605 00:36:22,760 --> 00:36:24,360 We have a few different examples here. 606 00:36:25,180 --> 00:36:28,720 These are just different ways to evade detection from, you know, getting stopped. 607 00:36:28,840 --> 00:36:33,940 Because it sucks when you hack the machine and they've run the commands and the shell gets stopped because they're running AV. 608 00:36:35,600 --> 00:36:40,780 There's a website out here, Script Asylum, which has a bunch of examples of encoding, decoding for your JavaScript. 609 00:36:40,960 --> 00:36:42,820 I advise you check it out. 610 00:36:42,860 --> 00:36:43,300 It looks cool. 611 00:36:43,500 --> 00:36:45,960 And then Egypt's talk for Ajax obfuscation. 612 00:36:46,120 --> 00:36:49,040 He mentions this a little bit briefly and I don't know if he'll talk about it more. 613 00:36:49,620 --> 00:36:50,460 But it's cool stuff. 614 00:36:51,120 --> 00:36:51,620 All right. 615 00:36:51,680 --> 00:36:52,540 So we're going to attempt a demo. 616 00:36:55,100 --> 00:36:57,960 And this time you'll get your hashes off that same box. 617 00:36:59,500 --> 00:37:01,180 For those that wanted those last time. 618 00:37:03,300 --> 00:37:03,660 Hopefully. 619 00:37:17,380 --> 00:37:17,940 All right. 620 00:37:17,980 --> 00:37:24,180 So we're going to load up a couple of Metasploit sessions with some resource files that preset them up since I can't type for crap. 621 00:37:26,840 --> 00:37:33,120 And the settings for the actual web applet is, you know, this is using HCP server from Metasploit. 622 00:37:33,200 --> 00:37:37,420 And it just basically defines, you know, what class name you want to use, this sort of thing. 623 00:37:37,560 --> 00:37:39,000 It builds what payload you want. 624 00:37:39,000 --> 00:37:41,200 We've picked, you know, reverse TCP meterpreter. 625 00:37:41,680 --> 00:37:43,580 And it just sort of sets through all these things. 626 00:37:43,880 --> 00:37:48,260 So there's a few things you're going to want to set in here like who you want to sign the applet as. 627 00:37:49,260 --> 00:37:50,480 You can put whoever you want. 628 00:37:51,720 --> 00:37:53,300 What ports and all the typical stuff. 629 00:37:53,460 --> 00:37:58,720 And also the URI path, meaning, you know, what do you want, what directory do you want this to come out of. 630 00:37:59,100 --> 00:38:01,180 And we picked CN underscore gov. 631 00:38:09,560 --> 00:38:11,160 So I'm going to get it set up here. 632 00:38:13,700 --> 00:38:15,000 You want to explain what's going on? 633 00:38:15,140 --> 00:38:17,940 So this is actually calling out to Java, which is a bad thing. 634 00:38:18,200 --> 00:38:21,480 HD assures me that he can just sort of throw out Java bytecode. 635 00:38:21,660 --> 00:38:24,300 So we'll be moving to something a little cooler and sexier later. 636 00:38:24,500 --> 00:38:28,240 But, you know, this is basically just compiling the Java applet. 637 00:38:28,300 --> 00:38:30,080 It, you know, renames a bunch of the functions. 638 00:38:30,420 --> 00:38:33,320 Puts the calls in to the right IP addresses and so forth. 639 00:38:33,360 --> 00:38:34,540 And builds and signs it. 640 00:38:34,700 --> 00:38:36,100 And then hosts it up on a website. 641 00:38:44,920 --> 00:38:45,460 All right. 642 00:38:45,500 --> 00:38:46,740 So I think we're all set up and running. 643 00:38:46,840 --> 00:38:47,920 I'm going to switch to our other VM. 644 00:39:04,740 --> 00:39:06,380 Windows is so much slower than Linux. 645 00:39:07,300 --> 00:39:07,660 . 646 00:39:16,720 --> 00:39:18,520 Interesting side note while we're waiting for him. 647 00:39:18,660 --> 00:39:23,960 The actual command, the CMD call that called the payload is due to the opening of page one. 648 00:39:24,200 --> 00:39:28,680 So if you went to page two and then back to page one, it would, in fact, launch the command over again. 649 00:39:28,820 --> 00:39:29,880 And you'd get two shells. 650 00:39:31,120 --> 00:39:31,520 Okay. 651 00:39:31,560 --> 00:39:36,340 So I'm going to go to our little client side enumeration web page that we have built. 652 00:39:37,620 --> 00:39:38,980 And what it's going to do is it's going to tell us, you know, what's going to happen. 653 00:39:38,980 --> 00:39:40,940 And what it's going to do is determine, is this a viable target? 654 00:39:41,180 --> 00:39:41,840 Is there in scope? 655 00:39:42,080 --> 00:39:42,980 Is it what we want to hack? 656 00:39:43,340 --> 00:39:43,700 Yes. 657 00:39:43,720 --> 00:39:45,680 And it's going to bounce us off to the Java applet. 658 00:39:46,940 --> 00:39:47,300 Hopefully. 659 00:39:52,060 --> 00:39:55,300 So if you can see up there, it decided that we were a good target. 660 00:39:55,700 --> 00:40:00,580 And it shipped us off to this other URL, which is a same IP address but a different directory. 661 00:40:05,940 --> 00:40:07,580 And it's running really slow. 662 00:40:07,580 --> 00:40:10,420 But I promise, it's just because it's in a VM. 663 00:40:13,620 --> 00:40:22,940 So what we've done is we've iframed in, you know, something that would look normal to our target so that they don't think that they've been hacked. 664 00:40:25,940 --> 00:40:26,480 All right. 665 00:40:26,520 --> 00:40:30,460 Eventually here, we should get a window or something. 666 00:40:46,800 --> 00:40:47,300 All right. 667 00:40:47,340 --> 00:40:48,080 We're going to try that again. 668 00:40:53,720 --> 00:40:55,160 Everyone pray to the demo gods. 669 00:40:58,340 --> 00:40:59,320 Quick, kill the chicken. 670 00:40:59,420 --> 00:40:59,700 Someone. 671 00:41:07,580 --> 00:41:08,860 Yeah, I haven't got the pop-up window yet. 672 00:41:10,860 --> 00:41:12,220 I think it's just really slow. 673 00:41:20,240 --> 00:41:20,700 All right. 674 00:41:20,700 --> 00:41:24,260 While we're waiting for that to work, we'll show it to you real quick in a video. 675 00:41:24,340 --> 00:41:26,140 I think my VM is hosed or something. 676 00:41:26,220 --> 00:41:27,240 It's running really, really slow. 677 00:41:27,760 --> 00:41:29,200 And I think that's what the problem is. 678 00:41:30,640 --> 00:41:31,580 But never fear. 679 00:41:31,880 --> 00:41:32,620 We have backup. 680 00:41:45,580 --> 00:41:46,300 All right. 681 00:41:46,320 --> 00:41:48,380 So you can see this is sort of a video of what you're just looking at. 682 00:41:52,240 --> 00:41:56,220 You've got to pay real close attention because Val clicks yes real fast. 683 00:42:01,880 --> 00:42:02,600 I've got to find that. 684 00:42:02,620 --> 00:42:03,720 I've got to find the spot where it actually happens. 685 00:42:21,380 --> 00:42:21,900 All right. 686 00:42:21,960 --> 00:42:23,980 So like he said, I clicked that really fast. 687 00:42:25,500 --> 00:42:26,680 He's such a trusting fellow. 688 00:42:27,000 --> 00:42:30,380 So what they get is a pop-up that says, hey, this is signed by whoever. 689 00:42:30,800 --> 00:42:32,600 And we could assign that as Chinese government. 690 00:42:32,620 --> 00:42:33,660 If we wanted to. 691 00:42:33,760 --> 00:42:34,680 They're going to click run. 692 00:42:35,060 --> 00:42:36,700 And then it's going to complete. 693 00:42:37,240 --> 00:42:40,500 Let's check our thing over here, see if it worked yet. 694 00:42:41,300 --> 00:42:41,840 Oh, look. 695 00:42:42,080 --> 00:42:42,660 It's sending. 696 00:42:46,680 --> 00:42:48,120 I don't know why it's so slow. 697 00:42:51,040 --> 00:42:52,420 It's not like we're hacking or anything. 698 00:42:56,360 --> 00:42:57,160 All right. 699 00:42:57,180 --> 00:42:59,900 So we've got another video of the attacker side so you can see what happens. 700 00:43:04,340 --> 00:43:06,980 I think our actual demo is going to work. 701 00:43:07,060 --> 00:43:09,800 I think it's just going to work in, like, super slow motion. 702 00:43:10,860 --> 00:43:13,180 Because everything goes perfectly when you're hacking boxes. 703 00:43:13,520 --> 00:43:15,320 Always perfectly goes as planned. 704 00:43:15,640 --> 00:43:15,900 All right. 705 00:43:15,940 --> 00:43:21,940 So essentially what happens is it ships off the interpreter EXE once they hit run on the cryptographically signed job applet. 706 00:43:22,020 --> 00:43:24,200 And then just opens a session on the other side. 707 00:43:24,760 --> 00:43:28,040 And runs the auto scraper to gather basic information. 708 00:43:29,400 --> 00:43:29,880 All right. 709 00:43:30,560 --> 00:43:32,500 So you see an interpreter session opens up. 710 00:43:34,420 --> 00:43:35,700 You can interact with it. 711 00:43:40,280 --> 00:43:41,740 You can execute a shell. 712 00:43:41,980 --> 00:43:43,580 You know, typical stuff like you can with an interpreter. 713 00:43:49,200 --> 00:43:55,440 And then sort of what the auto scrape stuff will look like is you have a director with the IP, time stamp and things like that. 714 00:43:55,520 --> 00:43:56,520 And you have all these different files. 715 00:43:56,620 --> 00:43:57,540 Like if you get hashes. 716 00:43:57,980 --> 00:43:59,280 And these hashes are meaningless. 717 00:43:59,440 --> 00:43:59,860 So crap. 718 00:43:59,880 --> 00:44:00,360 You can crack them if you want. 719 00:44:00,440 --> 00:44:00,720 I don't care. 720 00:44:03,560 --> 00:44:05,520 You know, what the network neighborhood is. 721 00:44:10,660 --> 00:44:11,600 Repeat your question? 722 00:44:13,580 --> 00:44:14,480 Or you're heckling? 723 00:44:15,680 --> 00:44:16,860 I think it was a different room. 724 00:44:17,200 --> 00:44:18,480 All right. 725 00:44:18,580 --> 00:44:20,620 So anyways, I don't know what's up with this. 726 00:44:22,240 --> 00:44:23,900 Like it actually sent the applet. 727 00:44:23,980 --> 00:44:25,680 But it never sent them interpreter. 728 00:44:30,640 --> 00:44:31,160 All right. 729 00:44:31,180 --> 00:44:31,720 Demo fail. 730 00:44:32,760 --> 00:44:33,120 Regardless. 731 00:44:33,320 --> 00:44:34,260 We'll move on to the next piece. 732 00:44:39,640 --> 00:44:40,000 Okay. 733 00:44:41,940 --> 00:44:43,660 So we were on a pen test one time. 734 00:44:43,740 --> 00:44:45,540 And we were supposed to go off site. 735 00:44:45,620 --> 00:44:49,060 Because it turned out that the people we were pen testing were monitoring our traffic. 736 00:44:49,360 --> 00:44:52,700 Sometimes the people who hire you and the security teams are not in sync. 737 00:44:54,260 --> 00:44:58,160 But so what I started playing with was some of the Tor stuff. 738 00:44:58,160 --> 00:45:03,040 And everybody knows about Tor for using it for anonymously browsing the web. 739 00:45:03,220 --> 00:45:05,500 But we started thinking, well, what if we can go ahead and do more with it? 740 00:45:05,780 --> 00:45:09,020 And so a lot of this is already published. 741 00:45:09,200 --> 00:45:11,800 But it takes a lot of time to figure out exactly how to do it. 742 00:45:12,500 --> 00:45:13,700 So that we kind of put it together. 743 00:45:13,820 --> 00:45:16,120 And these guys didn't have any clue that we could go as far as we could. 744 00:45:17,780 --> 00:45:22,340 So the first thing that we looked at was who do we want to be? 745 00:45:22,460 --> 00:45:23,640 So who do we want to come out as? 746 00:45:23,780 --> 00:45:25,800 Do we want to come out in China? 747 00:45:25,800 --> 00:45:29,880 Do we want to come out in a city where the place is located? 748 00:45:30,640 --> 00:45:36,760 One of the things that we're seeing as a trend is people are starting to get real reactive to being penetrated. 749 00:45:36,880 --> 00:45:40,580 So you'll see, oh, they all of a sudden block off all access to China. 750 00:45:40,700 --> 00:45:45,260 Or they all of a sudden try and block off everybody except for their local neighborhoods for their VPN. 751 00:45:45,860 --> 00:45:54,240 So instead of having to drive somewhere and try and figure out, you know, what the site will look like from China and having to fly to China, we just use Tor. 752 00:45:54,580 --> 00:45:55,340 An easy way. 753 00:45:55,340 --> 00:45:57,940 You can go ahead and buy a virtual server somewhere. 754 00:45:58,100 --> 00:45:58,980 That's kind of expensive. 755 00:46:00,120 --> 00:46:03,380 It's another way to cover your tracks, kind of keep the defense off guard. 756 00:46:03,680 --> 00:46:12,420 So if you're actually trying to test the security teams and they're expecting you to come out of your home base in San Francisco or wherever, they might be looking at that city a little bit more. 757 00:46:12,540 --> 00:46:17,860 If you're coming at them from Mexico, well, then they're not expecting it. 758 00:46:20,780 --> 00:46:25,320 So a little bit just on how to set it up and a couple of notes that we found. 759 00:46:25,320 --> 00:46:31,520 So in a lot of the documentation, it mentions that you can just specify a country in an RC file for Tor. 760 00:46:31,840 --> 00:46:34,120 It turns out that's a little bit harder to do. 761 00:46:34,320 --> 00:46:36,800 It doesn't seem to work correctly except in some of the betas. 762 00:46:39,280 --> 00:46:51,960 And one of the other things that we started to find is, and actually we found this from the defensive side, too, is if you're seeing a scan and it starts hopping IPs mid-scan, all of a sudden you start thinking something's up and it's a little bit more suspicious. 763 00:46:52,340 --> 00:46:55,300 So it's kind of nice to define your exit node to one particular location. 764 00:46:57,280 --> 00:47:02,600 And just pop out of that one place when you're doing a scan and then go to another place for another scan or for an attack. 765 00:47:06,060 --> 00:47:10,260 So, of course, the easiest way to figure out where you want to pop out of is through a Vidalia. 766 00:47:11,000 --> 00:47:15,660 You can go, you can see the little country flag, get an idea of what city it is, what the location is. 767 00:47:16,960 --> 00:47:25,280 The only big problem there is you have to have unique names in your Tor RC file or else you could potentially pop out of an exit node that you're not using. 768 00:47:25,300 --> 00:47:25,780 You're not expecting to. 769 00:47:26,180 --> 00:47:30,780 So the unnamed is a really bad choice if you're going to use Vidalia. 770 00:47:32,800 --> 00:47:41,780 So you go ahead, you choose your exit node, put it in your Tor RC file, make sure that you're strictly exiting out of that node with the strict exit node equals one. 771 00:47:41,940 --> 00:47:47,080 And just put a comma list, if you want more than one node, put a comma separated list of the exit nodes you want to pop out of. 772 00:47:48,060 --> 00:47:55,180 Of course, if you want to get some of those other, like, unnamed or not unique named exit nodes, you can do that. 773 00:47:55,180 --> 00:47:55,280 But if you want to get some of those other, like, unnamed or not unique named exit nodes, you can do that. 774 00:47:55,280 --> 00:47:56,580 But if you want to get some of those other, like, unnamed or not unique named exit nodes, you can do that. 775 00:47:56,640 --> 00:47:58,540 You can do this through a couple of websites that track it. 776 00:47:58,640 --> 00:48:08,160 So they'll give you a unique key that you can go ahead and put into the Tor RC file, and then you can pop out right at that node. 777 00:48:10,600 --> 00:48:13,560 And here's an example from one of the Tor sites. 778 00:48:17,120 --> 00:48:19,420 So this isn't real important unless you're coming back later. 779 00:48:19,520 --> 00:48:21,660 This is just how to get to the, where to set the Tor RC. 780 00:48:22,240 --> 00:48:25,180 Now, one of the things I discovered when I was talking with people about this is, 781 00:48:25,220 --> 00:48:25,260 Now, one of the things I discovered when I was talking with people about this is, 782 00:48:25,280 --> 00:48:28,060 they don't really understand what they have on their box when they're looking at Tor. 783 00:48:28,240 --> 00:48:34,380 So you see people running proxy-aware tools through the 8118 port, Privoxy. 784 00:48:34,600 --> 00:48:39,320 The problem is that will fuck with a lot of your tools, especially if it has Java on the other end or Flash. 785 00:48:40,280 --> 00:48:42,480 So you'll get weird false positives. 786 00:48:44,780 --> 00:48:47,740 So that's, you can do it, but it's not what I would recommend. 787 00:48:48,120 --> 00:48:51,140 Tor also has a full SOC spy proxy on 9050. 788 00:48:52,480 --> 00:48:54,760 And there are a lot of people who think Vidalia is Tor, 789 00:48:54,860 --> 00:48:55,260 And there are a lot of people who think Vidalia is Tor, 790 00:48:55,280 --> 00:48:56,140 but it's not, it's just the GUI. 791 00:48:56,420 --> 00:48:57,460 You don't need it at all. 792 00:48:59,120 --> 00:49:05,040 So there are a couple of standard tools that you can use if you want to get any TCP connection to go over Tor, 793 00:49:05,240 --> 00:49:06,280 or basically any. 794 00:49:07,160 --> 00:49:09,540 There's proxy chains, Tor SOCs, and TSOCs. 795 00:49:09,760 --> 00:49:12,920 They each have their own pluses and minuses, and we'll go over a couple of them. 796 00:49:13,400 --> 00:49:15,440 Depending on what I'm doing, I use different ones. 797 00:49:16,240 --> 00:49:19,600 A lot of the scans, I tend to like proxy chains because it gives you a little bit more feedback. 798 00:49:20,880 --> 00:49:23,500 The way these work, though, is they hook the socket call directly. 799 00:49:25,340 --> 00:49:27,020 And send that over the proxy. 800 00:49:27,200 --> 00:49:30,380 The reason this is important is so if you're trying to use Nmap as root, 801 00:49:30,820 --> 00:49:33,460 it opens a raw socket, so you really don't want to do that. 802 00:49:34,160 --> 00:49:38,380 It's doing it for efficiency, but then it ends up bypassing the proxy chains or the Tor SOCs. 803 00:49:39,460 --> 00:49:43,100 You also need to be careful about DNS leakage, IP leakage. 804 00:49:43,980 --> 00:49:47,360 One of the things that I always recommend, and that I do just now as standard practice, 805 00:49:47,540 --> 00:49:52,360 because if nothing else, I sometimes fat finger it and forget to put Tor SOCs at the beginning of the command, 806 00:49:52,360 --> 00:49:55,580 is IP chains off wherever you're going. 807 00:49:55,720 --> 00:49:57,000 Make sure none of your stuff leaks. 808 00:49:57,620 --> 00:50:00,460 If you want to know that you accidentally did it, put it in your logs. 809 00:50:02,340 --> 00:50:08,920 Always try not to run as root also, just in case that nice raw socket is opened. 810 00:50:09,800 --> 00:50:15,820 Yeah, we've seen Tor nodes that inject malicious code into every web page that you visit, 811 00:50:15,980 --> 00:50:18,140 so running as root can expose you to that. 812 00:50:18,480 --> 00:50:19,440 Yeah, that's true too. 813 00:50:20,280 --> 00:50:24,020 So I kind of went into a quick config here. 814 00:50:24,140 --> 00:50:27,140 The important parts, so we want to come back to this later, that's great, 815 00:50:27,220 --> 00:50:28,740 but the important parts are actually the timeouts. 816 00:50:29,100 --> 00:50:32,380 So if you're going to try and do something like Nmap over Tor, 817 00:50:32,560 --> 00:50:36,740 you need to play with these timeouts a lot, because you'll get a lot of false negatives or false positives. 818 00:50:42,720 --> 00:50:46,680 TSOCs, even a simpler config, you just point it to the local host at the Tor port, 819 00:50:47,960 --> 00:50:49,420 and Tor SOCs basically work. 820 00:50:49,440 --> 00:50:51,180 It works right out of the box. 821 00:50:53,200 --> 00:50:55,200 So we can go ahead and we can Nmap over Tor. 822 00:50:55,340 --> 00:50:56,400 It's actually not too bad. 823 00:50:57,500 --> 00:51:00,480 It can be problematic with the timeouts, as I mentioned before, 824 00:51:00,920 --> 00:51:02,800 and you have to be careful about your exit nodes. 825 00:51:02,960 --> 00:51:07,540 Some exit nodes won't allow 135 out, or other exit nodes won't allow some port out. 826 00:51:07,660 --> 00:51:09,480 So sometimes you'll fail and you think that you shouldn't. 827 00:51:09,580 --> 00:51:12,000 Just try another exit node and see if you're successful. 828 00:51:13,180 --> 00:51:17,560 Now, the results are not exactly foolproof, and it takes a lot of time, 829 00:51:17,560 --> 00:51:21,360 but if you run it overnight and then come back in the morning, 830 00:51:21,440 --> 00:51:22,560 you have something you can play with. 831 00:51:22,780 --> 00:51:24,540 So it's better than having to wait. 832 00:51:24,940 --> 00:51:28,140 A lot of the reason this came up is I just didn't want to wait for a pen test 833 00:51:28,140 --> 00:51:29,380 that we were supposed to go offsite for. 834 00:51:30,220 --> 00:51:33,180 I got anxious and wanted to get to hacking. 835 00:51:34,260 --> 00:51:37,120 Of course, you can't do any UDP, so be careful there. 836 00:51:39,320 --> 00:51:42,400 So here's an example of proxy chains with Nmap over Tor. 837 00:51:42,800 --> 00:51:47,080 Now, the important part here to note is that first access denied, 838 00:51:47,560 --> 00:51:48,860 let me see if I can... 839 00:51:55,160 --> 00:52:01,480 So this access denied here is showing you that the 443 is being denied. 840 00:52:01,640 --> 00:52:04,640 Now, if you just let this scan go, it'll take forever to actually time out, 841 00:52:04,740 --> 00:52:07,700 because basically it's still trying to get that connection going. 842 00:52:09,440 --> 00:52:12,740 Basically all of the Torsox proxy chains, 843 00:52:12,880 --> 00:52:15,560 they try and assume that the port's really supposed to be open, 844 00:52:15,640 --> 00:52:17,080 and they're timing out for a different reason, 845 00:52:17,560 --> 00:52:18,460 and they're being rejected for a different reason. 846 00:52:18,600 --> 00:52:19,600 So they keep retrying. 847 00:52:20,780 --> 00:52:23,640 So you can go and you can tweak what your scan is. 848 00:52:23,860 --> 00:52:25,740 And if you're using the minus A option on Nmap, 849 00:52:25,880 --> 00:52:27,700 you can end up finding a lot about the end host. 850 00:52:27,840 --> 00:52:30,060 And you just kind of sit there and play with the port ranges 851 00:52:30,060 --> 00:52:33,980 that you want to see and what ports are being scanned for. 852 00:52:34,280 --> 00:52:37,560 And you can find out, yeah, this is an open SSH running Ubuntu, 853 00:52:38,700 --> 00:52:40,020 and there's no OS detection. 854 00:52:40,380 --> 00:52:41,240 It's really nice. 855 00:52:44,820 --> 00:52:47,140 So here's an example of the scan that I was actually running. 856 00:52:47,760 --> 00:52:50,300 Again, it's blog.attackresearch.com. 857 00:52:50,440 --> 00:52:53,200 So we were popping out right in China. 858 00:52:55,720 --> 00:52:57,140 Except I lost the cursor again. 859 00:53:02,780 --> 00:53:04,600 Well, we're popping out here in China, 860 00:53:05,040 --> 00:53:07,020 going over 22 and 80 straight to blog. 861 00:53:08,420 --> 00:53:12,860 So in blog, all that was seen was China traffic from this random exit node. 862 00:53:15,460 --> 00:53:16,740 But let's go a little bit further. 863 00:53:16,740 --> 00:53:19,800 So Nmap's nice, but you can do a lot of more interesting things. 864 00:53:20,020 --> 00:53:21,840 So we ran NIC2 over Tor. 865 00:53:22,840 --> 00:53:25,880 We tried it a couple times with the privoxy, 866 00:53:25,900 --> 00:53:27,520 but that's one of the reasons I mentioned before. 867 00:53:27,820 --> 00:53:30,400 We switched over to using Torsocks. 868 00:53:31,920 --> 00:53:35,660 And what was nice about this is we were actually able to root a couple boxes, 869 00:53:36,300 --> 00:53:40,760 all remote, coming straight from some other IP somewhere else in the world. 870 00:53:41,140 --> 00:53:42,220 And it just took overnight. 871 00:53:42,480 --> 00:53:45,960 And all of a sudden, we were able to find a directory on some random website 872 00:53:45,960 --> 00:53:49,140 that they didn't know about or didn't think about 873 00:53:49,140 --> 00:53:52,460 that had the complete build documents, including the usernames and passwords 874 00:53:52,460 --> 00:53:55,220 to their entire website, database, everything else. 875 00:53:58,200 --> 00:53:59,880 So it's a nice thing to think about. 876 00:53:59,940 --> 00:54:03,360 We just showed it up here, again, scanning our attack research box. 877 00:54:03,820 --> 00:54:07,800 And you can see I use proxy chains because it gives us a little bit of output 878 00:54:07,800 --> 00:54:09,040 so we can see what's happening. 879 00:54:09,200 --> 00:54:12,240 And you can see each chain being created as it's going over the Tor network 880 00:54:12,740 --> 00:54:14,340 and hitting attack research. 881 00:54:16,440 --> 00:54:19,380 The minus host here, just as a side, I know I mentioned that you should try 882 00:54:19,380 --> 00:54:20,880 and use IPs whenever available. 883 00:54:21,060 --> 00:54:24,700 The host is to get to the virtual host on the IP that you're going after. 884 00:54:25,600 --> 00:54:27,560 So it's not actually doing a DNS lookup. 885 00:54:27,640 --> 00:54:29,520 It is a necessary thing with NIC2. 886 00:54:31,320 --> 00:54:32,260 But you can go further. 887 00:54:32,760 --> 00:54:35,120 And this was one of the fun ones that I was playing with one day. 888 00:54:35,200 --> 00:54:38,140 And we did a full VPN over Tor. 889 00:54:38,640 --> 00:54:41,200 It's painful. It's slow. It dropped a lot. 890 00:54:41,580 --> 00:54:45,680 But we were able to connect up eventually to the remote end. 891 00:54:45,960 --> 00:54:49,780 And to a VPN site that we were after. 892 00:54:50,720 --> 00:54:53,180 So it was popping out wherever we wanted it to. 893 00:54:53,680 --> 00:54:55,560 Now, it took two boxes to do this. 894 00:54:55,620 --> 00:54:57,060 So it's a little bit of a strange setup. 895 00:54:57,440 --> 00:55:01,180 But the nice thing about TSOCs, TorSOCs, proxy chains, all of them, 896 00:55:01,220 --> 00:55:03,640 is they only end up hooking your outbound stuff. 897 00:55:03,880 --> 00:55:04,780 So you can still listen. 898 00:55:05,300 --> 00:55:08,960 So if you use something like TCPXD or any of the port redirectors, 899 00:55:09,020 --> 00:55:10,800 it will go ahead and listen on one port 900 00:55:10,800 --> 00:55:13,540 and then inject it straight over the Tor network to wherever you want. 901 00:55:13,860 --> 00:55:15,680 So all we had to do was take our second box, 902 00:55:15,960 --> 00:55:17,840 have it VPN in to our first box, 903 00:55:18,040 --> 00:55:20,620 and that realistically piped it all over the Tor network. 904 00:55:23,660 --> 00:55:26,320 So these guys asked me, of course, what about Metasploit? 905 00:55:26,400 --> 00:55:29,220 And for a while there, I was doing TorSOCs with Metasploits 906 00:55:29,220 --> 00:55:32,780 until I read a post from HD and found out it's much easier than that. 907 00:55:33,040 --> 00:55:37,520 So all you have to do is set the global proxy to a SOCs4 proxy 908 00:55:37,520 --> 00:55:39,400 on localhost pointing to your Tor port. 909 00:55:40,220 --> 00:55:40,940 And there you go. 910 00:55:41,140 --> 00:55:42,720 Of course, you're restricted to connect shells. 911 00:55:42,960 --> 00:55:45,380 If you do a reverse shell, you're going to have a bad day 912 00:55:45,380 --> 00:55:46,460 because it points right back to you. 913 00:55:48,920 --> 00:55:50,060 So there's still some limitations. 914 00:55:51,640 --> 00:55:53,380 And we went ahead and decided to show that, though. 915 00:55:56,720 --> 00:56:01,740 Okay, I guess we're skipping this so that we can give more time to the Metasploit. 916 00:56:06,080 --> 00:56:06,920 Hold on a second. 917 00:56:07,000 --> 00:56:09,480 I actually want to see if our script ever came back up. 918 00:56:09,600 --> 00:56:12,480 I'm going to have Dave do the demo of his tool, 919 00:56:12,660 --> 00:56:14,380 and we're going to skip Metasploit over Tor, 920 00:56:14,380 --> 00:56:16,600 because basically, yes, you can Metasploit over Tor. 921 00:56:25,880 --> 00:56:26,640 All right. 922 00:56:27,120 --> 00:56:28,300 I'm going to bounce this box. 923 00:56:35,700 --> 00:56:39,320 Okay, so of course, once you get onto a box, 924 00:56:39,480 --> 00:56:41,560 you want to be able to get your command shell back. 925 00:56:41,880 --> 00:56:43,140 And it's... 926 00:56:43,140 --> 00:56:44,740 And you want it to be persistent. 927 00:56:45,120 --> 00:56:46,460 So can you... 928 00:56:46,950 --> 00:56:49,420 You want to have this anonymous server out somewhere. 929 00:56:49,620 --> 00:56:50,740 Well, you can use Tor to do that. 930 00:56:50,840 --> 00:56:51,740 They're the .onion sites. 931 00:56:51,960 --> 00:56:53,780 Normally, this requires Tor on both sides. 932 00:56:54,120 --> 00:56:57,640 So if you want, you can get onto your attacker's box, 933 00:56:57,820 --> 00:57:00,480 install Tor, install TSOX or PrivOxy, 934 00:57:00,660 --> 00:57:02,720 and sure, no problem. 935 00:57:02,780 --> 00:57:04,720 You can have a backdoor going over Tor in no time. 936 00:57:06,040 --> 00:57:08,100 It's actually fairly easy with Bash. 937 00:57:08,280 --> 00:57:12,240 So you can get Bash over Tor by setting up a hidden service 938 00:57:12,240 --> 00:57:15,060 on one of the Tor servers and just doing a netcat. 939 00:57:16,600 --> 00:57:24,700 You can also do it with the built-in TCP in Bash. 940 00:57:25,900 --> 00:57:26,260 And... 941 00:57:28,000 --> 00:57:29,280 But in the interest of time, 942 00:57:29,400 --> 00:57:31,020 what we did is we didn't want to do that. 943 00:57:31,120 --> 00:57:32,900 We didn't want to have to install Tor on the remote end. 944 00:57:33,180 --> 00:57:34,380 So we wrote a tool. 945 00:57:35,000 --> 00:57:38,520 This backdoor goes through a website called torproxy.net. 946 00:57:38,780 --> 00:57:40,020 It's not the only one out there, 947 00:57:40,080 --> 00:57:41,480 but it's an easy way to bounce through. 948 00:57:42,240 --> 00:57:44,580 So we can do HTTPS straight to this place in Germany, 949 00:57:45,140 --> 00:57:47,120 and then it'll go anonymously to the Tor network. 950 00:57:47,840 --> 00:57:49,960 So in the end, no one really knows where we are. 951 00:57:50,160 --> 00:57:51,120 And forensics from the... 952 00:57:52,060 --> 00:57:54,280 from the place that has this backdoor on it 953 00:57:54,280 --> 00:57:55,460 is really nasty, 954 00:57:55,580 --> 00:57:57,700 because everything's going HTTPS out their site. 955 00:57:57,940 --> 00:57:59,500 So it's not like it's the Tor network 956 00:57:59,500 --> 00:58:01,320 that's going over the wire. 957 00:58:01,680 --> 00:58:04,160 So IPSs that block Tor? No good. 958 00:58:07,020 --> 00:58:09,100 So there's some really nice benefits on this. 959 00:58:09,220 --> 00:58:11,260 Of course, no need for any special clients, 960 00:58:11,260 --> 00:58:12,420 just the actual backdoor. 961 00:58:13,240 --> 00:58:13,720 Oh. 962 00:58:14,780 --> 00:58:16,420 Apparently I'm not close enough to the mic. 963 00:58:18,740 --> 00:58:19,220 So... 964 00:58:20,700 --> 00:58:22,520 Can't tell who the server belongs to, of course. 965 00:58:22,580 --> 00:58:25,340 Don't know who the .onion belongs to. 966 00:58:25,500 --> 00:58:28,080 And it's all going over HTTPS out the front door. 967 00:58:28,740 --> 00:58:31,560 It's not what I would call an interactive at all. 968 00:58:31,740 --> 00:58:33,160 It's... or it's not interactive. 969 00:58:33,460 --> 00:58:35,420 It's just a simple send commands. 970 00:58:36,100 --> 00:58:37,520 And it's also very asynchronous. 971 00:58:37,720 --> 00:58:40,260 So it's not a fast backdoor. 972 00:58:41,280 --> 00:58:43,280 But it's extremely useful if you're trying to hide 973 00:58:43,280 --> 00:58:44,820 where you're coming from or any tracks 974 00:58:44,820 --> 00:58:47,660 and make it very hard on the defense. 975 00:58:49,020 --> 00:58:52,500 So just a quick kind of visual, 976 00:58:52,660 --> 00:58:54,340 because apparently a lot of people 977 00:58:54,340 --> 00:58:55,440 have trouble visualizing this. 978 00:58:55,580 --> 00:58:57,720 Yeah, the victim's going over HTTPS 979 00:58:57,720 --> 00:58:59,440 to the TorProxy.net. 980 00:58:59,580 --> 00:59:02,080 So TorProxy.net at that point can see your traffic 981 00:59:02,080 --> 00:59:02,900 entering the Tor cloud. 982 00:59:03,120 --> 00:59:04,420 But really all they can see 983 00:59:04,420 --> 00:59:06,200 is something going to a .onion site 984 00:59:06,200 --> 00:59:09,500 and some random traffic that looks like HTTP 985 00:59:09,500 --> 00:59:12,420 over the actual connection. 986 00:59:14,680 --> 00:59:16,200 So we're going to run this on a demo. 987 00:59:18,860 --> 00:59:20,020 Oh, that is true. 988 00:59:20,100 --> 00:59:21,300 One of the things I did forget to mention. 989 00:59:21,500 --> 00:59:23,800 So I ended up actually writing this backdoor twice. 990 00:59:24,040 --> 00:59:27,000 Once in Ruby, and then after I... 991 00:59:27,460 --> 00:59:29,700 my machine crashed and I lost my backups. 992 00:59:30,780 --> 00:59:32,160 Important to know where your backups are. 993 00:59:32,260 --> 00:59:34,240 Colin even saw me make them, but I can't find them. 994 00:59:34,340 --> 00:59:35,740 I wrote it again in mono. 995 00:59:35,940 --> 00:59:37,940 So it's using C sharp and mono. 996 00:59:37,940 --> 00:59:39,920 One of the benefits being that 997 00:59:39,920 --> 00:59:42,160 since now Ubuntu and Debian 998 00:59:42,160 --> 00:59:43,280 and a whole bunch of distributions 999 00:59:43,280 --> 00:59:44,340 are starting to come with mono, 1000 00:59:44,520 --> 00:59:46,220 I can actually use the same executable 1001 00:59:46,220 --> 00:59:48,240 on Linux and Windows. 1002 00:59:48,540 --> 00:59:50,080 And the backdoor will work. 1003 00:59:50,240 --> 00:59:50,980 No problem. 1004 00:59:51,320 --> 00:59:52,840 So what we got is a... 1005 00:59:53,380 --> 00:59:55,320 basically a backdoor that communicates 1006 00:59:55,320 --> 00:59:57,060 all over SSL through the Tor network 1007 00:59:57,060 --> 00:59:58,940 anonymously and is cross-platform. 1008 01:00:02,180 --> 01:00:03,760 So let's see if we can get it up here. 1009 01:00:03,940 --> 01:00:05,780 Now I admit I'm doing this all over video 1010 01:00:05,780 --> 01:00:07,260 because as we've seen... 1011 01:00:07,260 --> 01:00:07,760 You can get it up, Dave. 1012 01:00:07,880 --> 01:00:08,280 Oh, yeah. 1013 01:00:09,840 --> 01:00:11,180 So as we've seen, 1014 01:00:11,260 --> 01:00:13,180 the network here is kind of iffy 1015 01:00:13,180 --> 01:00:14,720 and I'm not going to try and tempt Tor 1016 01:00:14,720 --> 01:00:15,560 with the network here. 1017 01:00:16,200 --> 01:00:17,800 All we'll do is waste everybody's time. 1018 01:00:24,400 --> 01:00:25,680 I can't grab it. 1019 01:00:30,860 --> 01:00:31,820 Where is it? 1020 01:00:31,920 --> 01:00:32,620 It's right there. 1021 01:00:37,560 --> 01:00:39,980 So here I am on my Linux box. 1022 01:00:40,120 --> 01:00:41,540 I'm setting up a server for the Windows. 1023 01:00:42,500 --> 01:00:44,180 And I'm going to set up the server 1024 01:00:44,180 --> 01:00:45,220 for the Linux side here. 1025 01:00:46,700 --> 01:00:47,360 There we go. 1026 01:00:47,520 --> 01:00:48,600 He's doing two demos at once. 1027 01:00:48,640 --> 01:00:48,840 Yeah. 1028 01:00:48,880 --> 01:00:49,520 Linux and Windows. 1029 01:00:49,740 --> 01:00:52,040 So since this takes a while to actually run, 1030 01:00:52,180 --> 01:00:53,620 I figured I would get everything out. 1031 01:00:53,820 --> 01:00:55,900 So here's the actual command that's going out. 1032 01:00:55,960 --> 01:00:57,360 This is just debug output coming out 1033 01:00:57,360 --> 01:00:59,600 from the backdoor right now so I could show it. 1034 01:00:59,720 --> 01:01:01,620 You can see it going to the torproxy.net 1035 01:01:01,620 --> 01:01:03,100 and at the end of the URL here, 1036 01:01:03,240 --> 01:01:04,260 there's a .onion. 1037 01:01:04,440 --> 01:01:06,620 And that's the actual onion server 1038 01:01:06,620 --> 01:01:07,620 that it's sending everything to. 1039 01:01:07,800 --> 01:01:09,300 Very similar on the Linux side. 1040 01:01:09,480 --> 01:01:11,080 All HTTPS leaving the network. 1041 01:01:12,400 --> 01:01:13,380 So on the Linux one, 1042 01:01:13,440 --> 01:01:14,440 we want to go ahead and run a command. 1043 01:01:14,900 --> 01:01:18,120 So we'll go ahead and do an ls-la on slash. 1044 01:01:19,140 --> 01:01:21,340 So that's going to take a while to come back. 1045 01:01:21,620 --> 01:01:22,420 I mean, it is over Tor. 1046 01:01:22,540 --> 01:01:23,500 It's going to be a bit... 1047 01:01:24,040 --> 01:01:26,140 If we go over to the Linux client, 1048 01:01:26,320 --> 01:01:28,340 we can actually see this stuff being transmitted. 1049 01:01:28,560 --> 01:01:30,580 So it's being transmitted in 200 byte 1050 01:01:30,580 --> 01:01:32,340 modified base 64 encoding. 1051 01:01:33,200 --> 01:01:35,140 So it's just in the git request 1052 01:01:35,140 --> 01:01:36,600 is the actual data coming out. 1053 01:01:36,620 --> 01:01:36,760 It's coming back. 1054 01:01:38,440 --> 01:01:39,840 So now here on the Windows side, 1055 01:01:39,920 --> 01:01:41,120 we'll go ahead and do something else. 1056 01:01:42,000 --> 01:01:43,300 ipconfigure is what I chose 1057 01:01:43,700 --> 01:01:44,840 just so we can see it. 1058 01:01:45,320 --> 01:01:47,140 Now if we go back over to the actual Linux 1059 01:01:48,420 --> 01:01:49,740 place where the backdoor is, 1060 01:01:49,860 --> 01:01:51,380 or the Windows place where the backdoor is, 1061 01:01:51,480 --> 01:01:52,320 we can see it going by. 1062 01:01:52,480 --> 01:01:53,020 Same thing. 1063 01:01:53,760 --> 01:01:55,080 200 bytes at a time, 1064 01:01:55,140 --> 01:01:56,360 modified base 64. 1065 01:01:57,100 --> 01:01:58,620 And if we go back to the Linux client, 1066 01:01:59,120 --> 01:01:59,860 there's the output, 1067 01:02:00,040 --> 01:02:01,440 or the Linux server. 1068 01:02:02,320 --> 01:02:03,820 Client server gets confusing in Tor. 1069 01:02:04,940 --> 01:02:05,320 But 1070 01:02:06,620 --> 01:02:08,160 we succeeded in sending our complete command 1071 01:02:08,160 --> 01:02:11,980 over Tor SSL out from the victim. 1072 01:02:13,480 --> 01:02:15,180 So just to show kind of the speed, 1073 01:02:15,400 --> 01:02:16,800 we're going to go ahead and do a uname-sa, 1074 01:02:16,900 --> 01:02:18,040 and this time I'm not going to switch out. 1075 01:02:18,460 --> 01:02:20,260 So uname-sa isn't exactly big. 1076 01:02:20,380 --> 01:02:25,160 It's only one or two packets that need to be sent. 1077 01:02:26,900 --> 01:02:27,600 There it is. 1078 01:02:27,680 --> 01:02:28,420 All over Tor. 1079 01:02:30,160 --> 01:02:31,180 And on Windows, 1080 01:02:31,320 --> 01:02:32,380 there's our ipconfig. 1081 01:02:33,800 --> 01:02:34,500 Coming back, 1082 01:02:34,640 --> 01:02:35,400 all the data. 1083 01:02:37,320 --> 01:02:40,640 And that's pretty much it for the Tor backdoor. 1084 01:02:51,820 --> 01:02:52,540 Oh, yeah. 1085 01:02:55,120 --> 01:02:56,060 Talk about this real quick. 1086 01:02:56,140 --> 01:02:56,280 Oh, yeah. 1087 01:02:57,040 --> 01:02:59,020 So one of the things we were throwing around in the office 1088 01:02:59,020 --> 01:03:02,260 was we were going to do a Gmail backdoor, 1089 01:03:03,420 --> 01:03:05,200 and we never got to it. 1090 01:03:05,200 --> 01:03:05,820 We just got busy. 1091 01:03:06,280 --> 01:03:08,660 And our thought was we were going to use DynDNS 1092 01:03:08,660 --> 01:03:10,800 to trigger when to go check Gmail. 1093 01:03:11,180 --> 01:03:14,640 Well, then all of a sudden we see this maybe a month ago. 1094 01:03:14,760 --> 01:03:15,980 The TweetMyPC came out, 1095 01:03:16,040 --> 01:03:17,940 or at least a newer version that's more functional, 1096 01:03:18,440 --> 01:03:21,560 where you can control it over Twitter and Gmail, 1097 01:03:21,780 --> 01:03:23,040 your PC remotely. 1098 01:03:24,000 --> 01:03:25,680 So if you trust Twitter and Gmail, 1099 01:03:25,840 --> 01:03:27,140 that way you don't have to deal with Tor, 1100 01:03:27,280 --> 01:03:27,980 which is kind of nice. 1101 01:03:28,100 --> 01:03:29,920 If you still don't trust Twitter and Gmail, 1102 01:03:30,100 --> 01:03:31,120 you can go ahead and use Tor. 1103 01:03:31,340 --> 01:03:33,540 It's just another way to go ahead and hide the traffic, 1104 01:03:33,660 --> 01:03:34,620 especially since, 1105 01:03:34,620 --> 01:03:37,240 how many corporations are still trusting Twitter and Gmail? 1106 01:03:37,540 --> 01:03:39,440 A lot of corporations are using Gmail 1107 01:03:39,440 --> 01:03:41,740 as their primary means of communication. 1108 01:03:42,600 --> 01:03:44,760 So it's just another way to deal with it. 1109 01:03:44,780 --> 01:03:45,500 It's customizable. 1110 01:03:45,820 --> 01:03:46,940 Something to play with. 1111 01:03:47,620 --> 01:03:48,640 Can't take credit for it. 1112 01:03:48,920 --> 01:03:49,540 All right. 1113 01:03:49,580 --> 01:03:52,000 So far what we've talked about is 1114 01:03:52,000 --> 01:03:53,620 we're going to give you a MetaSuite module 1115 01:03:53,620 --> 01:03:56,200 that will infect targeted PDFs for you. 1116 01:03:56,640 --> 01:03:58,400 We're going to give you a MetaSuite module 1117 01:03:58,400 --> 01:04:00,860 that does cryptographically signed Java applets 1118 01:04:00,860 --> 01:04:01,860 and client-side enumeration. 1119 01:04:02,360 --> 01:04:03,740 And we're going to give you a backdoor 1120 01:04:03,740 --> 01:04:06,600 that's SSL cross-platform anonymous over Tor. 1121 01:04:06,820 --> 01:04:08,020 That's it so far. 1122 01:04:09,520 --> 01:04:12,740 So of course there's lots of other people out there 1123 01:04:12,740 --> 01:04:13,500 doing similar things. 1124 01:04:13,600 --> 01:04:15,100 A lot of us in the Metasploit community in this. 1125 01:04:15,220 --> 01:04:17,000 And one of our good friends, Dean DeBeer, 1126 01:04:17,580 --> 01:04:19,680 actually has created a front end 1127 01:04:19,680 --> 01:04:21,140 that will actually wrap around all this. 1128 01:04:21,200 --> 01:04:23,240 It gives us a nice fishing framework. 1129 01:04:23,500 --> 01:04:24,680 And so we're talking about Metafish. 1130 01:04:24,820 --> 01:04:26,240 This is really Metafish. 1131 01:04:26,280 --> 01:04:26,980 It's called Assegai. 1132 01:04:27,320 --> 01:04:29,020 And so here's some generic things here. 1133 01:04:29,120 --> 01:04:31,600 We got some nice statistics and pretty pieces. 1134 01:04:32,300 --> 01:04:33,240 You log in. 1135 01:04:33,240 --> 01:04:36,540 You run all of your fishes this way. 1136 01:04:36,640 --> 01:04:39,480 It generates templating and you can mimic websites. 1137 01:04:39,980 --> 01:04:43,160 So here's the users you sent your fish to. 1138 01:04:43,340 --> 01:04:44,000 Did they click? 1139 01:04:44,080 --> 01:04:45,580 Did you get a user and password out of it? 1140 01:04:45,620 --> 01:04:46,140 That sort of thing. 1141 01:04:46,740 --> 01:04:51,260 And it keeps track of all of the specific statistics, 1142 01:04:51,560 --> 01:04:53,420 when they clicked, what they were on, so forth. 1143 01:04:53,540 --> 01:04:55,000 If it can load an ActiveX control, 1144 01:04:55,260 --> 01:04:57,720 it'll do that and try and get more information from you. 1145 01:04:57,820 --> 01:04:59,560 If it can load other things, it just continues. 1146 01:04:59,680 --> 01:05:02,360 And this is all leveraging Metasploit under the hood. 1147 01:05:02,360 --> 01:05:06,520 And so you load in a CSV of your email addresses 1148 01:05:06,520 --> 01:05:07,440 you want to send it to. 1149 01:05:08,200 --> 01:05:10,960 Here's a nice SSL web page that you want to send them to 1150 01:05:10,960 --> 01:05:13,410 to say, hey, we now have upgraded SSL. 1151 01:05:13,960 --> 01:05:14,400 Log in. 1152 01:05:15,420 --> 01:05:17,180 And so here's the setup here. 1153 01:05:17,340 --> 01:05:22,320 We have a nice screenshot showing if you want to attach 1154 01:05:22,320 --> 01:05:25,080 a pre-made format here, kind of the two froms. 1155 01:05:25,180 --> 01:05:29,140 And then in this case, we're showing the email collab 1156 01:05:30,340 --> 01:05:32,100 vulnerability that MC here wrote. 1157 01:05:32,100 --> 01:05:33,720 We just want to attach it. 1158 01:05:33,760 --> 01:05:36,220 It'll automatically create it using Metasploit under the hood 1159 01:05:36,220 --> 01:05:37,820 and attach it to your emails to send out. 1160 01:05:38,440 --> 01:05:39,180 And that's it. 1161 01:05:40,060 --> 01:05:40,980 Everyone we want to thank. 1162 01:05:41,180 --> 01:05:41,920 Thank you for coming. 1163 01:05:42,700 --> 01:05:43,060 Thanks. 1164 01:05:49,380 --> 01:05:50,100 All right. 1165 01:05:50,140 --> 01:05:51,380 Really quickly, any questions? 1166 01:05:51,500 --> 01:05:54,380 If not, catch us after the talk. 1167 01:05:54,740 --> 01:05:57,600 There's a whole track still going on on Metasploit Talks. 1168 01:05:57,600 --> 01:05:59,140 A bunch of people are going to come up and do their thing. 1169 01:05:59,300 --> 01:06:01,240 So please stay and hang out and watch that. 1170 01:06:02,100 --> 01:06:03,900 Thank you very much. 1171 01:06:03,980 --> 01:06:04,600 Thank you. 1172 01:06:04,600 --> 01:06:05,140 Thank you. 1173 01:06:05,140 --> 01:06:05,520 Let's hear it for the rest of the floor as we 1174 01:06:05,520 --> 01:06:05,600 take a deep breath same step after the break.