1 00:00:00,000 --> 00:00:03,220 Hello, and welcome to BitTorrent Hacks! 2 00:00:05,120 --> 00:00:12,900 My name is Michael Brooks, and we are here to, to, we are pirates, we are hackers, and we like BitTorrent. 3 00:00:13,060 --> 00:00:15,840 Our motivation for this project is to improve the protocol. 4 00:00:16,180 --> 00:00:18,940 A part of this is to educate people on the weaknesses. 5 00:00:19,760 --> 00:00:21,560 Here's my speaker, co-speaker David. 6 00:00:21,920 --> 00:00:26,660 My name is David Aslanian, I'm a programmer, and I test avionics software. 7 00:00:26,860 --> 00:00:29,740 I may have worked on some of the products that some of you have flown here to. 8 00:00:32,420 --> 00:00:36,500 This is my trophy room. These are companies I have hacked. 9 00:00:38,560 --> 00:00:42,820 This is my Millworm page. My number is 677. 10 00:00:44,220 --> 00:00:47,180 The BitTorrent protocol is now seven years old. 11 00:00:47,420 --> 00:00:50,660 The protocol has become widely successful in a very short period of time. 12 00:00:50,820 --> 00:00:52,600 But with this success has come growing pains. 13 00:00:52,860 --> 00:00:55,840 The protocol originally envisioned by Bram Cohen is fairly secure. 14 00:00:56,540 --> 00:00:59,980 Vulnerabilities have been introduced by people trying to do things with the protocol. 15 00:01:00,000 --> 00:01:03,300 It was never meant to do, such as private networks and encryption. 16 00:01:03,900 --> 00:01:09,140 Most vulnerabilities identified by the CVE, or Common Vulnerability Exposure System, 17 00:01:09,880 --> 00:01:18,280 more than 37 vulnerabilities are identified, 37,000 vulnerabilities are identified by CVEs. 18 00:01:18,420 --> 00:01:24,840 Most CVEs fall into specific categories and are given a Common Weakness Enumeration, or CWE number. 19 00:01:25,100 --> 00:01:28,940 For instance, all SQL injection vulnerabilities are CWE89. 20 00:01:30,000 --> 00:01:34,260 In the current BitTorrent specification, there are three CWE violations. 21 00:01:34,920 --> 00:01:38,860 In order to understand the vulnerabilities, you must first understand the protocol. 22 00:01:40,200 --> 00:01:43,720 All right, so I'm going to go over some of the basics of the BitTorrent protocol here. 23 00:01:45,800 --> 00:01:49,360 All the data used in BitTorrent communication is B-encoded. 24 00:01:50,860 --> 00:01:53,880 The two simple data types are shown here. 25 00:01:54,200 --> 00:01:56,080 The first one that you see is an integer. 26 00:01:56,500 --> 00:01:58,380 The second one that you see is a string. 27 00:02:00,060 --> 00:02:05,060 As you can notice, with a string, the size of the string precedes the colon. 28 00:02:05,440 --> 00:02:09,500 And with the integer, the integers can be of any size. 29 00:02:09,660 --> 00:02:11,520 They start with an I and end with an E. 30 00:02:13,360 --> 00:02:15,300 The next data type is a list. 31 00:02:16,300 --> 00:02:19,920 This example shows a list that contains one number and two strings. 32 00:02:20,280 --> 00:02:21,100 Pretty simple. 33 00:02:23,060 --> 00:02:25,660 The fourth and final data type is a dictionary. 34 00:02:26,080 --> 00:02:28,480 This is very similar to a Python dictionary. 35 00:02:30,540 --> 00:02:34,920 This dictionary, shown here, contains a single integer and two strings. 36 00:02:36,120 --> 00:02:43,360 Dictionaries access their members using strings, whereas lists access their members using numerical indexes. 37 00:02:46,780 --> 00:02:48,420 This is a torrent file. 38 00:02:50,000 --> 00:02:56,780 These four data types that I just showed you can be used together to create more complex data types, such as irregular trees. 39 00:02:57,580 --> 00:02:59,140 As shown here. 40 00:03:02,320 --> 00:03:06,640 For instance, the first step in starting a torrent is obtaining the torrent file, obviously. 41 00:03:07,580 --> 00:03:12,380 The torrent file uses B-encoding, as we just described, to build a data tree. 42 00:03:12,780 --> 00:03:14,860 A couple things to notice about this data tree. 43 00:03:15,040 --> 00:03:18,840 All of the leaf nodes in this tree are either integers or strings. 44 00:03:20,740 --> 00:03:23,780 Another thing to notice is the announced list subtree. 45 00:03:24,520 --> 00:03:27,520 That's a list of all the trackers that the torrent can connect to. 46 00:03:27,780 --> 00:03:28,120 ... 47 00:03:29,460 --> 00:03:29,980 ... 48 00:03:29,980 --> 00:03:36,880 notice the pieces part of the info subtree. It contains SHA-1 49 00:03:36,880 --> 00:03:39,960 hashes of all the chunks of the file that will be transferred. 50 00:03:43,940 --> 00:03:48,840 During client tracker communication, torrents are 51 00:03:48,840 --> 00:03:53,460 identified by their info hash, which is a SHA-1 hash of the 52 00:03:53,460 --> 00:03:57,800 info subtree of a torrent file, shown highlighted in yellow 53 00:03:57,800 --> 00:04:04,980 here. One thing to note is that the list of trackers, as well as 54 00:04:04,980 --> 00:04:08,460 some other information about the torrent, can change without the 55 00:04:08,460 --> 00:04:16,000 info hash ever changing. Immediately after opening a 56 00:04:16,000 --> 00:04:19,100 torrent file, your BitTorrent sends a scrape request, which 57 00:04:19,100 --> 00:04:24,460 looks like this, to the tracker, to one of the trackers that is 58 00:04:24,460 --> 00:04:26,120 listed in the torrent file. 59 00:04:28,400 --> 00:04:33,580 The scrape request is a simple HTTP GET. Then the tracker 60 00:04:33,580 --> 00:04:36,120 responds with statistics about the torrent, including the 61 00:04:36,120 --> 00:04:39,100 number of people who have downloaded the file, the number of 62 00:04:39,100 --> 00:04:43,080 people who are seeding and leaching the file, and that's pretty 63 00:04:43,080 --> 00:04:43,420 much it. 64 00:04:45,420 --> 00:04:50,060 The next thing your BitTorrent client will do is it will send an 65 00:04:50,060 --> 00:04:53,760 announce request to the tracker. The announce request sends more 66 00:04:53,760 --> 00:04:57,660 information about your client. For instance, in this announce 67 00:04:57,660 --> 00:05:01,080 request, the event is started, as you can see, most of the way 68 00:05:01,080 --> 00:05:06,240 down there. For example, if you just completed a download, the event 69 00:05:06,240 --> 00:05:11,820 would be completed. And zero bytes have been uploaded and downloaded 70 00:05:11,820 --> 00:05:15,600 in this announce request. Another important thing to notice is the 71 00:05:15,600 --> 00:05:19,360 port number, which the tracker will use when identifying this 72 00:05:19,360 --> 00:05:27,080 client in a, in a announce response. This is an announce response. What the 73 00:05:27,080 --> 00:05:27,640 announce response will do is it will send a scrape request to the 74 00:05:27,660 --> 00:05:29,580 tracker. What the response does is it gives the client a list of 75 00:05:29,580 --> 00:05:34,660 peers that it can connect to. The peers, as you can probably see, are 76 00:05:34,660 --> 00:05:39,560 not being coded. Instead, it is a binary representation of the IP 77 00:05:39,560 --> 00:05:40,560 address and port pairs. 78 00:05:42,700 --> 00:05:46,920 At this point, now that the BitTorrent client has a list of peers, it's 79 00:05:46,920 --> 00:05:51,400 going to begin a series of handshakes to establish connections with 80 00:05:51,400 --> 00:05:57,460 other peers in the swarm. The first packet of a handshake is going to 81 00:05:57,460 --> 00:06:00,760 be a UDP ping request, as shown here. 82 00:06:03,720 --> 00:06:09,180 This is the response to the UDP ping request. Once the client 83 00:06:09,180 --> 00:06:14,080 receives this UDP ping response, the client knows that the remote 84 00:06:14,080 --> 00:06:17,960 peer is available, not firewalled or behind a NAT or otherwise 85 00:06:17,960 --> 00:06:27,140 unreachable. There are many other packets, UDP packets, that will be sent before any 86 00:06:27,140 --> 00:06:30,640 sort of file transfer begins. In addition, there are extensions to the 87 00:06:30,640 --> 00:06:36,680 BitTorrent protocol that allow things like chat to occur after the handshake 88 00:06:36,680 --> 00:06:37,140 is complete. 89 00:06:41,640 --> 00:06:43,480 Take a swig of Jameson. 90 00:06:46,660 --> 00:06:47,300 Ah! 91 00:06:47,780 --> 00:06:49,200 You are. You are. 92 00:06:54,080 --> 00:06:55,020 Client trust. 93 00:06:56,480 --> 00:06:57,120 Client trust. 94 00:06:57,120 --> 00:06:59,520 BitTorrent was never meant to be an exclusive protocol. 95 00:07:00,180 --> 00:07:02,540 As a result, two vulnerabilities were created. 96 00:07:03,100 --> 00:07:06,040 The first one is CWE-602, 97 00:07:06,660 --> 00:07:08,840 Client-Side Enforcement of Server-Side Security, 98 00:07:09,180 --> 00:07:10,740 or better known as Client-Side Trust. 99 00:07:12,020 --> 00:07:16,100 With every announced request, 100 00:07:16,200 --> 00:07:19,720 the client is expected to report on how much they've uploaded and downloaded 101 00:07:19,720 --> 00:07:21,240 and how much is remaining to download. 102 00:07:22,440 --> 00:07:25,920 Private BitTorrent networks use these announced requests to enforce the share ratio. 103 00:07:25,920 --> 00:07:30,420 For instance, some private BitTorrent networks will impose a 50% ratio 104 00:07:30,420 --> 00:07:33,940 in which you must upload at least half as much as you download. 105 00:07:34,460 --> 00:07:36,900 The tools to spoof this information are well known. 106 00:07:37,140 --> 00:07:42,180 They send spoofed HTTP GET requests informing the tracker that the client has uploaded data 107 00:07:42,180 --> 00:07:44,640 when in fact no data has been uploaded. 108 00:07:46,700 --> 00:07:49,140 RatioMaster is an example of a spoofed client. 109 00:07:49,400 --> 00:07:52,620 However, some BitTorrent communities have been able to detect this method. 110 00:07:52,880 --> 00:07:54,880 A more difficult to detect method 111 00:07:54,880 --> 00:07:55,160 is 112 00:07:55,920 --> 00:07:58,920 is that if the BitTorrent client lies to the tracker 113 00:07:58,920 --> 00:08:00,820 saying that it hasn't transferred any data. 114 00:08:01,040 --> 00:08:04,200 In addition, the client never reports that the transfer is completed. 115 00:08:04,600 --> 00:08:05,780 From the tracker's perspective, 116 00:08:06,200 --> 00:08:09,280 the BitTorrent client is unable to contact other peers in the swarm, 117 00:08:09,460 --> 00:08:11,300 which could happen under legitimate conditions. 118 00:08:11,980 --> 00:08:14,880 As a result, the bandwidth ratio stays constant. 119 00:08:15,460 --> 00:08:21,740 But, the BitTorrent client is able to accomplish this. 120 00:08:21,800 --> 00:08:22,860 It's called Stealth Bomber. 121 00:08:22,960 --> 00:08:25,100 I created it by modifying the original, 122 00:08:25,100 --> 00:08:28,640 Python BitTorrent 5.2.2 client written by Bram Cohen. 123 00:08:28,960 --> 00:08:32,360 The Stealth Bomber is open source and is on the DEF CON CD. 124 00:08:36,080 --> 00:08:39,260 The next vulnerability is Immortal Sessions. 125 00:08:39,900 --> 00:08:42,320 All private BitTorrent communities are vulnerable to this. 126 00:08:42,520 --> 00:08:47,300 It is CWE384, which ranks in at number 7 on the OWASP Top 10. 127 00:08:47,900 --> 00:08:51,700 All BitTorrent clients authenticate with private trackers using a session ID 128 00:08:51,700 --> 00:08:52,940 sent as a GET parameter. 129 00:08:53,820 --> 00:08:55,080 These values cannot be changed. 130 00:08:55,080 --> 00:08:57,080 Because there isn't a system in the protocol 131 00:08:57,080 --> 00:08:59,720 to notify the BitTorrent client of a new session ID. 132 00:09:00,140 --> 00:09:03,540 The session ID is a part of the announced URL in the .torrent file. 133 00:09:03,960 --> 00:09:05,540 One could exploit this vulnerability 134 00:09:05,920 --> 00:09:08,640 by sniffing the network for announced requests or .torrent files. 135 00:09:09,180 --> 00:09:11,860 Another try-and-true method is XSS in the web application. 136 00:09:12,580 --> 00:09:14,240 Due to this session fixation vulnerability, 137 00:09:14,660 --> 00:09:17,140 SQL injection in the tracker leads to immediate access 138 00:09:17,140 --> 00:09:19,160 without the need to break the password hash. 139 00:09:19,880 --> 00:09:24,460 The most popular private BitTorrent community codebase is TBDev. 140 00:09:24,460 --> 00:09:28,620 And the MD5 password hash is also the Immortal Session ID. 141 00:09:29,460 --> 00:09:32,160 Password hashes should always be kept secret. 142 00:09:32,460 --> 00:09:35,420 The hashing of passwords is meant to be a last line of defense 143 00:09:35,420 --> 00:09:36,660 after the database... 144 00:09:42,220 --> 00:09:43,860 Thank you, thank you. 145 00:09:44,220 --> 00:09:45,100 More Jameson! 146 00:09:45,300 --> 00:09:47,320 More Jameson! 147 00:09:50,820 --> 00:09:51,580 More Jameson! 148 00:09:59,240 --> 00:10:00,140 Where was I? 149 00:10:08,700 --> 00:10:09,340 DMCA bots. 150 00:10:09,620 --> 00:10:10,580 How do you get busted? 151 00:10:10,960 --> 00:10:12,900 Just out of curiosity, how many people in the crowd 152 00:10:12,900 --> 00:10:14,600 have gotten a DMCA violation? 153 00:10:15,300 --> 00:10:16,200 Quite a few of you. 154 00:10:16,200 --> 00:10:18,420 When I asked at Black Hat, no one raised their hand. 155 00:10:18,560 --> 00:10:19,800 I'm like, oh, you guys aren't pirates. 156 00:10:23,400 --> 00:10:25,120 Another client-side trust issue 157 00:10:25,680 --> 00:10:28,720 is that a number of seeds for the torrent is calculated 158 00:10:28,720 --> 00:10:30,480 by looking at the number of requests 159 00:10:30,480 --> 00:10:33,120 which have recently set an event as completed. 160 00:10:33,800 --> 00:10:35,600 It is trivial to inflate this number 161 00:10:35,600 --> 00:10:37,080 by forging announced requests. 162 00:10:37,380 --> 00:10:39,240 Just because a torrent has a lot of seeds 163 00:10:39,240 --> 00:10:40,240 doesn't mean it's good. 164 00:10:40,440 --> 00:10:43,080 In fact, it could be a trap laid by a DMCA bot. 165 00:10:44,240 --> 00:10:46,180 Announced requests are important to anti-pollution. 166 00:10:46,200 --> 00:10:46,760 They are piracy software. 167 00:10:49,240 --> 00:10:52,560 These automated bots will download torrent files 168 00:10:52,560 --> 00:10:54,060 of copyrighted material in question 169 00:10:54,060 --> 00:10:56,080 and periodically contact the announced server, 170 00:10:56,240 --> 00:10:57,600 obtaining a list of IP addresses. 171 00:10:58,100 --> 00:11:00,640 The DMCA bots will connect to you, 172 00:11:00,660 --> 00:11:02,540 pretending to be a normal BitTorrent client, 173 00:11:02,760 --> 00:11:06,120 and attempt to download a chunk of the copyrighted evidence 174 00:11:06,120 --> 00:11:06,960 to use in court. 175 00:11:07,980 --> 00:11:10,040 PeerGuardian is a popular peer-to-peer plugin 176 00:11:10,040 --> 00:11:13,740 that prevents you from contacting two known DMCA bots. 177 00:11:14,780 --> 00:11:16,180 PeerGuardian is similar in that it allows you 178 00:11:16,180 --> 00:11:17,200 to convert your server to a real-time blacklist 179 00:11:17,200 --> 00:11:18,400 used to fight spam. 180 00:11:18,800 --> 00:11:20,580 I don't like PeerGuardian at all. 181 00:11:21,040 --> 00:11:22,940 IP addresses are very cheap, 182 00:11:23,100 --> 00:11:24,800 and proxy servers are free. 183 00:11:26,080 --> 00:11:29,340 Unfortunately, the safest method to avoid anti-piracy bots 184 00:11:29,340 --> 00:11:31,540 is to use private BitTorrent networks. 185 00:11:32,900 --> 00:11:34,020 Demonoid is invite-only. 186 00:11:34,260 --> 00:11:37,220 However, Demonoid users will get DMCA violations. 187 00:11:37,700 --> 00:11:39,660 This is because the community is too open. 188 00:11:40,260 --> 00:11:43,320 Other communities, such as waffles.fm and what.cd, 189 00:11:43,580 --> 00:11:44,820 are very exclusive. 190 00:11:44,820 --> 00:11:46,460 I don't think any one of these communities 191 00:11:46,460 --> 00:11:48,000 will ever get a DMCA violation. 192 00:11:50,840 --> 00:11:53,500 The third vulnerability to affect BitTorrent 193 00:11:53,500 --> 00:11:55,340 falls under CWE-300, 194 00:11:56,420 --> 00:11:58,360 Channel Accessible by Non-Endpoint, 195 00:11:58,500 --> 00:12:00,420 or better known as Man in the Middle. 196 00:12:01,660 --> 00:12:05,040 This is a vulnerability in the Message Stream Encryption protocol 197 00:12:05,040 --> 00:12:06,460 used for BitTorrent encryption. 198 00:12:06,980 --> 00:12:09,720 This is not the first security problem that affects MSE. 199 00:12:09,920 --> 00:12:11,900 A company by the name of iPock 200 00:12:11,900 --> 00:12:14,420 is able to detect and throttle MSE traffic 201 00:12:14,820 --> 00:12:15,700 using deep packet inspection. 202 00:12:16,440 --> 00:12:18,400 Furthermore, a research paper entitled 203 00:12:18,400 --> 00:12:20,380 Attacks on Message Stream Encryption 204 00:12:20,380 --> 00:12:22,180 goes over many problems with MSE. 205 00:12:22,420 --> 00:12:23,880 The biggest problem with this paper 206 00:12:23,880 --> 00:12:25,360 is that many of the attacks discussed 207 00:12:25,360 --> 00:12:26,440 are highly theoretical 208 00:12:26,440 --> 00:12:28,060 and may not be possible in the real world. 209 00:12:28,340 --> 00:12:29,340 To make matters worse, 210 00:12:29,740 --> 00:12:31,600 no source code has been provided to otherwise 211 00:12:31,600 --> 00:12:34,660 prove or verify any of the attacks presented. 212 00:12:35,240 --> 00:12:37,180 I think this is a common problem with academics. 213 00:12:37,580 --> 00:12:39,440 They like to talk about security problems, 214 00:12:39,600 --> 00:12:41,120 and they don't write exploit code. 215 00:12:41,720 --> 00:12:44,640 On the con.cd is a proof-of-concept code that I wrote, 216 00:12:44,820 --> 00:12:49,540 to show that Man in the Middle attacks in MSE is possible. 217 00:12:50,540 --> 00:12:51,600 So here it is. 218 00:12:51,740 --> 00:12:53,360 This is MSE in short. 219 00:12:53,820 --> 00:12:56,680 MSE relies on three cryptographic primitives. 220 00:12:56,920 --> 00:12:59,580 The very beginning, before the dot dot dot, 221 00:12:59,740 --> 00:13:01,640 is the Diffie-Hellman key exchange. 222 00:13:02,260 --> 00:13:05,260 This is to produce a shared secret between the two users. 223 00:13:06,440 --> 00:13:10,180 This secret is then concatenated to the end of key A, 224 00:13:10,360 --> 00:13:11,700 the string key A. 225 00:13:12,780 --> 00:13:15,200 Finally, the info hash of the dot torrent file 226 00:13:15,200 --> 00:13:16,560 is concatenated to the end. 227 00:13:19,200 --> 00:13:22,520 Then, the SHA-1 hash of this entire string 228 00:13:22,520 --> 00:13:24,000 is used as the key. 229 00:13:25,780 --> 00:13:28,080 What is lacking from this protocol is authentication. 230 00:13:29,940 --> 00:13:32,220 The info hash is sent as a git request, 231 00:13:32,440 --> 00:13:34,160 usually over plain text, and can be obtained. 232 00:13:34,420 --> 00:13:37,200 Or often, you're downloading torrents from the Pyre Bay, 233 00:13:37,360 --> 00:13:38,820 in which case all info hashes are known. 234 00:13:39,040 --> 00:13:41,640 This is not a reasonable method 235 00:13:41,700 --> 00:13:42,060 of authentication. 236 00:13:43,320 --> 00:13:47,040 This protocol is very similar to unauthenticated SSL. 237 00:13:48,100 --> 00:13:50,660 Both can use DH key exchanges, 238 00:13:51,040 --> 00:13:52,480 both can use RC4, 239 00:13:52,720 --> 00:13:54,040 and most importantly, 240 00:13:54,140 --> 00:13:55,660 they're both vulnerable to Man in the Middle attacks. 241 00:13:58,900 --> 00:14:01,980 So, speaking of unauthenticated SSL, 242 00:14:03,280 --> 00:14:06,420 all of these BitTorrent clients whose icons are listed 243 00:14:06,420 --> 00:14:09,100 have a completely broken SSL implementation. 244 00:14:09,740 --> 00:14:11,680 When communicating over SSL, 245 00:14:11,700 --> 00:14:14,440 they don't even bother to check the validity of the certificate. 246 00:14:15,840 --> 00:14:18,140 What you're seeing right here on the bottom 247 00:14:18,460 --> 00:14:20,020 is a pop-up from Views, 248 00:14:20,040 --> 00:14:23,600 and what it originally said is basically something like, 249 00:14:24,120 --> 00:14:26,100 would you like to trust this invalid certificate? 250 00:14:27,080 --> 00:14:29,500 And what they're really saying is, 251 00:14:29,580 --> 00:14:30,460 do you want to get owned? 252 00:14:30,860 --> 00:14:32,300 And I think, unfortunately, 253 00:14:32,520 --> 00:14:34,460 the answer from most users would be yes, 254 00:14:34,560 --> 00:14:37,620 because most users aren't going to understand the subtleties 255 00:14:37,620 --> 00:14:40,340 of what this pop-up box even means. 256 00:14:43,380 --> 00:14:45,500 Views also fails to check the certificate, 257 00:14:45,820 --> 00:14:48,780 but rather claims all certificates are invalid, 258 00:14:49,180 --> 00:14:50,220 which is just as bad. 259 00:14:51,620 --> 00:14:54,160 These are not problems in the SSL library. 260 00:14:55,380 --> 00:14:58,240 They're problems in how the SSL library is being used. 261 00:14:58,460 --> 00:14:59,760 This is like the X-Files, 262 00:14:59,860 --> 00:15:00,860 trust no one, 263 00:15:01,060 --> 00:15:02,640 not even your certificate authority. 264 00:15:04,800 --> 00:15:05,940 And, you know, 265 00:15:05,960 --> 00:15:08,760 very powerful security tools like SSL 266 00:15:08,760 --> 00:15:10,540 can be used completely incorrectly, 267 00:15:10,540 --> 00:15:12,500 even if the libraries they're using 268 00:15:12,500 --> 00:15:13,380 are completely insecure. 269 00:15:20,960 --> 00:15:24,460 So while working with the Python BitTorrent client, 270 00:15:24,560 --> 00:15:26,080 I found some awesome code comments. 271 00:15:26,380 --> 00:15:27,080 The first one is, 272 00:15:27,160 --> 00:15:29,460 this function is a boat made of shit 273 00:15:29,460 --> 00:15:31,040 floating on a river of shit. 274 00:15:33,040 --> 00:15:34,280 The next one is, 275 00:15:34,320 --> 00:15:36,160 Azureus sucks equals choke. 276 00:15:36,300 --> 00:15:37,120 I'm not shitting. 277 00:15:37,960 --> 00:15:38,860 Great stuff. 278 00:15:38,860 --> 00:15:38,940 Great stuff. 279 00:15:40,820 --> 00:15:43,320 I don't know if Bram Cohen wrote that, 280 00:15:43,340 --> 00:15:45,540 but it'd be funny. 281 00:15:46,520 --> 00:15:47,080 Okay. 282 00:15:47,320 --> 00:15:47,780 Attack surface. 283 00:15:51,680 --> 00:15:52,240 Okay. 284 00:15:52,780 --> 00:15:53,340 So. 285 00:15:57,520 --> 00:15:59,740 So what is the attack surface of an application? 286 00:16:00,460 --> 00:16:02,860 The attack surface is any code 287 00:16:02,860 --> 00:16:05,100 the attacker is able to influence through data. 288 00:16:05,300 --> 00:16:07,160 The data structures I've shown you, 289 00:16:07,740 --> 00:16:08,540 .torrent files, 290 00:16:08,860 --> 00:16:09,420 scrape requests, 291 00:16:09,720 --> 00:16:10,240 announce requests, 292 00:16:10,480 --> 00:16:11,660 as well as handshake between peers, 293 00:16:11,880 --> 00:16:14,700 all data that touches BitTorrent code. 294 00:16:15,640 --> 00:16:18,360 Web applications have a very large attack surface, 295 00:16:18,640 --> 00:16:20,360 whereas GUI and desktop applications 296 00:16:20,360 --> 00:16:21,540 are usually, 297 00:16:21,600 --> 00:16:22,280 are very small. 298 00:16:23,380 --> 00:16:25,860 There are also inner workings of the application 299 00:16:25,860 --> 00:16:27,500 that isn't a surface at all, 300 00:16:27,580 --> 00:16:28,720 such as crons, 301 00:16:28,780 --> 00:16:29,260 scheduling, 302 00:16:29,500 --> 00:16:30,960 and logic to support configurations. 303 00:16:31,900 --> 00:16:34,400 It's best to think of an application as a fortress, 304 00:16:34,660 --> 00:16:38,000 but hackers make software into jumping castles. 305 00:16:38,000 --> 00:16:38,760 Oh. 306 00:16:39,240 --> 00:16:39,980 Missing a slide. 307 00:16:41,080 --> 00:16:41,600 No. 308 00:16:41,700 --> 00:16:42,080 There we go. 309 00:16:42,160 --> 00:16:42,440 Fun. 310 00:16:47,800 --> 00:16:48,320 Okay. 311 00:16:50,240 --> 00:16:53,120 Any data that the attacker controls is called tainted. 312 00:16:53,280 --> 00:16:55,280 If a variable containing tainted data 313 00:16:55,280 --> 00:16:56,820 is passed to a sensitive function, 314 00:16:57,120 --> 00:16:58,320 otherwise known as a sync, 315 00:16:58,540 --> 00:16:59,880 then a vulnerability is created. 316 00:17:00,880 --> 00:17:02,020 In this example, 317 00:17:02,220 --> 00:17:04,280 taint is coming from the command line, 318 00:17:04,340 --> 00:17:05,020 using scanf. 319 00:17:05,180 --> 00:17:06,620 We're reading in 100 characters, 320 00:17:06,660 --> 00:17:07,740 and then string copy, 321 00:17:07,740 --> 00:17:10,260 is being used as a, 322 00:17:10,300 --> 00:17:10,980 is a sync, 323 00:17:11,160 --> 00:17:12,700 and that is triggering a buffer overflow. 324 00:17:14,980 --> 00:17:17,980 Another example is in phpMySQL. 325 00:17:18,520 --> 00:17:19,540 In this case, 326 00:17:19,600 --> 00:17:20,800 taint is a get variable, 327 00:17:21,000 --> 00:17:23,040 and MySQL query is a sync. 328 00:17:32,680 --> 00:17:35,480 Input validation is a way of taking tainted data 329 00:17:35,480 --> 00:17:37,420 and making it safe to use with a sync. 330 00:17:37,740 --> 00:17:38,120 In this case, 331 00:17:38,180 --> 00:17:39,020 we're using int val, 332 00:17:39,840 --> 00:17:42,540 passing it to get before entering the query, 333 00:17:42,700 --> 00:17:43,760 making sure that it's a number. 334 00:17:52,640 --> 00:17:53,520 All right. 335 00:17:53,660 --> 00:17:53,960 So, 336 00:17:59,400 --> 00:18:02,260 we did a lot of fuzzing with BitTorrent clients, 337 00:18:05,200 --> 00:18:06,820 and we were looking into 338 00:18:06,820 --> 00:18:09,080 possibly any tools that are already out there 339 00:18:09,080 --> 00:18:10,840 to help us fuzz this application, 340 00:18:10,960 --> 00:18:12,640 to fuzz a variety of applications, 341 00:18:13,040 --> 00:18:15,600 and one of the tools that we ran into was Peach. 342 00:18:17,320 --> 00:18:19,480 Peach is a popular fuzzing framework, 343 00:18:19,720 --> 00:18:24,180 and let me diverge for a little bit here. 344 00:18:24,380 --> 00:18:26,880 What you're looking at is another .torrent file, 345 00:18:27,040 --> 00:18:28,060 displayed as a tree. 346 00:18:29,040 --> 00:18:31,140 What our fuzzing framework does, 347 00:18:31,420 --> 00:18:33,160 our fuzzing framework does not, 348 00:18:33,160 --> 00:18:34,320 is not Peach, 349 00:18:34,520 --> 00:18:35,460 but it uses Peach. 350 00:18:35,660 --> 00:18:36,800 What our fuzzing framework does, 351 00:18:36,800 --> 00:18:40,200 is it traverses this tree with a recursive function, 352 00:18:40,480 --> 00:18:42,380 and whenever it finds a leaf node, 353 00:18:43,800 --> 00:18:46,280 it inserts juicy fuzz data 354 00:18:48,120 --> 00:18:50,620 in place of the original data. 355 00:18:50,760 --> 00:18:51,460 Like, for example, 356 00:18:52,560 --> 00:18:54,860 once we get to the link node 357 00:18:54,860 --> 00:18:56,660 under the info subtree, 358 00:18:56,840 --> 00:18:58,260 we see that it's an integer, 359 00:18:58,480 --> 00:19:01,080 and then we query Peach 360 00:19:01,800 --> 00:19:03,100 for nasty integers 361 00:19:03,520 --> 00:19:05,540 that we can insert into the torrent file 362 00:19:05,540 --> 00:19:06,420 at that point, 363 00:19:06,560 --> 00:19:09,420 and that becomes one fuzz test case. 364 00:19:11,440 --> 00:19:14,220 Just given one torrent file like this, 365 00:19:14,400 --> 00:19:19,840 we can generate over 150,000 fuzzed test cases 366 00:19:20,260 --> 00:19:21,380 by using this method. 367 00:19:22,320 --> 00:19:25,440 I should note that the Peach fuzzing framework 368 00:19:25,440 --> 00:19:26,960 does not have an API 369 00:19:27,540 --> 00:19:29,360 to be able to say something like, 370 00:19:29,580 --> 00:19:32,960 I want an integer that would be great for fuzzing, 371 00:19:33,060 --> 00:19:34,660 or I want a string 372 00:19:34,660 --> 00:19:36,520 that would be great for fuzzing. 373 00:19:36,640 --> 00:19:38,780 So we basically had to use a debugger 374 00:19:38,780 --> 00:19:39,940 to dig into Peach 375 00:19:40,530 --> 00:19:43,380 and find out where we can get that sort of data. 376 00:19:48,320 --> 00:19:49,820 So at this point, 377 00:19:49,940 --> 00:19:51,500 I think it's important to make the distinction 378 00:19:51,500 --> 00:19:52,840 between fuzzing data 379 00:19:53,450 --> 00:19:55,100 versus fuzzing to code routines. 380 00:19:55,380 --> 00:19:59,140 And this is applicable not just to BitTorrent. 381 00:20:02,900 --> 00:20:04,640 The example at the top here 382 00:20:04,660 --> 00:20:08,320 you can see data being fuzzed. 383 00:20:08,480 --> 00:20:10,200 The encoding is correct 384 00:20:10,200 --> 00:20:13,340 for the first two examples under fuzzing data. 385 00:20:13,860 --> 00:20:15,820 However, the data itself 386 00:20:16,660 --> 00:20:18,660 is what's being fuzzed. 387 00:20:18,780 --> 00:20:19,980 In the first case, 388 00:20:20,160 --> 00:20:21,940 we're fuzzing for format string vulnerabilities. 389 00:20:25,240 --> 00:20:29,380 This is in contrast to actually fuzzing the routines 390 00:20:29,380 --> 00:20:31,680 that would decode this data, 391 00:20:32,460 --> 00:20:33,880 this been encoded, 392 00:20:33,880 --> 00:20:35,160 this be encoded data. 393 00:20:35,540 --> 00:20:38,220 And so for the first example 394 00:20:38,220 --> 00:20:39,280 on the bottom of the slide, 395 00:20:39,400 --> 00:20:41,440 you can see that we corrupted the size 396 00:20:41,440 --> 00:20:43,900 of the first string tiny 397 00:20:44,640 --> 00:20:46,140 to see what would happen 398 00:20:46,140 --> 00:20:47,920 when the decode routine comes across 399 00:20:47,920 --> 00:20:50,500 an invalid size of a string. 400 00:20:51,300 --> 00:20:53,440 Below that, it's the same thing, 401 00:20:53,540 --> 00:20:54,260 just vice versa. 402 00:20:56,620 --> 00:20:58,100 One important thing to note 403 00:20:58,100 --> 00:21:01,580 is when you find a memory corruption vulnerability 404 00:21:01,580 --> 00:21:02,720 in a lower level, 405 00:21:02,720 --> 00:21:03,920 in the encoding level, 406 00:21:04,540 --> 00:21:06,520 the vulnerability would appear 407 00:21:06,520 --> 00:21:08,240 in multiple places in the application. 408 00:21:08,900 --> 00:21:09,460 For instance, 409 00:21:10,680 --> 00:21:12,880 B decoding routines exist 410 00:21:12,880 --> 00:21:15,060 when you're opening .torrent files, 411 00:21:15,400 --> 00:21:17,740 when you're communicating with the tracker, 412 00:21:17,940 --> 00:21:19,200 as well as handshakes. 413 00:21:19,360 --> 00:21:21,220 So all three of those interfaces 414 00:21:21,220 --> 00:21:22,960 would be vulnerable to the buffer overflow. 415 00:21:23,240 --> 00:21:24,840 It would be up to the choice of the hacker 416 00:21:24,840 --> 00:21:26,260 where to exploit it. 417 00:21:31,420 --> 00:21:33,860 So our approach to fuzzing 418 00:21:33,860 --> 00:21:34,580 is a little bit different 419 00:21:34,580 --> 00:21:36,280 than Peach's approach to fuzzing, 420 00:21:36,360 --> 00:21:38,040 as you may already have inferred. 421 00:21:39,500 --> 00:21:40,700 What you're seeing here 422 00:21:40,700 --> 00:21:42,400 is what they call a Peach pit file. 423 00:21:45,600 --> 00:21:46,520 Peach is good 424 00:21:46,520 --> 00:21:48,140 because it has a lot of pre-made tools 425 00:21:48,140 --> 00:21:49,660 that are useful for fuzz testing 426 00:21:49,660 --> 00:21:51,680 a variety of different types of software. 427 00:21:52,940 --> 00:21:53,880 Peach is bad 428 00:21:53,880 --> 00:21:55,260 because you still have to know a lot 429 00:21:55,260 --> 00:21:57,080 about the protocol in general, 430 00:21:58,140 --> 00:22:00,660 or the file type that you're fuzzing. 431 00:22:01,140 --> 00:22:02,600 And it can take a lot of time 432 00:22:02,600 --> 00:22:03,980 to track down the documentation, 433 00:22:04,280 --> 00:22:07,480 or if there is no documentation, 434 00:22:07,820 --> 00:22:09,920 you might even have to reverse engineer the protocol 435 00:22:09,920 --> 00:22:11,680 before you can even start this process. 436 00:22:16,720 --> 00:22:18,380 Creating a Peach pit file, 437 00:22:18,940 --> 00:22:20,800 this XML file shown here, 438 00:22:20,920 --> 00:22:22,320 is really time-consuming 439 00:22:22,320 --> 00:22:24,260 and can be somewhat difficult. 440 00:22:24,500 --> 00:22:25,240 And what it does 441 00:22:25,260 --> 00:22:26,620 is what this XML file defines 442 00:22:26,620 --> 00:22:28,760 is it defines the type of data you're fuzzing, 443 00:22:28,920 --> 00:22:30,200 where the data should go, 444 00:22:30,420 --> 00:22:33,960 and how the fuzz test should actually be run. 445 00:22:35,360 --> 00:22:38,220 The biggest reason we specifically can't use Peach 446 00:22:38,220 --> 00:22:41,740 is because it's not good at modeling irregular trees, 447 00:22:42,780 --> 00:22:47,020 such as all of the B-encoded data types 448 00:22:47,020 --> 00:22:48,440 that we've shown you thus far. 449 00:22:49,440 --> 00:22:53,780 It has an ability to represent 450 00:22:54,520 --> 00:22:55,560 binary trees, 451 00:22:55,780 --> 00:22:57,800 but that's hardly ever useful 452 00:22:57,800 --> 00:22:58,800 in the real world. 453 00:23:03,260 --> 00:23:05,180 So, now we're going to talk a little bit 454 00:23:05,180 --> 00:23:06,040 about code coverage. 455 00:23:07,800 --> 00:23:09,060 All of these pictures, 456 00:23:09,360 --> 00:23:10,440 all of these products, rather, 457 00:23:10,560 --> 00:23:11,640 have something in common, 458 00:23:11,760 --> 00:23:13,540 and that is that they're all 459 00:23:13,540 --> 00:23:14,780 safety-critical applications. 460 00:23:18,620 --> 00:23:20,840 Code coverage has likely been used 461 00:23:20,840 --> 00:23:21,860 in the testing process 462 00:23:21,860 --> 00:23:23,260 of each of these products, 463 00:23:23,260 --> 00:23:26,900 even the robot from RoboCop, obviously. 464 00:23:27,500 --> 00:23:30,520 And the reason that is 465 00:23:30,520 --> 00:23:31,660 is because code coverage 466 00:23:32,160 --> 00:23:35,020 is really good at finding certain types of bugs. 467 00:23:35,260 --> 00:23:37,800 It's really good at quantifying 468 00:23:37,800 --> 00:23:39,840 how good your tests are. 469 00:23:40,360 --> 00:23:45,980 And, like, for example, 470 00:23:46,100 --> 00:23:47,380 in safety-critical industries 471 00:23:47,380 --> 00:23:48,780 like the airspace industry, 472 00:23:49,940 --> 00:23:52,320 you have to show that 473 00:23:52,320 --> 00:23:55,140 your code base was thoroughly tested. 474 00:23:55,480 --> 00:23:57,000 And what code coverage does 475 00:23:57,000 --> 00:23:58,160 is it provides visibility 476 00:23:58,160 --> 00:24:01,900 into what your tests are actually doing. 477 00:24:02,160 --> 00:24:04,800 And it also provides a way 478 00:24:04,800 --> 00:24:06,320 to indirectly quantify 479 00:24:06,320 --> 00:24:08,320 the quality of your testing. 480 00:24:09,640 --> 00:24:11,700 This is really important in fuzzing, 481 00:24:11,820 --> 00:24:13,480 because fuzzing can be 482 00:24:13,480 --> 00:24:14,700 like shooting in the dark. 483 00:24:15,040 --> 00:24:16,940 You don't really know 484 00:24:16,940 --> 00:24:19,860 what your fuzz tests are doing as a whole, 485 00:24:20,060 --> 00:24:22,300 and code coverage can be 486 00:24:22,320 --> 00:24:22,740 something that can provide 487 00:24:22,740 --> 00:24:24,020 much-needed visibility 488 00:24:24,020 --> 00:24:26,020 into what fuzz inputs 489 00:24:26,020 --> 00:24:28,180 are actually covering 490 00:24:28,180 --> 00:24:30,080 parts of the application 491 00:24:30,080 --> 00:24:32,060 that you're interested in, 492 00:24:32,120 --> 00:24:33,620 basically your attack surface. 493 00:24:41,120 --> 00:24:43,120 So what is code coverage? 494 00:24:44,600 --> 00:24:46,080 Code coverage is a form 495 00:24:46,080 --> 00:24:47,160 of white-box testing. 496 00:24:47,620 --> 00:24:49,120 It provides visibility 497 00:24:49,120 --> 00:24:50,560 into the code that... 498 00:24:50,560 --> 00:24:53,000 into how the code that you're running 499 00:24:53,000 --> 00:24:53,920 is being executed. 500 00:24:54,580 --> 00:24:56,660 And from an attacker's standpoint, 501 00:24:56,960 --> 00:24:59,500 it allows you to test 502 00:24:59,500 --> 00:25:01,140 more of your attack surface. 503 00:25:01,500 --> 00:25:03,000 It allows you to identify 504 00:25:03,350 --> 00:25:04,160 your attack surface 505 00:25:04,160 --> 00:25:07,000 and attempt to increase 506 00:25:07,560 --> 00:25:08,800 how much you're testing 507 00:25:08,800 --> 00:25:09,800 at that attack surface. 508 00:25:10,220 --> 00:25:12,240 And there's many different types 509 00:25:12,240 --> 00:25:13,320 of code coverage metrics, 510 00:25:13,640 --> 00:25:15,480 and there's many different ways 511 00:25:15,480 --> 00:25:17,600 that you can get code coverage data. 512 00:25:21,460 --> 00:25:22,560 For example, 513 00:25:22,720 --> 00:25:24,520 we have statement coverage, 514 00:25:24,840 --> 00:25:25,780 which is pretty simple. 515 00:25:25,900 --> 00:25:27,500 How many statements were executed? 516 00:25:28,480 --> 00:25:30,060 We have decision coverage, 517 00:25:30,220 --> 00:25:32,620 which is how many control flow structures, 518 00:25:32,760 --> 00:25:33,640 like if statements, 519 00:25:33,860 --> 00:25:35,400 took both their true and false pass. 520 00:25:36,040 --> 00:25:37,580 We have condition coverage, 521 00:25:37,740 --> 00:25:39,420 which is how many conditions 522 00:25:39,420 --> 00:25:41,780 within each decision evaluated 523 00:25:41,780 --> 00:25:42,980 to both true and false. 524 00:25:43,480 --> 00:25:45,000 So in this context, 525 00:25:45,180 --> 00:25:46,400 the condition refers to 526 00:25:46,400 --> 00:25:48,320 a Boolean sub-expression, 527 00:25:49,180 --> 00:25:50,540 say, within an if statement. 528 00:25:50,560 --> 00:25:55,660 And then the new concept here 529 00:25:55,660 --> 00:25:56,700 is sync coverage, 530 00:25:57,440 --> 00:25:59,840 which is how many syncs have I executed. 531 00:26:00,180 --> 00:26:04,280 And we're able to infer this metric 532 00:26:04,280 --> 00:26:05,520 from statement coverage. 533 00:26:05,820 --> 00:26:08,540 So what we do is we look at 534 00:26:08,540 --> 00:26:11,280 the output from a source code analysis program, 535 00:26:11,500 --> 00:26:12,400 like, for example, 536 00:26:12,440 --> 00:26:15,000 the open source source code analysis program RATS, 537 00:26:15,420 --> 00:26:17,520 and determine what percentage 538 00:26:17,520 --> 00:26:20,540 of the syncs that we're interested in 539 00:26:20,560 --> 00:26:23,980 have been executed during a set, 540 00:26:24,120 --> 00:26:26,560 during a run of a specific test 541 00:26:26,560 --> 00:26:27,600 or a set of tests. 542 00:26:29,620 --> 00:26:33,120 And just to provide a graphical example, 543 00:26:33,380 --> 00:26:35,280 this is a statement coverage report 544 00:26:37,160 --> 00:26:38,720 produced by LCOV. 545 00:26:40,720 --> 00:26:43,740 LCOV is a HTML front end 546 00:26:43,740 --> 00:26:45,780 to the GCOV application, 547 00:26:46,320 --> 00:26:48,300 which comes with GCC. 548 00:26:50,780 --> 00:26:53,040 So there's a couple caveats 549 00:26:53,040 --> 00:26:54,980 that you have to be aware of 550 00:26:54,980 --> 00:26:59,080 when trying to interpret code coverage metrics. 551 00:26:59,720 --> 00:27:01,140 One of them is that 552 00:27:01,140 --> 00:27:03,600 just because you've executed code 553 00:27:03,600 --> 00:27:05,300 does not mean that you've tested code. 554 00:27:13,400 --> 00:27:16,740 So in this example, 555 00:27:18,040 --> 00:27:19,120 you can, 556 00:27:19,120 --> 00:27:24,040 with the user input of less than ten characters, 557 00:27:24,240 --> 00:27:26,060 you can execute this code 558 00:27:26,060 --> 00:27:30,440 without having the bug being, 559 00:27:30,500 --> 00:27:32,040 the buffer overflow discovered. 560 00:27:32,520 --> 00:27:33,540 In addition, 561 00:27:33,780 --> 00:27:35,320 in this case, 562 00:27:35,420 --> 00:27:37,160 you're only gonna be able to find 563 00:27:37,160 --> 00:27:39,960 the null free that exists in this code snippet 564 00:27:39,960 --> 00:27:44,240 if the condition is false, 565 00:27:44,420 --> 00:27:47,220 in which case you'd have less than 100% code coverage. 566 00:27:49,120 --> 00:27:51,900 So 100% code coverage really doesn't mean anything. 567 00:27:52,140 --> 00:27:53,720 It's, it's how you interpret these metrics 568 00:27:53,720 --> 00:27:54,620 that makes a difference. 569 00:27:55,180 --> 00:27:55,780 And, 570 00:27:57,000 --> 00:27:57,600 yeah. 571 00:27:58,800 --> 00:27:59,400 Okay. 572 00:28:01,320 --> 00:28:03,440 So this is basically the same example, 573 00:28:04,120 --> 00:28:05,740 except it's with decision coverage. 574 00:28:07,340 --> 00:28:09,800 You can completely execute this code 575 00:28:09,800 --> 00:28:11,280 with these two test cases listed 576 00:28:12,020 --> 00:28:13,720 without ever discovering 577 00:28:13,720 --> 00:28:15,640 the buffer overflow 578 00:28:17,020 --> 00:28:18,800 in the string copy. 579 00:28:20,760 --> 00:28:23,480 So there's a lot of code coverage tools out there. 580 00:28:26,080 --> 00:28:27,760 But there's a lot of problems 581 00:28:27,760 --> 00:28:29,600 with the code coverage tools that are out there. 582 00:28:32,740 --> 00:28:34,420 A lot of them don't, 583 00:28:34,420 --> 00:28:36,160 are short on the list of features. 584 00:28:37,280 --> 00:28:39,780 They don't integrate source code analysis, 585 00:28:40,040 --> 00:28:41,000 which is really useful, 586 00:28:41,180 --> 00:28:43,340 whether you're a software tester or an attacker. 587 00:28:43,940 --> 00:28:46,200 They don't allow you to add, subtract, 588 00:28:46,320 --> 00:28:47,880 or compare coverage reports. 589 00:28:47,880 --> 00:28:50,700 They don't allow you to automate the process. 590 00:28:51,180 --> 00:28:54,740 And this is really a big problem. 591 00:28:56,020 --> 00:28:59,200 So how can we use code coverage with fuzzing? 592 00:29:02,760 --> 00:29:04,360 During DEF CON 15, 593 00:29:05,220 --> 00:29:10,040 Charlie Miller came up with a pretty cool concept 594 00:29:10,040 --> 00:29:15,580 that says you keep adding smart fuzz templates 595 00:29:15,580 --> 00:29:17,680 until the effect, 596 00:29:17,880 --> 00:29:19,940 the cumulative coverage does not increase. 597 00:29:20,460 --> 00:29:22,840 And we built a tool to automate this 598 00:29:22,840 --> 00:29:27,000 so that we can have a set of smart fuzz templates 599 00:29:27,560 --> 00:29:31,160 to base all of our other fuzz test cases on. 600 00:29:33,820 --> 00:29:36,560 And we also integrated source code analysis 601 00:29:36,560 --> 00:29:37,480 into this tool 602 00:29:37,480 --> 00:29:39,040 so that we could have an idea 603 00:29:39,040 --> 00:29:41,760 of what dangerous function calls were 604 00:29:41,760 --> 00:29:44,120 or were not being executed during our fuzzing. 605 00:29:46,480 --> 00:29:47,160 So... 606 00:29:47,160 --> 00:29:48,820 I'm going to give it to Mike from here. 607 00:29:53,320 --> 00:29:54,700 Charlie Miller is a doctor. 608 00:29:54,780 --> 00:29:55,420 He has a doctoral. 609 00:29:57,500 --> 00:29:58,780 Man, I would go to any... 610 00:29:58,780 --> 00:30:02,080 But he actually doesn't use doctorate in his name. 611 00:30:02,140 --> 00:30:02,740 And I asked him why. 612 00:30:02,900 --> 00:30:05,600 And it said because it was too pretentious. 613 00:30:05,680 --> 00:30:06,480 I have to agree with him. 614 00:30:07,780 --> 00:30:10,820 But hey, if there was a talk by Dr. Doom, 615 00:30:11,400 --> 00:30:12,700 even if it was a cooking talk, 616 00:30:12,820 --> 00:30:14,960 I would be there cooking with Dr. Doom. 617 00:30:18,280 --> 00:30:19,080 Oh, sorry. 618 00:30:19,320 --> 00:30:20,120 Let's skip this. 619 00:30:20,440 --> 00:30:20,880 Anyway. 620 00:30:22,140 --> 00:30:25,740 And I'm going to show you some smash stacks. 621 00:30:26,100 --> 00:30:26,280 Here. 622 00:30:28,520 --> 00:30:28,960 Yeah. 623 00:30:32,660 --> 00:30:34,020 Oh, no, we lost the parrot. 624 00:30:34,460 --> 00:30:35,100 All right. 625 00:30:35,500 --> 00:30:38,640 So this is the fuzzing application. 626 00:30:38,960 --> 00:30:43,160 I've set it to a very special place in the test cases. 627 00:30:43,340 --> 00:30:44,220 And I hit enter. 628 00:30:44,640 --> 00:30:45,540 That's a stack trace. 629 00:30:45,740 --> 00:30:46,680 And more to come. 630 00:30:47,240 --> 00:30:49,500 What it's doing is actually it's multi-threaded. 631 00:30:49,520 --> 00:30:51,000 We have about 32 threads running. 632 00:30:53,880 --> 00:30:55,280 Fucking segfault, bitches. 633 00:30:56,620 --> 00:30:58,500 This hit at like 2 a.m. 634 00:30:58,560 --> 00:30:59,900 I did this on purpose. 635 00:31:00,220 --> 00:31:01,380 None of them are crashing. 636 00:31:01,520 --> 00:31:02,300 But a lot of them are. 637 00:31:03,260 --> 00:31:07,320 I was screaming and jumping up and down with excitement. 638 00:31:07,680 --> 00:31:12,800 And the apartment above me, they're hitting the floor. 639 00:31:12,880 --> 00:31:13,440 Quiet down! 640 00:31:14,320 --> 00:31:15,160 Just like... 641 00:31:18,800 --> 00:31:19,320 Anyway. 642 00:31:20,860 --> 00:31:21,380 Anyway. 643 00:31:21,660 --> 00:31:22,780 Got to call all Python. 644 00:31:23,840 --> 00:31:24,360 Anyway. 645 00:31:24,540 --> 00:31:28,120 Thank you for seeing our talk. 646 00:31:28,520 --> 00:31:30,700 This is the end of BitTorrent Hacks. 647 00:31:30,820 --> 00:31:31,400 Thank you.