1 00:00:00,000 --> 00:00:03,720 Cool, thanks. Yeah, it's a little early on Sunday. 2 00:00:07,120 --> 00:00:10,280 Yeah, we're going to be rolling old school today with some ARP. 3 00:00:10,460 --> 00:00:15,980 So, I know hacking ARP has been around for a bit. 4 00:00:16,140 --> 00:00:19,360 We're going to kind of go over some of the classic attacks 5 00:00:19,360 --> 00:00:22,240 and then a little bit of a twist on some of them, 6 00:00:22,280 --> 00:00:24,720 a little bit more effective here and there. 7 00:00:25,900 --> 00:00:29,360 Some of the tools that are out there that do things like 8 00:00:29,360 --> 00:00:30,720 ARP cache poisoning and stuff like that 9 00:00:30,720 --> 00:00:33,160 don't really take advantage of some of these techniques. 10 00:00:33,500 --> 00:00:35,160 So, I'm going to go over that. 11 00:00:39,420 --> 00:00:42,640 So, first we're going to start with kind of a background on ARP. 12 00:00:44,720 --> 00:00:48,600 For most of you, this is probably going to be pretty basic, 13 00:00:49,170 --> 00:00:53,660 but it's kind of essential to build what really ARP is 14 00:00:54,760 --> 00:00:57,060 and what it does and how we can attack it. 15 00:00:58,120 --> 00:00:58,960 So, obviously, 16 00:00:59,360 --> 00:01:01,560 network systems, like in a network, 17 00:01:02,940 --> 00:01:04,520 need a way to talk to each other. 18 00:01:04,720 --> 00:01:07,020 A lot of times we think of them talking to each other 19 00:01:07,020 --> 00:01:08,960 via protocol address, like IP addresses. 20 00:01:10,380 --> 00:01:14,020 But on a local area network or a physical network, 21 00:01:14,160 --> 00:01:16,300 they actually have to talk via physical addresses. 22 00:01:16,520 --> 00:01:20,020 And so, we need a way to translate from our protocol address, 23 00:01:20,180 --> 00:01:20,960 like our IP address, 24 00:01:21,200 --> 00:01:24,180 to the physical addresses, like MAC addresses. 25 00:01:25,820 --> 00:01:28,040 ARP, in this particular talk, 26 00:01:28,160 --> 00:01:29,240 we're in... 27 00:01:29,360 --> 00:01:30,720 In reference, in this talk, 28 00:01:30,800 --> 00:01:33,580 we're talking about ARP over Ethernet 29 00:01:33,580 --> 00:01:35,860 and in reference to IPv4. 30 00:01:36,120 --> 00:01:38,160 So, ARP can work in other environments, 31 00:01:38,280 --> 00:01:39,540 but we're specifically talking about 32 00:01:39,540 --> 00:01:41,200 that particular environment right now. 33 00:01:43,060 --> 00:01:45,180 So, the address resolution protocol 34 00:01:45,180 --> 00:01:49,820 allows us to resolve a hardware address 35 00:01:49,820 --> 00:01:52,680 from given a protocol address. 36 00:01:52,860 --> 00:01:54,220 So, if we have an IP address, 37 00:01:54,420 --> 00:01:56,940 like 192.168.1.100, 38 00:01:57,020 --> 00:01:58,040 and we want to talk to it, 39 00:01:58,140 --> 00:01:58,680 we... 40 00:01:58,680 --> 00:02:01,360 We can send an ARP request packet out 41 00:02:01,360 --> 00:02:02,840 to the broadcast of the network. 42 00:02:04,440 --> 00:02:07,560 It's kind of like a who has 192.168.1.100. 43 00:02:08,540 --> 00:02:10,080 And every host on the network, 44 00:02:10,160 --> 00:02:11,180 since it's sent out to the broadcast, 45 00:02:11,400 --> 00:02:14,480 gets this particular request packet. 46 00:02:14,720 --> 00:02:16,420 And if their protocol address 47 00:02:16,420 --> 00:02:19,540 matches the protocol address in the field 48 00:02:19,540 --> 00:02:21,380 for the target protocol address 49 00:02:21,380 --> 00:02:22,560 in the ARP request packet, 50 00:02:22,760 --> 00:02:25,160 they send out a response to the sender 51 00:02:25,160 --> 00:02:27,320 saying, I'm at blah, blah, blah. 52 00:02:27,600 --> 00:02:28,340 So, here, 53 00:02:28,680 --> 00:02:30,060 192.168.1.100 54 00:02:30,060 --> 00:02:32,540 sends out that they're at the hardware address 55 00:02:35,600 --> 00:02:36,120 00DF1A9CA378. 56 00:02:37,840 --> 00:02:38,360 So... 57 00:02:39,140 --> 00:02:41,140 Okay, so now we have a way of translating 58 00:02:41,140 --> 00:02:44,500 between protocol addresses, or IP addresses, 59 00:02:44,680 --> 00:02:45,980 and hardware addresses. 60 00:02:47,420 --> 00:02:51,080 But, obviously, there'd be a lot of chatter on a network, 61 00:02:51,300 --> 00:02:52,780 unnecessary chatter on a network, 62 00:02:52,920 --> 00:02:55,480 if for every packet or every frame 63 00:02:55,480 --> 00:02:57,420 that has to go out on a physical network, 64 00:02:57,660 --> 00:02:58,660 we have to send out a request packet. 65 00:02:58,660 --> 00:02:59,660 We have to send out an ARP request 66 00:02:59,660 --> 00:03:00,900 and receive an ARP reply. 67 00:03:01,340 --> 00:03:05,000 So, hosts, in order to overcome this overhead, 68 00:03:05,360 --> 00:03:10,620 have local caches of MAC address and IP pairs. 69 00:03:10,900 --> 00:03:13,220 So, it's the ARP cache. 70 00:03:14,120 --> 00:03:15,960 What this does is it just, 71 00:03:16,040 --> 00:03:19,960 once we've resolved an IP and MAC pair, 72 00:03:20,160 --> 00:03:22,980 we cache it for a certain period of time locally 73 00:03:22,980 --> 00:03:26,240 so that when we go to communicate to another host again, 74 00:03:26,400 --> 00:03:28,240 we look in our table and, 75 00:03:28,660 --> 00:03:31,040 if the ARP entry exists, 76 00:03:31,200 --> 00:03:32,640 then we know where to go. 77 00:03:32,800 --> 00:03:34,780 We don't have to send out an ARP request again. 78 00:03:35,800 --> 00:03:41,000 So, this is where really part of the weaknesses in ARP 79 00:03:41,000 --> 00:03:45,840 kind of starts out, is that particular table. 80 00:03:46,240 --> 00:03:49,600 So, go over a little bit of a background 81 00:03:49,600 --> 00:03:52,700 and anatomy of an ARP packet to begin with. 82 00:03:54,260 --> 00:03:57,000 So, this is kind of a typical ARP packet. 83 00:03:58,660 --> 00:04:01,740 One of the first field is hardware type field. 84 00:04:01,980 --> 00:04:06,140 And so, this specifies what the underlying type of hardware 85 00:04:06,140 --> 00:04:08,820 that we're sending our frames on is. 86 00:04:09,820 --> 00:04:11,660 Typically, and in our environment 87 00:04:11,660 --> 00:04:13,360 that we're talking about today, 88 00:04:13,460 --> 00:04:16,100 this is going to be set to the code for Ethernet. 89 00:04:17,220 --> 00:04:18,800 Next, we have the protocol type, 90 00:04:18,960 --> 00:04:21,500 which, again, specifies what protocol we're using. 91 00:04:21,680 --> 00:04:26,200 So, this will be filled with the code for IPv4. 92 00:04:28,660 --> 00:04:31,560 Then, the next two fields are hardware length 93 00:04:31,560 --> 00:04:32,640 and protocol length. 94 00:04:33,290 --> 00:04:37,720 So, because we can use different protocols 95 00:04:37,720 --> 00:04:42,120 and different hardware mediums in order to send ARPs over, 96 00:04:42,400 --> 00:04:46,080 obviously, the associated addresses can vary 97 00:04:46,080 --> 00:04:47,580 the length of those addresses. 98 00:04:47,840 --> 00:04:51,420 So, we need a place to specify how long each field should be 99 00:04:51,420 --> 00:04:53,340 as far as the protocol length and the hardware length. 100 00:04:53,500 --> 00:04:55,160 So, that's done in these two fields. 101 00:04:56,980 --> 00:04:58,400 We'll go over... 102 00:04:58,660 --> 00:05:01,800 actual examples of ARP packets in a little bit 103 00:05:01,800 --> 00:05:04,680 and what values go in there. 104 00:05:06,240 --> 00:05:07,920 The next is going to be the op code. 105 00:05:08,480 --> 00:05:13,280 And this is typically going to be either a request or a reply. 106 00:05:13,480 --> 00:05:15,640 So, this is where in the packet we specify 107 00:05:15,640 --> 00:05:18,540 what kind of packet we're sending. 108 00:05:18,680 --> 00:05:19,720 If we're sending an ARP request 109 00:05:19,720 --> 00:05:21,140 or if we're sending an ARP reply. 110 00:05:21,400 --> 00:05:24,160 And that's how the associated hosts 111 00:05:25,440 --> 00:05:28,640 translate that packet when they respond. 112 00:05:28,660 --> 00:05:28,840 So, we're sending an ARP request 113 00:05:28,840 --> 00:05:28,920 And that's how we receive it. 114 00:05:33,940 --> 00:05:37,720 The sender hardware address is pretty self-explanatory. 115 00:05:37,920 --> 00:05:40,940 This is the hardware address or MAC address, in our case, 116 00:05:41,020 --> 00:05:45,880 of the sender's Ethernet card or interface card. 117 00:05:46,120 --> 00:05:51,140 So, whoever's sending out an ARP request or an ARP reply, 118 00:05:51,420 --> 00:05:53,680 they put their own hardware address 119 00:05:53,680 --> 00:05:56,320 of the interface it's going out into this field. 120 00:05:56,540 --> 00:05:58,340 Same thing with the sender protocol address. 121 00:05:58,660 --> 00:06:04,700 This is, of course, how, in your typical or standard ARP conversation, 122 00:06:06,040 --> 00:06:08,300 we're going to abuse these fields a little bit 123 00:06:08,300 --> 00:06:10,000 in order to get what we want out of it. 124 00:06:11,960 --> 00:06:14,300 So, then you have the target hardware address, 125 00:06:14,620 --> 00:06:16,460 which is pretty self-explanatory again. 126 00:06:16,780 --> 00:06:19,000 It's the hardware address or MAC address 127 00:06:19,000 --> 00:06:22,400 of the target we're sending our packet to. 128 00:06:22,620 --> 00:06:24,340 And target protocol address, 129 00:06:24,480 --> 00:06:25,980 which would be the IP address of that target. 130 00:06:27,860 --> 00:06:28,640 So, as an example, 131 00:06:28,640 --> 00:06:36,060 if 192.168.1.20 wants to speak with 192.168.1.100, 132 00:06:37,160 --> 00:06:43,340 1.20 will send an ARP request packet out to the local network broadcast. 133 00:06:44,000 --> 00:06:45,980 And this is what the packet will look like. 134 00:06:46,240 --> 00:06:50,760 We see that the first field, the hardware type, 135 00:06:50,960 --> 00:06:54,540 is set to 01, which is the code for Ethernet. 136 00:06:55,060 --> 00:06:58,480 The protocol type, 137 00:06:58,640 --> 00:06:59,520 is set to IP. 138 00:06:59,880 --> 00:07:02,680 The Ethernet length is set to 6, 139 00:07:02,860 --> 00:07:05,520 because it's 6 bytes for an Ethernet address. 140 00:07:05,800 --> 00:07:09,300 And the protocol length is 4, 141 00:07:09,460 --> 00:07:13,580 because it's an IPv4 or 4 byte address. 142 00:07:14,420 --> 00:07:17,040 We also see the opcode is 1, 143 00:07:17,320 --> 00:07:20,020 which is the code for an ARP request. 144 00:07:20,560 --> 00:07:22,780 And then we have all the different, 145 00:07:23,500 --> 00:07:24,880 the sender hardware address, 146 00:07:25,140 --> 00:07:28,480 which is the requester's hardware address. 147 00:07:28,640 --> 00:07:29,960 And their IP address in the protocol, 148 00:07:30,240 --> 00:07:31,620 the sender's protocol address. 149 00:07:32,140 --> 00:07:33,760 And then target hardware address, 150 00:07:33,940 --> 00:07:35,300 which here is set to null, 151 00:07:35,400 --> 00:07:36,720 because that's what we're trying to do. 152 00:07:36,800 --> 00:07:39,240 We're trying to resolve what the hardware address 153 00:07:39,240 --> 00:07:40,880 for the IP address that we have. 154 00:07:41,060 --> 00:07:43,280 So that's set to null and sent out on the wire. 155 00:07:44,240 --> 00:07:47,060 And then we have the IP address that we're trying to resolve 156 00:07:47,480 --> 00:07:48,860 in the target protocol address. 157 00:07:51,420 --> 00:07:53,440 So the response looks like this. 158 00:07:54,100 --> 00:07:56,320 192.168.1.100 replies, 159 00:07:56,500 --> 00:07:57,760 sends out an ARP reply, 160 00:07:57,760 --> 00:08:02,500 with its hardware address, 00AABBCCDDFF. 161 00:08:03,660 --> 00:08:06,960 And it's specifically sent to 1.20. 162 00:08:07,080 --> 00:08:09,440 And to its, the target, 163 00:08:09,520 --> 00:08:11,000 you can see that the target hardware address 164 00:08:11,000 --> 00:08:12,000 and target protocol address 165 00:08:12,000 --> 00:08:13,020 are both filled out correctly. 166 00:08:13,260 --> 00:08:14,500 And the sender hardware address 167 00:08:14,500 --> 00:08:15,580 and sender protocol address 168 00:08:15,580 --> 00:08:19,480 are filled out with the host that's answering. 169 00:08:21,100 --> 00:08:22,580 This then in turn, 170 00:08:22,700 --> 00:08:25,620 the host 192.168.1.20 171 00:08:25,620 --> 00:08:27,740 will take that and enter it 172 00:08:27,760 --> 00:08:28,640 into its ARP cache, 173 00:08:28,700 --> 00:08:33,780 or update its ARP cache for 1.100. 174 00:08:33,920 --> 00:08:37,660 So now it knows who belongs to 1.100 175 00:08:37,660 --> 00:08:39,160 and doesn't have to send out more requests 176 00:08:39,160 --> 00:08:40,120 until a timeout occurs. 177 00:08:42,760 --> 00:08:46,200 So traditional ARP attacks, 178 00:08:47,080 --> 00:08:49,300 one of the most common ARP attacks 179 00:08:49,300 --> 00:08:53,020 for taking over really any local area network 180 00:08:53,020 --> 00:08:54,540 is ARP cache poisoning. 181 00:08:54,960 --> 00:08:56,680 ARP cache poisoning is, 182 00:08:56,680 --> 00:09:00,140 since ARP is completely unauthenticated, 183 00:09:00,440 --> 00:09:02,540 you might have noticed as we were talking about, 184 00:09:02,640 --> 00:09:04,480 even if you're not familiar with ARP cache poisoning, 185 00:09:04,960 --> 00:09:06,620 the dangers as we were talking about, 186 00:09:06,780 --> 00:09:08,940 a host sends out an ARP request 187 00:09:08,940 --> 00:09:09,960 and it receives, 188 00:09:10,300 --> 00:09:12,280 somebody else sends out an ARP reply, 189 00:09:12,560 --> 00:09:14,380 and when it receives that ARP reply, 190 00:09:14,580 --> 00:09:15,700 it updates its cache. 191 00:09:15,880 --> 00:09:17,140 It has no sort of authentication 192 00:09:17,140 --> 00:09:20,480 to verify who actually sent the ARP reply. 193 00:09:20,760 --> 00:09:23,700 So it doesn't really know who it's talking to. 194 00:09:24,080 --> 00:09:25,560 And that's what ARP cache poisoning 195 00:09:25,560 --> 00:09:26,420 is really about. 196 00:09:26,740 --> 00:09:27,440 You basically, 197 00:09:28,580 --> 00:09:31,000 since it's completely unauthenticated, 198 00:09:31,200 --> 00:09:34,560 whoever sends a reply to the requester first 199 00:09:34,560 --> 00:09:37,360 wins and gets their information, 200 00:09:37,580 --> 00:09:39,940 whether it's legitimate or spoofed, 201 00:09:39,940 --> 00:09:41,920 input into the ARP cache. 202 00:09:44,160 --> 00:09:45,780 We have another condition though 203 00:09:45,780 --> 00:09:48,400 where sometimes the ARP cache 204 00:09:48,400 --> 00:09:51,500 can be updated with gratuitous ARP replies. 205 00:09:51,760 --> 00:09:54,680 So even if the host didn't send out an ARP request, 206 00:09:54,680 --> 00:09:56,880 and it's just humming along, 207 00:09:58,960 --> 00:10:00,760 and receives an ARP reply, 208 00:10:01,160 --> 00:10:03,060 then it'll still update its cache 209 00:10:03,060 --> 00:10:05,140 because it's dumb. 210 00:10:08,180 --> 00:10:09,080 So basically, 211 00:10:09,820 --> 00:10:13,580 that's really what most of the ARP cache poisoning tools rely on. 212 00:10:13,660 --> 00:10:16,780 Instead of waiting for an ARP request to go out 213 00:10:16,780 --> 00:10:20,080 and trying to race with the actual owner, 214 00:10:20,240 --> 00:10:21,860 it just sends out gratuitous ARP replies 215 00:10:21,860 --> 00:10:23,340 in order to try to update the cache. 216 00:10:25,060 --> 00:10:27,620 This isn't effective on all operating systems, 217 00:10:27,940 --> 00:10:31,280 but many operating systems this is the case. 218 00:10:33,340 --> 00:10:34,460 So basically, 219 00:10:34,660 --> 00:10:36,340 in order to exploit this, 220 00:10:36,420 --> 00:10:38,780 you just send out a forged ARP reply packet 221 00:10:38,780 --> 00:10:39,420 to a victim. 222 00:10:40,420 --> 00:10:45,260 You put in the legitimate sender protocol address, 223 00:10:45,560 --> 00:10:48,000 whatever you want to hijack the connection of, 224 00:10:48,120 --> 00:10:50,420 and your MAC address or some other MAC address, 225 00:10:50,600 --> 00:10:53,680 and effectively poison the ARP cache 226 00:10:53,680 --> 00:10:55,680 so that the victim is now talking to you 227 00:10:55,680 --> 00:10:58,340 when it thinks it's talking to Joe Blow Gateway. 228 00:11:01,080 --> 00:11:03,080 So the results of this, as you can see, 229 00:11:03,220 --> 00:11:05,880 are probably the most common is man in the middle. 230 00:11:06,020 --> 00:11:09,580 If we poison an ARP cache entry 231 00:11:09,580 --> 00:11:12,460 with our own MAC address information, 232 00:11:12,760 --> 00:11:14,020 or our own hardware information, 233 00:11:15,420 --> 00:11:16,680 for, say, the Gateway, 234 00:11:16,940 --> 00:11:18,400 then all the hosts, 235 00:11:18,700 --> 00:11:21,460 or all the traffic between the host and the Gateway, 236 00:11:21,660 --> 00:11:23,420 or any, of course, 237 00:11:23,680 --> 00:11:27,280 obviously any traffic going to hosts 238 00:11:27,280 --> 00:11:28,360 on the other side of the Gateway, 239 00:11:28,560 --> 00:11:30,760 are going to go through us first. 240 00:11:30,920 --> 00:11:32,600 So we can look at it, 241 00:11:32,660 --> 00:11:34,160 we can modify it, 242 00:11:34,280 --> 00:11:35,700 we can sniff it, 243 00:11:36,460 --> 00:11:37,620 whatever we want to do, 244 00:11:37,780 --> 00:11:39,040 classic man in the middle attack, 245 00:11:39,800 --> 00:11:41,380 and then pass it on to the Gateway 246 00:11:41,380 --> 00:11:45,280 as if it were legitimate traffic. 247 00:11:46,780 --> 00:11:49,200 Another condition with this would be denial of service. 248 00:11:49,880 --> 00:11:51,180 So if we put in, 249 00:11:51,700 --> 00:11:53,520 instead of putting in our own, 250 00:11:53,680 --> 00:11:54,980 our own MAC address, 251 00:11:55,260 --> 00:11:56,600 or a legitimate MAC address 252 00:11:56,600 --> 00:11:58,240 in order to hijack the connection, 253 00:11:58,460 --> 00:12:01,040 we can just put in a bogus or non-existent 254 00:12:01,040 --> 00:12:02,100 random MAC address, 255 00:12:02,300 --> 00:12:04,420 and now that host can't communicate 256 00:12:04,420 --> 00:12:06,620 with that, the other host. 257 00:12:06,860 --> 00:12:08,880 So you can sever connections between hosts. 258 00:12:09,400 --> 00:12:11,000 Obviously the benefits of that 259 00:12:11,000 --> 00:12:13,160 can either be just simply 260 00:12:13,680 --> 00:12:15,020 for fun or malicious, 261 00:12:15,320 --> 00:12:18,640 or if it's used in conjunction with other attacks, 262 00:12:19,240 --> 00:12:22,720 like say we're attacking or attempting to exploit 263 00:12:22,720 --> 00:12:23,960 a vulnerable server, 264 00:12:24,200 --> 00:12:26,920 but we know that we're already on the local network, 265 00:12:27,020 --> 00:12:28,580 and we know that the server is logging 266 00:12:28,580 --> 00:12:30,780 to some central syslog server, 267 00:12:31,000 --> 00:12:35,520 or reporting to some central intrusion detection sensor, 268 00:12:35,760 --> 00:12:39,440 then we can sever that connection, 269 00:12:39,600 --> 00:12:41,540 deny service between those two hosts, 270 00:12:41,700 --> 00:12:44,480 and now prevent that external logging 271 00:12:44,480 --> 00:12:46,240 as we carry out the rest of our attack. 272 00:12:48,140 --> 00:12:51,160 So an example of man in the middle attack would be 273 00:12:51,160 --> 00:12:53,960 the client sends an ARP request for 1.1, 274 00:12:55,040 --> 00:12:57,300 and we can see that 275 00:12:58,880 --> 00:13:01,160 it's a standard ARP request packet, 276 00:13:01,880 --> 00:13:05,900 so we have the sender hardware address 277 00:13:05,900 --> 00:13:08,080 and protocol address, which are our victim host, 278 00:13:08,320 --> 00:13:10,540 and then target hardware address, again, is null, 279 00:13:10,720 --> 00:13:13,340 and we're looking up 192.168.1.1, 280 00:13:13,440 --> 00:13:14,580 and it's a request packet, 281 00:13:14,720 --> 00:13:16,700 as you can see in the opcode field. 282 00:13:17,920 --> 00:13:19,880 Now before 1.1 responds, 283 00:13:19,880 --> 00:13:24,060 the attacker now sends another ARP packet 284 00:13:24,060 --> 00:13:28,640 directly to 1.20 at 00AABBCCDDEE, 285 00:13:28,940 --> 00:13:32,020 and says, hey, I'm 1.1, 286 00:13:32,820 --> 00:13:34,720 and it gives it its MAC address, 287 00:13:34,900 --> 00:13:37,620 so 00AABBCC01AA. 288 00:13:38,400 --> 00:13:41,720 So now, the attacker is actually, 289 00:13:42,060 --> 00:13:45,820 the victim, 1.20, is talking to the attacker, 290 00:13:46,020 --> 00:13:49,540 where it thinks it's talking to the gateway or 1.1, 291 00:13:49,540 --> 00:13:51,120 so the attacker can do anything it wants 292 00:13:51,120 --> 00:13:53,300 with that data stream, inject things in, 293 00:13:53,400 --> 00:13:54,180 sniff on it, 294 00:13:56,040 --> 00:13:57,340 gather usernames and passwords, 295 00:13:57,560 --> 00:13:58,700 anything that's relevant. 296 00:14:02,060 --> 00:14:04,140 Again, an example of denial of service 297 00:14:04,140 --> 00:14:07,320 would be that 192.168.1.20 298 00:14:07,320 --> 00:14:09,740 requests the hardware address of the gateway, 299 00:14:09,940 --> 00:14:11,520 again, same packet, 300 00:14:12,560 --> 00:14:16,580 and the attacker, instead of replying with his credentials 301 00:14:16,580 --> 00:14:18,160 in order to perform a man in the middle, 302 00:14:18,160 --> 00:14:24,640 replies with a bogus MAC address of 00AABBCC01. 303 00:14:25,280 --> 00:14:30,220 So now the victim goes to try to talk to the gateway, 304 00:14:30,340 --> 00:14:33,380 and can't, the communications channel is severed 305 00:14:33,380 --> 00:14:35,540 because it doesn't really know the hardware address, 306 00:14:35,620 --> 00:14:37,840 even though it thinks it knows the hardware address of 1.1, 307 00:14:37,960 --> 00:14:41,920 so it sends packets out, and 1.1 never receives them. 308 00:14:44,980 --> 00:14:47,840 Another ARP attack, classic ARP attack, 309 00:14:48,160 --> 00:14:50,300 is a cam table overflow. 310 00:14:51,400 --> 00:14:53,700 And this has been around for a long time. 311 00:14:53,980 --> 00:14:57,260 The reason for this specific attack is that 312 00:14:57,260 --> 00:14:59,960 back in the day when anybody used hubs, 313 00:15:01,100 --> 00:15:04,540 a hub is just a dumb piece of network equipment. 314 00:15:05,040 --> 00:15:08,740 So two hosts communicating over a hub, 315 00:15:09,000 --> 00:15:11,080 all of their traffic is forwarded 316 00:15:11,080 --> 00:15:13,020 to all of ports on that hub. 317 00:15:13,200 --> 00:15:15,820 So if you were plugged in anywhere on that hub 318 00:15:15,820 --> 00:15:16,740 or that physical network, 319 00:15:16,740 --> 00:15:21,140 you can intercept or sniff, eavesdrop, 320 00:15:21,260 --> 00:15:24,160 on any of that traffic and that conversation. 321 00:15:25,360 --> 00:15:28,780 And even potentially inject things into stream as well 322 00:15:28,780 --> 00:15:29,360 and things like that. 323 00:15:29,860 --> 00:15:32,560 So switches, though, are different. 324 00:15:32,720 --> 00:15:34,380 As we probably all know, 325 00:15:34,500 --> 00:15:36,940 that switches maintain a table. 326 00:15:37,540 --> 00:15:39,640 This is actually called a cam table, 327 00:15:39,800 --> 00:15:41,420 or content addressable memory table. 328 00:15:41,660 --> 00:15:46,440 And what this table holds is a matrix 329 00:15:46,740 --> 00:15:50,820 of pairs between port numbers and MAC addresses 330 00:15:50,820 --> 00:15:52,880 that are discovered on those port numbers, 331 00:15:53,000 --> 00:15:54,300 along with some other information. 332 00:15:55,160 --> 00:15:57,880 But what's relevant to our discussion right now 333 00:15:57,880 --> 00:16:00,100 is that MAC address and port number pair. 334 00:16:00,340 --> 00:16:04,520 So the cam table says that switch port 23 335 00:16:04,520 --> 00:16:07,840 has these MAC addresses associated with it. 336 00:16:08,220 --> 00:16:10,980 So when an Ethernet frame arrives at the switch, 337 00:16:11,260 --> 00:16:14,660 instead of broadcasting that frame out to all ports, 338 00:16:14,880 --> 00:16:16,720 it instead looks it up in the cam table 339 00:16:16,740 --> 00:16:20,180 and only forwards it to the port 340 00:16:20,180 --> 00:16:22,080 where that MAC address actually exists. 341 00:16:22,440 --> 00:16:24,120 So that kind of severs our ability 342 00:16:24,120 --> 00:16:27,400 to eavesdrop on conversations 343 00:16:27,400 --> 00:16:30,100 because now we're not getting that traffic. 344 00:16:30,200 --> 00:16:31,840 Even if we're in promiscuous mode or whatever, 345 00:16:31,940 --> 00:16:35,160 that traffic just never ends up on our network port. 346 00:16:37,700 --> 00:16:39,400 So a cam table overflow, 347 00:16:40,500 --> 00:16:43,340 what it does is no matter how big your switch is, 348 00:16:43,380 --> 00:16:46,120 no matter what kind of enterprise switch you have, 349 00:16:46,120 --> 00:16:50,200 it's going to have a size limit to the cam table. 350 00:16:50,420 --> 00:16:52,620 I mean, it's not going to be infinitely sized. 351 00:16:52,900 --> 00:16:54,920 So there's going to be some point at which 352 00:16:54,920 --> 00:16:59,780 it has to overflow or purge other information 353 00:16:59,780 --> 00:17:02,180 out of the table if it receives too much information. 354 00:17:02,620 --> 00:17:07,100 So basically what you do to perform a cam table overflow 355 00:17:07,100 --> 00:17:09,720 is you send hundreds or thousands 356 00:17:09,720 --> 00:17:12,640 of spoofed Ethernet frames 357 00:17:12,640 --> 00:17:15,200 with spoof MAC addresses to the network. 358 00:17:16,120 --> 00:17:19,600 And overflow the internal cam table of the network switch. 359 00:17:19,940 --> 00:17:22,860 So here the network switch gets filled up, 360 00:17:23,000 --> 00:17:25,000 starts purging out legitimate data, 361 00:17:25,140 --> 00:17:27,000 and now when legitimate traffic 362 00:17:27,000 --> 00:17:28,780 or legitimate frames enter the switch, 363 00:17:29,040 --> 00:17:32,220 it doesn't have a pairing in that cam table 364 00:17:32,220 --> 00:17:34,280 for a legitimate MAC address. 365 00:17:34,500 --> 00:17:36,440 So it then ends up broadcasting it 366 00:17:36,440 --> 00:17:38,300 to all of the ports on the switch. 367 00:17:38,480 --> 00:17:41,180 So effectively turning the switch into a hub, 368 00:17:41,960 --> 00:17:45,420 just like we were able to do before. 369 00:17:45,420 --> 00:17:48,300 So now we can sniff again on, 370 00:17:49,620 --> 00:17:52,480 we can now sniff again on traffic 371 00:17:52,480 --> 00:17:53,620 on the local network. 372 00:17:56,100 --> 00:17:58,020 Just like we were able to with a hub. 373 00:18:00,060 --> 00:18:01,660 There are weaknesses, though, 374 00:18:01,800 --> 00:18:05,260 with these different ARP attacks. 375 00:18:06,240 --> 00:18:07,980 ARP cache poisoning in particular, 376 00:18:08,860 --> 00:18:10,780 most all of the current methods 377 00:18:10,780 --> 00:18:12,740 of ARP cache poisoning in the tools 378 00:18:12,740 --> 00:18:15,400 that perform this particular attack 379 00:18:15,420 --> 00:18:17,200 as well as different papers 380 00:18:17,200 --> 00:18:20,760 that identify how to do ARP cache poisoning. 381 00:18:21,820 --> 00:18:23,500 Utilize ARP reply packets 382 00:18:23,500 --> 00:18:28,380 as a way to inject the falsified information 383 00:18:28,380 --> 00:18:31,100 into a host's ARP cache table. 384 00:18:32,080 --> 00:18:33,540 But as we said before, 385 00:18:33,700 --> 00:18:37,200 not all OSs, most, will update 386 00:18:37,200 --> 00:18:40,380 when it just receives a gratuitous ARP reply packet, 387 00:18:40,500 --> 00:18:41,900 even though it didn't send out a request. 388 00:18:42,180 --> 00:18:43,420 But not all OSs will. 389 00:18:46,060 --> 00:18:48,580 Some tools have overcome this 390 00:18:48,580 --> 00:18:50,680 by sniffing the network, 391 00:18:50,840 --> 00:18:52,720 and so when it sees the first ARP request, 392 00:18:53,040 --> 00:18:57,740 it races to respond faster than the legitimate host 393 00:18:57,740 --> 00:19:00,680 in order to inject its entry into the ARP cache. 394 00:19:02,020 --> 00:19:04,540 A CAM table overflow obviously 395 00:19:04,540 --> 00:19:06,880 also has weaknesses and drawbacks. 396 00:19:07,120 --> 00:19:09,540 CAM table overflow requires hundreds 397 00:19:09,540 --> 00:19:12,200 or sometimes many thousands 398 00:19:12,200 --> 00:19:14,140 of spoofed frames, 399 00:19:14,840 --> 00:19:15,800 spoofed MAC addresses, 400 00:19:15,980 --> 00:19:17,220 in order to actually overflow 401 00:19:17,220 --> 00:19:19,380 depending on the switch that you're actually using. 402 00:19:20,100 --> 00:19:22,740 So obviously if you're a savvy network engineer 403 00:19:22,740 --> 00:19:25,040 and you've got ethereal running, 404 00:19:25,260 --> 00:19:26,700 then you can probably detect 405 00:19:26,700 --> 00:19:29,740 that an ARP cache or a CAM table overflow 406 00:19:29,740 --> 00:19:32,860 or something funky is happening on your network. 407 00:19:35,720 --> 00:19:38,280 It's very identifiable, very noisy, 408 00:19:38,920 --> 00:19:41,400 lots and lots of, you know, 409 00:19:41,400 --> 00:19:42,860 crap packets on your network. 410 00:19:44,000 --> 00:19:46,080 And we also can prevent 411 00:19:46,080 --> 00:19:48,160 the traditional CAM table overflow 412 00:19:48,160 --> 00:19:51,000 with technologies like port security, 413 00:19:51,280 --> 00:19:52,140 Cisco's port security 414 00:19:52,140 --> 00:19:55,220 and other related types of technologies 415 00:19:55,220 --> 00:19:57,960 that actually can just limit the amount of, 416 00:19:58,040 --> 00:20:00,440 the number of MAC addresses that are allowed 417 00:20:00,440 --> 00:20:02,940 to be identified on a given port. 418 00:20:03,100 --> 00:20:06,100 So if we plug in to port 34 419 00:20:06,100 --> 00:20:08,880 and we send out thousands of bogus frames, 420 00:20:09,120 --> 00:20:10,900 then port security says, 421 00:20:11,400 --> 00:20:13,600 oh, well, there's only 10 allowed 422 00:20:13,600 --> 00:20:14,920 on this particular port. 423 00:20:15,100 --> 00:20:17,240 And so then can either turn off the port 424 00:20:17,240 --> 00:20:19,780 or ignore traffic after that or whatever. 425 00:20:20,220 --> 00:20:22,460 So we're not able to effectively overflow 426 00:20:22,460 --> 00:20:25,520 the CAM table because we can't get 427 00:20:25,520 --> 00:20:27,180 that many frames passed. 428 00:20:29,560 --> 00:20:31,660 So this really kind of mitigates, 429 00:20:31,680 --> 00:20:34,900 this is kind of the default answer 430 00:20:34,900 --> 00:20:38,100 for mitigating the risk of a CAM table overflow. 431 00:20:38,400 --> 00:20:39,620 Again, really, 432 00:20:39,620 --> 00:20:42,420 the whole idea of a switch, 433 00:20:42,640 --> 00:20:44,100 a switch is not a security device. 434 00:20:45,840 --> 00:20:47,780 Relying on that you have a switched network 435 00:20:48,260 --> 00:20:50,720 to prevent people from sniffing on your network 436 00:20:50,720 --> 00:20:51,920 is kind of retarded. 437 00:20:52,160 --> 00:20:54,420 But people do. 438 00:20:54,640 --> 00:20:57,300 And people, they rely on using port security 439 00:20:57,300 --> 00:20:58,840 or they had to add port security 440 00:20:58,840 --> 00:21:01,340 because this was kind of an issue 441 00:21:01,340 --> 00:21:04,100 along with other issues in switched networks. 442 00:21:05,900 --> 00:21:09,140 So we're going to go over some new kind of, 443 00:21:09,620 --> 00:21:10,540 not completely new, 444 00:21:10,720 --> 00:21:13,020 but attacks on ARP 445 00:21:13,020 --> 00:21:15,160 and kind of take a different approach 446 00:21:15,160 --> 00:21:17,360 than the traditional attacks. 447 00:21:18,700 --> 00:21:19,920 To do this, 448 00:21:19,920 --> 00:21:21,860 I wrote a tool called ARPCraft, 449 00:21:22,120 --> 00:21:24,120 which basically just allows us 450 00:21:24,120 --> 00:21:26,300 to put together ARP packets 451 00:21:26,300 --> 00:21:27,540 and send them on the wire 452 00:21:27,540 --> 00:21:29,920 with whatever information we want 453 00:21:29,920 --> 00:21:31,520 put into the different fields 454 00:21:31,520 --> 00:21:33,120 of the ARP packet. 455 00:21:33,840 --> 00:21:36,120 So this is kind of the different options 456 00:21:36,120 --> 00:21:37,420 that are available with ARPCraft. 457 00:21:37,680 --> 00:21:38,360 We have, 458 00:21:38,360 --> 00:21:39,700 we can specify the interface, 459 00:21:40,020 --> 00:21:42,680 we specify the source hardware address, 460 00:21:42,860 --> 00:21:44,240 the source protocol address, 461 00:21:44,580 --> 00:21:45,680 the target hardware address, 462 00:21:45,800 --> 00:21:46,620 and protocol address. 463 00:21:46,920 --> 00:21:48,640 What the opcode is, 464 00:21:48,860 --> 00:21:50,620 whether it's a request or a reply packet. 465 00:21:51,260 --> 00:21:53,460 And we can also specify the 466 00:21:53,460 --> 00:21:55,260 ethernet source and ethernet destination. 467 00:21:55,620 --> 00:21:56,180 So if we want, 468 00:21:56,300 --> 00:21:57,560 by default, 469 00:21:57,680 --> 00:21:59,420 the ethernet source and destination 470 00:21:59,420 --> 00:22:02,640 match what the target hardware address 471 00:22:02,640 --> 00:22:03,420 and protocol address, 472 00:22:03,680 --> 00:22:05,200 or, sorry, 473 00:22:05,380 --> 00:22:07,460 target hardware address 474 00:22:07,460 --> 00:22:08,340 and source hardware address 475 00:22:08,360 --> 00:22:09,820 fields are. 476 00:22:10,020 --> 00:22:10,980 But if we, for some reason, 477 00:22:11,040 --> 00:22:13,520 want to put a different MAC address 478 00:22:13,520 --> 00:22:15,420 in the ethernet frame 479 00:22:15,420 --> 00:22:16,920 than we have in our ARP packet, 480 00:22:17,120 --> 00:22:18,520 then we can do that with those flags. 481 00:22:21,300 --> 00:22:24,140 Again, we can also set the interval. 482 00:22:24,340 --> 00:22:25,100 So in seconds, 483 00:22:25,320 --> 00:22:27,620 how often we want to send this packet 484 00:22:27,620 --> 00:22:28,400 out onto the wire. 485 00:22:28,600 --> 00:22:30,980 By default, I think it's at five seconds. 486 00:22:31,120 --> 00:22:31,880 So every five seconds, 487 00:22:31,980 --> 00:22:33,460 whatever ARP packet we've built, 488 00:22:33,580 --> 00:22:34,920 we send that out onto the wire 489 00:22:34,920 --> 00:22:35,680 every five seconds. 490 00:22:35,820 --> 00:22:36,680 And then a count. 491 00:22:36,820 --> 00:22:37,360 We can set, 492 00:22:37,360 --> 00:22:40,100 we can set how many we want to send out. 493 00:22:40,200 --> 00:22:42,800 So if we just want to send out one, 494 00:22:42,900 --> 00:22:44,720 or if we want to send out 5,000, 495 00:22:44,900 --> 00:22:47,720 we can set that without having to rerun the tool. 496 00:22:52,100 --> 00:22:52,540 Huh. 497 00:22:53,680 --> 00:22:55,080 This is a pretty slide. 498 00:22:57,620 --> 00:22:59,540 Not quite sure what the point with that was. 499 00:23:02,040 --> 00:23:02,480 Anyway, 500 00:23:03,900 --> 00:23:05,900 here's an example of using 501 00:23:06,600 --> 00:23:09,280 ARPCraft to send out an ARP request 502 00:23:09,900 --> 00:23:12,300 to the destination protocol address 503 00:23:12,300 --> 00:23:14,160 of 192.168.1.100, 504 00:23:14,480 --> 00:23:16,580 which has a hardware address 505 00:23:16,580 --> 00:23:20,040 of 00AABBCCDDFF. 506 00:23:20,360 --> 00:23:22,600 And we want it to say 507 00:23:22,600 --> 00:23:24,900 that it's from 192.168.1.20 508 00:23:25,580 --> 00:23:26,680 at the hardware address 509 00:23:26,680 --> 00:23:29,140 of 00AABBCCDDEEE. 510 00:23:30,520 --> 00:23:33,220 So we use ARPCraft, 511 00:23:33,440 --> 00:23:34,880 and we specify the interface 512 00:23:34,880 --> 00:23:36,220 with the dash I. 513 00:23:37,720 --> 00:23:38,680 Dash SHA, 514 00:23:38,860 --> 00:23:39,620 we just put in 515 00:23:39,620 --> 00:23:41,380 our source hardware address 516 00:23:41,380 --> 00:23:42,360 in there, 517 00:23:42,460 --> 00:23:43,360 the MAC address that we want 518 00:23:43,360 --> 00:23:45,040 the packet to say it came from. 519 00:23:45,200 --> 00:23:47,540 And the SPA, 520 00:23:47,580 --> 00:23:48,500 the source protocol address, 521 00:23:48,660 --> 00:23:50,240 the IP address we want it 522 00:23:50,240 --> 00:23:51,500 to say it came from. 523 00:23:52,980 --> 00:23:55,160 And then the target hardware address 524 00:23:55,160 --> 00:23:56,860 and target protocol address, 525 00:23:56,980 --> 00:23:57,280 respectively. 526 00:23:57,640 --> 00:23:59,360 And then the dash O flag, 527 00:23:59,540 --> 00:24:01,280 we want to send out a request packet. 528 00:24:01,840 --> 00:24:02,920 So here you'll see, 529 00:24:02,920 --> 00:24:05,160 the tool kind of prints out 530 00:24:06,980 --> 00:24:09,320 a snapshot of what our packet looks like, 531 00:24:09,420 --> 00:24:10,180 kind of a layout 532 00:24:10,180 --> 00:24:11,260 of what the different fields 533 00:24:11,260 --> 00:24:12,960 in the ARP packet are going to look like, 534 00:24:13,060 --> 00:24:14,680 so that if something looks wrong, 535 00:24:14,800 --> 00:24:15,820 you can cancel it 536 00:24:15,820 --> 00:24:17,780 and maybe you made a mistake 537 00:24:17,780 --> 00:24:18,660 in the options or whatever. 538 00:24:18,900 --> 00:24:19,880 And then it just goes ahead 539 00:24:19,880 --> 00:24:20,960 and injects the ARP request 540 00:24:20,960 --> 00:24:21,940 to the wire. 541 00:24:25,640 --> 00:24:26,620 Same thing with this, 542 00:24:26,660 --> 00:24:27,840 just another example of, 543 00:24:28,280 --> 00:24:28,780 let's see, 544 00:24:39,460 --> 00:24:40,820 hmm, anyway. 545 00:24:41,720 --> 00:24:44,840 Okay, so another approach 546 00:24:44,840 --> 00:24:46,840 to ARP cache poisoning, 547 00:24:47,160 --> 00:24:48,280 instead of, 548 00:24:48,920 --> 00:24:50,240 basically instead of using 549 00:24:50,240 --> 00:24:51,540 ARP reply packets, 550 00:24:51,780 --> 00:24:55,080 we went over the weaknesses already 551 00:24:55,080 --> 00:24:55,880 to a certain extent 552 00:24:55,880 --> 00:24:57,020 of ARP cache poisoning 553 00:24:57,020 --> 00:24:58,580 or the traditional methods 554 00:24:58,580 --> 00:24:59,700 of ARP cache poisoning. 555 00:24:59,920 --> 00:25:00,920 So again, 556 00:25:01,560 --> 00:25:02,900 some OSs don't update 557 00:25:02,920 --> 00:25:03,500 their ARP cache 558 00:25:03,500 --> 00:25:05,280 just when they receive 559 00:25:05,280 --> 00:25:06,540 a gratuitous ARP reply. 560 00:25:08,380 --> 00:25:09,340 Most OSs, 561 00:25:09,500 --> 00:25:10,960 if not all OSs, 562 00:25:11,040 --> 00:25:12,640 according to RFC, 563 00:25:13,740 --> 00:25:16,160 won't just add an ARP entry 564 00:25:16,160 --> 00:25:17,120 into the cache 565 00:25:17,120 --> 00:25:18,680 if it doesn't already exist 566 00:25:18,680 --> 00:25:19,200 in the cache 567 00:25:19,200 --> 00:25:20,340 when it receives a reply. 568 00:25:20,580 --> 00:25:22,100 So that's a little convoluted 569 00:25:22,540 --> 00:25:23,340 as far as that sentence, 570 00:25:23,460 --> 00:25:24,980 but basically what that means is, 571 00:25:25,080 --> 00:25:26,300 if I'm a host 572 00:25:26,300 --> 00:25:28,060 and I receive a gratuitous ARP reply, 573 00:25:28,240 --> 00:25:29,840 because I didn't send out 574 00:25:29,840 --> 00:25:30,620 an ARP request, 575 00:25:30,800 --> 00:25:31,900 I just receive an ARP reply 576 00:25:31,900 --> 00:25:32,280 saying, 577 00:25:32,920 --> 00:25:33,960 182.168.1.1, 578 00:25:34,540 --> 00:25:34,980 the gateway, 579 00:25:35,120 --> 00:25:35,720 is at, 580 00:25:35,760 --> 00:25:36,340 you know, 581 00:25:36,360 --> 00:25:36,500 blah. 582 00:25:38,540 --> 00:25:40,440 If 1.1 is in my cache 583 00:25:40,440 --> 00:25:41,940 and I'm a retarded host, 584 00:25:42,140 --> 00:25:44,180 then I will update my cache 585 00:25:44,180 --> 00:25:44,660 and say, 586 00:25:44,780 --> 00:25:44,960 okay, 587 00:25:45,020 --> 00:25:47,020 1.1 is at blah MAC address, 588 00:25:47,220 --> 00:25:49,360 but I'm not going to add it 589 00:25:49,360 --> 00:25:49,980 to my cache 590 00:25:49,980 --> 00:25:53,500 if it doesn't already exist there. 591 00:25:53,600 --> 00:25:54,400 I'll update it 592 00:25:54,400 --> 00:25:55,120 if it's already there, 593 00:25:55,320 --> 00:25:56,120 but I'm not gonna add 594 00:25:56,120 --> 00:25:57,420 a new host to my cache 595 00:25:57,420 --> 00:25:58,500 just because I receive 596 00:25:58,500 --> 00:25:59,420 an ARP reply 597 00:25:59,420 --> 00:26:00,740 that I never sent out 598 00:26:00,740 --> 00:26:01,320 a request for. 599 00:26:02,920 --> 00:26:04,760 Then another weakness is like, 600 00:26:04,840 --> 00:26:06,380 along the same lines, 601 00:26:06,560 --> 00:26:07,840 some OSs, 602 00:26:07,880 --> 00:26:09,140 specifically Solaris, 603 00:26:09,240 --> 00:26:10,960 Solaris has kind of traditionally been 604 00:26:10,960 --> 00:26:13,180 kind of harder to perform 605 00:26:13,760 --> 00:26:16,100 ARP cache poisoning on, 606 00:26:16,200 --> 00:26:18,400 because the problem is 607 00:26:18,400 --> 00:26:20,980 that Solaris doesn't rely, 608 00:26:21,220 --> 00:26:22,480 they don't really conform 609 00:26:22,480 --> 00:26:24,820 to the RFC specification 610 00:26:24,820 --> 00:26:26,300 as far as what to do 611 00:26:26,300 --> 00:26:26,880 when you receive 612 00:26:26,880 --> 00:26:27,940 an ARP request or reply. 613 00:26:28,240 --> 00:26:30,420 If it has an entry in its table, 614 00:26:30,520 --> 00:26:31,920 in its local cache, 615 00:26:31,920 --> 00:26:34,300 and it receives either a reply 616 00:26:34,300 --> 00:26:35,320 or a request or whatever, 617 00:26:35,600 --> 00:26:36,660 it doesn't update it. 618 00:26:36,740 --> 00:26:39,400 If it differs from what it already has 619 00:26:39,400 --> 00:26:39,920 in its table, 620 00:26:40,060 --> 00:26:40,640 it does nothing. 621 00:26:41,920 --> 00:26:42,800 But instead, 622 00:26:42,980 --> 00:26:45,200 it just goes on a timeout. 623 00:26:45,300 --> 00:26:46,820 So it waits for that entry 624 00:26:46,820 --> 00:26:47,360 to time out, 625 00:26:47,420 --> 00:26:48,700 then it sends out a new ARP request 626 00:26:48,700 --> 00:26:49,920 and resolves it in that way. 627 00:26:50,140 --> 00:26:51,860 So in order to poison, 628 00:26:52,100 --> 00:26:52,820 you're basically stuck 629 00:26:52,820 --> 00:26:54,160 in this race condition 630 00:26:54,160 --> 00:26:55,820 as far as you have to wait 631 00:26:55,820 --> 00:26:57,760 for Solaris to time out its entry, 632 00:26:57,860 --> 00:26:59,600 then send out the first request packet 633 00:26:59,600 --> 00:27:01,140 and respond with a reply 634 00:27:01,140 --> 00:27:03,160 faster than the legitimate host 635 00:27:03,160 --> 00:27:05,640 in order to poison a Solaris machine. 636 00:27:05,980 --> 00:27:06,860 In a way, 637 00:27:07,020 --> 00:27:08,380 if you can do it correctly, 638 00:27:08,520 --> 00:27:09,200 it has a certain benefit 639 00:27:09,200 --> 00:27:11,800 because then that host, 640 00:27:12,000 --> 00:27:12,640 that entry, 641 00:27:12,840 --> 00:27:14,520 your forged entry, 642 00:27:14,720 --> 00:27:16,060 is not going to be updated 643 00:27:16,060 --> 00:27:17,780 by even the legitimate server 644 00:27:17,780 --> 00:27:19,000 or legitimate machine. 645 00:27:19,140 --> 00:27:19,860 It's stuck in there 646 00:27:19,860 --> 00:27:20,720 until it times out. 647 00:27:23,940 --> 00:27:24,740 Notice, though, 648 00:27:24,820 --> 00:27:25,880 that RFC 826, 649 00:27:26,040 --> 00:27:28,440 which specifies the ARP specification, 650 00:27:29,740 --> 00:27:30,660 says that 651 00:27:31,140 --> 00:27:32,460 instead of an ARP reply, 652 00:27:32,840 --> 00:27:35,040 if a host receives an ARP request, 653 00:27:35,500 --> 00:27:40,020 so if I am sitting along 654 00:27:40,020 --> 00:27:41,000 as Joe Blow host 655 00:27:41,000 --> 00:27:42,840 and I receive a request 656 00:27:42,840 --> 00:27:44,020 for my information, 657 00:27:44,300 --> 00:27:45,820 so my MAC address 658 00:27:45,820 --> 00:27:47,440 according to my IP, 659 00:27:48,140 --> 00:27:50,320 and the target protocol address, 660 00:27:50,440 --> 00:27:50,820 of course, 661 00:27:50,960 --> 00:27:54,020 because it's sent out to broadcast, 662 00:27:54,340 --> 00:27:55,560 if it matches the information 663 00:27:55,560 --> 00:27:56,520 that I have, 664 00:27:56,700 --> 00:27:58,080 if it's my protocol address 665 00:27:58,080 --> 00:27:58,940 that it's looking for 666 00:27:58,940 --> 00:28:01,120 to resolve the MAC address, 667 00:28:02,460 --> 00:28:03,940 then before responding, 668 00:28:04,080 --> 00:28:06,460 first the host updates 669 00:28:06,960 --> 00:28:09,000 or adds the source protocol address 670 00:28:09,000 --> 00:28:10,240 and hardware address pair 671 00:28:10,240 --> 00:28:11,620 to the local cache. 672 00:28:12,180 --> 00:28:12,700 Again, 673 00:28:13,260 --> 00:28:15,200 if somebody asks me 674 00:28:15,200 --> 00:28:16,200 for my information, 675 00:28:16,500 --> 00:28:18,260 whether if I have that information, 676 00:28:18,540 --> 00:28:19,880 if I have their information 677 00:28:19,880 --> 00:28:20,560 in my cache, 678 00:28:20,820 --> 00:28:21,800 or even if I don't, 679 00:28:21,840 --> 00:28:23,120 first of all, 680 00:28:23,120 --> 00:28:24,140 what I do is I check 681 00:28:24,140 --> 00:28:25,080 if it's in my cache. 682 00:28:25,300 --> 00:28:26,120 If it is, 683 00:28:26,220 --> 00:28:27,300 then I'll update it. 684 00:28:27,400 --> 00:28:28,000 If it's not, 685 00:28:28,140 --> 00:28:29,500 I actually add their information. 686 00:28:29,500 --> 00:28:30,060 Basically, 687 00:28:30,700 --> 00:28:31,820 it's for performance reasons, 688 00:28:32,400 --> 00:28:36,120 so that if you don't have to 689 00:28:36,120 --> 00:28:38,820 both exchange and send out ARP requests, 690 00:28:39,240 --> 00:28:42,120 only one request initiation 691 00:28:42,120 --> 00:28:45,240 will update the cache on both sides. 692 00:28:45,520 --> 00:28:46,700 If you send out a request 693 00:28:46,700 --> 00:28:49,100 to a victim or to a host, 694 00:28:50,640 --> 00:28:52,340 they'll update their cache 695 00:28:52,340 --> 00:28:53,780 with your information as well, 696 00:28:53,840 --> 00:28:56,880 so that they have the cache now 697 00:28:56,880 --> 00:28:58,560 in order to speak with you further. 698 00:28:59,860 --> 00:29:02,400 The actual verbiage from RFC 826, 699 00:29:02,740 --> 00:29:03,840 you can see there, 700 00:29:04,440 --> 00:29:05,400 it's pretty straightforward. 701 00:29:05,700 --> 00:29:07,900 It basically just says what I just said. 702 00:29:10,340 --> 00:29:12,180 Instead of using an ARP reply packet, 703 00:29:12,380 --> 00:29:13,780 we can use an ARP request packet 704 00:29:14,900 --> 00:29:17,040 to inject our information, 705 00:29:17,280 --> 00:29:18,120 the information we want, 706 00:29:18,300 --> 00:29:19,620 into an ARP cache 707 00:29:20,500 --> 00:29:21,980 in order to poison an ARP cache. 708 00:29:25,320 --> 00:29:27,060 All we need is a single packet. 709 00:29:27,220 --> 00:29:28,660 We don't have to wait for an ARP request 710 00:29:28,660 --> 00:29:29,500 to come out from them 711 00:29:29,500 --> 00:29:31,200 and try to race with a response. 712 00:29:31,860 --> 00:29:33,040 All we need to do 713 00:29:33,040 --> 00:29:34,840 is send out a request 714 00:29:34,840 --> 00:29:35,640 with our information, 715 00:29:35,840 --> 00:29:37,780 and most hosts will just update 716 00:29:37,780 --> 00:29:39,840 if that host already exists 717 00:29:39,840 --> 00:29:41,300 in the cache. 718 00:29:41,540 --> 00:29:41,820 Otherwise, 719 00:29:42,060 --> 00:29:44,900 you can actually add new entries, 720 00:29:45,020 --> 00:29:45,980 where with a reply packet, 721 00:29:46,200 --> 00:29:47,760 it's not going to add a new entry 722 00:29:47,760 --> 00:29:48,180 into the cache, 723 00:29:48,440 --> 00:29:49,520 but we can actually inject 724 00:29:49,520 --> 00:29:50,880 new entries into the cache 725 00:29:51,540 --> 00:29:52,660 using a request packet. 726 00:29:54,720 --> 00:29:56,060 Here, the attacker, 727 00:29:56,260 --> 00:29:57,880 without being initiated 728 00:29:57,880 --> 00:30:00,500 by the victim, 1.20, 729 00:30:00,680 --> 00:30:01,600 the attacker just sends 730 00:30:01,600 --> 00:30:03,080 a request packet to 1.20, 731 00:30:03,200 --> 00:30:05,460 saying it's from 1.1, 732 00:30:05,620 --> 00:30:07,540 but it's with the attacker's MAC address. 733 00:30:07,720 --> 00:30:10,260 We see that the opcode on this packet 734 00:30:10,260 --> 00:30:13,460 is 1, or a request, 735 00:30:13,600 --> 00:30:16,060 so we're sending a request packet to 1.20, 736 00:30:17,480 --> 00:30:19,880 and saying the sender hardware address 737 00:30:19,880 --> 00:30:23,220 is 00AABBCC01AA, 738 00:30:23,520 --> 00:30:25,160 which is the attacker's hardware address, 739 00:30:25,300 --> 00:30:27,320 and then saying our protocol address 740 00:30:27,880 --> 00:30:28,240 is the gateways, 741 00:30:28,980 --> 00:30:31,800 and then sending it to the victim, 742 00:30:31,960 --> 00:30:33,320 their target hardware address 743 00:30:33,320 --> 00:30:34,460 and protocol address. 744 00:30:36,540 --> 00:30:37,020 Sorry? 745 00:30:38,560 --> 00:30:39,040 Yes. 746 00:30:39,960 --> 00:30:40,440 Sorry. 747 00:30:45,100 --> 00:30:45,580 Huh? 748 00:30:47,080 --> 00:30:47,880 Oh, I'm sorry. 749 00:30:47,980 --> 00:30:49,120 He said, is it unicast? 750 00:30:49,880 --> 00:30:50,660 Yeah, sorry. 751 00:30:51,780 --> 00:30:52,740 I'm bad at that. 752 00:30:53,900 --> 00:30:55,680 So, like, throw things at me 753 00:30:55,680 --> 00:30:56,940 if I don't repeat the question. 754 00:30:58,100 --> 00:31:01,140 So, I'm going to kind of demo that. 755 00:31:55,060 --> 00:31:57,860 All right. 756 00:32:03,920 --> 00:32:10,560 So, I'm going to send, say, here we have our victim here as a FreeBSD box, and I'm going 757 00:32:10,560 --> 00:32:16,760 to just enter a random MAC address and IP pair into its cache. 758 00:32:17,840 --> 00:32:23,280 So, here we have the current ARP cache, which has an entry for 1.1 and 1.157. 759 00:32:23,280 --> 00:32:23,420 I'm going to write this one down. 760 00:32:23,420 --> 00:32:23,440 So, I'm going to type in 1.1.1.7. 761 00:32:37,070 --> 00:32:40,500 And it's here. 762 00:32:49,320 --> 00:32:52,360 And then, I'm just going to type in 1.2.7. 763 00:32:52,360 --> 00:32:52,860 And then, I'm just going to type in 0.7. 764 00:32:53,020 --> 00:32:53,260 All right. 765 00:32:55,500 --> 00:32:56,900 Thank you. 766 00:33:30,560 --> 00:33:35,800 Okay, so we're just injecting to 192.168.1.163 767 00:33:35,800 --> 00:33:39,440 an ARP request packet from 1.2 768 00:33:40,300 --> 00:33:43,800 saying that 1.2 is at 00 deadbeef01. 769 00:33:44,080 --> 00:33:46,900 So now we'll go over to the victim and look at the ARP cache, 770 00:33:47,600 --> 00:33:52,380 and we have an entry for 1.2 at 00 deadbeef01. 771 00:33:53,280 --> 00:33:58,380 So we can just arbitrarily enter entries into the ARP cache 772 00:33:58,380 --> 00:34:02,020 using request as opposed to just gratuitous reply packets. 773 00:34:05,740 --> 00:34:12,800 I'll demo a little further that we can overwrite 1, 1.1, 774 00:34:13,300 --> 00:34:16,580 our gateway, with 00 deadbeef01 775 00:34:19,420 --> 00:34:22,260 by using request packet 2. 776 00:34:24,980 --> 00:34:26,680 So here, 1.1, 777 00:34:28,980 --> 00:34:34,060 now we've overwritten the gateway address with deadbeef01. 778 00:34:34,340 --> 00:34:38,060 So it's a fairly straightforward ARP cache poisoning technique, 779 00:34:38,240 --> 00:34:39,980 but it's just using a different packet type, 780 00:34:40,100 --> 00:34:42,420 so it's a little bit more reliable on different hosts. 781 00:34:44,540 --> 00:34:45,060 Thanks. 782 00:34:45,800 --> 00:34:46,320 Thanks. 783 00:34:53,280 --> 00:34:57,980 So again, we talked about the weaknesses of some of the ARP poisoning techniques. 784 00:34:58,940 --> 00:35:01,540 Cam table overflows obviously have certain weaknesses. 785 00:35:01,660 --> 00:35:05,000 They can be prevented with port security. 786 00:35:05,200 --> 00:35:09,500 They can be very easily identified by an intrusion detection system 787 00:35:09,500 --> 00:35:12,900 or an administrator running TCP dump. 788 00:35:14,340 --> 00:35:22,260 It takes thousands of packets usually in order to perform a successful cam table overflow. 789 00:35:23,540 --> 00:35:24,520 Do you have a question? 790 00:35:29,080 --> 00:35:30,200 Static cam entries? 791 00:35:31,040 --> 00:35:37,100 Yeah, static entries are usually a fairly acceptable defense 792 00:35:37,100 --> 00:35:40,420 for any of the, even for ARP cache poisoning as well. 793 00:35:40,540 --> 00:35:45,640 Static ARP entries are probably the best way to go as far as defense. 794 00:35:45,880 --> 00:35:49,600 It's just in your average enterprise network, 795 00:35:49,800 --> 00:35:52,940 you can't really create static entries for all of your hosts. 796 00:35:52,940 --> 00:35:54,900 So that's obviously a mitigating problem. 797 00:35:58,100 --> 00:36:00,060 Okay, so we went over those problems, 798 00:36:00,280 --> 00:36:05,000 but often, usually we don't really need in a real targeted attack, 799 00:36:05,320 --> 00:36:08,020 we don't really need to sniff the entire network for something. 800 00:36:08,160 --> 00:36:09,340 I mean, it might be nice sometimes, 801 00:36:09,560 --> 00:36:13,760 but usually we're going after one machine or a more targeted approach, 802 00:36:14,520 --> 00:36:18,040 especially if stealth is in order at all. 803 00:36:19,540 --> 00:36:22,300 So there's a couple of ways that we could already do that. 804 00:36:22,360 --> 00:36:22,440 Okay. 805 00:36:22,940 --> 00:36:29,240 We can already inject into the, or poison the ARP cache of a specific host. 806 00:36:29,320 --> 00:36:31,960 So a man in the middle attack essentially allows us to sniff as well 807 00:36:31,960 --> 00:36:33,680 because traffic is going through us. 808 00:36:33,840 --> 00:36:36,140 So it's kind of a targeted sniffing approach. 809 00:36:36,260 --> 00:36:41,700 That's how most people get by sniffing on a switch network 810 00:36:41,700 --> 00:36:43,200 without using a cam table overflow. 811 00:36:43,440 --> 00:36:47,280 You just poison the ARP cache and perform a man in the middle attack 812 00:36:47,280 --> 00:36:49,300 and then you can sniff on that traffic. 813 00:36:49,520 --> 00:36:52,140 But obviously that's not always appropriate 814 00:36:52,140 --> 00:36:52,660 because... 815 00:36:52,940 --> 00:37:01,020 Now your MAC address is in the ARP cache table of the victim. 816 00:37:01,220 --> 00:37:04,160 So you can forensically and further, 817 00:37:05,170 --> 00:37:09,240 it's just easier to identify who's actually perpetrating an attack. 818 00:37:11,100 --> 00:37:16,680 But a little bit back before as far as the whole cam table scenario, 819 00:37:17,140 --> 00:37:21,140 if a switch receives a frame and checks its cam 820 00:37:21,140 --> 00:37:22,460 and doesn't have... 821 00:37:23,100 --> 00:37:27,060 Doesn't have that pair or an entry that matches that frame, 822 00:37:27,300 --> 00:37:29,860 it, again, it floods it to the entire network. 823 00:37:32,000 --> 00:37:33,880 So we can accomplish the same thing 824 00:37:33,880 --> 00:37:37,080 as opposed to flooding and overflowing the entire cam table. 825 00:37:37,240 --> 00:37:42,160 We can accomplish this type of attack by just... 826 00:37:42,160 --> 00:37:42,660 Here. 827 00:37:45,280 --> 00:37:48,300 Again, utilizing the ARP cache poisoning technique. 828 00:37:49,100 --> 00:37:52,140 Instead of poisoning and performing a man in the middle attack, 829 00:37:52,140 --> 00:37:56,000 we just poison the target with a null MAC address. 830 00:37:56,900 --> 00:38:00,340 And so basically when the target sends it out onto the network, 831 00:38:00,540 --> 00:38:02,800 the switch doesn't have an entry in its cam table, 832 00:38:02,900 --> 00:38:04,200 so it floods it to all ports again. 833 00:38:04,640 --> 00:38:06,200 But it still gets through. 834 00:38:06,400 --> 00:38:08,820 The gateway, the traffic is not going to be interrupted. 835 00:38:09,160 --> 00:38:11,340 So even if you don't... 836 00:38:11,340 --> 00:38:13,040 If you're in a man in the middle attack, 837 00:38:13,180 --> 00:38:16,320 you actually have to route the traffic back to the legitimate host. 838 00:38:16,540 --> 00:38:21,200 Here, it gets to all the ports and the legitimate host is still going to pick it up 839 00:38:21,200 --> 00:38:22,120 because it's got an entry. 840 00:38:22,140 --> 00:38:25,900 It's got a null destination on the frame. 841 00:38:27,980 --> 00:38:30,320 So we can kind of... 842 00:38:30,320 --> 00:38:36,640 We can perform targeted sniffing or eavesdropping on a switched network 843 00:38:36,640 --> 00:38:38,320 by using this technique. 844 00:38:38,680 --> 00:38:42,380 And this works on every switch that is out there 845 00:38:42,380 --> 00:38:43,560 because it's really... 846 00:38:44,120 --> 00:38:47,520 The underlying principle is that it looks in the cam table 847 00:38:47,520 --> 00:38:51,240 and since that pair, the null MAC address pair, 848 00:38:52,140 --> 00:38:53,220 doesn't exist in the cam table, 849 00:38:53,360 --> 00:38:54,520 then it floods it to all the ports. 850 00:38:56,380 --> 00:38:59,980 This doesn't require hundreds or thousands of packets. 851 00:39:00,100 --> 00:39:07,260 It requires a single packet in order to inject or poison the ARP table 852 00:39:07,260 --> 00:39:08,980 of our victim host. 853 00:39:09,780 --> 00:39:11,920 So port security is not going to stop it. 854 00:39:12,080 --> 00:39:13,120 We're not actually... 855 00:39:13,120 --> 00:39:14,900 Even if we're sending it to multiple hosts, 856 00:39:14,980 --> 00:39:18,840 we're not spraying thousands of random MAC address 857 00:39:18,840 --> 00:39:21,560 or frames with random MAC addresses 858 00:39:21,560 --> 00:39:23,900 out to the network in order to overflow a cam table. 859 00:39:24,680 --> 00:39:26,100 It's only a single MAC address. 860 00:39:26,280 --> 00:39:28,600 And so we're not using multiple entries 861 00:39:29,180 --> 00:39:32,540 in the allowable entries from port security, etc. 862 00:39:33,880 --> 00:39:36,200 And obviously it's less identifiable. 863 00:39:36,320 --> 00:39:38,800 A single packet is a lot less identifiable on your network 864 00:39:38,800 --> 00:39:41,720 than thousands of bogus packets. 865 00:39:45,720 --> 00:39:48,840 A few other fun little things with ARP. 866 00:39:53,120 --> 00:39:55,420 Some OSs can actually be poisoned 867 00:39:55,420 --> 00:39:58,320 with their own MAC address for the destination. 868 00:39:58,920 --> 00:40:03,340 So here we can actually poison the... 869 00:40:03,340 --> 00:40:06,700 Say we want to sever a connection 870 00:40:06,700 --> 00:40:07,900 or denial of service connection 871 00:40:07,900 --> 00:40:11,740 between a host and a logging server. 872 00:40:12,100 --> 00:40:14,960 All we have to do is send a request packet again 873 00:40:15,800 --> 00:40:18,020 with the sender hardware address, 874 00:40:18,240 --> 00:40:20,900 which equals the host that we're poisoning, 875 00:40:20,900 --> 00:40:22,780 and the target hardware address 876 00:40:22,780 --> 00:40:25,380 equaling the host that we're poisoning. 877 00:40:25,560 --> 00:40:29,920 And then the target protocol address 878 00:40:29,920 --> 00:40:33,280 and target sender protocol address 879 00:40:33,900 --> 00:40:36,300 with the hosts that were... 880 00:40:36,900 --> 00:40:40,280 The target would be the host we're poisoning 881 00:40:40,280 --> 00:40:42,600 and the sender would be the host 882 00:40:42,600 --> 00:40:44,320 that we're masquerading as. 883 00:40:44,580 --> 00:40:46,180 And now we can completely... 884 00:40:46,180 --> 00:40:48,840 Basically, the host doesn't even send it out to the network 885 00:40:48,840 --> 00:40:50,700 because it thinks it's local. 886 00:40:50,700 --> 00:40:54,060 And so the traffic never ends up on the switch. 887 00:40:54,980 --> 00:40:57,380 So it can't communicate with the log server, et cetera. 888 00:40:57,880 --> 00:40:58,180 Yeah? 889 00:40:58,360 --> 00:40:59,920 You said some OSs. 890 00:41:00,060 --> 00:41:00,500 Yeah. 891 00:41:00,620 --> 00:41:01,960 What OSs let you do that? 892 00:41:03,700 --> 00:41:05,140 Windows will let you do it. 893 00:41:06,440 --> 00:41:07,480 Solaris will let you do it. 894 00:41:09,140 --> 00:41:10,520 I don't think... 895 00:41:10,520 --> 00:41:12,020 If I remember correctly, 896 00:41:13,160 --> 00:41:15,220 FreeBSD, I think, doesn't do that. 897 00:41:15,280 --> 00:41:17,700 It actually does check if it's in your... 898 00:41:17,700 --> 00:41:19,520 If it's already, you know, 899 00:41:19,520 --> 00:41:20,540 one of the local interfaces. 900 00:41:21,500 --> 00:41:22,840 So just test. 901 00:41:23,180 --> 00:41:24,240 I mean, the tool, 902 00:41:24,400 --> 00:41:27,300 ARPCraft is gonna be released for... 903 00:41:27,300 --> 00:41:28,620 So, you know, play around with it. 904 00:41:28,680 --> 00:41:30,700 There's other network testing tools, too, 905 00:41:30,800 --> 00:41:32,060 like SCAPI and things like that 906 00:41:32,060 --> 00:41:33,400 that can do similar things. 907 00:41:33,860 --> 00:41:34,220 So... 908 00:41:37,300 --> 00:41:38,320 So here, obviously, 909 00:41:39,180 --> 00:41:43,480 tries to log to a network syslog server. 910 00:41:43,780 --> 00:41:46,100 The attacks that you've done after poisoning cache 911 00:41:46,100 --> 00:41:47,780 can't talk to the syslog server. 912 00:41:47,980 --> 00:41:48,820 So, you know, 913 00:41:49,420 --> 00:41:50,380 nobody's gonna see anything 914 00:41:50,380 --> 00:41:52,140 other than on the local host. 915 00:41:52,220 --> 00:41:54,060 So you pop whatever vulnerable service 916 00:41:54,060 --> 00:41:55,460 and, you know, drop the logs there. 917 00:41:59,340 --> 00:42:00,960 Another thing that's kind of cool 918 00:42:00,960 --> 00:42:03,080 or kind of fun, silly, 919 00:42:03,640 --> 00:42:06,500 is that if a host receives an ARP request or reply 920 00:42:06,500 --> 00:42:09,380 with the same protocol address as its own 921 00:42:09,380 --> 00:42:11,720 or one of its own interfaces, 922 00:42:12,800 --> 00:42:14,180 but a different MAC address, 923 00:42:14,380 --> 00:42:15,220 so it's saying... 924 00:42:15,220 --> 00:42:16,700 So if some other host on the network 925 00:42:16,700 --> 00:42:18,360 is saying that it has that IP address, 926 00:42:19,000 --> 00:42:21,400 then most OSes, Windows, 927 00:42:21,860 --> 00:42:23,980 a bunch of the Nixes, things like that, 928 00:42:24,080 --> 00:42:25,820 will complain to the user 929 00:42:25,820 --> 00:42:28,740 that whether it's via syslog or console log 930 00:42:28,740 --> 00:42:30,660 or in case of Windows, 931 00:42:30,820 --> 00:42:32,020 it actually pops up a dialog 932 00:42:32,020 --> 00:42:34,380 that there's a duplicate IP address on the network. 933 00:42:34,960 --> 00:42:38,940 So you can play games with Windows users 934 00:42:38,940 --> 00:42:42,360 by sending them or popping up this nice dialog 935 00:42:42,360 --> 00:42:43,740 or a bunch of times. 936 00:42:43,900 --> 00:42:46,760 Helps out social engineering attempts, actually, 937 00:42:46,780 --> 00:42:48,800 because if you do this, you know, 938 00:42:48,820 --> 00:42:51,620 a bunch of times in a row or just do it in a loop 939 00:42:51,620 --> 00:42:54,780 and it actually burns up quite a bit of clock cycles. 940 00:42:54,900 --> 00:42:56,280 I've had Windows machines just crash 941 00:42:56,280 --> 00:42:58,160 if you just kind of keep sending them the thing. 942 00:43:00,700 --> 00:43:01,420 But if... 943 00:43:01,420 --> 00:43:02,740 Or if you just do it, you know, 944 00:43:02,740 --> 00:43:03,620 for a little amount of time 945 00:43:03,620 --> 00:43:05,060 and you call up as tech support 946 00:43:05,060 --> 00:43:07,140 and say that apparently they've been having, 947 00:43:07,220 --> 00:43:09,320 you know, a conflict of IP addresses 948 00:43:09,320 --> 00:43:10,540 and ask for their username and password. 949 00:43:10,700 --> 00:43:11,800 Most people actually do it. 950 00:43:11,880 --> 00:43:13,340 So, you know, kind of fun. 951 00:43:18,980 --> 00:43:21,640 Other fun with ARP, 952 00:43:23,600 --> 00:43:24,960 the Kaminsky Factor. 953 00:43:25,560 --> 00:43:27,680 Got to throw in a covert channel, of course, 954 00:43:27,740 --> 00:43:31,040 over any protocol like DNS or ARP or whatever. 955 00:43:32,140 --> 00:43:35,360 So just like any protocol that has optional fields 956 00:43:35,360 --> 00:43:36,460 or fields that you can play with, 957 00:43:36,600 --> 00:43:39,620 you can throw other data in it and get it across. 958 00:43:39,900 --> 00:43:44,300 So we can use ARP to transmit, you know, 959 00:43:44,300 --> 00:43:47,620 secret information over a local area network. 960 00:43:49,080 --> 00:43:51,640 Basically, I had a demo, 961 00:43:51,740 --> 00:43:53,040 but it's... 962 00:43:53,040 --> 00:43:55,640 The other hardware's not working, so... 963 00:43:56,560 --> 00:43:58,960 But I do have a better demo, actually. 964 00:43:59,320 --> 00:44:02,400 So we're actually, in this case, 965 00:44:02,480 --> 00:44:05,500 just using a sender hardware address field, 966 00:44:05,680 --> 00:44:07,020 which is just four byte... 967 00:44:07,020 --> 00:44:11,620 Or six bytes of bandwidth per packet. 968 00:44:11,780 --> 00:44:13,200 I think I said four, yeah. 969 00:44:14,140 --> 00:44:17,120 I had to rewrite this stupid slide deck last night 970 00:44:17,120 --> 00:44:17,600 because, like, 971 00:44:17,620 --> 00:44:20,820 I only brought the PDF version stupidly, so... 972 00:44:21,340 --> 00:44:23,100 Excuse any typos, please, 973 00:44:23,280 --> 00:44:25,940 because I wasn't not partying either, so... 974 00:44:27,740 --> 00:44:30,560 Anyway, we get six bytes of bandwidth per packet. 975 00:44:36,300 --> 00:44:38,780 Somebody's saying something, but... 976 00:44:41,760 --> 00:44:44,260 And then, basically, in order to just kind of 977 00:44:44,260 --> 00:44:46,320 simply obfuscate the message over the wire, 978 00:44:46,320 --> 00:44:49,080 we just threw in a little bit of XOR encryption 979 00:44:49,080 --> 00:44:51,680 with a shared key between the client and server 980 00:44:51,680 --> 00:44:54,240 and can receive, you know, secret messages. 981 00:44:54,600 --> 00:44:57,460 We could increase the bandwidth per packet 982 00:44:57,460 --> 00:44:58,980 by using more than one field, 983 00:44:59,060 --> 00:45:00,860 or, even more simply, 984 00:45:01,100 --> 00:45:03,620 since, like we went over, 985 00:45:03,740 --> 00:45:06,160 we can specify the length of the address fields, 986 00:45:06,340 --> 00:45:08,320 we can specify whatever length we want 987 00:45:08,320 --> 00:45:09,400 for the hardware address field 988 00:45:09,400 --> 00:45:10,460 or the protocol address field, 989 00:45:10,560 --> 00:45:12,620 and just stuff as much data as we want. 990 00:45:12,700 --> 00:45:15,800 So we could specify a length of, you know, 1,024, 991 00:45:15,800 --> 00:45:19,520 and stuff a, you know, kilobyte of data 992 00:45:19,520 --> 00:45:21,720 into that hardware address field 993 00:45:21,720 --> 00:45:23,680 or the protocol address field 994 00:45:23,680 --> 00:45:25,240 and put one packet on the network 995 00:45:25,240 --> 00:45:26,760 and get all the data we want. 996 00:45:30,280 --> 00:45:31,780 Another kind of... 997 00:45:32,440 --> 00:45:33,340 kind of... 998 00:45:36,000 --> 00:45:36,960 extra thing, 999 00:45:37,720 --> 00:45:39,540 instead of just passing network... 1000 00:45:39,540 --> 00:45:41,360 passing messages over the network, 1001 00:45:41,620 --> 00:45:42,880 I kind of went a step further 1002 00:45:42,880 --> 00:45:44,700 and threw together ARP SH. 1003 00:45:45,000 --> 00:45:45,660 I'm going to show you 1004 00:45:45,800 --> 00:45:48,140 just a fun little proof of concept. 1005 00:45:48,620 --> 00:45:52,300 Remote so-called encrypted shell over ARP. 1006 00:45:53,380 --> 00:45:55,420 So fun for backdoors. 1007 00:45:56,260 --> 00:45:57,680 Kind of just proof of concept. 1008 00:45:57,700 --> 00:45:59,300 It's totally buggy right now, 1009 00:45:59,420 --> 00:46:02,040 but basically it consists of two parts, 1010 00:46:02,180 --> 00:46:03,840 ARP SH D and ARP SH. 1011 00:46:04,640 --> 00:46:06,580 And again, we just obfuscate the data 1012 00:46:06,580 --> 00:46:08,840 so, you know, dumb network administrators 1013 00:46:08,840 --> 00:46:11,160 can't just see our complete traffic 1014 00:46:12,120 --> 00:46:14,920 via XOR encryption and a simple shared key. 1015 00:46:14,920 --> 00:46:16,460 So I'll demo that. 1016 00:46:28,620 --> 00:46:29,640 Here's our victim. 1017 00:46:30,460 --> 00:46:32,640 So somehow we've popped this machine 1018 00:46:32,640 --> 00:46:35,000 with whatever vulnerability or whatever. 1019 00:46:35,180 --> 00:46:40,720 So we're going to start ARP SH D. 1020 00:46:44,240 --> 00:46:45,620 And over here... 1021 00:46:46,320 --> 00:46:47,200 actually over here, 1022 00:46:47,320 --> 00:46:50,160 we'll just start a network sniffer 1023 00:46:50,160 --> 00:46:52,700 so we can see what traffic's actually being passed. 1024 00:46:52,860 --> 00:46:54,740 It's not, you know, actually wrapping it 1025 00:46:54,740 --> 00:46:56,120 through telnet or some crap like that. 1026 00:46:56,880 --> 00:46:57,260 Um... 1027 00:47:08,900 --> 00:47:10,060 So... 1028 00:47:10,060 --> 00:47:11,340 Put that up here. 1029 00:47:11,780 --> 00:47:13,360 And, uh... 1030 00:47:17,720 --> 00:47:18,300 So... 1031 00:47:19,840 --> 00:47:21,040 We, uh... 1032 00:47:21,040 --> 00:47:22,600 ... 1033 00:47:22,600 --> 00:47:23,400 ... 1034 00:47:27,260 --> 00:47:27,340 Yay! 1035 00:47:27,980 --> 00:47:30,600 So there's no ports listening on the victim server 1036 00:47:30,600 --> 00:47:31,360 or anything like that. 1037 00:47:31,960 --> 00:47:33,640 It's just monitoring ARP traffic 1038 00:47:33,640 --> 00:47:36,620 and detecting our command, 1039 00:47:36,980 --> 00:47:39,100 executing it and sending it back all over ARP. 1040 00:47:39,160 --> 00:47:40,200 You can see all the traffic here. 1041 00:47:41,820 --> 00:47:42,300 So... 1042 00:47:43,000 --> 00:47:43,760 Fun stuff. 1043 00:47:59,580 --> 00:48:00,300 There you go. 1044 00:48:06,600 --> 00:48:07,920 So really, uh... 1045 00:48:07,920 --> 00:48:09,800 the moral as far as that goes is just 1046 00:48:09,800 --> 00:48:12,620 you can't really trust any protocol, um... 1047 00:48:13,240 --> 00:48:15,360 to be what it really says it is. 1048 00:48:15,560 --> 00:48:16,040 Um... 1049 00:48:16,040 --> 00:48:17,580 What we're doing there is, again, 1050 00:48:17,660 --> 00:48:20,420 just sending the data via the sender hardware address. 1051 00:48:20,880 --> 00:48:21,360 Um... 1052 00:48:22,440 --> 00:48:23,660 Sending a little bit... 1053 00:48:24,360 --> 00:48:24,840 What? 1054 00:48:26,320 --> 00:48:27,000 Two minutes? 1055 00:48:28,500 --> 00:48:29,020 Oh... 1056 00:48:29,600 --> 00:48:30,120 Sorry. 1057 00:48:31,460 --> 00:48:31,980 Well... 1058 00:48:31,980 --> 00:48:34,220 I think we're... 1059 00:48:37,360 --> 00:48:39,860 So ARP Venom is a tool that, uh... 1060 00:48:39,860 --> 00:48:41,340 It kind of automates these attacks. 1061 00:48:41,640 --> 00:48:42,340 Check, uh... 1062 00:48:42,340 --> 00:48:43,700 digrev.org for, uh... 1063 00:48:43,700 --> 00:48:44,660 release and updates on that. 1064 00:48:45,000 --> 00:48:45,520 Um... 1065 00:48:46,200 --> 00:48:47,580 It should be up pretty soon. 1066 00:48:47,840 --> 00:48:48,340 Uh... 1067 00:48:48,340 --> 00:48:49,320 I don't think it's, uh... 1068 00:48:49,320 --> 00:48:50,820 I got it posted yet, so... 1069 00:48:51,560 --> 00:48:52,080 Um... 1070 00:48:52,080 --> 00:48:55,240 Again, traditional ARP attacks work well 1071 00:48:55,240 --> 00:48:56,660 and they're good standbys. 1072 00:48:56,720 --> 00:48:57,240 Um... 1073 00:48:57,260 --> 00:48:59,180 They have certain weaknesses, so... 1074 00:48:59,180 --> 00:48:59,660 Um... 1075 00:49:00,040 --> 00:49:00,300 There's... 1076 00:49:00,300 --> 00:49:01,980 There's certain cases where you can use 1077 00:49:01,980 --> 00:49:02,960 some of the techniques, uh... 1078 00:49:02,960 --> 00:49:04,200 that I've showed today 1079 00:49:04,200 --> 00:49:04,920 that, uh... 1080 00:49:04,920 --> 00:49:06,000 would be a little bit more effective. 1081 00:49:06,820 --> 00:49:07,780 And, um... 1082 00:49:07,780 --> 00:49:08,420 Uh... 1083 00:49:09,100 --> 00:49:10,700 Targeted sniffing can be, uh... 1084 00:49:10,700 --> 00:49:12,420 again, accomplished by, uh... 1085 00:49:12,420 --> 00:49:15,460 poisoning with null MAC addresses, um... 1086 00:49:15,460 --> 00:49:16,740 for the intended destination. 1087 00:49:17,040 --> 00:49:18,920 A lot less noisy than cam table overflow 1088 00:49:18,920 --> 00:49:21,420 can still do kind of the same thing, so... 1089 00:49:21,420 --> 00:49:22,120 Um... 1090 00:49:22,120 --> 00:49:24,040 A lot more reliable, too, for... 1091 00:49:24,040 --> 00:49:25,220 for switches that have, uh... 1092 00:49:25,220 --> 00:49:26,720 port security and things built in, so... 1093 00:49:26,720 --> 00:49:27,560 Any questions? 1094 00:49:30,280 --> 00:49:30,780 Uh... 1095 00:49:34,620 --> 00:49:35,840 I'm sorry, can you... 1096 00:49:39,800 --> 00:49:43,320 Yeah, the question was, 1097 00:49:43,480 --> 00:49:43,980 if... 1098 00:49:43,980 --> 00:49:45,060 if you poison, uh... 1099 00:49:45,060 --> 00:49:46,620 a victim with a null MAC address 1100 00:49:46,620 --> 00:49:48,560 in order to do sniffing, um... 1101 00:49:48,560 --> 00:49:49,440 does the... 1102 00:49:49,440 --> 00:49:50,700 does the destination host, 1103 00:49:50,900 --> 00:49:51,380 while... 1104 00:49:51,380 --> 00:49:52,360 while you get the data 1105 00:49:52,360 --> 00:49:53,500 and are able to... 1106 00:49:53,500 --> 00:49:54,420 to sniff the data, 1107 00:49:54,520 --> 00:49:55,020 does... 1108 00:49:55,020 --> 00:49:56,600 is the transmission interrupted? 1109 00:49:56,780 --> 00:49:57,040 Is... 1110 00:49:57,040 --> 00:49:58,780 does the destination actually still 1111 00:49:58,780 --> 00:50:00,140 get and process the data? 1112 00:50:00,240 --> 00:50:00,600 And, yes, 1113 00:50:00,700 --> 00:50:01,360 in... 1114 00:50:01,360 --> 00:50:02,480 in most every case, 1115 00:50:02,540 --> 00:50:03,880 it does actually, uh... 1116 00:50:03,880 --> 00:50:05,220 accept and process that... 1117 00:50:05,220 --> 00:50:06,100 that packet, so... 1118 00:50:08,240 --> 00:50:09,020 Anyone else? 1119 00:50:11,640 --> 00:50:12,200 Time's up? 1120 00:50:12,320 --> 00:50:12,540 Oh. 1121 00:50:13,360 --> 00:50:14,080 Well, thank you. 1122 00:50:18,020 --> 00:50:19,200 Thanks for your time. 1123 00:50:19,940 --> 00:50:20,380 .