1 00:00:00,620 --> 00:00:07,900 Okay, it's probably time to get started. Can everybody hear me okay? No? Okay. 2 00:00:09,720 --> 00:00:15,540 Okay, my name is Michael Rash. I'm the CTO of a network security company called Solirix. 3 00:00:16,360 --> 00:00:23,120 This talk is going to concentrate on the concept of running single packet authorization over the Tor network 4 00:00:23,120 --> 00:00:30,260 and why that might be an interesting thing for you to look at for providing an additional layer of security for services such as SSH. 5 00:00:33,980 --> 00:00:40,280 By the way, please interrupt me at any time if you have any questions. I don't mind being interrupted, so fire away. 6 00:00:45,540 --> 00:00:50,440 So, I'm going to start with a brief overview of Tor. I'm sure nearly all of you are familiar with it. 7 00:00:51,260 --> 00:00:52,760 We'll move from there into... 8 00:00:53,120 --> 00:00:57,240 Talking about default drop packet filters and single packet authorization, 9 00:00:57,960 --> 00:01:05,840 why that provides an important mechanism for protecting long-running services such as SSH or OpenVPN. 10 00:01:06,900 --> 00:01:11,260 Talk a little bit about SPA over Tor that will comprise the bulk of the presentation. 11 00:01:11,980 --> 00:01:16,500 And I'm leasing a new version of FWNOP at this conference. 12 00:01:18,300 --> 00:01:20,960 FWNOP stands for the Firewall Knock Operator. 13 00:01:21,060 --> 00:01:23,100 I introduced that software two years ago. 14 00:01:23,120 --> 00:01:24,800 For the first time at this conference. 15 00:01:25,080 --> 00:01:31,380 It was the first port knocking implementation that combined encrypted port knocking with passive OS fingerprinting. 16 00:01:31,700 --> 00:01:36,660 However, port knocking is an outdated protocol next to single packet authorization. 17 00:01:37,120 --> 00:01:43,100 The default mechanism for passive authorization is now single packet authorization in FWNOP. 18 00:01:43,320 --> 00:01:50,760 So, 0.9.7 is available for free on my website, released under the GPL, which is cipherdyne.org. 19 00:01:51,920 --> 00:01:57,200 And I'm going to end up with a live demonstration and hopefully leave time for questions. 20 00:02:00,580 --> 00:02:04,220 So, Tor. Tor is a really interesting project. 21 00:02:04,600 --> 00:02:14,800 It is a network of onion routers that makes it very difficult to perform traffic analysis of TCP-based traffic. 22 00:02:15,080 --> 00:02:19,280 It constructs a cloud of routers across the internet. 23 00:02:19,280 --> 00:02:30,320 With the unique characteristic that no individual router in that cloud knows the full path of a virtual circuit that's created for each individual TCP connection. 24 00:02:31,820 --> 00:02:38,880 So, each individual router only knows its immediate upstream hop and its immediate downstream hop. 25 00:02:39,180 --> 00:02:46,440 So, anyone who is actually trying to know where traffic is destined for or comes from 26 00:02:46,440 --> 00:02:49,780 is not really able to determine that. 27 00:02:50,820 --> 00:02:57,420 There are attacks wherever if someone is able to watch every single entry and exit router out of this network. 28 00:02:58,660 --> 00:03:01,660 Based on some timing attacks, you could get some information. 29 00:03:01,880 --> 00:03:09,940 However, in general, the strength of the Tor router cloud is increased by the number of nodes that are running on the internet that are running Tor. 30 00:03:10,320 --> 00:03:13,460 And at last count, I think it's in the several thousand. 31 00:03:13,720 --> 00:03:15,140 Somebody can correct me on that. 32 00:03:15,140 --> 00:03:17,380 But it's getting more popular all the time. 33 00:03:19,860 --> 00:03:24,800 It's compatible with any application that can speak SOX or with SOX support. 34 00:03:25,320 --> 00:03:28,140 It uses the TCP protocol for transport. 35 00:03:29,240 --> 00:03:35,520 And traffic, of course, is encrypted between individual router nodes within the Tor network. 36 00:03:37,760 --> 00:03:43,200 So, visually, Alice wishes to talk to a server that Bob is running. 37 00:03:44,520 --> 00:03:49,160 Alice will make a connection to an entry router into the Tor network. 38 00:03:50,220 --> 00:03:54,000 And once the connection goes into the established state 39 00:03:54,000 --> 00:03:57,380 and only after the entry point connection goes into the established state 40 00:03:57,380 --> 00:04:00,080 will a virtual circuit actually be constructed. 41 00:04:00,480 --> 00:04:06,100 That established characteristic is important for the remainder of the talk. 42 00:04:06,200 --> 00:04:07,560 And we'll talk about that a little bit more later. 43 00:04:08,120 --> 00:04:12,140 But the links between Alice and the entry router are unencrypted. 44 00:04:12,140 --> 00:04:15,000 From there, the rest of the traffic is completely encrypted 45 00:04:15,000 --> 00:04:16,700 as it's bounced around through the router cloud. 46 00:04:17,060 --> 00:04:20,700 And finally, it hits an exit router, which is randomly selected. 47 00:04:21,080 --> 00:04:25,220 And then traffic is unencrypted for eventual communication 48 00:04:25,220 --> 00:04:27,520 to the actual server that Bob is running. 49 00:04:28,680 --> 00:04:29,660 Nice concept. 50 00:04:31,480 --> 00:04:34,220 So, single packet authorization, what is it? 51 00:04:35,180 --> 00:04:39,060 It is a mechanism by which default drop packet filters are used 52 00:04:39,060 --> 00:04:41,380 to minimize execution paths 53 00:04:41,380 --> 00:04:44,460 that an attacker can permute. 54 00:04:44,760 --> 00:04:47,880 So, if I'm running a default drop packet filter 55 00:04:47,880 --> 00:04:52,840 so that nobody can even connect to SSH, say, running on a system, 56 00:04:53,060 --> 00:04:57,520 then they are fundamentally unable to interact 57 00:04:57,520 --> 00:05:00,780 with any of the user land functions in that daemon 58 00:05:00,780 --> 00:05:02,520 that may potentially contain vulnerabilities. 59 00:05:03,280 --> 00:05:06,340 Every function has a certain non-zero probability 60 00:05:06,340 --> 00:05:08,300 of containing some vulnerability. 61 00:05:08,680 --> 00:05:11,360 Of course, SSH being written by some of the best computers 62 00:05:11,380 --> 00:05:14,100 or security programmers around has been very good 63 00:05:14,100 --> 00:05:16,680 about not having vulnerabilities in general. 64 00:05:16,840 --> 00:05:17,980 However, they do happen. 65 00:05:18,540 --> 00:05:22,120 And I, for one, do not let arbitrary IP addresses connect 66 00:05:22,120 --> 00:05:24,980 to my SSH daemon for that reason. 67 00:05:25,100 --> 00:05:27,660 I personally have had a system hacked via SSH once, 68 00:05:28,180 --> 00:05:30,400 and I vowed never to let that happen again. 69 00:05:33,640 --> 00:05:36,080 Authentication and authorization data that's sent 70 00:05:36,080 --> 00:05:40,080 by single packet authorization is monitored passively, 71 00:05:40,080 --> 00:05:41,740 completely by libPCAP, 72 00:05:41,940 --> 00:05:45,840 although FWNOP also supports the ulogd PCAP writer 73 00:05:45,840 --> 00:05:48,900 if you prefer getting a little bit more esoteric 74 00:05:48,900 --> 00:05:49,920 with net filters capabilities. 75 00:05:51,520 --> 00:05:54,020 I should mention that single packet authorization 76 00:05:54,020 --> 00:05:55,380 is a little bit of a misnomer. 77 00:05:55,600 --> 00:05:59,860 It includes both authentication and authorization capabilities, 78 00:06:00,180 --> 00:06:00,960 which are different. 79 00:06:01,980 --> 00:06:03,880 Authentication has to do with trying to verify 80 00:06:03,880 --> 00:06:06,160 whether or not an entity is who it claims to be, 81 00:06:06,280 --> 00:06:08,780 whereas authorization tries to determine 82 00:06:08,780 --> 00:06:12,580 whether or not an entity is allowed to perform an action. 83 00:06:14,580 --> 00:06:17,780 There is no traditional server in the FWNOP architecture 84 00:06:17,780 --> 00:06:19,160 in the Berkeley socket since. 85 00:06:19,780 --> 00:06:21,460 All the communication is done, 86 00:06:21,640 --> 00:06:24,820 or the packet data is collected passively on the server side. 87 00:06:27,580 --> 00:06:33,740 So, you know, it kind of is interesting that if you might ask, 88 00:06:33,820 --> 00:06:35,520 well, how do you really secure a system, 89 00:06:35,720 --> 00:06:38,760 and assuming that you're not running a web server 90 00:06:38,780 --> 00:06:39,500 or a wireless device driver, 91 00:06:39,760 --> 00:06:44,080 and you're being monitored or attacked by David Manor 92 00:06:44,080 --> 00:06:45,040 or Johnny Cash, 93 00:06:45,300 --> 00:06:46,840 which is a really interesting talk at Black Hat. 94 00:06:47,500 --> 00:06:48,740 I personally, by the way, 95 00:06:48,780 --> 00:06:51,660 am running a kernel that does not have even the driver compiled 96 00:06:51,660 --> 00:06:55,700 for my wireless device driver, my wireless card. 97 00:06:56,600 --> 00:06:58,180 But what's the closest we can get 98 00:06:58,180 --> 00:06:59,820 to Marcus Random's perfect firewall? 99 00:07:00,160 --> 00:07:02,400 I mean, sure, you can cut the ethernet cable to your computer, 100 00:07:02,560 --> 00:07:05,300 but then it's not very functional on the network either, right? 101 00:07:05,360 --> 00:07:08,760 So the next best thing is a default drop packet file. 102 00:07:08,780 --> 00:07:09,000 It's a default drop packet filter. 103 00:07:09,460 --> 00:07:10,900 Intercepting packets within the kernel 104 00:07:11,540 --> 00:07:13,300 is pretty much the lowest level 105 00:07:13,300 --> 00:07:17,080 that you can possibly restrict an attacker's ability 106 00:07:17,080 --> 00:07:19,000 to communicate with a user LAN daemon. 107 00:07:19,180 --> 00:07:21,700 So let's try to build a security mechanism 108 00:07:21,700 --> 00:07:23,840 that uses a default drop packet filter fundamentally 109 00:07:24,540 --> 00:07:27,060 to make it difficult to detect that a service is even running. 110 00:07:29,060 --> 00:07:32,120 So some quick characteristics of single packet authorization. 111 00:07:32,720 --> 00:07:35,120 Up to the minimum MTU of data can be sent 112 00:07:35,120 --> 00:07:38,760 between the SBA client address 113 00:07:38,780 --> 00:07:39,580 and the SBA server. 114 00:07:39,960 --> 00:07:43,300 That makes it possible to use encryption algorithms 115 00:07:43,300 --> 00:07:46,300 such as the El Gamal cipher in GNU PG, 116 00:07:46,620 --> 00:07:50,520 which has, I mean, you can have relatively large key sizes 117 00:07:50,520 --> 00:07:52,080 compared to symmetric algorithms. 118 00:07:52,440 --> 00:07:55,220 I use a 2048-bit GPG key. 119 00:07:55,440 --> 00:07:57,480 That is fundamentally incompatible 120 00:07:57,480 --> 00:08:00,820 with transmission over a port-knocking scheme 121 00:08:00,820 --> 00:08:04,920 because the data transmission rate is so error-prone and slow. 122 00:08:07,160 --> 00:08:10,240 An additional consequence of the larger payload 123 00:08:10,240 --> 00:08:14,340 is that replay attacks can be elegantly thwarted. 124 00:08:14,960 --> 00:08:17,320 If someone is able to monitor the SBA packet 125 00:08:17,320 --> 00:08:19,120 from the SBA client to the server, 126 00:08:19,300 --> 00:08:20,740 it does them absolutely no good. 127 00:08:20,940 --> 00:08:23,480 At least, that is, they can, of course, 128 00:08:23,560 --> 00:08:25,480 try cryptanalysis of that packet, 129 00:08:25,560 --> 00:08:26,940 but then you're on pretty solid ground 130 00:08:26,940 --> 00:08:29,580 because a lot of research has gone into making sure 131 00:08:29,580 --> 00:08:32,320 that encryption algorithms are implemented well 132 00:08:32,320 --> 00:08:34,440 and resist that kind of analysis. 133 00:08:34,920 --> 00:08:37,400 The point is that every SBA packet includes 134 00:08:37,920 --> 00:08:40,000 16 bytes worth of random data, 135 00:08:41,680 --> 00:08:43,420 and on the server side, 136 00:08:43,680 --> 00:08:46,840 the server side tracks all the MD5 sums 137 00:08:46,840 --> 00:08:48,800 of the valid encrypted packets. 138 00:08:49,080 --> 00:08:52,520 If a new packet is seen that has the same MD5 sum 139 00:08:52,520 --> 00:08:54,740 as any of the previous packets that have been seen, 140 00:08:54,880 --> 00:08:56,280 then no action is taken whatsoever 141 00:08:56,280 --> 00:08:57,840 and an alert is sent. 142 00:09:00,040 --> 00:09:04,360 By default, SBA uses UDP for transport. 143 00:09:05,140 --> 00:09:06,900 You will note that it's a little bit different 144 00:09:06,900 --> 00:09:08,880 from the Tor requirement of using TCP, 145 00:09:09,640 --> 00:09:14,460 but if you are using SBA without using Tor, 146 00:09:14,680 --> 00:09:16,300 you can spoof the packets 147 00:09:16,300 --> 00:09:18,180 because only a single packet is sent. 148 00:09:18,580 --> 00:09:20,000 That's kind of a nice consequence. 149 00:09:33,200 --> 00:09:33,760 So... 150 00:09:34,920 --> 00:09:36,080 Just to drive the point home, 151 00:09:36,780 --> 00:09:38,980 SBA and port knocking are similar 152 00:09:39,760 --> 00:09:41,560 in the sense that they both use 153 00:09:41,560 --> 00:09:42,800 default drop packet filters, 154 00:09:43,060 --> 00:09:47,140 and they can also use timeouts on accept rules 155 00:09:47,140 --> 00:09:48,800 that are added to your net filter policy 156 00:09:48,800 --> 00:09:51,220 but allow TCP connections to remain established 157 00:09:51,840 --> 00:09:53,820 by using a state tracking mechanism. 158 00:09:54,820 --> 00:09:57,240 But that's where the differences pretty much end. 159 00:09:58,240 --> 00:10:01,020 From there, SBA solves the replay problem, 160 00:10:01,180 --> 00:10:03,880 whereas there are mechanisms to attempt to do this 161 00:10:03,880 --> 00:10:04,600 in port knocking schemes, 162 00:10:04,900 --> 00:10:08,440 but they generally require either successive iterations 163 00:10:08,440 --> 00:10:10,800 of a hashing function as an S-key style authentication 164 00:10:10,800 --> 00:10:14,160 or time synchronization, things of that type, 165 00:10:14,320 --> 00:10:15,700 but they require keeping state 166 00:10:15,700 --> 00:10:17,300 on both the client and the server side, 167 00:10:17,500 --> 00:10:20,160 and that is generally not all that scalable. 168 00:10:21,960 --> 00:10:24,220 SBA is compatible with asymmetric ciphers. 169 00:10:25,340 --> 00:10:27,820 It cannot be busted or broken 170 00:10:27,820 --> 00:10:29,940 by trivial sequence busting attacks. 171 00:10:30,260 --> 00:10:31,840 If I'm an attacker and I can monitor 172 00:10:31,840 --> 00:10:33,860 a port knocking sequence in SBA, 173 00:10:33,880 --> 00:10:36,500 in route to a port knocking server, 174 00:10:37,280 --> 00:10:40,000 I can simply just spoof a packet 175 00:10:40,000 --> 00:10:43,340 to the same port as the previous packet was sent 176 00:10:43,340 --> 00:10:45,100 and thereby bust the sequence 177 00:10:45,100 --> 00:10:47,260 because now there's an additional port in there 178 00:10:47,260 --> 00:10:50,240 that breaks any encryption scheme. 179 00:10:50,460 --> 00:10:51,660 Encryption schemes don't like it 180 00:10:51,660 --> 00:10:54,080 when there's bogus data injected inside. 181 00:10:54,180 --> 00:10:57,420 They don't decrypt very well in that case. 182 00:10:57,680 --> 00:10:59,880 And, of course, port knocking implementations 183 00:11:00,780 --> 00:11:03,160 look like port scans when they're sent over the wire. 184 00:11:03,160 --> 00:11:06,460 An intermediate IDS has no way to be able to tell 185 00:11:06,460 --> 00:11:09,240 that this sequence of connections to ports 186 00:11:09,240 --> 00:11:10,900 is not actually a port scan. 187 00:11:15,200 --> 00:11:17,000 So in the SBA architecture, 188 00:11:18,220 --> 00:11:20,200 we will see how this gets changed. 189 00:11:20,340 --> 00:11:22,160 We run the packets over the Tor network, 190 00:11:22,520 --> 00:11:25,020 but essentially, you know, who can sniff what? 191 00:11:25,740 --> 00:11:30,300 We have an SBA client here at the upper left 192 00:11:31,120 --> 00:11:32,540 who wishes to authenticate. 193 00:11:33,340 --> 00:11:36,400 To the SBA server that's running here on this brick wall, 194 00:11:36,560 --> 00:11:39,680 this firewall, this is net filter in the FWNOPS case. 195 00:11:41,400 --> 00:11:43,020 And it is possible, 196 00:11:43,100 --> 00:11:45,700 because we are just sending a single packet across the wire, 197 00:11:45,800 --> 00:11:48,520 that we could send the packet to this dummy target IP. 198 00:11:49,220 --> 00:11:52,540 But as long as the FWNOPS sniffer that's running here, 199 00:11:52,700 --> 00:11:54,780 which is essentially an authenticating Ethernet sniffer, 200 00:11:54,980 --> 00:11:57,040 can monitor that packet in route, 201 00:11:57,180 --> 00:11:59,820 the firewall ruleset can be changed here 202 00:11:59,820 --> 00:12:02,860 to allow the actual connection to come from the SBA client. 203 00:12:03,160 --> 00:12:05,780 An attacker, of course, can monitor any of these communications, 204 00:12:07,940 --> 00:12:09,360 but, as I said before, 205 00:12:09,580 --> 00:12:13,080 replay attacks are not useful in the SBA case. 206 00:12:13,980 --> 00:12:15,340 Okay, so just one... 207 00:12:15,340 --> 00:12:18,220 So this sort of concludes the SBA portion, 208 00:12:18,740 --> 00:12:21,820 that is, before we get into talking about Tor. 209 00:12:22,020 --> 00:12:23,480 But I wanted to mention something. 210 00:12:24,440 --> 00:12:26,800 There seems to be some confusion out there. 211 00:12:26,860 --> 00:12:29,760 Some people think that SBA may be sort of 212 00:12:29,760 --> 00:12:31,580 along the lines of security through obscurity. 213 00:12:31,820 --> 00:12:32,960 Well, I would say that's... 214 00:12:33,720 --> 00:12:36,980 SBA is no more security through obscurity 215 00:12:36,980 --> 00:12:41,700 than using passwords, shared keys, or GPG private keys. 216 00:12:42,560 --> 00:12:43,860 SBA is additive. 217 00:12:44,140 --> 00:12:45,840 It's not as though we're using SBA 218 00:12:45,840 --> 00:12:47,820 as the complete security mechanism 219 00:12:47,820 --> 00:12:49,780 for protocols such as SSH. 220 00:12:50,360 --> 00:12:52,080 It is just an additional layer 221 00:12:52,080 --> 00:12:55,740 to make it so that if somebody is using Nmap out there 222 00:12:55,740 --> 00:12:58,160 and trying to detect that SSH is running on a system, 223 00:12:58,340 --> 00:13:00,360 they are fundamentally unable to tell 224 00:13:00,360 --> 00:13:01,780 that SSH is actually running. 225 00:13:01,780 --> 00:13:03,540 It is not the complete mechanism. 226 00:13:03,780 --> 00:13:05,420 It is just an additional mechanism 227 00:13:05,420 --> 00:13:07,740 to raise the bar just a little bit. 228 00:13:08,820 --> 00:13:10,220 Jay Beal wrote a good paper 229 00:13:10,570 --> 00:13:12,460 on why security through obscurity 230 00:13:12,460 --> 00:13:14,000 is not what many people might think. 231 00:13:14,420 --> 00:13:16,000 If you're interested in reading that, 232 00:13:16,100 --> 00:13:17,020 I highly recommend it. 233 00:13:17,080 --> 00:13:17,800 It's at the link below. 234 00:13:19,600 --> 00:13:20,600 Okay, so... 235 00:13:23,680 --> 00:13:25,400 Single packet authorization over Tor. 236 00:13:27,000 --> 00:13:29,600 Well, you know, why not always 237 00:13:29,600 --> 00:13:31,660 just run SSH connections over Tor? 238 00:13:31,780 --> 00:13:33,300 You can do this, of course, 239 00:13:33,340 --> 00:13:36,560 and that provides an additional layer of protection 240 00:13:36,560 --> 00:13:38,540 in the sense that packet traffic analysis 241 00:13:38,540 --> 00:13:39,700 is now difficult to do. 242 00:13:39,780 --> 00:13:43,780 You can't detect that you're, as an attacker, 243 00:13:43,940 --> 00:13:45,020 that you're able to see 244 00:13:45,780 --> 00:13:47,520 where an SSH connection is going 245 00:13:47,520 --> 00:13:48,540 or where it's coming from. 246 00:13:49,140 --> 00:13:51,640 However, an attacker can also run connections, 247 00:13:51,840 --> 00:13:55,020 make connections over the Tor network as well. 248 00:13:55,680 --> 00:13:59,160 We still need to have a method 249 00:13:59,160 --> 00:14:00,920 of restricting arbitrary connections 250 00:14:00,920 --> 00:14:04,480 to SSH with a default drop packet filter, 251 00:14:04,680 --> 00:14:06,760 and that implies that you still want SBA. 252 00:14:07,080 --> 00:14:08,560 So what we want to try to do 253 00:14:08,560 --> 00:14:12,240 is make SBA compatible with the Tor network 254 00:14:12,240 --> 00:14:13,480 in some way. 255 00:14:14,660 --> 00:14:16,360 Does anyone have any questions so far? 256 00:14:19,080 --> 00:14:20,020 Oh, okay. 257 00:14:21,000 --> 00:14:24,820 Okay, so Tor uses TCP for transport. 258 00:14:25,240 --> 00:14:27,340 This has some implications. 259 00:14:28,700 --> 00:14:30,900 We cannot fundamentally integrate 260 00:14:30,920 --> 00:14:32,620 or influence how TCP stacks 261 00:14:32,620 --> 00:14:35,240 communicate over the network. 262 00:14:35,460 --> 00:14:37,820 Tor is written on top of TCP, 263 00:14:39,060 --> 00:14:41,020 and a consequence of that 264 00:14:41,020 --> 00:14:42,560 is that we can passively fingerprint 265 00:14:42,560 --> 00:14:44,460 operating system stacks 266 00:14:44,460 --> 00:14:46,500 that are actually running Tor, 267 00:14:46,640 --> 00:14:48,200 and we'll have a slide on this a little bit later. 268 00:14:50,820 --> 00:14:54,700 Another consequence is that if you use Nmap 269 00:14:56,460 --> 00:14:58,200 to try to connect, 270 00:14:58,540 --> 00:15:00,900 to send a scan over the Tor network 271 00:15:00,920 --> 00:15:02,140 you know, what do you get? 272 00:15:02,300 --> 00:15:03,840 Well, if you're running as root, 273 00:15:03,960 --> 00:15:05,220 the default Nmap scanning method 274 00:15:05,220 --> 00:15:07,080 is a SIN scan or a half-open scan, 275 00:15:08,180 --> 00:15:10,780 and if you try to send that over a SOCAT proxy 276 00:15:10,780 --> 00:15:12,320 that is interfaced with Tor, 277 00:15:13,220 --> 00:15:16,520 you will notice that a SIN scan by itself 278 00:15:16,520 --> 00:15:19,180 never actually gets a virtual circuit 279 00:15:19,180 --> 00:15:20,860 set up through Tor at all. 280 00:15:21,180 --> 00:15:23,720 The virtual circuit is only established 281 00:15:23,720 --> 00:15:26,620 after the connection to the entry point router 282 00:15:26,620 --> 00:15:28,380 goes into the established state. 283 00:15:29,180 --> 00:15:32,080 You can get a virtual circuit to be set up 284 00:15:32,080 --> 00:15:34,720 if you use the normal TCP connect method 285 00:15:34,720 --> 00:15:36,200 or dash S capital T, 286 00:15:37,740 --> 00:15:39,540 but presumably if you're running 287 00:15:39,540 --> 00:15:40,740 a port knocking implementation, 288 00:15:41,240 --> 00:15:42,500 you're not actually going to have 289 00:15:42,500 --> 00:15:43,880 a whole bunch of servers listening 290 00:15:43,880 --> 00:15:46,220 for all the ports that you're actually connecting to. 291 00:15:46,280 --> 00:15:48,260 You're just passively transmitting this data across 292 00:15:48,260 --> 00:15:50,220 and that is passively monitoring it. 293 00:15:50,720 --> 00:15:52,360 And the consequence is that 294 00:15:52,360 --> 00:15:54,820 when each of those virtual circuits 295 00:15:54,820 --> 00:15:56,160 tries to connect to that port 296 00:15:56,160 --> 00:15:57,300 that you're trying to scan, 297 00:15:58,380 --> 00:16:00,420 nothing will be, nothing will respond. 298 00:16:00,800 --> 00:16:02,600 In other words, a reset will not be sent 299 00:16:02,600 --> 00:16:05,020 because there's no accessible server there. 300 00:16:05,540 --> 00:16:08,980 And so Tor will retry and set up a new virtual circuit 301 00:16:08,980 --> 00:16:09,980 with a new exit router, 302 00:16:10,240 --> 00:16:12,880 which means that your port knock sequence 303 00:16:12,880 --> 00:16:15,460 will look as though it's coming across from, 304 00:16:15,680 --> 00:16:17,840 you know, essentially arbitrarily, 305 00:16:17,880 --> 00:16:20,140 you know, as many different exit routers 306 00:16:20,140 --> 00:16:21,480 as you're sending virtual, 307 00:16:21,660 --> 00:16:23,380 as you're setting up virtual connections to. 308 00:16:24,700 --> 00:16:27,460 That is not very good for trying to guarantee 309 00:16:27,460 --> 00:16:31,080 that you're able to send a port knock sequence 310 00:16:31,080 --> 00:16:32,700 from a single IP address. 311 00:16:37,440 --> 00:16:44,080 Okay, so Tor using TCP for transport 312 00:16:44,080 --> 00:16:46,580 means that we must have bidirectional communication 313 00:16:47,320 --> 00:16:52,320 for data to be transmitted across the network. 314 00:16:53,840 --> 00:16:56,400 So that means that technically, 315 00:16:56,400 --> 00:16:59,300 this is incompatible fundamentally 316 00:16:59,300 --> 00:17:01,840 with the idea of single packet authorization. 317 00:17:02,300 --> 00:17:04,820 There are going to be at least, you know, 318 00:17:04,840 --> 00:17:07,520 you have three packets for the TCP three-way handshake, 319 00:17:07,740 --> 00:17:10,260 followed by a packet to send the actual data, 320 00:17:10,980 --> 00:17:16,280 followed by the FIN to close down the TCP session. 321 00:17:16,860 --> 00:17:20,160 And we can't also just simply include SBA data 322 00:17:20,160 --> 00:17:22,320 within a SYN packet and send it across the network. 323 00:17:22,640 --> 00:17:26,240 Recall that we can't permute how the TCP stack 324 00:17:26,400 --> 00:17:28,520 on any of those operating systems are actually functioning. 325 00:17:28,740 --> 00:17:30,340 Tor is built completely on top of TCP. 326 00:17:30,720 --> 00:17:36,320 We have no control over how each of the individual Tor routers 327 00:17:36,320 --> 00:17:38,880 are actually sending packet data across the wire. 328 00:17:40,560 --> 00:17:44,400 So the fundamental consequence is that we must have 329 00:17:44,400 --> 00:17:47,080 a real TCP server to which to connect 330 00:17:47,080 --> 00:17:50,180 on the FWNOP daemon side. 331 00:17:51,240 --> 00:17:54,760 So default drop can't apply to that server, clearly. 332 00:17:54,760 --> 00:18:00,500 We must allow connections to some TCP server 333 00:18:00,500 --> 00:18:04,060 so that we can actually get the SBA data across the Tor network. 334 00:18:05,420 --> 00:18:10,920 So if you'll allow me the, I guess, the indiscretion sort of, 335 00:18:11,000 --> 00:18:14,560 or the leeway to say that we're sending 336 00:18:14,560 --> 00:18:16,840 single packet authorization data over Tor 337 00:18:16,840 --> 00:18:20,060 and it's going to involve multiple packets, 338 00:18:20,340 --> 00:18:21,720 then we can proceed. 339 00:18:23,020 --> 00:18:24,740 So how can we do this in a way 340 00:18:24,760 --> 00:18:26,180 that enhances security? 341 00:18:27,120 --> 00:18:30,180 So in the 0.9.7 release of FWNOP, 342 00:18:30,380 --> 00:18:34,900 there's a new mode that allows a TCP server 343 00:18:34,900 --> 00:18:36,680 to be instantiated by FWNOP 344 00:18:36,680 --> 00:18:38,400 with the following characteristics. 345 00:18:39,040 --> 00:18:40,040 It listens on a high port, 346 00:18:42,220 --> 00:18:44,140 specifically 62201, which is the same port 347 00:18:44,140 --> 00:18:47,220 that the UDP communication normally takes place over. 348 00:18:48,440 --> 00:18:49,580 It runs as nobody. 349 00:18:49,900 --> 00:18:51,540 It does a bind, a listen, 350 00:18:51,540 --> 00:18:55,860 and then it loops over successive accept and receive calls 351 00:18:55,860 --> 00:18:57,060 with no other code. 352 00:18:57,940 --> 00:19:01,260 So the consequence is that this server 353 00:19:01,260 --> 00:19:04,940 has a lot less complexity than a more complex server, 354 00:19:05,040 --> 00:19:05,960 such as SSH. 355 00:19:07,940 --> 00:19:09,700 So I feel more comfortable 356 00:19:09,700 --> 00:19:12,340 in at least allowing people to connect to this server 357 00:19:13,020 --> 00:19:17,540 instead of seeing that SSH is actually running. 358 00:19:21,540 --> 00:19:24,100 The data acquired on the FWNOP daemon side 359 00:19:24,100 --> 00:19:27,940 is still acquired passively via libPCAP. 360 00:19:28,180 --> 00:19:30,400 It doesn't actually listen on... 361 00:19:30,400 --> 00:19:33,260 The daemon side doesn't actually look for the packet data 362 00:19:33,260 --> 00:19:34,740 over that established TCP connection 363 00:19:34,740 --> 00:19:38,240 to 62201 via a receive. 364 00:19:38,380 --> 00:19:41,000 It actually still monitors the packet data passively, 365 00:19:41,080 --> 00:19:44,340 so it's compatible with also sending the SPA data 366 00:19:44,340 --> 00:19:46,580 over UDP port 62201 367 00:19:46,580 --> 00:19:48,800 as long as you don't also filter that port 368 00:19:48,800 --> 00:19:51,180 out of your PCAP filtering statement. 369 00:19:55,920 --> 00:19:59,040 So TOR is designed to make the exit router hard to predict. 370 00:19:59,320 --> 00:20:02,900 So that has implications also for how SPA is going to work. 371 00:20:04,000 --> 00:20:06,000 Normally, in many cases, 372 00:20:06,360 --> 00:20:10,580 people will use FWNOP with the dash cap lowercase s argument 373 00:20:10,580 --> 00:20:14,380 just to say to the FWNOP daemon, 374 00:20:14,560 --> 00:20:18,740 whatever IP address happened to communicate this SPA packet to 375 00:20:18,740 --> 00:20:20,580 is going to be the one that 376 00:20:20,580 --> 00:20:21,520 I'm going to use 377 00:20:21,540 --> 00:20:23,680 to allow to connect through to SSH 378 00:20:23,680 --> 00:20:24,900 and the one that I'm going to reconfigure 379 00:20:24,900 --> 00:20:26,380 my net filter policy for. 380 00:20:29,460 --> 00:20:33,580 That, unless map address is used within the TOR network, 381 00:20:33,920 --> 00:20:37,880 presents a problem because once the SSH connection 382 00:20:37,880 --> 00:20:39,180 is made over the open internet, 383 00:20:40,320 --> 00:20:45,520 then the IP address from which it originates 384 00:20:45,520 --> 00:20:47,980 is going to be different than the exit router IP address 385 00:20:47,980 --> 00:20:50,500 that the SPA packet was sent from via TOR. 386 00:20:53,320 --> 00:20:55,300 So just to drive this point home, 387 00:20:56,340 --> 00:21:01,940 if we look at a SYN scan over a SOCAT proxy with TOR, 388 00:21:04,440 --> 00:21:07,080 you will see that this first command here 389 00:21:07,080 --> 00:21:11,280 is where we're setting up to listen on local host 390 00:21:11,280 --> 00:21:13,080 over port 62201, 391 00:21:13,200 --> 00:21:14,760 but we're interfacing with the SOX port. 392 00:21:15,600 --> 00:21:19,300 And so if I send an in-map scan against local host 393 00:21:19,300 --> 00:21:21,440 looking for whether or not port 62201 394 00:21:21,540 --> 00:21:22,140 is actually open, 395 00:21:22,260 --> 00:21:24,940 of course in-map returns the fact that it is open 396 00:21:24,940 --> 00:21:26,300 because we're running SOCAT 397 00:21:26,300 --> 00:21:28,600 and it's waiting for a connection 398 00:21:28,600 --> 00:21:29,980 to go to the established state 399 00:21:29,980 --> 00:21:32,880 and thereby send it on through the TOR network 400 00:21:32,880 --> 00:21:34,380 where it will set up the virtual circuit. 401 00:21:34,580 --> 00:21:37,560 But if you do a TCP dump on the server side 402 00:21:37,560 --> 00:21:42,300 and actually look for a connection to be established 403 00:21:43,020 --> 00:21:44,980 over port 62201, 404 00:21:46,080 --> 00:21:48,460 which is where we're actually mapping it to up here, 405 00:21:49,040 --> 00:21:51,120 you will see that no traffic comes across 406 00:21:51,120 --> 00:21:54,180 whatsoever because the in-map scan 407 00:21:54,180 --> 00:21:56,100 never actually went into the established state. 408 00:21:56,200 --> 00:21:58,660 It only sent a SYN packet across via a raw SOCAT 409 00:21:58,660 --> 00:22:01,040 and the corresponding three-way handshake 410 00:22:01,040 --> 00:22:01,860 never actually occurred. 411 00:22:04,660 --> 00:22:06,520 If we use a CONNECT scan, however, 412 00:22:06,640 --> 00:22:07,980 against local host, 413 00:22:08,160 --> 00:22:10,380 again, the port is open because, yes, 414 00:22:10,460 --> 00:22:12,260 we're listening on port 62201. 415 00:22:15,240 --> 00:22:20,020 And if we do a TCP dump on the server side, 416 00:22:20,020 --> 00:22:22,880 this comes out of the TOR network now. 417 00:22:23,620 --> 00:22:27,140 We see that we do actually see traffic over port 62201. 418 00:22:27,320 --> 00:22:30,580 But take a look at these three packets. 419 00:22:31,600 --> 00:22:34,140 In this case, I was using NetFilter 420 00:22:34,140 --> 00:22:37,200 to filter all the incoming connection attempts 421 00:22:37,200 --> 00:22:38,000 to this port. 422 00:22:38,340 --> 00:22:43,620 So TOR continually retries to set up the virtual circuit 423 00:22:43,620 --> 00:22:45,180 and is unable to 424 00:22:45,180 --> 00:22:46,980 because there's no data coming back whatsoever. 425 00:22:47,080 --> 00:22:48,880 There's no reset packet that comes back. 426 00:22:50,160 --> 00:22:54,420 So we can see that the TCP options portion 427 00:22:54,420 --> 00:22:56,200 and the TCP header is a little bit different 428 00:22:56,200 --> 00:22:57,600 for each of these successive connections. 429 00:22:57,980 --> 00:23:01,980 So the first one here is the 6474207.50 address. 430 00:23:02,760 --> 00:23:05,380 It begins with a maximum segment size of 1460. 431 00:23:05,560 --> 00:23:08,160 It follows by a selective acknowledgment as OK, etc. 432 00:23:10,120 --> 00:23:11,780 Well, when it doesn't get a reply, 433 00:23:13,800 --> 00:23:15,280 a new connection is attempted. 434 00:23:15,780 --> 00:23:18,400 It comes across from this 82.224 address. 435 00:23:19,060 --> 00:23:20,820 Maximum segment size is 1460, 436 00:23:21,000 --> 00:23:22,200 but now there are two NOP instructions 437 00:23:22,200 --> 00:23:24,780 before the selective acknowledgment is OK. 438 00:23:25,080 --> 00:23:26,920 Clearly, this is a different TCP stack, 439 00:23:27,080 --> 00:23:29,140 even if the IP address didn't tell you that. 440 00:23:31,060 --> 00:23:35,380 And finally, yet another TCP stack down here. 441 00:23:36,280 --> 00:23:37,840 Maximum segment size 1460, 442 00:23:37,980 --> 00:23:38,800 two NOP instructions, 443 00:23:38,940 --> 00:23:39,740 selective acknowledgment OK, 444 00:23:39,840 --> 00:23:40,760 and then a bunch of other stuff 445 00:23:41,600 --> 00:23:44,420 that neither of the other two operating systems actually had. 446 00:23:46,600 --> 00:23:48,380 So you can fingerprint the IP address 447 00:23:48,400 --> 00:23:48,680 of one of these things 448 00:23:48,680 --> 00:23:50,680 just to see what kinds of operating systems 449 00:23:50,680 --> 00:23:52,140 are actually out there they're running toward. 450 00:23:55,280 --> 00:23:58,240 FWNOP includes a passive OS fingerprinting mode. 451 00:23:58,460 --> 00:24:00,940 It's a complete reimplementation of POF, 452 00:24:01,140 --> 00:24:03,440 but it only requires NetFilter logging messages 453 00:24:03,440 --> 00:24:04,380 in order to do this. 454 00:24:04,580 --> 00:24:08,200 So if you add the log TCP options argument 455 00:24:08,200 --> 00:24:09,780 to your logging rule in NetFilter, 456 00:24:09,900 --> 00:24:12,780 you can get FWNOP to tell you 457 00:24:12,780 --> 00:24:15,600 what operating systems are constructing those SYN packets 458 00:24:15,600 --> 00:24:16,840 as they come across the wire. 459 00:24:18,680 --> 00:24:20,800 So here we have one that's running Linux. 460 00:24:21,880 --> 00:24:23,680 There's also a FreeBSD one in there 461 00:24:23,680 --> 00:24:25,720 and an OpenBSD one in there, too. 462 00:24:33,480 --> 00:24:36,060 OK, so over the Tor network, 463 00:24:38,660 --> 00:24:39,640 what do we see? 464 00:24:41,320 --> 00:24:43,240 Single-backed authorization gets sent 465 00:24:43,240 --> 00:24:45,620 across this established TCP connection. 466 00:24:46,000 --> 00:24:48,180 So traffic analysis, 467 00:24:48,400 --> 00:24:50,140 where an attacker is able to sniff traffic 468 00:24:50,140 --> 00:24:53,480 between the client and the entry router. 469 00:24:56,920 --> 00:24:59,680 So you can see that, you know, 470 00:24:59,680 --> 00:25:02,760 once the SBA packet actually makes it into the Tor network, 471 00:25:03,060 --> 00:25:04,320 it's not really all that useful 472 00:25:04,320 --> 00:25:06,520 because you don't know where it's coming from 473 00:25:06,520 --> 00:25:07,340 or where it's going to. 474 00:25:08,420 --> 00:25:12,060 All you see is a TCP connection 475 00:25:12,060 --> 00:25:15,360 that contains this seemingly strange-looking data. 476 00:25:15,700 --> 00:25:16,900 You know, it's about, say, 477 00:25:16,900 --> 00:25:18,760 a thousand bytes worth of encrypted data 478 00:25:18,760 --> 00:25:19,920 that doesn't repeat ever, 479 00:25:20,840 --> 00:25:24,780 and it gets sent across to the minimal TCP server 480 00:25:24,780 --> 00:25:27,140 that's running on the FWNOP daemon side. 481 00:25:29,900 --> 00:25:31,800 And then the SSH connection 482 00:25:31,800 --> 00:25:33,660 does not go through the Tor network, 483 00:25:36,240 --> 00:25:38,140 and that is totally... 484 00:25:38,140 --> 00:25:40,700 There's no way to relate the two communications together. 485 00:25:43,000 --> 00:25:45,880 So in FWNOP 0.9.7, 486 00:25:47,000 --> 00:25:48,840 the features that I've released 487 00:25:48,840 --> 00:25:51,760 are the FWNOP serve minimal TCP server 488 00:25:51,760 --> 00:25:52,640 that we talked about. 489 00:25:53,040 --> 00:25:56,740 You can enable that with the enable TCP server argument 490 00:25:56,740 --> 00:25:58,340 in FWNOP.conf. 491 00:26:00,080 --> 00:26:02,800 This next bullet is kind of interesting. 492 00:26:03,020 --> 00:26:05,300 If you use FWNOP against multiple hosts, 493 00:26:05,500 --> 00:26:07,460 but because the FWNOP command line 494 00:26:07,460 --> 00:26:08,380 is a little bit complicated 495 00:26:08,380 --> 00:26:10,160 and you don't want to have to always remember exactly, 496 00:26:10,300 --> 00:26:13,240 you know, which GPG key you're actually using 497 00:26:13,240 --> 00:26:14,220 for which host, 498 00:26:14,220 --> 00:26:17,540 you can use this last host argument 499 00:26:18,220 --> 00:26:20,640 to specify which command line arguments 500 00:26:20,640 --> 00:26:21,600 you would want it to run. 501 00:26:21,800 --> 00:26:24,240 It keeps state with respect to those arguments 502 00:26:24,240 --> 00:26:25,740 for each host that you run it against. 503 00:26:28,160 --> 00:26:30,720 I ported the OpenSSH patch 504 00:26:31,740 --> 00:26:32,860 to SSH... 505 00:26:33,600 --> 00:26:35,340 OpenSSH 4.3 P2. 506 00:26:35,700 --> 00:26:37,920 I'll give a demonstration of this a little bit later. 507 00:26:39,220 --> 00:26:42,380 There was a vulnerability in the CryptCBC module 508 00:26:42,380 --> 00:26:43,400 where... 509 00:26:44,220 --> 00:26:46,060 the initialization vectors 510 00:26:46,060 --> 00:26:49,580 would result in weak encrypted data, 511 00:26:49,840 --> 00:26:52,040 so I needed to update that. 512 00:26:52,620 --> 00:26:55,280 Updated also not to advertise the FWNOP client 513 00:26:55,280 --> 00:26:56,800 to whatismyip.com. 514 00:26:56,980 --> 00:26:58,760 We will see that we are able to use 515 00:26:58,760 --> 00:27:01,700 automatic resolution against whatismyip.com 516 00:27:01,700 --> 00:27:03,440 in order to tell what the external address 517 00:27:03,440 --> 00:27:04,600 may be that you're going through 518 00:27:04,600 --> 00:27:05,360 if you're behind a NAT. 519 00:27:07,800 --> 00:27:09,160 Okay, live demonstration. 520 00:27:20,200 --> 00:27:21,420 Can anyone see this? 521 00:27:28,420 --> 00:27:28,900 Yes? 522 00:27:29,020 --> 00:27:29,460 Okay. 523 00:27:31,340 --> 00:27:31,840 What's that? 524 00:27:33,920 --> 00:27:34,620 The lights? 525 00:27:34,820 --> 00:27:35,180 These lights? 526 00:27:35,680 --> 00:27:35,700 Yeah. 527 00:27:39,880 --> 00:27:40,360 Whoa. 528 00:27:41,920 --> 00:27:42,400 Okay. 529 00:27:42,480 --> 00:27:43,100 Can you see that? 530 00:27:43,440 --> 00:27:43,920 Yeah. 531 00:27:43,940 --> 00:27:44,200 Okay. 532 00:27:44,200 --> 00:27:44,640 All right. 533 00:28:07,300 --> 00:28:08,920 Okay, so Tor is up and running. 534 00:28:11,100 --> 00:28:12,640 I'm going to run our SOCAT 535 00:28:13,760 --> 00:28:16,000 proxy so that I can connect to localhosts 536 00:28:16,000 --> 00:28:16,740 and have it sent across. 537 00:28:17,060 --> 00:28:18,920 This is the IP address that I'm actually going to 538 00:28:18,920 --> 00:28:20,960 in case anybody would like to know that. 539 00:28:27,220 --> 00:28:28,480 So right now, 540 00:28:31,460 --> 00:28:33,740 I'm running Nmap in a watch window 541 00:28:34,840 --> 00:28:40,600 so that I can tell exactly when SSH is filtered 542 00:28:40,600 --> 00:28:41,840 and when it isn't filtered. 543 00:28:41,840 --> 00:28:44,660 From the NAT that I'm going out here 544 00:28:44,660 --> 00:28:46,000 from the DEF CON network. 545 00:28:50,400 --> 00:28:51,080 I'm sorry? 546 00:28:53,380 --> 00:28:53,900 Okay. 547 00:28:57,480 --> 00:28:58,260 Is that good? 548 00:29:02,040 --> 00:29:02,560 Okay. 549 00:29:05,700 --> 00:29:06,960 Is the one on the left okay? 550 00:29:12,920 --> 00:29:13,280 Okay. 551 00:29:13,440 --> 00:29:14,400 That's got to be okay, right? 552 00:29:15,640 --> 00:29:16,000 Okay. 553 00:29:16,960 --> 00:29:17,320 Okay. 554 00:29:17,380 --> 00:29:21,920 So you can see that SSH is currently filtered on this IP. 555 00:29:25,540 --> 00:29:27,380 So I'm going to use that last command line argument 556 00:29:27,380 --> 00:29:28,100 that I told you about. 557 00:29:28,220 --> 00:29:29,400 The host name is spotor. 558 00:29:31,120 --> 00:29:36,660 And what's happening here is, excuse me, no, it's localhost. 559 00:29:39,700 --> 00:29:40,060 Okay. 560 00:29:41,000 --> 00:29:42,540 So what's happening here is, 561 00:29:42,600 --> 00:29:44,720 I'm using a new TCP command line argument, 562 00:29:44,960 --> 00:29:46,580 I should say, to FWNOP, 563 00:29:46,740 --> 00:29:50,540 to send the SBA connection over an established TCP socket. 564 00:29:50,680 --> 00:29:52,620 That's the TCP SOC command line argument here. 565 00:29:53,220 --> 00:29:55,820 We're going to say that we want access to TCP port 22, 566 00:29:56,080 --> 00:29:57,380 which is where SSH is living. 567 00:29:57,800 --> 00:29:59,300 We're using GPG authentication, 568 00:29:59,700 --> 00:30:01,100 which I highly recommend, by the way, 569 00:30:01,240 --> 00:30:03,760 because if you type your password in incorrectly, 570 00:30:04,120 --> 00:30:06,100 you don't have to worry about whether or not 571 00:30:06,100 --> 00:30:08,560 the packet that gets sent was actually sent 572 00:30:08,560 --> 00:30:10,020 or ever received by the target. 573 00:30:10,060 --> 00:30:13,680 It tells you before, just as the return value of GPG, 574 00:30:13,760 --> 00:30:15,280 whether or not the password was valid 575 00:30:16,260 --> 00:30:18,420 before you have to get into that strange, 576 00:30:18,560 --> 00:30:20,140 you don't know what's happening scenario. 577 00:30:23,180 --> 00:30:25,900 So the recipient's key is identified 578 00:30:25,900 --> 00:30:27,760 by the host name spotor here. 579 00:30:27,960 --> 00:30:30,200 The signing key is one that I have on my laptop. 580 00:30:30,240 --> 00:30:31,340 It's called Isengard. 581 00:30:31,540 --> 00:30:34,300 This dash W argument says that I want it to resolve 582 00:30:34,300 --> 00:30:37,240 what my external address is via whatismyip.com. 583 00:30:37,640 --> 00:30:39,740 By default, the user agent that it sends 584 00:30:39,740 --> 00:30:41,460 is a Firefox user agent, 585 00:30:41,560 --> 00:30:43,420 so there's nothing to actually identify the fact 586 00:30:43,420 --> 00:30:47,220 that you're running FWNOP as a client. 587 00:30:50,080 --> 00:30:52,400 And we're going to send this in verbose mode 588 00:30:52,400 --> 00:30:53,280 against localhost. 589 00:30:53,360 --> 00:30:55,180 So if I type this password in correctly... 590 00:30:56,680 --> 00:30:57,220 Okay. 591 00:31:03,820 --> 00:31:05,040 Now everything worked. 592 00:31:11,740 --> 00:31:12,140 Yes. 593 00:31:13,400 --> 00:31:14,780 You can see that up here, 594 00:31:15,660 --> 00:31:17,100 the port is currently open. 595 00:31:18,940 --> 00:31:20,560 Of course, now you all have access 596 00:31:20,560 --> 00:31:21,940 for a limited amount of time 597 00:31:21,940 --> 00:31:23,220 if you're going over the same network, 598 00:31:23,420 --> 00:31:24,880 but it's now back to filtered. 599 00:31:25,440 --> 00:31:26,960 So you have a little window of time. 600 00:31:27,060 --> 00:31:28,180 You can tell what's running there 601 00:31:28,180 --> 00:31:29,380 if you're on the same local network. 602 00:31:33,300 --> 00:31:34,780 However, you can see that 603 00:31:35,440 --> 00:31:37,300 if I try to make a new connection... 604 00:31:40,060 --> 00:31:41,700 Of course, the port is filtered. 605 00:31:44,260 --> 00:31:44,840 Also... 606 00:31:46,700 --> 00:31:48,740 If I take this original packet data 607 00:31:48,740 --> 00:31:50,040 and replay it, 608 00:31:50,120 --> 00:31:52,740 because somebody might have sniffed it en route... 609 00:32:04,140 --> 00:32:05,660 Before I do that... 610 00:32:11,380 --> 00:32:13,100 I wanted to point out something here. 611 00:32:15,500 --> 00:32:18,000 These messages are coming across from FWNOPd. 612 00:32:19,080 --> 00:32:23,780 What you can see here is that FWNOP received 613 00:32:23,780 --> 00:32:25,500 a valid GPG encrypted packet 614 00:32:25,500 --> 00:32:29,080 signed with this GPG here that we require. 615 00:32:32,160 --> 00:32:34,560 And it received it from this particular IP address, 616 00:32:34,860 --> 00:32:36,620 which is a Tor exit router. 617 00:32:37,920 --> 00:32:40,240 So it added an input accept rule 618 00:32:40,240 --> 00:32:42,420 for this IP, though, however, 619 00:32:42,520 --> 00:32:43,960 which is not the same thing. 620 00:32:44,120 --> 00:32:46,880 That's what we received from whatismyip.com. 621 00:32:48,200 --> 00:32:50,680 And so it was able to extract 622 00:32:50,680 --> 00:32:52,960 what IP address to actually allow access to 623 00:32:52,960 --> 00:32:55,240 from the encrypted packet data itself. 624 00:32:55,320 --> 00:32:57,740 That's never exposed in the clear text. 625 00:32:59,540 --> 00:33:03,080 And finally, after a 10-second timeout, 626 00:33:03,180 --> 00:33:06,600 which is configurable via how you set up the IP, 627 00:33:06,620 --> 00:33:07,760 your access.conf file, 628 00:33:08,180 --> 00:33:12,140 the netfilter input accept rule was removed. 629 00:33:13,660 --> 00:33:16,540 Okay, so I saw my packet data there. 630 00:33:17,420 --> 00:33:18,840 If I do the same thing 631 00:33:19,620 --> 00:33:24,180 and send that packet data across the wire... 632 00:33:35,160 --> 00:33:36,480 The port is still filtered. 633 00:33:38,860 --> 00:33:40,320 There should be something coming up here. 634 00:33:47,680 --> 00:33:48,660 Try that one more time. 635 00:33:52,280 --> 00:33:52,680 Yeah. 636 00:33:52,680 --> 00:33:57,120 So attempted message replay from this IP 637 00:33:57,120 --> 00:33:58,920 because the MD5SOM matched. 638 00:34:01,480 --> 00:34:02,880 So that concludes the demo. 639 00:34:03,060 --> 00:34:04,280 Can you give me lights, please? 640 00:34:10,660 --> 00:34:11,620 And finally, 641 00:34:15,220 --> 00:34:16,420 if you're looking for 642 00:34:17,660 --> 00:34:19,300 updated versions of these slides, 643 00:34:19,440 --> 00:34:20,160 they're a little bit different 644 00:34:20,160 --> 00:34:21,240 from what's on the con CD. 645 00:34:21,240 --> 00:34:23,420 Oh, is that not showing up there? 646 00:34:23,620 --> 00:34:24,160 Let's see. 647 00:34:29,320 --> 00:34:29,760 Okay. 648 00:34:30,140 --> 00:34:31,740 You can find them at this link down here. 649 00:34:32,220 --> 00:34:33,180 Anyone have any questions? 650 00:34:37,920 --> 00:34:38,360 Yes. 651 00:34:41,980 --> 00:34:47,120 Right, so the question was, 652 00:34:47,220 --> 00:34:49,320 if I actually wanted to send the SSH connection 653 00:34:49,320 --> 00:34:50,700 also over Tor, 654 00:34:51,240 --> 00:34:53,820 how would I know what my exit IP is? 655 00:34:54,240 --> 00:34:56,580 And what you'd need to do 656 00:34:56,580 --> 00:34:57,520 to be able to make that work 657 00:34:57,520 --> 00:35:01,100 is use the map address functionality in Tor 658 00:35:01,100 --> 00:35:01,940 to get that to work. 659 00:35:03,480 --> 00:35:05,560 That has some interesting implications 660 00:35:05,560 --> 00:35:07,980 actually doing it that way by... 661 00:35:08,640 --> 00:35:10,040 What that would mean is 662 00:35:10,660 --> 00:35:13,020 that traffic analysis with respect 663 00:35:13,020 --> 00:35:14,700 to your SSH connection as well 664 00:35:14,700 --> 00:35:16,040 would be thwarted, 665 00:35:16,100 --> 00:35:17,020 which is a good idea. 666 00:35:17,480 --> 00:35:18,740 It's just I didn't have time 667 00:35:18,740 --> 00:35:20,280 to actually put the map address stuff in here. 668 00:35:20,280 --> 00:35:22,060 So any other questions? 669 00:35:23,100 --> 00:35:23,620 Yes. 670 00:35:25,060 --> 00:35:25,920 Am I on? 671 00:35:26,040 --> 00:35:26,180 Yeah. 672 00:35:27,080 --> 00:35:29,580 So was the benefit of sending this over Tor 673 00:35:30,160 --> 00:35:32,380 just that if somebody's sniffing the traffic 674 00:35:32,380 --> 00:35:34,100 going to the server, 675 00:35:34,240 --> 00:35:35,920 it's a little bit more difficult for them to tell 676 00:35:35,920 --> 00:35:39,400 that the packet that came from some random IP address 677 00:35:39,400 --> 00:35:40,800 just before your SSH connection 678 00:35:40,800 --> 00:35:43,760 was what was allowing the connection to go through? 679 00:35:44,040 --> 00:35:47,620 Right, so I'm applying traffic analysis. 680 00:35:48,080 --> 00:35:50,220 I'm making it difficult for traffic analysis 681 00:35:50,280 --> 00:35:51,760 to work against SPA itself. 682 00:35:53,720 --> 00:35:55,400 So someone, say, for example, 683 00:35:55,400 --> 00:35:56,520 here on this internal network 684 00:35:56,520 --> 00:35:58,680 that was able to see that there were... 685 00:35:58,680 --> 00:36:00,340 If I was not running it over Tor, 686 00:36:00,520 --> 00:36:02,960 they could see that there is a... 687 00:36:02,960 --> 00:36:07,380 By default, if a packet goes over port 62201 UDP 688 00:36:07,880 --> 00:36:09,040 and they're looking for that, 689 00:36:09,240 --> 00:36:11,160 they might know that SPA is actually running 690 00:36:11,160 --> 00:36:13,040 and have an idea, therefore, 691 00:36:13,180 --> 00:36:17,060 that some packet filter may get modified as a result. 692 00:36:17,480 --> 00:36:19,380 But running it over the Tor network 693 00:36:19,380 --> 00:36:21,240 makes that just a little bit harder to do 694 00:36:21,240 --> 00:36:24,440 because you can't tell that you're actually, you know, 695 00:36:24,460 --> 00:36:25,660 to where you're sending it to. 696 00:36:26,580 --> 00:36:29,220 So it's designed to help harden the SPA protocol itself. 697 00:36:29,600 --> 00:36:29,740 Okay. 698 00:36:29,880 --> 00:36:30,900 If you also then... 699 00:36:30,900 --> 00:36:33,380 Also use the map address functionality in Tor 700 00:36:33,380 --> 00:36:35,000 and run both connections over Tor, 701 00:36:35,260 --> 00:36:36,780 then you get traffic... 702 00:36:36,780 --> 00:36:39,160 It's hard to do traffic analysis on both connections. 703 00:36:40,160 --> 00:36:42,080 I had another question, but it's getting hard to hear you, 704 00:36:42,140 --> 00:36:43,020 so I'll probably just go up there. 705 00:36:43,460 --> 00:36:44,840 Okay. Any other questions? 706 00:36:48,460 --> 00:36:49,740 Thank you very much.