00:00:00.000 --> 00:00:05.839 Hello. Okay. So hi everyone and welcome to track one. Our talk 00:00:05.839 --> 00:00:11.678 here at 4:30 is how to secure the keyboard chain. And our 00:00:11.678 --> 00:00:16.550 speakers today are Paul Amicelli and Baptiste David. And here 00:00:16.550 --> 00:00:21.889 they are. Please help me welcome ... (applause)... >> So, hi 00:00:21.889 --> 00:00:27.227 everyone. Thank you for coming. His name is Baptiste David and 00:00:27.227 --> 00:00:32.566 I'm Paul Amicelli. We are from France and we're working on 00:00:32.566 --> 00:00:37.905 computer security luck. Today we're going to talk about how to 00:00:37.905 --> 00:00:42.276 secure the keyboard chain against a certain type of 00:00:42.276 --> 00:00:48.115 viruses which are Quito gaps. So this is under windows, so sorry 00:00:48.115 --> 00:00:53.453 for the [indiscernible]. As we lost so much time we will 00:00:53.453 --> 00:00:59.293 quickly see the security forms and then the main idea of our 00:00:59.293 --> 00:01:05.632 work with some details and we will end up with some ideas that 00:01:05.632 --> 00:01:11.972 we had to go further. So what's a Quito (ph.) gap. Basically a 00:01:11.972 --> 00:01:17.311 Quito gap are little piece of software or hardware or whatever 00:01:17.311 --> 00:01:22.182 you want which is able to retract every piece of 00:01:22.182 --> 00:01:27.521 information that can be typed on a keyboard. Meaning for instance 00:01:27.521 --> 00:01:32.392 a credit card number, bank account credentials and so on. 00:01:32.392 --> 00:01:37.264 They are underestimated since they can be anywhere and they 00:01:37.264 --> 00:01:43.103 are barely invisible. As you're going to see in a few moments, 00:01:43.103 --> 00:01:49.443 they're quite easy to develop. So first we have to see how the 00:01:49.443 --> 00:01:54.314 Quito chain works. There are three major stages, the hardware 00:01:54.314 --> 00:02:00.654 part. Basically each key is a switch and when you press a key 00:02:00.654 --> 00:02:03.590 it’s generating [indiscernible] with a code 00:02:03.590 --> 00:02:09.429 called a SAM (ph.) code. And this is handled by the channel 00:02:09.429 --> 00:02:14.768 part of the operating system which consists of a set of 00:02:14.768 --> 00:02:20.607 drivers. So we have the 1822 port which is the driver port. 00:02:20.607 --> 00:02:25.946 It basically handles every event on the keyboard and the mouse 00:02:25.946 --> 00:02:31.785 and then we have the keyboard class which allows to extend the 00:02:31.785 --> 00:02:36.156 functionalities by the keyboard manufacturers. Then this code is 00:02:36.156 --> 00:02:40.527 handled by the [indiscernible] part of the system. Similarly 00:02:40.527 --> 00:02:45.866 like you do with windows which converts the keyboard codes into 00:02:45.866 --> 00:02:50.737 a windowss message which will be understood by all the 00:02:50.737 --> 00:02:55.609 applications and the operating system itself. >> Well, when you 00:02:55.609 --> 00:03:02.916 want to make a -- you have many ways to do it. First you can 00:03:02.916 --> 00:03:08.255 create user mode one which is quite easy to develop because 00:03:08.255 --> 00:03:13.126 it's quiet easy to find codes on the internet. The 00:03:13.126 --> 00:03:17.497 [indiscernible] is really easy to install, since it normally 00:03:17.497 --> 00:03:22.369 doesn't require any specific rights and it's very good piece 00:03:22.369 --> 00:03:28.709 of software which is able to do the job requested. Most of these 00:03:28.709 --> 00:03:33.580 keyloggers are well known malware and can be detected by 00:03:33.580 --> 00:03:38.919 most of the antivirus software on the market. Because they are 00:03:38.919 --> 00:03:43.790 detected and removable from the system and it's very efficient 00:03:43.790 --> 00:03:49.629 but not so strong. If you want something stronger you can use 00:03:49.629 --> 00:03:54.968 cam ma (ph.) mode one. The driver which is inserted inside 00:03:54.968 --> 00:03:59.339 the keyboard driver sack, it's much more efficient. Because 00:03:59.339 --> 00:04:04.678 they have pre--- access to the key strokes. When the user 00:04:04.678 --> 00:04:09.549 presses the key strokes it's first identified as a driver 00:04:09.549 --> 00:04:15.388 from the -- of windows. This is why [indiscernible] not try. But 00:04:15.388 --> 00:04:21.728 we need to develop a driver and you need to have specific rights 00:04:21.728 --> 00:04:28.068 like admin wise to install the driver on the system and on 64 00:04:28.068 --> 00:04:33.406 windows subset you need to assign the driver and set figure 00:04:33.406 --> 00:04:37.778 [indiscernible] and things like that. It's more difficult to 00:04:37.778 --> 00:04:41.181 broadcast your -- [indiscernible]. And software is 00:04:41.181 --> 00:04:46.052 more difficult to detect because analyzing drivers is a bit 00:04:46.052 --> 00:04:51.391 harder and since the driver is running with zero right, like 00:04:51.391 --> 00:04:55.295 [indiscernible]. So add something stronger, like in mode 00:04:55.295 --> 00:05:01.635 one, you can use hardware -- it's a -- way to have a 00:05:01.635 --> 00:05:05.038 keylogger. Almost invisible since there is antivirus 00:05:05.038 --> 00:05:08.942 software. Antivirus software only analyze software on the 00:05:08.942 --> 00:05:14.781 hard drive or the system. There is no antivirus for an address. 00:05:14.781 --> 00:05:19.152 So it almost impossible to detect because it's invisible. 00:05:19.152 --> 00:05:23.523 Hardware keyloggers can be directly to your machine or 00:05:23.523 --> 00:05:28.395 already inserted during the birth of the hardware by the 00:05:28.395 --> 00:05:33.733 manufacturers. It's very hard to detect with your eyes when you 00:05:33.733 --> 00:05:39.072 see your computer. Most of the times this type of targeted 00:05:39.072 --> 00:05:44.411 attack. It's not broadcast to worldwide threat. This is a bit 00:05:44.411 --> 00:05:49.749 complicated to use it because you need physical access, one to 00:05:49.749 --> 00:05:56.089 plug in the keylogger first and one more time when you need to 00:05:56.089 --> 00:06:00.460 retrieve the information stored inside this keylogger. So what 00:06:00.460 --> 00:06:05.332 we proposed today is like a software library that is 00:06:05.332 --> 00:06:10.670 possible in the subsystem of windows trained to deal with all 00:06:10.670 --> 00:06:14.574 this. [indiscernible] not trained to detect or remove 00:06:14.574 --> 00:06:18.945 keylogger, it's a work of continuous software and they're 00:06:18.945 --> 00:06:25.752 free to do it. Our goal is to scramble key strokes in order to 00:06:25.752 --> 00:06:31.091 jamming keylogger (ph.) in the system. That's the goal of our 00:06:31.091 --> 00:06:36.429 system. And we want to fight the keyloggers that have many 00:06:36.429 --> 00:06:42.269 possibilities to be inside the system. When you use a user mode 00:06:42.269 --> 00:06:46.172 keylogger, you have possibilities to create it. One 00:06:46.172 --> 00:06:51.044 possibility, we can use windows API function to retrieve message 00:06:51.044 --> 00:06:57.384 from the keyboard. For example we get a -- key state. You can 00:06:57.384 --> 00:07:02.255 release the [indiscernible] when the key stroke is pressed and 00:07:02.255 --> 00:07:08.094 when a key is received on the system. That's for user mode 00:07:08.094 --> 00:07:13.433 application keylogger. If you are a driver, you are in the 00:07:13.433 --> 00:07:18.305 keyboard device -- and it depends, just a question of 00:07:18.305 --> 00:07:23.643 priority. If you're on -- you are able to keep [indiscernible] 00:07:23.643 --> 00:07:29.983 directly and use the code backs -- by the driver to be notified 00:07:29.983 --> 00:07:35.322 rooting to higher IRPs when they're received. You can use -- 00:07:35.322 --> 00:07:39.693 using the laptop driver. A [indiscernible] port driver and 00:07:39.693 --> 00:07:46.499 you are notified before -- if you want to be -- one more time, 00:07:46.499 --> 00:07:52.339 again, you can hook the keyboard into this table, to be, to 00:07:52.339 --> 00:07:56.242 replace the original keyboard interruption using this new 00:07:56.242 --> 00:08:00.613 interruption to manage your keylogger -- on the keyboard. 00:08:00.613 --> 00:08:06.453 This is also a possibility. This one, the last one, it's more 00:08:06.453 --> 00:08:11.791 difficult to use on 64 systems since windows tracks and checks 00:08:11.791 --> 00:08:17.630 the validity of the system. This normally doesn't work on the 64 00:08:17.630 --> 00:08:22.969 system? >> About the solution we developed. We put a protection 00:08:22.969 --> 00:08:28.808 driver in the middle of the keyboard driver sack. Why not in 00:08:28.808 --> 00:08:33.680 user mode? Any other application without the ability to retract 00:08:33.680 --> 00:08:40.987 the key strokes as driver. So we put it in as a higher -- driver 00:08:40.987 --> 00:08:47.327 but also by setting up a lower -- driver, will be able to 00:08:47.327 --> 00:08:53.166 retract the key strokes. And final solution will be to -- the 00:08:53.166 --> 00:08:59.005 table but with the patch work it's not a regular, a regular 00:08:59.005 --> 00:09:04.844 solution. So the only place to be the most efficient would be, 00:09:04.844 --> 00:09:11.184 is to be in the middle of keyboard driver site. So if we 00:09:11.184 --> 00:09:17.023 go into details on the keyboard driver side. When the key is 00:09:17.023 --> 00:09:21.394 pressed it generates a interruption which is handled by 00:09:21.394 --> 00:09:26.733 the interservice 14 of the IHE42 -- driver. Which detects the 00:09:26.733 --> 00:09:32.071 scan card and directly forward it to the protection driver. The 00:09:32.071 --> 00:09:37.410 protection driver, the scan code if it's needed and give them 00:09:37.410 --> 00:09:44.217 back to the IHE42 driver. It goes into a DPC and the -- of 00:09:44.217 --> 00:09:50.557 the class is done and it can displace to the rest of the 00:09:50.557 --> 00:09:55.895 system that is encrypted? >> So about encryption, in fact the 00:09:55.895 --> 00:10:01.234 original idea we got when we started this project was to 00:10:01.234 --> 00:10:07.073 sample every -- when it was received by the system. It's not 00:10:07.073 --> 00:10:12.912 a very sophisticated solution. But if you try to do that it 00:10:12.912 --> 00:10:19.252 won't work as you expect. What you see is very few key strokes 00:10:19.252 --> 00:10:24.123 are broadcast and received by the application of the system. 00:10:24.123 --> 00:10:30.463 What does this mean? If you are looking for it, you will see 00:10:30.463 --> 00:10:35.335 that windows only broadcasts P codes that it receives and 00:10:35.335 --> 00:10:40.673 knows. It means that unknown key codes with not broadcasted and 00:10:40.673 --> 00:10:45.044 are inhibited by windows. Of course if you [indiscernible], 00:10:45.044 --> 00:10:50.383 it means you use all possible outputs, but using the keyboard 00:10:50.383 --> 00:10:56.222 code and inside this code very small portion of the code is 00:10:56.222 --> 00:11:01.561 understandable by windows. That is why you receive so few key 00:11:01.561 --> 00:11:07.400 strokes for the application. So it leads us to find a solution. 00:11:07.400 --> 00:11:13.239 A solution which only gives none key strokes to be broadcasted on 00:11:13.239 --> 00:11:17.143 the system. And the solution [indiscernible] uses the 00:11:17.143 --> 00:11:24.450 following ideas. The idea is to use 62 bit -- on a set of key 00:11:24.450 --> 00:11:29.789 strokes, broadcastable key codes by windows. We have -- the right 00:11:29.789 --> 00:11:36.596 key code and we have worked with them on our algorithm to let the 00:11:36.596 --> 00:11:42.435 key code being broadcast by the system. We will use the original 00:11:42.435 --> 00:11:47.307 screen cipher to -- random generator which is used to 00:11:47.307 --> 00:11:53.146 [indiscernible] and a set of key codes. And this set for HD 00:11:53.146 --> 00:11:58.484 receiver on the system that makes other -- therefore -- with 00:11:58.484 --> 00:12:02.388 [indiscernible] properties. And with this solution because it's 00:12:02.388 --> 00:12:07.727 just a permutation, the code are broadcast on the system, that 00:12:07.727 --> 00:12:13.066 was the goal of our solution. Of course keylogger will receive 00:12:13.066 --> 00:12:17.937 only key codes, that means they're not keys shared between 00:12:17.937 --> 00:12:22.809 the driver and the application we choose [indiscernible] to be 00:12:22.809 --> 00:12:28.147 able to decipher the received key codes and receive the key 00:12:28.147 --> 00:12:33.019 strokes on the system. We talk about the [indiscernible] arise 00:12:33.019 --> 00:12:39.359 key code. And for example just on the screen is a keyboard and 00:12:39.359 --> 00:12:45.698 in green you've got keys which are in the white space for us 00:12:45.698 --> 00:12:51.537 until now. It's our old key strokes. That's enough to take a 00:12:51.537 --> 00:12:55.441 [indiscernible] because you have characters and numbers and 00:12:55.441 --> 00:13:00.313 symbols and these keys are all -- [indiscernible]. In orange 00:13:00.313 --> 00:13:06.653 it's keys that can be included in the white keys but they don't 00:13:06.653 --> 00:13:11.991 directly mean something for the user like enter or remove or 00:13:11.991 --> 00:13:17.330 shift. It could be used to improve the number of possible 00:13:17.330 --> 00:13:22.201 -- but until now it's not [indiscernible] the white space. 00:13:22.201 --> 00:13:28.041 The white keys are not -- because this key, most of the 00:13:28.041 --> 00:13:31.944 time it's something for the system, something like 00:13:31.944 --> 00:13:36.315 [indiscernible] doesn't make sense because the user will lose 00:13:36.315 --> 00:13:42.155 control of the machine very soon. So most of these keys are 00:13:42.155 --> 00:13:47.994 much used by password and most of them also depends on the 00:13:47.994 --> 00:13:52.365 keyboard manufacturers from a laptop to -- keyboards, there 00:13:52.365 --> 00:13:58.204 are many different keys. So to be as generic as possible we 00:13:58.204 --> 00:14:05.011 just use a smaller set of keys. In the future it could be much 00:14:05.011 --> 00:14:11.350 more larger. To sum up, in fact we have an algorithm from a 00:14:11.350 --> 00:14:15.722 [indiscernible] point of view, the algorithm, you have two 00:14:15.722 --> 00:14:21.060 possibilities. If the key stroke received is not in the white 00:14:21.060 --> 00:14:26.899 list that means we have not make any encryption operation on its 00:14:26.899 --> 00:14:32.238 because it doesn't make sense. It just broadcast to the system 00:14:32.238 --> 00:14:37.577 and normally it won't touch our application. If the key strokes 00:14:37.577 --> 00:14:44.383 we see is in the white keys, that means we need to cipher it. 00:14:44.383 --> 00:14:48.755 It receives encryption operation [indiscernible] and it follows a 00:14:48.755 --> 00:14:54.093 process described -- out put on the system. More generally if 00:14:54.093 --> 00:15:01.400 you want to have a good idea how the use the solution, we have an 00:15:01.400 --> 00:15:06.272 API which is [indiscernible] which is used by the application 00:15:06.272 --> 00:15:13.079 on the top left of the picture. As the beginning the API is made 00:15:13.079 --> 00:15:18.918 to have the first -- the key between the drivers and the 00:15:18.918 --> 00:15:21.854 application. Once the [indiscernible] is sharing 00:15:21.854 --> 00:15:28.194 between the two parts we can start. That is to say, when a 00:15:28.194 --> 00:15:31.130 piece is received, the exploitation driver 00:15:31.130 --> 00:15:36.469 [indiscernible] will be notified of the key code. It will perform 00:15:36.469 --> 00:15:41.340 the encryption operation and broadcast it to the -- driver 00:15:41.340 --> 00:15:46.212 which will translate the code into windows message. The key 00:15:46.212 --> 00:15:51.083 application will be able to decipher the code because they 00:15:51.083 --> 00:15:55.955 share the same key with the stream -- But another 00:15:55.955 --> 00:16:00.827 application, but the keyloggers we only see random data because 00:16:00.827 --> 00:16:06.666 it doesn't make sense for it. From that point, once you can 00:16:06.666 --> 00:16:13.005 say that it's not enough to make -- for example. If someone wants 00:16:13.005 --> 00:16:18.845 to insert a driver, it means it will receive key strokes before 00:16:18.845 --> 00:16:25.184 our -- drivers. So it will be -- from operation where there is 00:16:25.184 --> 00:16:30.523 disturbing [indiscernible]. So to give -- to such a program, we 00:16:30.523 --> 00:16:34.894 have implemented many solutions. First, to detect that driver, 00:16:34.894 --> 00:16:39.765 we're first checking there is no driver [indiscernible]. And then 00:16:39.765 --> 00:16:44.637 during the run time, the keyboard driver checks there is 00:16:44.637 --> 00:16:50.476 no driver in -- lower than us. At the end, we perform 00:16:50.476 --> 00:16:53.880 protection again, developing techniques, injection and stuff 00:16:53.880 --> 00:16:58.751 like that. The goal is to prevent application from getting 00:16:58.751 --> 00:17:03.623 access to the working sets of our protected application to 00:17:03.623 --> 00:17:08.494 retrieve, for example -- key between the application and the 00:17:08.494 --> 00:17:13.833 driver. So doing that we make filtering process on the -- 00:17:13.833 --> 00:17:19.672 shred from the process access, et cetera. At the end we use 00:17:19.672 --> 00:17:24.043 self-cryptography tests to check the integrity of the system 00:17:24.043 --> 00:17:28.915 between the driver and the application. The goal is to 00:17:28.915 --> 00:17:33.786 prove the [indiscernible] from both side and in addition check 00:17:33.786 --> 00:17:39.625 the -- of the system before beginning to use. Is it working? 00:17:39.625 --> 00:17:45.464 So in fact just for the -- we have created a little 00:17:45.464 --> 00:17:51.304 application which has two -- one acting as a keylogger and one 00:17:51.304 --> 00:17:54.707 acting as a protected application. First the 00:17:54.707 --> 00:17:59.578 application and the protected threat. We try to make a 00:17:59.578 --> 00:18:04.450 connection between the drivers. Itself, showing the key. We will 00:18:04.450 --> 00:18:10.289 try to launch the video. It's very short. So at the beginning 00:18:10.289 --> 00:18:16.128 you have initiation and sharing the key. That is made. And then 00:18:16.128 --> 00:18:21.467 following, you've got something typed on the keyboard and on the 00:18:21.467 --> 00:18:26.806 left you have a random data received by any keyloggers which 00:18:26.806 --> 00:18:32.645 -- on the system. Which key strokes I pressed. On the right 00:18:32.645 --> 00:18:38.484 you've got a good key strokes received on the system. That was 00:18:38.484 --> 00:18:45.791 the goal of our library? >> So now here is some ideas we had to 00:18:45.791 --> 00:18:51.130 -- the protection system and to improve it. For instance -- 00:18:51.130 --> 00:18:56.969 combination when the user -- twice give an A or whatever the 00:18:56.969 --> 00:19:02.308 user wants. Then we add poly morphic keyboards. The idea of 00:19:02.308 --> 00:19:07.179 this is to fool all keyloggers even hardwares. It's a 00:19:07.179 --> 00:19:12.051 representation of the real keyboards and the user will have 00:19:12.051 --> 00:19:16.422 to [indiscernible] on the keyboard according to the VR 00:19:16.422 --> 00:19:20.326 representation. And the VR representation can change with 00:19:20.326 --> 00:19:25.664 every key stroke according to the out puts of the stream 00:19:25.664 --> 00:19:29.568 cipher [indiscernible] protection. We have ten base key 00:19:29.568 --> 00:19:35.908 strokes for instance to use -- to press a key according to a 00:19:35.908 --> 00:19:41.247 time map on the screen. Or like -- general keyboards, for 00:19:41.247 --> 00:19:46.118 instance, press the key according to a certain melody or 00:19:46.118 --> 00:19:50.489 something like that. The last idea is [indiscernible] key 00:19:50.489 --> 00:19:55.828 strokes to zero as we're developing it in industry. So go 00:19:55.828 --> 00:20:00.699 script is a [indiscernible] developed in our labs in which 00:20:00.699 --> 00:20:06.038 we are removed the UK/USA algorithm. The problem is the -- 00:20:06.038 --> 00:20:12.378 why all the encryption system is done in ring 0. It's easy to 00:20:12.378 --> 00:20:17.716 retrieve the password with the DLA injection. The idea is to 00:20:17.716 --> 00:20:23.055 lower all the [indiscernible] and in order to add a security 00:20:23.055 --> 00:20:29.395 layer. In fact the key strokes will be internally -- as soon as 00:20:29.395 --> 00:20:34.266 password prompt is shown. The key stroke is stored and 00:20:34.266 --> 00:20:39.605 directly sent to the encryption function of the ghost script. If 00:20:39.605 --> 00:20:45.444 one wants to retract the passwords it will be to be in 00:20:45.444 --> 00:20:51.283 the channel which is much much more complicated. The -- of the 00:20:51.283 --> 00:20:55.654 project, for now it's a bit [indiscernible] needs more 00:20:55.654 --> 00:21:00.526 improvements and tests. Obviously it's -- a label on the 00:21:00.526 --> 00:21:06.866 -- you have the link below. And if one wants to participate we 00:21:06.866 --> 00:21:13.672 will be glad to welcome you in the team. So thank you for your 00:21:13.672 --> 00:21:18.544 attention. If you have any questions, maybe we'll have a 00:21:18.544 --> 00:21:22.915 round of beer or we're on [indiscernible].com. Thank you 00:21:22.915 --> 00:21:26.318 again. ...(applause)... >> (inaudible, question from the 00:21:26.318 --> 00:21:31.657 audience). >> We can't detect it with the monitoring of the 00:21:31.657 --> 00:21:37.496 registry of the keyboard driver class. As we said there is two 00:21:37.496 --> 00:21:43.335 possibilities. The first one is to raise an alarm to the user 00:21:43.335 --> 00:21:48.674 and saying this is what happened today. Removing it is possible 00:21:48.674 --> 00:21:54.013 but -- because you will broken [indiscernible] and it can lead 00:21:54.013 --> 00:21:59.852 to -- check. It's possible but it depends on the user option 00:21:59.852 --> 00:22:04.223 configuration. Yes. Inside it's not broadcast in ring three 00:22:04.223 --> 00:22:10.062 mode. If you are in an application you won't be able to 00:22:10.062 --> 00:22:16.869 see it. If you're a driver you will be able to see this meaning 00:22:16.869 --> 00:22:22.208 codes. I think it's maybe the answer to your question. Thank 00:22:22.208 --> 00:22:27.079 you. Thank you for your attention. And we are available 00:22:27.079 --> 00:22:31.951 for beer or something stronger if you want. Thank you. 00:22:31.951 --> 00:00:00.000 ...(applause)...