1 00:00:00,440 --> 00:00:07,140 My name is Rick Deacon. I'm going to be talking about hacking social lives in MySpace. Apparently 2 00:00:07,140 --> 00:00:10,800 a lot of you people care about that and I didn't expect the turnout that's here right 3 00:00:10,800 --> 00:00:12,980 now. So excuse me if I'm a little nervous. 4 00:00:22,640 --> 00:00:28,100 A little bit about me. Me and my buddies came up here. We're from right around Cleveland. 5 00:00:28,100 --> 00:00:33,520 We lived a little west of it. Yeah, exactly. Cleveland. Really crappy. Awesome. 6 00:00:36,320 --> 00:00:41,120 I'm an IT specialist at a CPA firm. I'm still in college. I just turned 21. 7 00:00:42,920 --> 00:00:54,920 Sorry, I'm straight edge. It's basically just a job I have right now between college and 8 00:00:54,920 --> 00:00:57,680 a real job at a security firm or something like that. 9 00:00:57,720 --> 00:00:58,080 It's a great job. 10 00:00:58,080 --> 00:01:02,120 But I work in Beechwood. It's in the east side of Cleveland. I also go to college. I 11 00:01:02,120 --> 00:01:08,380 just attend a community college for a networking degree. I've been doing IT stuff for seven 12 00:01:08,380 --> 00:01:12,280 years and security for like four. Obviously, it means I was pretty young when I did it 13 00:01:12,280 --> 00:01:16,780 so I wasn't real serious about it, but I've still been doing it for a while. I had an 14 00:01:17,340 --> 00:01:21,640 article published in 2600 talking sort of about the same thing that I'm going to be 15 00:01:21,640 --> 00:01:25,660 talking about today. Not exactly because it didn't give the details and the exploit that 16 00:01:25,660 --> 00:01:27,280 I'm going to be talking about isn't actually... 17 00:01:27,800 --> 00:01:31,960 Anywhere near what I posted there. That one was patched. This one is not. All the other 18 00:01:31,960 --> 00:01:33,800 stuff I'm into is cars and music. Not that you guys care. 19 00:01:35,240 --> 00:01:38,860 What I'm basically going to be talking about is if anyone doesn't know what MySpace is, 20 00:01:38,940 --> 00:01:43,620 I know it's a really small site and everything. I'll be talking about a little what MySpace 21 00:01:43,620 --> 00:01:48,760 is. I'll be talking about what cross-site scripting is, how to evade the filters on 22 00:01:48,760 --> 00:01:54,140 MySpace for cross-site scripting, session information, the tools, the current zero 23 00:01:54,140 --> 00:01:56,700 day and a demonstration with my friend Dan over there. 24 00:01:57,500 --> 00:02:01,500 Ways to prevent cross-site scripting attacks and then I'll take your questions in closing 25 00:02:01,500 --> 00:02:05,000 and obviously I'll be at the Q&A room for anybody else who wants to ask me questions 26 00:02:05,000 --> 00:02:06,020 that I won't be able to answer. 27 00:02:08,160 --> 00:02:11,680 Basically if you don't know anything about MySpace, it's one of the largest social networking 28 00:02:11,680 --> 00:02:18,100 sites. I believe it actually may be the largest. It's driven by a lot, a lot of dynamic web 29 00:02:18,100 --> 00:02:22,000 applications and that's what gives it its popularity and that's what gives it its security 30 00:02:22,000 --> 00:02:22,420 holes. 31 00:02:25,160 --> 00:02:27,260 Obviously it has a major impact on today's society. It has a major impact on today's 32 00:02:27,280 --> 00:02:31,100 society. I mean obviously you guys are all here to see it. A lot of the press is interested 33 00:02:31,100 --> 00:02:38,920 in this story. It's been in movies. It's on the radio. It's on TV shows. It's mentioned 34 00:02:38,920 --> 00:02:40,480 everywhere now. It got pretty huge. 35 00:02:41,900 --> 00:02:46,000 The other thing about it, I mean there's things that go on MySpace. Obviously a lot 36 00:02:46,000 --> 00:02:50,360 of your personal information. It's a good source of social interaction. Like I said, 37 00:02:50,380 --> 00:02:56,660 it shows up everywhere. It's also in this presentation if you guys didn't know. The security 38 00:02:57,280 --> 00:03:00,840 vault of MySpace. It's vulnerable to a lot of things. I'll only be talking about one 39 00:03:00,840 --> 00:03:05,000 but just to mention a few. It's vulnerable to social engineering obviously. Phishing 40 00:03:05,000 --> 00:03:07,460 is the biggest one right now. I'm sure if you have a MySpace you've seen the phishing 41 00:03:07,460 --> 00:03:11,720 links with ads and they take you to a page that looks like a fake log in. You type in 42 00:03:11,720 --> 00:03:18,480 your information and then someone has it. You can do packet capture over a network of 43 00:03:18,480 --> 00:03:23,620 course. I mean there's been viruses that have spread via cross site scripting and whatnot. 44 00:03:27,280 --> 00:03:32,300 A couple of well known ones. The Sammy virus I'm sure everyone knows about that infected 45 00:03:32,300 --> 00:03:39,400 a few million I believe that changed their profiles, had it advertised. Sammy got famous 46 00:03:39,400 --> 00:03:45,260 for it. The QuickTime virus which was relatively recent used cross site scripting and QuickTime 47 00:03:45,260 --> 00:03:51,640 to add the QuickTime movie to your page which propagated it to all your friends. That was 48 00:03:51,640 --> 00:03:56,480 a rather large virus too. It was subject to the Windows Meta file vulnerability which 49 00:03:56,480 --> 00:03:57,260 I'm sure everyone's aware of. 50 00:03:57,280 --> 00:04:00,900 And the phishing links that I just talked about. That's some of the well known stuff 51 00:04:00,900 --> 00:04:18,040 at this point. My water disappeared. Oh, it's down there. Cross site scripting in case someone 52 00:04:18,040 --> 00:04:22,220 didn't know. I'm not going to talk too much into it. If you really don't know all that 53 00:04:22,220 --> 00:04:27,120 much about it, you want to do some Google and you will find plenty of it. It's a vulnerability 54 00:04:27,120 --> 00:04:31,840 that's found in many web applications and many websites. Some of the biggest websites 55 00:04:31,840 --> 00:04:38,660 have had it. Hotmail had it for awhile. Google had it. Tons of sites. Anything you can find 56 00:04:38,660 --> 00:04:41,680 it. Some of them are really kind of useless because you can't really do too much with 57 00:04:41,680 --> 00:04:44,960 them. But other ones like the one I will be talking about you can do a lot with. 58 00:04:45,760 --> 00:04:52,340 What basically it does is it allows code injection into the URL or into a link or anything like 59 00:04:52,340 --> 00:04:57,100 that to basically malform the URL with HTML or JavaScript to do whatever you want to do. 60 00:04:57,100 --> 00:05:00,780 you so choose. It could be used for 61 00:05:00,780 --> 00:05:04,900 phishing or browser exploitation. As far as phishing 62 00:05:04,900 --> 00:05:08,680 goes, you can use it to pass along phishing links. In browser exploitation 63 00:05:08,680 --> 00:05:12,980 you can actually, sometimes you can work things into it 64 00:05:12,980 --> 00:05:16,840 to actually crash browsers and do session hijacking, which is what I will be 65 00:05:16,840 --> 00:05:20,820 talking about, and cookie stealing. It can be 66 00:05:20,820 --> 00:05:24,760 identified very easily. You can find cross-site scripting holes with minimal effort, just 67 00:05:24,760 --> 00:05:26,360 a little bit of time wasted. 68 00:05:28,900 --> 00:05:32,600 This is the easiest way that I found. There are many other ways, and 69 00:05:32,600 --> 00:05:36,480 I'm sure I don't even know of them all, but this is the easiest way. 70 00:05:37,060 --> 00:05:40,100 I'd like to state also that I'm not a programmer by any means. 71 00:05:40,580 --> 00:05:44,720 Anything that I do I basically just learn, but I'm not a programmer. I absolutely hate it. 72 00:05:44,780 --> 00:05:48,860 It drives me crazy. Everything that I do here is basically just me 73 00:05:48,860 --> 00:05:52,700 learning things. I don't really know any languages 74 00:05:52,700 --> 00:05:54,680 backward and forward. If you have questions, 75 00:05:54,760 --> 00:05:56,120 about that, I'm not the guy to ask. 76 00:05:58,700 --> 00:06:02,580 What you want to do to try to find XSS holes is just to insert 77 00:06:02,580 --> 00:06:06,400 code into the application, like the link I have below. I just made up 78 00:06:07,060 --> 00:06:10,600 trustedsite.org and then the search CGI and the criteria. Normally 79 00:06:10,600 --> 00:06:14,340 the criteria would be whatever you're searching for that you may type into a text box, 80 00:06:14,560 --> 00:06:18,720 but in this case, you can see what I put in there, the script, and what that would do 81 00:06:20,040 --> 00:06:22,600 would pop up the alert that said LOL 82 00:06:22,600 --> 00:06:23,260 internets. 83 00:06:24,760 --> 00:06:27,660 That would obviously mean that it's open to cross-site scripting because you injected 84 00:06:28,360 --> 00:06:31,160 JavaScript right into the URL, which should not be able to happen. 85 00:06:33,320 --> 00:06:38,920 The link structure above can be used to do anything also. I mean, you can do that same 86 00:06:38,920 --> 00:06:42,200 where it's bolded there. You can do that and put anything you want in there. You could 87 00:06:42,200 --> 00:06:45,620 have it run a malicious script. You could display a cookie by doing it. Instead of saying 88 00:06:45,620 --> 00:06:49,720 alert in the word I put there in quotes, you could have it document.cookie and it would 89 00:06:49,720 --> 00:06:51,900 display the cookie in Firefox anyway. 90 00:06:51,900 --> 00:06:56,780 Like I said, if you really don't know too much about cross-site scripting, you want 91 00:06:56,780 --> 00:07:01,700 to just go on Google. There are plenty of sites. There's Wikipedia. The wiki on it isn't 92 00:07:01,700 --> 00:07:06,580 too bad. So, I mean, you could take a look at that and learn a good bit. A lot of forms 93 00:07:06,580 --> 00:07:06,980 and what not. 94 00:07:09,760 --> 00:07:15,020 The most widely used purpose for XSS whole exploits is for, in my opinion, it's for 95 00:07:15,020 --> 00:07:19,420 cookie stealing and session information. That's basically what the point of what I'm talking 96 00:07:19,420 --> 00:07:21,880 about is. On Myspace, that's the best use for. 97 00:07:23,800 --> 00:07:28,720 Basically, in a nutshell, the attacker sends an authenticated user a link that contains 98 00:07:28,720 --> 00:07:33,120 cross-site scripting. The link takes the authenticated user to a site that will log their cookie. 99 00:07:33,360 --> 00:07:37,160 The attacker reviews the log file and steals information as necessary. That's basically 100 00:07:37,160 --> 00:07:42,780 just in a nutshell of what you can do with the exploits. Obviously, I'm going to go into 101 00:07:42,780 --> 00:07:44,040 depth with that. 102 00:07:45,640 --> 00:07:51,240 Myspace obviously uses cookies. The way it works is once you log in, you get the cookie, 103 00:07:51,240 --> 00:07:54,880 so you don't have to re-authenticate every time you go to a different portion of the 104 00:07:54,880 --> 00:07:57,720 site. Without the cookies, you would have to re-authenticate every time you click the 105 00:07:57,720 --> 00:08:01,960 link to go to the music pages or a forum or something like that. Obviously, everyone 106 00:08:01,960 --> 00:08:02,440 knows that. 107 00:08:03,600 --> 00:08:08,520 It contains the session information and log in information. It also contains sometimes 108 00:08:08,520 --> 00:08:13,220 – it's not 100% that it even contains session information, depending on what browser 109 00:08:13,220 --> 00:08:17,400 the person is using. For some reason, I've seen it happen actually where they could be 110 00:08:17,400 --> 00:08:20,600 using the same platform as someone else, but they don't have the session information 111 00:08:20,600 --> 00:08:21,220 in their cookie. 112 00:08:21,240 --> 00:08:26,880 It's sort of random, but for the most part, it works perfectly fine. Also, the email 113 00:08:26,880 --> 00:08:31,340 address is posted in there and past search criteria, like for some reason it shows the 114 00:08:31,340 --> 00:08:34,420 things you've searched for last and the last time you clicked, the time and date time 115 00:08:34,420 --> 00:08:34,720 stamp. 116 00:08:35,760 --> 00:08:40,380 It may contain an encrypted password. I've never actually delved into that, so don't 117 00:08:40,380 --> 00:08:43,800 quote me on it, but I'm pretty sure I've heard somewhere that you can decrypt the password 118 00:08:43,800 --> 00:08:50,940 out of the cookie. I never really cared to do that, so I never did. The session information 119 00:08:51,240 --> 00:08:54,580 can be used for a form of session hijacking. Obviously, session hijacking, when you usually 120 00:08:54,580 --> 00:09:00,340 hear the word, you think of like spoofing over a network, so you obtain the information 121 00:09:00,340 --> 00:09:04,520 via that way and you take over their session, like on a network. I use it in this example 122 00:09:04,960 --> 00:09:09,840 because it sounds good, basically, and you can do it on the web just as easily as you 123 00:09:09,840 --> 00:09:13,180 could on a network. It's the same sort of idea, just a different implementation. 124 00:09:14,940 --> 00:09:19,460 And MySpace contains hundreds of undetected and undiscovered XSS vulnerabilities. The 125 00:09:19,460 --> 00:09:21,220 one I'm going to be talking about is one I think is kind of a good one. We're going to be talking about one of my other� 126 00:09:21,220 --> 00:09:24,180 one of many, and there are thousands that have already been patched. They're fairly 127 00:09:24,180 --> 00:09:28,680 decent at patching them, in my opinion. I mean, some people will disagree, but for the 128 00:09:28,680 --> 00:09:35,380 most part, they patch them relatively quickly when they're reported. I've known about 30 129 00:09:35,380 --> 00:09:40,780 personally that were up, and then a week later, I would go see if they're still there, and 130 00:09:40,780 --> 00:09:41,360 they weren't there anymore. 131 00:09:46,200 --> 00:09:51,380 MySpace deployed cross-site scripting filters to try to limit the amount of information 132 00:09:51,380 --> 00:09:58,040 that can be stolen using cross-site scripting, and it keeps you from finding them. It looks 133 00:09:58,040 --> 00:10:03,140 for embed tags, so for a while, you could embed Flash right onto your page, and you 134 00:10:03,140 --> 00:10:08,140 can't do it anymore. I mean, you still can in some manners, but other times, it kind 135 00:10:08,140 --> 00:10:11,340 of scans for it in script tags. What it does, it just sends a message to your page, and 136 00:10:11,360 --> 00:10:14,840 it filters these tags into period, period. Instead of writing script, it just takes 137 00:10:14,840 --> 00:10:20,460 the word script and turns it into two periods, and that's the filter they have. It has closed 138 00:10:20,460 --> 00:10:26,860 and hindered many attacks, and it gets kind of annoying. The filter isn't consistent, 139 00:10:26,980 --> 00:10:30,980 though. It changes per page for some reason. They don't patch every single page. From what 140 00:10:30,980 --> 00:10:34,820 I found, every single page doesn't have the exact filtering, depending on, I guess, how 141 00:10:34,820 --> 00:10:40,680 new it is or how it was designed. I'm not real sure. Some portions of the site are more 142 00:10:40,680 --> 00:10:41,340 liberal than others. 143 00:10:41,360 --> 00:10:45,920 With the way you can type in, sometimes you can do embeds into certain areas. Other times, 144 00:10:46,000 --> 00:10:51,980 you can't. Just the way it's set up, I'm sure it's because it's so huge. Luckily for us, 145 00:10:51,980 --> 00:10:58,760 though, the filters are easily avoided using encoding of some sort. Obviously, what I have 146 00:10:58,760 --> 00:11:02,920 the example is ASCII to Hex or Unicode, and actually, you can take what it says, like 147 00:11:02,920 --> 00:11:09,620 there, the simple coding of the caret script caret, it decodes to that, and that would evade 148 00:11:09,620 --> 00:11:10,000 the filter. 149 00:11:10,000 --> 00:11:18,260 Because it doesn't see the carets, it doesn't turn the word script into two periods, because 150 00:11:18,260 --> 00:11:32,520 the carets is what it's looking for. At the same time, sometimes it does actually filter, 151 00:11:32,620 --> 00:11:38,160 even though you can encode the carets. It depends on the page, like I said. Other ways 152 00:11:38,160 --> 00:11:39,920 to avoid it are... 153 00:11:40,700 --> 00:11:45,800 simple things like actually putting line breaks in between, like, say, the SC and the RIPT. 154 00:11:46,060 --> 00:11:50,400 That would be like if you SC and then you would hit enter a few times in the code and 155 00:11:50,400 --> 00:11:55,780 actually would evade the filter in that manner too. There's so many of those, it's another 156 00:11:55,780 --> 00:12:00,880 thing to Google and find. There's a couple good pages that show literally like 50 to 157 00:12:00,880 --> 00:12:06,640 100 with explanations, and you can try them. The evasions have been patched on certain 158 00:12:06,640 --> 00:12:09,820 pages, though, with, like I said, with alignment. 159 00:12:09,820 --> 00:12:13,180 The line breaks and with the encoding, sometimes the encoding doesn't work. It's basically 160 00:12:13,180 --> 00:12:16,840 just a crapshoot when you think about it, because there's chances it could work, chances 161 00:12:16,840 --> 00:12:17,340 it could not. 162 00:12:20,100 --> 00:12:24,500 The best way to do it is just trial and error. You can go through and try whatever filters 163 00:12:24,500 --> 00:12:28,480 you can come up with in your head or on a web page and see if they work. And there's 164 00:12:28,480 --> 00:12:33,520 the site, that's the site I was talking about that has a really good list. I'm sure many 165 00:12:33,520 --> 00:12:38,140 of you, if you've talked about, ever looked up this before, then you know that site. 166 00:12:41,120 --> 00:12:45,000 I'm going to talk about a previous exploit to lead into the exploit that I'll be talking 167 00:12:45,000 --> 00:12:49,900 about. This one was in the browse function of MySpace, which basically is a user search. 168 00:12:50,020 --> 00:12:55,880 You can search by your area, you can search within 20 miles and whatnot. It was found 169 00:12:55,880 --> 00:13:03,780 using trial and error. The exploit was used by me and by others to steal cookies and to 170 00:13:03,780 --> 00:13:07,900 hijack current user sessions, like I talked about, take full control of the user. And 171 00:13:07,900 --> 00:13:09,260 it has been patched, this one. 172 00:13:10,400 --> 00:13:18,240 This is the encoded URL for that exploit. Obviously you can see I encoded the 173 00:13:19,200 --> 00:13:26,060 carrots and various other things into hex, but basically it says document.location is 174 00:13:26,490 --> 00:13:32,760 your web server, your cookie stealer, and then it adds the document.cookie to your log 175 00:13:32,760 --> 00:13:39,040 file, basically is what that says. And that's basically what I said here too. It's encoded 176 00:13:39,040 --> 00:13:39,540 using hex. 177 00:13:39,820 --> 00:13:44,720 The XSS actually begins after search request equals. The JavaScript points to a PHP file. 178 00:13:44,780 --> 00:13:49,740 The PHP file records document.cookie to a log file. And it could be easily replaced 179 00:13:49,740 --> 00:13:54,240 with a redirect to malicious code on a foreign domain or anything like that. Anything you'd 180 00:13:54,240 --> 00:13:57,000 want to, you could run a malicious script right through it. You don't even need to 181 00:13:57,000 --> 00:14:02,680 redirect if you didn't want to. That's the way it worked. This was an early cross-site 182 00:14:02,680 --> 00:14:09,160 scripting hole. It was found and it was exploited majorly for a while and then MySpace patched 183 00:14:09,160 --> 00:14:09,200 it. 184 00:14:09,200 --> 00:14:14,060 But it was a while ago, probably maybe even a year. This is kind of hard to see on the 185 00:14:14,060 --> 00:14:19,400 page, but this is actually very difficult to see. But this is basically my log file. 186 00:14:19,600 --> 00:14:23,760 That's all lists of cookies. The blank space are just smaller cookies. But I mean, if 187 00:14:23,760 --> 00:14:29,540 you can see the scroll bar, it goes up and down rather long. All it takes is some time 188 00:14:29,540 --> 00:14:36,880 to get people to click it and you get their cookie, which I'll be talking about. It's 189 00:14:36,880 --> 00:14:38,260 broken down into various parts. 190 00:14:38,260 --> 00:14:43,940 MySpace broke down the cookie for us and makes it kind of easy. And like I said, it 191 00:14:43,940 --> 00:14:49,020 contains last display name, last logged in email, last search page and various other 192 00:14:49,020 --> 00:14:54,060 things depending on what the user just did on MySpace. It contains the current user session, 193 00:14:54,220 --> 00:14:59,620 which is called My User Info. And that made it kind of easy for us because My User Info 194 00:14:59,620 --> 00:15:05,300 is generally the cookie of choice for session information and it happens to be in this. 195 00:15:06,580 --> 00:15:08,240 But within the limitations of MySpace, it's pretty easy to get people to click it. So, 196 00:15:08,240 --> 00:15:13,960 what happens with this overall is that it's only valid while the person is logged in. 197 00:15:14,040 --> 00:15:18,080 Once the person logs out, the cookie dies. I never tried to actually extend the life 198 00:15:18,080 --> 00:15:22,860 of the cookie to see if it would last longer. But as far as I've never really delved into 199 00:15:22,860 --> 00:15:27,320 that either, but I know just if they log out, the session information died. So, if 200 00:15:27,320 --> 00:15:32,660 you try to use the My User Info, it just fails. It doesn't work. There is an example 201 00:15:32,660 --> 00:15:35,880 of My User Info. I know all of you guys want to write that down. So, go ahead and do it 202 00:15:35,880 --> 00:15:36,160 real quick. 203 00:15:37,740 --> 00:15:42,660 I'll give you a minute. And then that's actually the user session right there. That's usually 204 00:15:42,660 --> 00:15:45,800 what it looks like. It ends with a semicolon. I didn't put that in there, but usually you 205 00:15:45,800 --> 00:15:51,020 can tell the end by a semicolon. It absolutely means nothing to me. I have no idea what that 206 00:15:51,020 --> 00:15:51,140 says. 207 00:15:53,560 --> 00:15:56,720 Actually, it's funny. I just read a couple of days ago that you can decode that and it 208 00:15:56,720 --> 00:16:02,200 actually turns into something. I don't remember where I read it or what I was searching for 209 00:16:02,200 --> 00:16:05,120 when I found it, but I heard that actually is encoded into something. Don't ask me what. 210 00:16:05,280 --> 00:16:05,600 Okay. 211 00:16:08,620 --> 00:16:13,300 Obviously, like I said, it can be used to hijack. You must have a MySpace account to 212 00:16:13,300 --> 00:16:17,720 use this. So, for all the people that don't have one because they think it's too lame, 213 00:16:17,820 --> 00:16:20,400 you're right. But you need to have one in order to do this, obviously. 214 00:16:22,920 --> 00:16:27,860 Once the user has clicked through the encoded link that I showed earlier, that's how we 215 00:16:27,860 --> 00:16:31,720 get their cookie. And obviously, like I said, it adds it to a log file. So, once they click 216 00:16:31,720 --> 00:16:36,000 it, all you have to do is review the log file. Simply copy and paste the stolen My User Info 217 00:16:36,160 --> 00:16:41,360 into your current MySpace cookie using a cookie editor of your choice. I mean, this actually, 218 00:16:41,440 --> 00:16:44,540 I think, only worked in Firefox. I haven't used Internet Explorer in a while, so I haven't 219 00:16:44,540 --> 00:16:48,140 even tested it. But this one worked in Firefox, and that's what I use. I use add and edit 220 00:16:48,140 --> 00:16:51,580 cookies. I'm sure many people have heard of it before, but that's what I use for Firefox. 221 00:16:52,740 --> 00:16:56,360 And you now are the user. Once you refresh your browser, all you have to do is refresh 222 00:16:56,360 --> 00:17:00,240 and you're taken to their homepage and you are greeted as them. It's really as simple 223 00:17:00,240 --> 00:17:00,720 as that. 224 00:17:02,140 --> 00:17:06,140 Now, I'll be talking about the zero day. I don't want to get too ahead here, because 225 00:17:06,160 --> 00:17:11,020 I talk quickly and I obviously haven't killed that much time yet. It has been reported 226 00:17:11,020 --> 00:17:15,300 before I get started here, because I know there's legality issues here with MySpace 227 00:17:15,300 --> 00:17:19,540 and other things like that. But this has been reported and it has been for a few months. 228 00:17:19,780 --> 00:17:24,040 They haven't patched it. I'm not sure why. Obviously, this is the main point of this 229 00:17:24,040 --> 00:17:28,160 presentation and why many of you are probably here. But I wanted to let everyone know that 230 00:17:28,160 --> 00:17:32,620 this has not been patched, but it has been reported. And anyone that says it hasn't been 231 00:17:32,620 --> 00:17:34,940 is lying. It's been reported by multiple people and I know it. 232 00:17:35,680 --> 00:17:36,140 So, let's get started. 233 00:17:36,160 --> 00:17:45,920 It involves domain generalization. It doesn't perform any sort of filtering if you cross 234 00:17:45,920 --> 00:17:50,260 domain link. It's kind of a weird concept to talk about just by saying it, but you'll 235 00:17:50,260 --> 00:17:56,560 see it in the next few slides. For some reason it passes any JavaScript that you put 236 00:17:56,560 --> 00:18:01,600 on your web server to their web server and it can use cross site scripting just to do 237 00:18:01,600 --> 00:18:02,140 it like that. 238 00:18:03,660 --> 00:18:06,040 What you need to do is put a page with an iframe. 239 00:18:06,040 --> 00:18:10,580 containing MySpace on your web server of choice and use cross site scripting to steal 240 00:18:10,580 --> 00:18:14,580 the cookie. All they need to do is click the link and since it is on your domain, it can 241 00:18:14,580 --> 00:18:19,660 be easily hidden as anything. You could call the page, you know, slideshow or my pictures 242 00:18:19,660 --> 00:18:25,320 or Goatsey if anyone likes Goatsey. And if they're like, oh, wow, I like Goatsey a lot. 243 00:18:25,480 --> 00:18:28,980 And then they're like, oh, wow, I just clicked that. Where's my cookie? You know, stuff happens. 244 00:18:31,420 --> 00:18:35,080 This is the code that you need to put in your iframe. 245 00:18:35,140 --> 00:18:35,380 Okay. 246 00:18:36,640 --> 00:18:41,500 You can take a look at it. It just basically is, like I said, I'm not a programmer, but 247 00:18:41,500 --> 00:18:46,020 I know what that says. Basically it takes the iframe, the cookie from the iframe and 248 00:18:46,020 --> 00:18:55,260 logs it to the PHP file. I just used a random example for the server. This all I believe 249 00:18:55,260 --> 00:19:03,100 is included in the CD that everyone has gotten when they paid their $100. So if you want 250 00:19:03,100 --> 00:19:06,020 to use that, it's on the CD. I didn't, I did not hide it. 251 00:19:06,040 --> 00:19:09,620 I'm not hiding anything in this presentation. You guys can see everything that I've used 252 00:19:09,620 --> 00:19:10,680 and everything I will use. 253 00:19:11,420 --> 00:19:20,140 I also want to mention that the exploit that I'm talking about right now was not exactly 254 00:19:20,140 --> 00:19:24,300 found just by me. So I don't want anyone to get anyone the wrong idea that I'm taking 255 00:19:24,300 --> 00:19:27,560 credit for this by saying it. There was a group of people that found it and I sort of 256 00:19:27,560 --> 00:19:31,420 just expanded on what they found and it was a group effort type of thing on a forum that 257 00:19:31,420 --> 00:19:31,980 I won't mention. 258 00:19:33,980 --> 00:19:35,400 But basically, yeah. 259 00:19:36,620 --> 00:19:40,620 It was just found by multiple people. So I'm not trying to steal credit from anyone 260 00:19:40,620 --> 00:19:45,900 where it deserves credit. I just kind of expanded on it and took what I knew previously and 261 00:19:45,900 --> 00:19:46,480 added to it. 262 00:19:50,000 --> 00:19:54,700 That will steal the user's cookie right there because obviously you saw it stole the cookie 263 00:19:54,700 --> 00:20:01,060 using taking the frame, taking document.cookie and logging it to a file. It's more of a general 264 00:20:01,060 --> 00:20:05,680 vulnerability because it doesn't directly involve putting the cross-site scripting in a MySpace 265 00:20:05,680 --> 00:20:10,860 link and staying just in MySpace. Obviously, you have to go to this other web server to 266 00:20:10,860 --> 00:20:18,180 find it, to actually use it. But the fundamentals of cross-site scripting are there and anyone 267 00:20:18,180 --> 00:20:19,460 can learn tons from just that. 268 00:20:20,140 --> 00:20:25,600 The PHP file calls a text file and just writes the cookie to it. It just opens it, writes 269 00:20:25,600 --> 00:20:26,020 the cookie. 270 00:20:28,160 --> 00:20:32,460 You can actually, obviously, if you didn't want to make the page look so conspicuous 271 00:20:32,460 --> 00:20:35,660 because I never cared because I don't send these things out to people. You can actually, 272 00:20:35,660 --> 00:20:35,740 obviously, if you didn't want to make the page look so conspicuous because I never cared because I don't send these things out to people. 273 00:20:35,860 --> 00:20:40,240 When I find this stuff, I don't use it for any, I mean, it's just, I don't have any reason 274 00:20:40,240 --> 00:20:45,360 to hack anyone. They're MySpace. I mean, it's MySpace. What do I want with that? I 275 00:20:45,360 --> 00:20:48,200 have my own. I just know how to do it, you know. 276 00:20:50,160 --> 00:20:55,780 But I, so mine is plain and simple. It just has a little iframe, MySpace in it and then 277 00:20:55,780 --> 00:21:00,440 it redirects to my cookie logger and you get a blank page. But if you wanted to, after 278 00:21:00,440 --> 00:21:04,440 the cookie logger, you could have it redirect to, back to MySpace home page and they wouldn't 279 00:21:04,440 --> 00:21:05,640 even know like anything happened. They couldn't even know like anything happened. They couldn't 280 00:21:05,660 --> 00:21:09,680 see the iframe for a moment and then it would disappear. Or you could even make the iframe 281 00:21:09,680 --> 00:21:12,920 so little you could make it like two by two pixels and then you would, you wouldn't even 282 00:21:12,920 --> 00:21:18,080 see it and then it would go to the next page. It's really up to you. I never messed with 283 00:21:18,080 --> 00:21:25,760 how it looked. I don't really care. This is the PHP file. I basically took it from 284 00:21:25,760 --> 00:21:29,840 the internet. I just kind of Googled it and added whatever I needed to to it because like 285 00:21:29,840 --> 00:21:34,960 I said, I'm not a programmer. I know some PHP but not that much. I know what that says 286 00:21:34,960 --> 00:21:35,140 though. 287 00:21:35,140 --> 00:21:37,640 It just opens cookie log and writes the cookie. 288 00:21:40,420 --> 00:21:46,180 This is the URL that would need to be sent to the authenticated MySpace user and it may 289 00:21:46,180 --> 00:21:52,060 look simple to you but if you notice, after the dot com, there's a dot and that's basically 290 00:21:52,060 --> 00:21:56,560 the entire exploit and why it works. Without the dot, it doesn't work. That's part of the 291 00:21:56,560 --> 00:22:03,980 domain generalization. I believe the reason it's like that is because they had ads that 292 00:22:03,980 --> 00:22:04,640 used that. 293 00:22:04,640 --> 00:22:08,580 In order to pass JavaScript to their server and obviously they're not going to tell their 294 00:22:08,580 --> 00:22:12,740 ad people that pay them that they're not going to be able to do that and someone found that 295 00:22:12,740 --> 00:22:21,540 and another site and not just MySpace and you can use that to exploit this. That's 296 00:22:21,540 --> 00:22:24,520 basically the only reason it works. Without the dot, none of this works. So make sure 297 00:22:24,520 --> 00:22:28,720 if you're going to try this, you have the dot. But don't try it because it's bad. You 298 00:22:28,720 --> 00:22:33,180 shouldn't be doing that anyway. Don't ever try this, ever. Just know it. That's all. 299 00:22:33,180 --> 00:22:36,780 And it's Caturday, so you need to post more cats. It's actually Sunday, but every day 300 00:22:36,780 --> 00:22:37,120 is Caturday. 301 00:22:38,980 --> 00:22:43,220 Like I said, the dot at the end of dot com is the reason why this works and Caturday 302 00:22:43,220 --> 00:22:53,480 LOL is the HTML page which contains the iframe. All you have to do to exploit the vulnerability 303 00:22:53,480 --> 00:22:58,600 once you've stolen the cookie is log in, review the log, copy the my user info into 304 00:22:58,600 --> 00:23:02,040 your user info. Obviously, I stated this, but refresh the browser. I just wanted to 305 00:23:02,040 --> 00:23:06,200 reiterate that it's no harder than what I talked about earlier. It's the same sort 306 00:23:06,200 --> 00:23:12,560 of thing. No big deal. And you now are the user that clicked your finally crafted hidden 307 00:23:12,560 --> 00:23:15,520 link that looks like crap anyway. 308 00:23:16,520 --> 00:23:24,460 The limitations to this. Like I said, the user must be logged in. But other than that, 309 00:23:24,580 --> 00:23:30,980 the user must use Mozilla Firefox. And I will talk in a second. The person will know what 310 00:23:30,980 --> 00:23:31,840 the link is there recently. 311 00:23:31,840 --> 00:23:35,880 They clicked and that's a limitation. If you don't have it, look hidden and they know. 312 00:23:36,060 --> 00:23:40,180 Like say you posted in a bulletin and, you know, my name is Rick and they saw Rick's 313 00:23:40,180 --> 00:23:43,480 bulletin and they clicked it and then they noticed that their page now has Goatsy on 314 00:23:43,480 --> 00:23:47,540 it. They might suspect something because they clicked your link last. So they may know 315 00:23:47,540 --> 00:23:50,960 and then they'll come after you and beat you with baseball bats. Because MySpace is 316 00:23:50,960 --> 00:23:53,560 really important. That's where everyone's friends are at, you know, internet friends. 317 00:23:55,600 --> 00:23:59,180 Obviously, you can hurt your friend's feelings also by putting Goatsy on their page. They 318 00:23:59,180 --> 00:24:01,820 may not, they may be offended by Goatsy. I know I'm not. I like Goatsy. I'm not a 319 00:24:01,820 --> 00:24:03,400 fan. I like it. It's my background. So, you know. 320 00:24:06,120 --> 00:24:09,440 Depending on what you do also with their page, you can change it to be funny. You can change 321 00:24:09,440 --> 00:24:13,220 it to do whatever. But obviously don't because that's bad. Don't be doing none of that stuff. 322 00:24:14,160 --> 00:24:18,100 But and I found out just a couple days ago and I didn't even notice until I tried to 323 00:24:18,100 --> 00:24:24,080 test this again after I updated my Firefox, that Firefox 2005 finally implemented HTTP 324 00:24:24,080 --> 00:24:31,280 only cookies, which doesn't let you get the user session anymore, which is bad for me 325 00:24:31,280 --> 00:24:34,500 because I tried to do this presentation. I'm like, oh wait, it doesn't work anymore. 326 00:24:35,420 --> 00:24:39,900 And then I realized that's a problem. So what you need to do is, I mean, not everyone updates 327 00:24:39,900 --> 00:24:44,700 their Firefox. And this, as far as I know, it never worked on IE, not for a while anyway 328 00:24:44,700 --> 00:24:47,580 because I'm pretty sure they've used HTTP only in a while. Like I said, I haven't used 329 00:24:47,580 --> 00:24:54,800 IE in forever. So if I'm wrong, don't throw things at me. If you use the older version, 330 00:24:54,860 --> 00:24:58,300 it works perfectly fine. But also I've never messed with this yet because I didn't have 331 00:24:58,300 --> 00:25:01,040 time. I, like I said, it's 8-2. That's like the day 332 00:25:01,040 --> 00:25:04,580 before I left to come to Las Vegas and it was like midnight when I was looking at this 333 00:25:04,580 --> 00:25:09,540 so I didn't feel like doing it again. But you can, I was reading you can use XML HTTP 334 00:25:09,540 --> 00:25:13,680 request to obtain the cookie. It just is a lot more difficult than just using document.cookie. 335 00:25:13,860 --> 00:25:17,200 But I mean, if you know the language, then it shouldn't be, it should be no problem. 336 00:25:17,340 --> 00:25:21,880 It's just as easy. You just need to use that instead because that doesn't block, doesn't 337 00:25:21,880 --> 00:25:27,340 block HTTP only cookies, which my user info is part of the cookie, but it's actually the 338 00:25:27,340 --> 00:25:30,720 only part that's blocked because it's HTTP only. It keeps cross-site scripting from 339 00:25:30,720 --> 00:25:31,020 happening. 340 00:25:31,040 --> 00:25:34,900 And that's why it's been implemented. It's, people have apparently wanted it in Firefox 341 00:25:36,020 --> 00:25:42,400 for a while. And now I'm going to do the demonstration here and hope everything goes well. 342 00:25:47,380 --> 00:25:57,860 We'll start by, this is my MySpace. See, there's me. And we're going to call Dan up 343 00:25:57,860 --> 00:26:00,780 here in a minute. But we're going to go to Dan's page. Oh, no we're not. 344 00:26:00,780 --> 00:26:01,440 Just kidding. 345 00:26:07,740 --> 00:26:09,820 Oh, getting an IP address. Hold on. 346 00:26:15,800 --> 00:26:26,440 All right. So for this example, we're going to send Dan a message containing my exploit 347 00:26:26,440 --> 00:26:26,960 for this. 348 00:26:29,380 --> 00:26:36,320 There's my server hosting that. And Dan will click it because he always wants a cheeseburger. 349 00:26:36,420 --> 00:26:39,640 And it says I can't have his cheeseburger. So I mean, come on. 350 00:26:46,500 --> 00:26:49,040 I'm his friend, just so he knows, just in case he doesn't realize it. 351 00:26:53,240 --> 00:26:56,080 So I just sent him the link here. 352 00:26:56,080 --> 00:27:02,700 And now I'm going to log out. So you guys stop looking at my messages. And then Dan 353 00:27:02,700 --> 00:27:03,540 is going to come up here. 354 00:27:04,000 --> 00:27:04,960 Come on up, Dan. 355 00:27:07,780 --> 00:27:11,980 Doesn't it suck Bob Barker's off prices right now? I love Bob Barker. 356 00:27:14,440 --> 00:27:15,300 Speaker 4, inaudible 357 00:27:16,380 --> 00:27:18,940 Speaker 5, inaudible 00-6. 358 00:27:20,300 --> 00:27:21,000 Speaker 2, inaudible 00-8. 359 00:27:21,000 --> 00:27:24,080 Speaker 4, inaudible 00-3. 360 00:27:26,080 --> 00:27:27,660 There, you guys like that? There you go. 361 00:27:36,080 --> 00:27:36,600 Better? 362 00:27:38,480 --> 00:27:40,580 No? Well, then get new glasses. 363 00:27:43,520 --> 00:27:46,080 Hey, I got glasses. 364 00:27:53,440 --> 00:27:56,040 Oh, I'll change that later. 365 00:28:06,260 --> 00:28:08,260 Nah, it's all right. 366 00:28:17,920 --> 00:28:20,340 Now Dan is going to read the message I sent him 367 00:28:21,280 --> 00:28:22,820 and change his password. 368 00:28:35,840 --> 00:28:36,380 What's that? 369 00:28:36,700 --> 00:28:38,360 I told you he wanted a cheeseburger. 370 00:28:39,820 --> 00:28:42,100 Oh, and now it's not forwarding. Of course. 371 00:28:42,280 --> 00:28:44,380 Of course. Why would it work when I'm not on it, too? 372 00:28:45,140 --> 00:28:45,800 Let's try again. 373 00:28:47,640 --> 00:28:49,120 I had some catastrophic failure. 374 00:28:49,240 --> 00:28:50,480 He was actually supposed to be in the audience 375 00:28:50,480 --> 00:28:52,620 using my second laptop, but the master boot record 376 00:28:52,620 --> 00:28:54,460 got messed up 20 minutes before my speech. 377 00:28:54,740 --> 00:28:56,420 So this actually isn't going to work 378 00:28:56,420 --> 00:28:57,460 exactly the way it should. 379 00:28:57,620 --> 00:28:59,380 What he should be doing is clicking this link. 380 00:28:59,460 --> 00:29:01,700 I should be using it up here, and then I should review 381 00:29:01,700 --> 00:29:03,060 the cookie log, and he should 382 00:29:04,060 --> 00:29:05,740 have his cookie in my cookie log, 383 00:29:05,820 --> 00:29:07,560 and I was going to refresh my browser and become him. 384 00:29:07,640 --> 00:29:09,660 But since we're logged in as him, I'm going to basically show you 385 00:29:09,660 --> 00:29:11,500 exactly what you need to do, but 386 00:29:11,500 --> 00:29:13,820 it actually isn't going to work the perfect way. 387 00:29:13,900 --> 00:29:14,460 Sorry, guys. 388 00:29:14,460 --> 00:29:16,120 I apologize. 389 00:29:16,280 --> 00:29:17,520 My laptop is older than me. 390 00:29:20,520 --> 00:29:22,360 And of course, it's not forwarding. 391 00:29:25,980 --> 00:29:28,620 Okay, well, we're going to go to the cookie log. 392 00:29:28,660 --> 00:29:29,220 Thanks, Dan. 393 00:29:29,420 --> 00:29:30,920 Thanks for giving everyone your password. 394 00:29:37,880 --> 00:29:40,920 We tested this a couple days ago, and for whatever reason, 395 00:29:41,580 --> 00:29:44,360 my script file isn't deciding not to work right now. 396 00:29:44,360 --> 00:29:47,120 But this is an older log. 397 00:29:47,300 --> 00:29:48,980 Like I said, I can't show you guys 398 00:29:48,980 --> 00:29:51,140 exactly how it worked anyway, because he doesn't have 399 00:29:51,140 --> 00:29:53,000 the laptop out there, so we'll just use this. 400 00:29:53,480 --> 00:29:54,760 But here's the My User Info. 401 00:29:56,160 --> 00:29:57,100 So what you do 402 00:29:57,100 --> 00:29:58,860 is you scroll 403 00:29:58,860 --> 00:29:59,860 for a year. 404 00:30:02,860 --> 00:30:03,340 ... 405 00:30:07,140 --> 00:30:07,580 ... 406 00:30:10,240 --> 00:30:10,680 ... 407 00:30:11,800 --> 00:30:12,240 ... 408 00:30:13,880 --> 00:30:14,320 ... 409 00:30:14,360 --> 00:30:14,500 ... 410 00:30:14,500 --> 00:30:15,040 ... 411 00:30:19,400 --> 00:30:19,760 ... 412 00:30:19,760 --> 00:30:19,900 ... 413 00:30:20,840 --> 00:30:21,240 I know. 414 00:30:21,340 --> 00:30:22,840 You guys are all perfect, and I just suck. 415 00:30:22,860 --> 00:30:23,140 It sucks. 416 00:30:29,140 --> 00:30:32,840 So that is the portion of the cookie we need. 417 00:30:33,140 --> 00:30:35,100 I'm sure you guys loved how it took an hour. 418 00:30:36,780 --> 00:30:40,180 So now, from this point, I'm going to go into my Cookie Editor. 419 00:30:42,460 --> 00:30:43,780 Don't look at all the porn, please. 420 00:30:43,980 --> 00:30:44,340 ... 421 00:30:46,200 --> 00:30:51,820 My User Info. I'm using ANEC cookie editor for this one. I usually use Add and Edit. 422 00:30:51,920 --> 00:30:56,780 I'm using this right now because it was quicker to find. So there's the cookie, the My User 423 00:30:56,780 --> 00:31:02,040 Info cookie right there. I'm editing it. I'm taking what I just copied and I'm just going 424 00:31:02,040 --> 00:31:22,800 to paste it. Saving it. Closing it. Going back to MySpace. Going home off my page. Obviously 425 00:31:23,200 --> 00:31:27,160 the cookie was old, so it's not going to actually work right now, but usually all you have to 426 00:31:27,160 --> 00:31:30,200 do is click home and you would be Dan Hammon. 427 00:31:30,580 --> 00:31:32,020 And that was basically it. 428 00:31:32,040 --> 00:31:36,220 I'm sorry that it couldn't work perfectly the way I wanted it to, but it will work if 429 00:31:36,220 --> 00:31:39,820 you guys try it at home. Unless, of course, MySpace patched the vulnerability overnight, 430 00:31:40,120 --> 00:31:49,980 which would make me very upset. But basically, that is it. And it will work once you don't 431 00:31:49,980 --> 00:31:56,340 ... If you're not on a stage, it'll work perfectly fine. Trust me. And I'm not embarrassed 432 00:31:56,340 --> 00:31:56,960 by it, so. 433 00:32:01,680 --> 00:32:07,760 So that was the demonstration. I'm glad you guys watched it. Obviously, like I said, 434 00:32:07,840 --> 00:32:13,620 it would have worked perfectly fine. The tools I used, Firefox, Notepad, and Brain or Lack 435 00:32:13,620 --> 00:32:17,540 Thereof, depending on who you're hacking and what network you're on and whether you 436 00:32:17,540 --> 00:32:26,600 like to be sued. Add and edit cookies, like I said. That's basically the tools used. 437 00:32:26,600 --> 00:32:30,420 These are some penetration testing tools that you can also be used. It's probably really 438 00:32:30,420 --> 00:32:34,340 small up there, but I copied it from a previous presentation I did. Basically, just some good 439 00:32:34,340 --> 00:32:38,960 stuff for use for hiding cross-site scripting. Tamper data, add and edit cookies, Firebug, 440 00:32:39,120 --> 00:32:46,040 Firekeeper, Hackbar, switch proxy, and Tor for anonymous purposes, obviously. I think 441 00:32:46,040 --> 00:32:48,720 there was a couple speeches I didn't get to catch about Tor. I'm sorry about that, but 442 00:32:48,720 --> 00:32:49,360 I would have loved to. 443 00:32:50,460 --> 00:32:54,260 Paros, which is a web vulnerability scanning proxy, and that's good for finding cross-site 444 00:32:54,260 --> 00:32:54,740 scripting. 445 00:32:55,840 --> 00:32:56,200 Akinetics. 446 00:32:56,260 --> 00:32:56,580 Akinetics. 447 00:32:56,580 --> 00:33:03,640 Another one. And Nikto and Wicto for Linux and Windows web pen testing. I do have time 448 00:33:03,640 --> 00:33:08,940 here. I have another 15 minutes, I believe, up here. If anyone has any questions, we can 449 00:33:08,940 --> 00:33:13,520 ask them here or you can ask them in the Q&A room where I'll be next. I wanted to 450 00:33:13,520 --> 00:33:17,300 thank everybody for coming. Thank you for filling the room. I didn't expect it at all. 451 00:33:17,400 --> 00:33:24,780 Hopefully, everybody enjoyed watching it not work. It will work, I promise you that. Thank 452 00:33:24,780 --> 00:33:25,020 you. 453 00:33:26,840 --> 00:33:28,300 Thank you.