00:00:00.634 --> 00:00:05.239 Thank you for coming to my talk, Chigula, a Wi-Fi forensics 00:00:05.239 --> 00:00:10.210 framework. A lot of talks going on. I appreciate you coming 00:00:10.210 --> 00:00:16.116 down. And hopefully it will be fun. Before I begin, a little 00:00:16.116 --> 00:00:19.453 introduction about myself, started as an electronics, 00:00:19.453 --> 00:00:26.860 worked with a bunch of companies programmer to architect. Moved 00:00:26.860 --> 00:00:30.063 on to wireless security. I discovered the cafe latte 00:00:30.063 --> 00:00:36.403 attack, a couple of other interesting things, and then 00:00:36.403 --> 00:00:42.276 started my own training company. I also run SecurityTube.net and 00:00:42.276 --> 00:00:46.513 Pentester Academy. I've written a couple of books on wireless 00:00:46.513 --> 00:00:51.652 security. The latest one is Make Your Own Hacker Gadget. So 00:00:51.652 --> 00:00:58.992 before we begin with today's topic, this has been a team 00:00:58.992 --> 00:01:03.297 effort. I started off with the idea of creating a Wi-Fi 00:01:03.297 --> 00:01:08.335 forensics framework around January of this year. Beginning 00:01:08.335 --> 00:01:12.172 when I worked with a lot of interesting ideas, I eventually 00:01:12.172 --> 00:01:17.544 figured the amount of work requires a theme, so we were 00:01:17.544 --> 00:01:22.049 primarily responsible for creating this. Chigula will be 00:01:22.049 --> 00:01:24.651 available at PentesterAcademy.com/Chigula. 00:01:24.651 --> 00:01:31.024 Right after this talk, you can download it and try it out. So 00:01:31.024 --> 00:01:35.462 what was the motivation? Now, I've been doing wireless 00:01:35.462 --> 00:01:40.100 security probably for the last ten to 15 years. And a lot of 00:01:40.100 --> 00:01:44.771 times, I've struggled trying to use Wireshark to get meaningful 00:01:44.771 --> 00:01:48.942 information from places. How many of you have tried to do 00:01:48.942 --> 00:01:53.180 forensics with Wireshark for Wi-Fi? How many of you 00:01:53.180 --> 00:02:01.021 succeeded? So given the sheer amount of traffic at the very 00:02:01.021 --> 00:02:05.859 same time, all those different packets, I figured Wireshark is 00:02:05.859 --> 00:02:09.796 of course, great as being a sniffer, right? Showing you the 00:02:09.796 --> 00:02:14.501 packets, passing them. Unfortunately, framework to 00:02:14.501 --> 00:02:19.306 build stuff, Wireshark is difficult to work with. Yes, you 00:02:19.306 --> 00:02:23.810 could write protocol dissectors, maybe lure -- matter, but the 00:02:23.810 --> 00:02:30.117 learning curve is actually quite high. So I really wanted a Wi-Fi 00:02:30.117 --> 00:02:33.920 forensics framework, first for myself. I was the end customer 00:02:33.920 --> 00:02:39.026 to begin with. And something which pentesters can use, not 00:02:39.026 --> 00:02:42.062 just programmers, right, because a programmer could probably 00:02:42.062 --> 00:02:47.634 write his own sync code and stuff. I wanted something which 00:02:47.634 --> 00:02:54.041 would allow pentester SQL, go ahead and run -- and get 00:02:54.041 --> 00:03:00.013 meaningful information. So what is Chigula? It's a set of tools 00:03:00.013 --> 00:03:04.951 and scripts for wireless forensic. The core is written in 00:03:04.951 --> 00:03:10.924 C++. This basically involves all the packet parsing, pushing into 00:03:10.924 --> 00:03:16.797 the database, and all the plug-ins which you can write are 00:03:16.797 --> 00:03:19.933 -- actually you could write plug-ins in any language which 00:03:19.933 --> 00:03:24.371 has a SQL, driver. You don't have to only know or use -- What 00:03:24.371 --> 00:03:30.377 platforms can Chigula work on? It can work on Windows as well 00:03:33.480 --> 00:03:38.085 as Linux. Actually any -- system. The packet, itself, 00:03:38.085 --> 00:03:45.792 could just be -- on any platform. So here is a 00:03:45.792 --> 00:03:50.197 screenshot of Chigula on Windows. Here's the same on -- 00:03:50.197 --> 00:03:58.105 this is one, 214. Now, what can Chigula help us with? So what 00:03:58.105 --> 00:04:03.977 we've done is we've -- we take a pcap file, pick up individual 00:04:03.977 --> 00:04:09.983 packets, parse each field and map it, finding SQL*Lite table. 00:04:13.153 --> 00:04:17.791 So you could actually write SQL queries which could be as 00:04:17.791 --> 00:04:20.594 granular as select -- MAC, equals something, dot subtype 00:04:20.594 --> 00:04:28.468 equals something, and pretty much go ahead and, you know, 00:04:28.468 --> 00:04:31.404 write tools on top of that, which could probably work -- and 00:04:31.404 --> 00:04:37.444 take up some examples today. Now, Chigula can allow you to 00:04:37.444 --> 00:04:42.516 create blacklist signatures, so if you wanted to go ahead and 00:04:42.516 --> 00:04:48.622 create a signature for -- or any Honeypot tool for that matter or 00:04:48.622 --> 00:04:55.228 aireplay. It can allow you to detect and visualize Wi-Fi 00:04:55.228 --> 00:05:01.168 attacks. MAC -- can be detected, reasonably reliably using 00:05:04.237 --> 00:05:10.777 Chigula. So what is the architecture? At a very high 00:05:10.777 --> 00:05:17.050 level we have data sources, which basically feed the packet 00:05:17.050 --> 00:05:21.288 into the actual packet parsing engine, the engine pushes that 00:05:21.288 --> 00:05:25.659 into a data store, and through that data store you can use any 00:05:25.659 --> 00:05:31.865 data tool which can work with SQL, or scripts which can create 00:05:31.865 --> 00:05:38.405 the database. Now, Chigula can work both in and offline, and 00:05:38.405 --> 00:05:44.778 online mode. In the offline mode it's going to take the files and 00:05:44.778 --> 00:05:48.014 the online mode, which is currently experimental, and 00:05:48.014 --> 00:05:52.352 works only with -- based systems can actually sniff packets off 00:05:52.352 --> 00:06:00.060 -- as well. Okay. It's -- it looks like the captioning 00:06:00.060 --> 00:06:04.431 probably a little off the -- I have an accent so I don't know 00:06:04.431 --> 00:06:08.568 who is captioning it. So either way, as I said in last talk 00:06:08.568 --> 00:06:12.672 yesterday, you'll have fun probably looking at Chigula, 00:06:12.672 --> 00:06:18.678 looking at the captions, so -- [ Laughter ] Now the packet itself 00:06:22.449 --> 00:06:26.086 is a standalone tool, which can be used for a lot of other 00:06:26.086 --> 00:06:32.859 purposes. In Chigula, we convert packets into SQL*Lite databases 00:06:32.859 --> 00:06:35.428 but the stand-alone tool, SQL*Lite can convert packets 00:06:35.428 --> 00:06:42.569 into XML, so that you can go ahead and write -- all of that 00:06:42.569 --> 00:06:47.307 stuff will work as well. The focus of Chigula is to use 00:06:47.307 --> 00:06:54.848 SQL*Lite but you can use XML and SQL, to generate both, if you 00:06:54.848 --> 00:06:59.686 want. Now, we currently parse most management -- packets of 00:06:59.686 --> 00:07:05.125 interest. So all those little subfields inside, Beacon frame 00:07:05.125 --> 00:07:08.194 can be passed, so you could write queries, which are 00:07:08.194 --> 00:07:15.135 searching for a specific information element in -- across 00:07:15.135 --> 00:07:21.141 the packet, which you have. Now, the data store is a SQL*Lite 00:07:23.310 --> 00:07:28.448 database, the reason we chose this to begin, available on all 00:07:28.448 --> 00:07:32.953 platforms, does not require a server-based process. You could 00:07:32.953 --> 00:07:38.024 even -- to embedded systems, right? Isn't limited to just 00:07:38.024 --> 00:07:44.030 your workstations. Of course, you can migrate the schema to 00:07:46.299 --> 00:07:53.239 pretty much any database you like. Now, once all the data is 00:07:53.239 --> 00:07:58.011 in sight, you can use query tool, SQL*Lite browser on 00:07:58.011 --> 00:08:04.217 Windows, or whatever is the best SQL threading tool on Linux, 00:08:04.217 --> 00:08:09.956 analysis scripts, written in any language as I mentioned. So let 00:08:09.956 --> 00:08:17.430 me go ahead and show you a quick demo. Actually, rest of the talk 00:08:17.430 --> 00:08:23.436 is really just demos. That's probably going to be the most 00:08:31.511 --> 00:08:37.517 difficult part. Here, Windows has color change. Screen 00:08:42.789 --> 00:08:48.795 background. Is this better? Okay. Great. So I have a pcap 00:08:57.871 --> 00:09:03.810 file here. Pick up a sample. Right. I think this has around 00:09:11.718 --> 00:09:18.058 400 --> 000 packets in it. We've tested Chigula up to 3 to 4 gigs 00:09:18.058 --> 00:09:22.395 of pcap file, there hasn't been any problem but if you report 00:09:22.395 --> 00:09:28.668 any bugs you can always send it to us. So you can give the pcap 00:09:28.668 --> 00:09:33.706 file as an input. Hyphen S option, stands for the output 00:09:33.706 --> 00:09:39.712 SQL*Lite database. Okay. [ Laughter ] Not the best thing to 00:09:57.297 --> 00:10:02.902 happen. Okay. So here is -- figured out what went wrong. At 00:10:02.902 --> 00:10:06.239 the end we check if it is the latest version, so I have to do 00:10:06.239 --> 00:10:12.245 it -- so it works. [ Laughter ] So if open up the database file, 00:10:15.515 --> 00:10:19.552 here is the schema, for literally every single header 00:10:19.552 --> 00:10:25.291 field actually have a table in there. So as an example, let's 00:10:25.291 --> 00:10:31.965 begin with MAC headers. So you have the protocol version, the 00:10:31.965 --> 00:10:36.603 type, the subtype, every single field including bit fields have 00:10:36.603 --> 00:10:43.610 been mapped to an actual column. Now, across different frame 00:10:43.610 --> 00:10:48.848 types, and at the very same time we even save all the -- values, 00:10:48.848 --> 00:10:52.852 pretty much all the time IEs -- elements, separately so that we 00:10:52.852 --> 00:10:58.858 can query them. Now, here is how the data looks like. So we could 00:11:02.795 --> 00:11:08.701 look at the MAC headers -- and you can see we have around 00:11:08.701 --> 00:11:15.942 400 --> 000 entries in there. And every single field is map. So 00:11:15.942 --> 00:11:21.948 now let's actually run some interesting queries. See me type 00:11:24.384 --> 00:11:28.922 everything out. So here is the first query, finding all Beacon 00:11:28.922 --> 00:11:33.860 frames, right? This is something Wireshark can do as well. Let's 00:11:33.860 --> 00:11:40.833 try this with Chigula. In here, run the query, and then there 00:11:40.833 --> 00:11:46.940 you go. Thirty-six Beacon frames, basically inside the 00:11:46.940 --> 00:11:52.345 packet, capture file. Now, let's look at something Wireshark 00:11:52.345 --> 00:11:56.883 cannot do, but Chigula can. With Wireshark, can you figure out 00:11:56.883 --> 00:12:03.189 all the unique devices around and get a distinct list? So I'd 00:12:03.189 --> 00:12:06.759 like to know just the unique list of all clients and -- now, 00:12:06.759 --> 00:12:14.100 with Chigula, this is actually quite simple. All we have to do 00:12:14.100 --> 00:12:17.904 is select distinct across address one, two, three, and 00:12:17.904 --> 00:12:23.476 four. And the moment we do that, actually see how powerful the 00:12:23.476 --> 00:12:29.482 framework is. And there you go. We have 395 rows in there. Right 00:12:33.920 --> 00:12:38.424 now, folks, the broadcast MAC is included, you can always write a 00:12:38.424 --> 00:12:41.194 little wrapper to include broadcast and -- addresses. This 00:12:41.194 --> 00:12:46.866 is just a query to look at all distinct addresses across the 00:12:46.866 --> 00:12:53.740 different fields. So we have 395 rows. There are 394 devices 00:12:53.740 --> 00:12:59.746 actually in there. Now, if you are to find all the axis points, 00:13:03.883 --> 00:13:10.156 again, extremely easy. All we have to do is find the distinct 00:13:10.156 --> 00:13:17.130 addresses with send out Beacon frames. There we go. Thirty-six 00:13:17.130 --> 00:13:23.169 APs, right? Managed to do this with Wireshark? And you can 00:13:23.169 --> 00:13:26.039 actually write your own scripts, which can query and dig this 00:13:26.039 --> 00:13:32.045 out, reports and do a lot of other interesting things. Now, 00:13:35.815 --> 00:13:40.053 if you wanted to look at all devices, sending data packets, 00:13:40.053 --> 00:13:42.055 basically just do a select distinct address one, go in 00:13:42.055 --> 00:13:44.057 here. And there you go. You have all devices in your pcaps with 00:13:44.057 --> 00:13:51.798 send data packets. Now, we can actually even do other 00:13:51.798 --> 00:13:57.804 interesting macro level -- what's that? >> [ Inaudible ] >> 00:14:12.618 --> 00:14:16.389 So basically we have a -- there which does interesting stuff. We 00:14:16.389 --> 00:14:19.992 look at MAC address spoofing, you'll see that demo. That's an 00:14:19.992 --> 00:14:23.596 interesting thing you noted, but using the same thing for the 00:14:23.596 --> 00:14:29.602 attacks as well. So you can actually go in here, select 00:14:31.804 --> 00:14:37.810 average, and the average length, 106 bytes. Now, here is another 00:14:40.213 --> 00:14:45.051 interesting query. You could actually do a time built up 00:14:45.051 --> 00:14:48.721 between packets, you can figure out what is the time difference? 00:14:48.721 --> 00:14:53.559 Of course, you can add the MAC addresses as well, in case 00:14:53.559 --> 00:14:59.565 you're interested in just one device. There you go. Now, we 00:15:01.968 --> 00:15:06.639 can do simple queries but what about more complicated ones? If 00:15:06.639 --> 00:15:11.277 we wanted to find the list of -- MAC addresses, and return that 00:15:11.277 --> 00:15:16.649 as a table, right? Something currently you may be rely on 00:15:16.649 --> 00:15:21.020 error dump and G, to export everything, and then maybe read 00:15:21.020 --> 00:15:27.026 the CSV. You can actually do this quite easily, using a join 00:15:29.328 --> 00:15:37.303 in Chigula, go in here. Paste it. And there you go. This also 00:15:37.303 --> 00:15:42.809 -- SSID net works. Right? So we see the AP MAC address and the 00:15:42.809 --> 00:15:48.815 SSID. It is broadcasting. Now, what we've done is, we've -- the 00:15:53.052 --> 00:15:56.956 packets and actually added more macro statistics in there. 00:15:56.956 --> 00:16:01.861 Things like encryption, you would not have to go and pass 00:16:01.861 --> 00:16:07.967 the IEs yourself, already have in tables we create. So we can 00:16:07.967 --> 00:16:13.973 go in here -- do that in just a bit. You can do the hidden SSID 00:16:17.477 --> 00:16:24.550 net works. Show you this first. So these are all the hidden in 00:16:24.550 --> 00:16:30.556 SSID net works, all the distinct lists. Now, if you wanted to 00:16:32.959 --> 00:16:37.730 figure out the different SSIDs on a given channel, you can do 00:16:37.730 --> 00:16:42.168 that as well. Again, join between multiple tables, the 00:16:42.168 --> 00:16:45.438 entire SQL schema published along with the tool, so you can 00:16:45.438 --> 00:16:52.712 write your own queries. If you love SQL injection, you'll 00:16:52.712 --> 00:16:57.884 probably love Chigula. [ Laughter ] Well, for what it's 00:16:57.884 --> 00:17:03.823 worth, Chigula could have a SQL injection. Packet -- code -- 00:17:07.426 --> 00:17:10.296 Now, one of the other interesting things as a 00:17:10.296 --> 00:17:15.434 pentester which I always wanted is a list of client MAC 00:17:15.434 --> 00:17:20.640 addresses and SSIDs they're threading for, again as a 00:17:20.640 --> 00:17:24.143 distinct list, so this is something we can easily do with 00:17:24.143 --> 00:17:31.550 Chigula. Actually pick this up here. And run the query. And 00:17:31.550 --> 00:17:38.391 this actually gives you the MAC and the -- SSID. Keep in mind, 00:17:38.391 --> 00:17:44.363 every single client also sends a null probe request, right? Null 00:17:44.363 --> 00:17:50.369 probes, including a ton of other SSIDs being queried for. Now, 00:17:53.172 --> 00:17:58.010 you can even optimize this on a -- basis. You can go ahead and 00:17:58.010 --> 00:18:03.516 say, hey, for this specific, which are the SSIDs being 00:18:03.516 --> 00:18:08.754 queried for? So there you go. This client with the MAC 00:18:08.754 --> 00:18:15.061 address, AP61B, et cetera, is actually querying for all of 00:18:15.061 --> 00:18:21.067 these SSIDs. Now, we're talking about macro tables, right, SSID, 00:18:25.171 --> 00:18:31.243 all of that, here is a query which can actually give us the 00:18:31.243 --> 00:18:37.249 SSID authentication and encryption, just simple query. 00:18:41.487 --> 00:18:47.493 There we go, right? You could have passed the packets 00:18:50.963 --> 00:18:56.369 yourself, and figured out a lot of this information. But Chigula 00:18:56.369 --> 00:19:03.909 holds many of these in macro tables as well. You can 00:19:03.909 --> 00:19:08.547 reconstruct Beacon frames. People were there in my top 00:19:08.547 --> 00:19:13.019 yesterday, Beacon frames was one of the ways we were using to go 00:19:13.019 --> 00:19:16.922 ahead and create signatures, so you could construct entire 00:19:16.922 --> 00:19:22.928 Beacon frames using the PLVs for any network in there. You can do 00:19:29.869 --> 00:19:35.875 the same for client probe requests as well. Right, so 00:19:39.879 --> 00:19:45.751 these are all PLVs sent by the client. The value is bit 64 00:19:45.751 --> 00:19:49.889 imported, it makes it easy for you to go ahead and put it in 00:19:49.889 --> 00:19:55.895 your scripts, rather than having to work with binary values. Now, 00:19:55.895 --> 00:20:01.901 ahead and look at transmissions on a device -- so for a given 00:20:13.712 --> 00:20:17.016 MAC address, we can look at different time stamps when the 00:20:17.016 --> 00:20:21.220 device transmitted. You could even join tables to figure out 00:20:21.220 --> 00:20:27.226 what were the actual frames. So this is Chigula going ahead and 00:20:29.962 --> 00:20:36.202 querying, marketable data from the pcap, in the bottom of the 00:20:36.202 --> 00:20:43.442 SQL*Lite table. So these are queries you can write, you can 00:20:43.442 --> 00:20:48.714 extend, you can add your own, if you like. Any questions about 00:20:48.714 --> 00:20:54.653 the querying? Or anything about the architecture? Now, this is 00:20:54.653 --> 00:20:58.424 step one, right? Step two is being able to actually do 00:20:58.424 --> 00:21:04.363 forensics and ideas for this. Now, broadly, if you look at 00:21:08.400 --> 00:21:12.104 forensics or intrusion detection, the first is being 00:21:12.104 --> 00:21:17.176 able to detect signatures of existing attack tools. This is 00:21:17.176 --> 00:21:20.946 actually quite easy to do, and again, people came to my talk 00:21:20.946 --> 00:21:26.485 yesterday, most attack tools have fixed CLVs, most of them 00:21:26.485 --> 00:21:30.456 don't even change the values. Of course, fingerprinting tools 00:21:30.456 --> 00:21:34.493 would depend on the -- tool, tool can change that, but you 00:21:34.493 --> 00:21:38.931 can do this with Chigula. I'll just show you in a bit. The 00:21:38.931 --> 00:21:45.538 second attack, or rather -- attacks are -- attacks. How many 00:21:45.538 --> 00:21:50.809 of you cracked WEP? Replayed the same packet over and over again, 00:21:50.809 --> 00:21:55.481 right? Another example of replay attack could be D. Go ahead, 00:21:55.481 --> 00:22:02.555 send a huge, packets from time to time, to ensure that we can 00:22:02.555 --> 00:22:06.392 disconnect clients from the authorized network. Right? So 00:22:06.392 --> 00:22:10.229 this is an example of the replay attack. Then you have 00:22:10.229 --> 00:22:14.800 unauthorized devices and associations. So for example, 00:22:14.800 --> 00:22:19.638 you can have an axis point, which you created for your 00:22:19.638 --> 00:22:24.176 network, but someone can create fake APs and Honeypots, right? 00:22:24.176 --> 00:22:27.813 How do we go about identifying them, using extremely simple 00:22:27.813 --> 00:22:34.653 scripts. Now last, but probably one of the more interesting ones 00:22:34.653 --> 00:22:42.328 is how do you detect MAC address -- so let's look at each of 00:22:42.328 --> 00:22:48.334 these. Now, the first signature we look at is MD -- a lot of 00:22:52.905 --> 00:22:59.545 people. Mdk3, can create fake Beacon frames, the most common 00:22:59.545 --> 00:23:04.917 use is to randomize the SSID, so that your devices get confused, 00:23:04.917 --> 00:23:09.088 everything looks completely gobbled. Now, if you analyze the 00:23:09.088 --> 00:23:16.762 Beacon, for Beacon, what you find is, fixed values, as well 00:23:16.762 --> 00:23:21.500 as the SSIDs values, or if you look at the alphanumeric nature, 00:23:21.500 --> 00:23:27.506 skewed. Written two scripts, one for each. Let me show you that. 00:23:56.669 --> 00:24:02.608 I'm sorry. Wrong directory. Okay. Real solve because it's 00:24:34.740 --> 00:24:41.347 checking, basically we have a newer version. Now, what you'd 00:24:41.347 --> 00:24:45.784 actually find is, Chigula detects that all of these SSIDs 00:24:45.784 --> 00:24:52.358 created by Mdk3. Let's see how simple the script is to go ahead 00:24:52.358 --> 00:24:58.364 and do this. How many of you have -- before? So this is, most 00:25:10.642 --> 00:25:15.447 of the stuff you've seen, arguments and help, just so 00:25:15.447 --> 00:25:21.453 people can look at it later. So here is an example, what we 00:25:23.522 --> 00:25:27.760 check is of the number of alphanumeric, on an average, is 00:25:27.760 --> 00:25:31.497 -- specific threshold. That's one way of looking at completely 00:25:31.497 --> 00:25:38.203 random SSIDs. Now, the other interesting way is to go ahead 00:25:38.203 --> 00:25:44.209 and look at the PLVs. Okay. The screen is actually giving me -- 00:25:51.150 --> 00:25:56.755 so here is what we are doing. We go ahead, open the pcap file and 00:25:56.755 --> 00:26:00.759 written a very simple library, which you can use directly, 00:26:00.759 --> 00:26:06.331 called models, and to that you can go ahead, import most of the 00:26:06.331 --> 00:26:10.669 intelligence Chigula has. And all you have to do then is 00:26:10.669 --> 00:26:14.740 basically tell Chigula what kind of packet you would like to 00:26:14.740 --> 00:26:20.379 select and analyze. Right. So we have a MAC headers module, and 00:26:20.379 --> 00:26:25.884 you can go ahead, create macros, look at different SSIDs and 00:26:25.884 --> 00:26:31.023 things like that, and associate it with SSIDs and check which 00:26:31.023 --> 00:26:37.029 ones are skewed. Now, we can actually do the same thing with 00:26:41.266 --> 00:26:47.272 Airbase-NG. Now, Airbase-NG has a very specific signature. 00:26:55.347 --> 00:27:01.019 Anyone know the only four elements Airbase-NG has in probe 00:27:01.019 --> 00:27:07.025 packets and Beacon packets, for probably the last seven years? 00:27:10.362 --> 00:27:17.703 Quite easy to fingerprint. So it has the SSIDs, of course, the 00:27:17.703 --> 00:27:24.610 channel, the -- and the extended. And at time some of 00:27:24.610 --> 00:27:28.914 the older ones even have a bug, where the probe request packets 00:27:28.914 --> 00:27:36.188 probably go ahead and add a null SSIDs as an additional. So using 00:27:36.188 --> 00:27:41.593 that, we can go ahead and create a signature, run all the entire, 00:27:41.593 --> 00:27:47.599 and if there aren't any issues in -- if there are any issues in 00:27:55.474 --> 00:28:00.445 packet passing, it will tell specific packets. In most cases, 00:28:00.445 --> 00:28:06.652 some of these packets have been truncated by Wireshark, so just 00:28:06.652 --> 00:28:09.388 tells you, I have to stop somewhere in between, because I 00:28:09.388 --> 00:28:16.929 don't have the full packet. And there you go. It actually tells 00:28:16.929 --> 00:28:20.299 you that this is the MAC address, of which creates the 00:28:20.299 --> 00:28:26.305 fake, and we can verify that by looking at the trace file, so 00:28:31.276 --> 00:28:36.281 this is something actually created at DEFCON. Let me go 00:28:36.281 --> 00:28:42.287 ahead and apply the filter. And all of these Beacon frames as 00:28:50.596 --> 00:28:56.101 well as probe requests have been created using Airbase, so if you 00:28:56.101 --> 00:29:00.572 select any of these, actually find that these are the only -- 00:29:00.572 --> 00:29:06.311 right? Most attack tools are actually quite easy to 00:29:06.311 --> 00:29:12.317 fingerprint, if you look at the time frames. Unbelievably easy 00:29:15.687 --> 00:29:21.693 to fingerprint. Now, attack signatures, easy to write. What 00:29:24.129 --> 00:29:30.135 about replay attacks, require us to take a single frame and then 00:29:30.135 --> 00:29:34.406 check the entire SQL*Lite database to see if something 00:29:34.406 --> 00:29:37.943 matches directly and if it matches about a certain 00:29:37.943 --> 00:29:42.714 threshold. Keep in mind, in Wi-Fi, they can actually be a 00:29:42.714 --> 00:29:46.785 lot of retries, so you need to check that this isn't a retry 00:29:46.785 --> 00:29:52.624 packet for a previous one. So with Chigula, you can actually 00:29:52.624 --> 00:29:57.696 go ahead and check for replay attacks for any -- I mean, this 00:29:57.696 --> 00:30:01.233 is frame agnostic, even though -- further, frames or 00:30:01.233 --> 00:30:08.006 disassociation frames or anything you like. Let me show 00:30:08.006 --> 00:30:14.012 you a quick demo. So one of the things which are adding is also 00:30:33.899 --> 00:30:38.503 a hash for everything. So that this check can be much more -- 00:30:38.503 --> 00:30:44.509 that's something you already working on. And Chigula tells 00:30:46.678 --> 00:30:53.852 you senders and the number of frames replayed by that sender. 00:30:53.852 --> 00:30:57.356 And it also gives you the frame ID, so you can actually go back 00:30:57.356 --> 00:31:02.227 to the pcap file, open it up, look at the very first screen, 00:31:02.227 --> 00:31:09.701 which is there in your pcap, actually replayed. And the 00:31:09.701 --> 00:31:13.805 replay attack even has an option to isolate the frames which have 00:31:13.805 --> 00:31:19.811 been replayed. Now, detecting honey parts is basically a two 00:31:23.915 --> 00:31:30.722 level problem. At level one, quite easy to do, the admin, 00:31:30.722 --> 00:31:36.228 whoever is checking, has a list of allowed SSIDs and allowed 00:31:36.228 --> 00:31:40.665 clients, and if you have any associations of clients or -- 00:31:40.665 --> 00:31:44.903 which differ from this list, then of course, you have some 00:31:44.903 --> 00:31:48.607 kind of a -- Now, the biggest problem with this kind of 00:31:48.607 --> 00:31:53.478 detection is AP MAC spoofing, right? What happens, spoof 00:31:53.478 --> 00:31:59.918 access point in which case, a detection would be very 00:31:59.918 --> 00:32:04.423 difficult to succeed. So in the first one, I'll show you the 00:32:04.423 --> 00:32:09.294 plain way of looking at it without AP MAC spoofing and in 00:32:09.294 --> 00:32:13.131 the next example I'll show you how to detect AP MAC spoofing. 00:32:19.838 --> 00:32:22.007 And all of these scripts are available so you can try them 00:32:22.007 --> 00:32:28.013 out later along with your own. I already have a list of 00:32:36.288 --> 00:32:43.929 authorized APs. Just -- two of them, just as a sample. And then 00:32:43.929 --> 00:32:48.834 I'm going to be running against the pcap. And this gives me the 00:32:48.834 --> 00:32:54.072 list of all unauthorized SSIDs, advertising the same SSID, 00:32:54.072 --> 00:32:59.077 right? Now, this is of course, quite simple and trivial, which 00:32:59.077 --> 00:33:04.583 brings us to the next part, MAC spoofing. What happens when an 00:33:04.583 --> 00:33:10.288 attacker spoofs the MAC of alleged -- at this point? Could 00:33:10.288 --> 00:33:14.092 someone tell me how you could go ahead and detect that using 00:33:14.092 --> 00:33:20.098 something like Chigula? And whoever answers that gets a -- 00:33:22.267 --> 00:33:26.905 The Beacon frames might even look identical, actually, so you 00:33:26.905 --> 00:33:30.575 can take an existing Beacon frame and just replay it. >> [ 00:33:30.575 --> 00:33:36.581 Inaudible ] >> Time difference might not be it, simply because 00:33:45.724 --> 00:33:50.295 the attacker's AP would be running concurrently as, you 00:33:50.295 --> 00:33:54.366 know, the enterprise AP. I mean, almost the same time always. 00:33:54.366 --> 00:33:58.203 Could even be -- fake access points and probably one of the 00:33:58.203 --> 00:34:05.510 more difficult things to crack. >> [ Inaudible ] >> 00:34:05.510 --> 00:34:11.349 Transmission, one dimension, unfortunately just one sensor 00:34:11.349 --> 00:34:15.186 it's difficult to go ahead and ascertain that reliably, because 00:34:15.186 --> 00:34:19.291 in any wireless communication, you have things like multiple -- 00:34:19.291 --> 00:34:24.629 right? So the same location, you can have maximize and minimize, 00:34:24.629 --> 00:34:29.134 depending upon how the environment changes. So all your 00:34:29.134 --> 00:34:36.308 commercial -- vendors at least have more than three sensors who 00:34:36.308 --> 00:34:38.476 -- access points -- anything else? >> [ Inaudible ] >> So if 00:34:47.619 --> 00:34:53.425 an attacker clones let's say the Beacon frame or clones the MAC 00:34:53.425 --> 00:34:59.264 address, clones all the information elements as well, 00:34:59.264 --> 00:35:03.068 how do you figure the difference out? Right? If he doesn't clone 00:35:03.068 --> 00:35:07.772 the -- you know, that's what was about yesterday, which I spoke, 00:35:07.772 --> 00:35:11.109 which is the IE cannot be cloned exactly because the attacker 00:35:11.109 --> 00:35:15.513 won't have prior knowledge, but in this kind of fake AP attack, 00:35:15.513 --> 00:35:19.618 attacker in the parking lot, somewhere close to the 00:35:19.618 --> 00:35:25.256 enterprise, he can actually clone as least the Beacons. >> [ 00:35:29.961 --> 00:35:32.163 Inaudible ] >> The attacker could probably do an MIT -- 00:35:32.163 --> 00:35:36.468 attack, where he can read off the traffic -- he would have two 00:35:36.468 --> 00:35:42.474 client Wi-Fi cards, read out the traffic -- Anyone? Who is that? 00:35:48.346 --> 00:35:51.016 >> [ Inaudible ] >> What are sequence numbers? [ Laughter ] 00:35:51.016 --> 00:35:57.055 Okay. You're on the right track. So a little bit more. A little 00:35:57.055 --> 00:36:03.962 bit more. Yeah. >> [ Inaudible ] >> We might not be able to look 00:36:03.962 --> 00:36:08.800 at the protocol layer because it would be entirely encrypted, 00:36:08.800 --> 00:36:12.437 right? It could be encrypted -- and Chigula right now, I mean, 00:36:12.437 --> 00:36:15.373 we are just looking at layers, we aren't looking at layer three 00:36:15.373 --> 00:36:21.379 and above. Sequence number is, like, right starting points I'm 00:36:26.284 --> 00:36:30.555 going to give you a book for that, but who can explain -- [ 00:36:36.194 --> 00:36:39.664 Applause ] [ Laughter ] But who can explain all sequence numbers 00:36:39.664 --> 00:36:45.670 can be used. For two books. [ Laughter ] >> [ Inaudible ] >> 00:36:50.608 --> 00:36:55.013 So sequence numbers, unlike things like TTL, in the case of 00:36:55.013 --> 00:37:01.252 IP, basically get incremented and then wrap around. Unlike TTL 00:37:01.252 --> 00:37:04.222 where you could see a Linux based system could have, I don't 00:37:04.222 --> 00:37:08.093 remember, but 128 as their default, or Windows could have, 00:37:08.093 --> 00:37:12.163 you know, 64 as default. In Wi-Fi, the sequence number just 00:37:12.163 --> 00:37:15.333 getting implemented one per frame and when we reach the end, 00:37:15.333 --> 00:37:20.638 we wrap around. So it's not operating system specific. >> [ 00:37:23.241 --> 00:37:28.480 Inaudible ] >> Okay. Very good. Here you go. So if you have two 00:37:28.480 --> 00:37:34.486 devices -- [ Applause ] -- so if you have multiple devices, and 00:37:40.725 --> 00:37:47.132 we actually do a sequence number analysis, for a MAC address, so 00:37:47.132 --> 00:37:52.103 here's what we do. For every given MAC in the place file you 00:37:52.103 --> 00:37:57.909 have, do a sequence ID analysis, and what you actually see is, 00:37:57.909 --> 00:38:03.148 you have two different sequence -- sequences, sequence ID 00:38:03.148 --> 00:38:06.985 sequences or clusters, which are moving in completely different 00:38:06.985 --> 00:38:11.289 directions. Now, you might say, what if the attacker tries to 00:38:11.289 --> 00:38:15.160 clone the sequence number as close as possible and what you'd 00:38:15.160 --> 00:38:19.797 end up having is duplicates. Right? Either way, it's going to 00:38:19.797 --> 00:38:23.968 be duplicates, if the attacker, the moment he sees the real AP 00:38:23.968 --> 00:38:27.806 sent out a frame, fix the sequence number, immediately -- 00:38:27.806 --> 00:38:31.576 next frame, right? You have duplicates. That's very 00:38:31.576 --> 00:38:34.779 difficult to do, simply because the attacker -- speak next, 00:38:34.779 --> 00:38:40.652 right? The other possibility is of course, that both the 00:38:40.652 --> 00:38:47.392 devices, both the devices are progressing on their own. So 00:38:47.392 --> 00:38:52.497 this is probably the standard way of detecting MAC address 00:38:52.497 --> 00:38:58.336 spoofing almost in all wireless intrusion detection systems. 00:38:58.336 --> 00:39:04.008 This is an extremely powerful metric. In 2007, I gave a talk 00:39:04.008 --> 00:39:09.047 called cracking WEP cloaking, at DEFCON, which was basically how 00:39:09.047 --> 00:39:13.051 do you crack WEP in the presence of shaft packets? Absolute 00:39:13.051 --> 00:39:19.724 garbage injected by SSIDs and one of the key metrics I 00:39:19.724 --> 00:39:23.261 actually used to separate different kind of packets was 00:39:23.261 --> 00:39:28.333 actually sequence numbers, so let's actually see how Chigula 00:39:28.333 --> 00:39:35.473 can allow you to do a very easy and simple analysis. With 00:39:35.473 --> 00:39:41.479 sequence numbers. And we can open up the image. There we go. 00:40:04.636 --> 00:40:08.373 So if you looked at the pcap file, which I'll show you in a 00:40:08.373 --> 00:40:13.111 bit, in the very beginning, we had one device, and really this 00:40:13.111 --> 00:40:15.213 -- extrapolated as well, depends when start file. You have one 00:40:15.213 --> 00:40:20.985 device, but often sometimes you have another device, it seems to 00:40:20.985 --> 00:40:28.026 have a separate sequence number, kind of going in a very 00:40:28.026 --> 00:40:34.599 different value -- I'm going to show you how it looks like in 00:40:34.599 --> 00:40:39.837 the sample. And you can create a fake -- and same MAC address and 00:40:39.837 --> 00:40:47.478 try this out. This detection actually works quite well. So 00:40:47.478 --> 00:40:55.353 closely look at the SN. SN is basically sequence numbers. So 00:40:55.353 --> 00:40:59.791 as we scroll down, currently see one device which has an 00:40:59.791 --> 00:41:05.730 incrementing sequence number. And now you're probably starting 00:41:11.903 --> 00:41:15.907 to see something in the range of 1 --> 000 and something else in the 00:41:15.907 --> 00:41:21.045 range of 3,500. Right? Interestingly, you can even 00:41:21.045 --> 00:41:25.516 detect the number of pcaps by figuring out each one of these 00:41:25.516 --> 00:41:30.321 progressions and clusters and Chigula allows you to do that, 00:41:30.321 --> 00:41:34.092 because you're basically picking up the individual numbers and 00:41:34.092 --> 00:41:40.098 defaulting it. Work by default, no magic required to do this. 00:41:43.134 --> 00:41:46.671 You can see that. Now, if you started collecting the trace 00:41:46.671 --> 00:41:51.943 file in the very beginning, you would probably see this stretch 00:41:51.943 --> 00:41:55.046 out absolutely from the very beginning of your collection 00:41:55.046 --> 00:42:00.952 time as well. Right? This actually is -- a lot of times 00:42:00.952 --> 00:42:05.923 pentester to scan an area, find Rogue devices mimicking MAC 00:42:05.923 --> 00:42:10.828 addresses of authorized devices, using Wireshark, but allows me 00:42:10.828 --> 00:42:13.998 to explain that there are multiple devices to admin, 00:42:13.998 --> 00:42:20.004 people higher up. Okay. So we are going to be releasing 00:42:24.909 --> 00:42:29.180 Chigula. You can download it, maybe within next hour, the link 00:42:29.180 --> 00:42:34.085 should be live. All the scripts are included. Already developing 00:42:34.085 --> 00:42:37.155 more plug-ins, more attacks and visualizations which can be 00:42:37.155 --> 00:42:43.227 detected. Going to be completely open source. So feel free to, 00:42:43.227 --> 00:42:46.497 you know, look at all the bad code we've written. Already 00:42:46.497 --> 00:42:51.536 written crash, right in the front. The other thing which 00:42:51.536 --> 00:42:54.972 you're going to do is something like an -- I don't know how many 00:42:54.972 --> 00:43:00.111 of you have used the feature, when it was available. Right, 00:43:00.111 --> 00:43:03.781 automatically tries every single exploit. So what we'd like to do 00:43:03.781 --> 00:43:09.620 is for every device have a go through each of these individual 00:43:09.620 --> 00:43:12.890 plug-ins so we can detect different attacks which may be 00:43:12.890 --> 00:43:17.094 happening. Right? So streamlining so that the moment 00:43:17.094 --> 00:43:20.965 you pass the pcap file it can actually automatically tell you, 00:43:20.965 --> 00:43:25.403 these five MAC addresses are being spoofed. That is a replay 00:43:25.403 --> 00:43:29.340 attack happening for these streams, right, and all of the 00:43:29.340 --> 00:43:33.978 stuff that you saw right now, going to -- different MAC 00:43:33.978 --> 00:43:39.383 addresses. Finally, reporting capability. So do we have time 00:43:39.383 --> 00:43:43.554 for questions? A couple questions? Okay. Questions. >> [ 00:43:45.823 --> 00:43:49.227 Inaudible ] >> Yes. So that is an -- there is an option 00:43:49.227 --> 00:43:55.233 available. You can go ahead and sniff packets live as well. So 00:44:05.676 --> 00:44:09.847 you actually notice there are sniffing options available. This 00:44:09.847 --> 00:44:15.920 will only work for -- you can -- feed interface in. Right? Any 00:44:15.920 --> 00:44:17.922 more questions? >> I have a question. [ Applause ] >> Thank 00:44:17.922 --> 00:44:23.928 you. Thank you. Thank you.