A Security Analysis of the WPA-TKIP and TLS Security Protocols
Total Page:16
File Type:pdf, Size:1020Kb
ARENBERG DOCTORAL SCHOOL Faculty of Engineering Science A Security Analysis of the WPA-TKIP and TLS Security Protocols Mathy Vanhoef Supervisor: Dissertation presented in partial Prof. dr. ir. F. Piessens fulfillment of the requirements for the degree of Doctor in Engineering Science: Computer Science July 2016 A Security Analysis of the WPA-TKIP and TLS Security Protocols Mathy VANHOEF Examination committee: Dissertation presented in partial Prof. dr. ir. P. Van Houtte, chair fulfillment of the requirements for Prof. dr. ir. F. Piessens, supervisor the degree of Doctor in Engineering Prof. dr. ir. C. Huygens Science: Computer Science Prof. dr. D. Hughes Prof. dr. ir. B. Preneel Prof. dr. K. Paterson (Royal Holloway, University of London) July 2016 © 2016 KU Leuven – Faculty of Engineering Science Uitgegeven in eigen beheer, Mathy Vanhoef, Celestijnenlaan 200A box 2402, B-3001 Leuven (Belgium) Alle rechten voorbehouden. Niets uit deze uitgave mag worden vermenigvuldigd en/of openbaar gemaakt worden door middel van druk, fotokopie, microfilm, elektronisch of op welke andere wijze ook zonder voorafgaande schriftelijke toestemming van de uitgever. All rights reserved. No part of the publication may be reproduced in any form by print, photoprint, microfilm, electronic or any other means without written permission from the publisher. Preface When I started my PhD four years ago, I thought people were exaggerating when they said that doing a PhD was a unique and special experience. Turns out I was wrong: it is indeed quite the journey! It was a roller coaster of exciting and sometimes no so exciting research results, late-night deadline races, moments of doubt, enriching and rewarding travels, grueling dilemmas, facing your own limitations,. you get the idea. This journey would not have been possible without the help of several people, and with the risk of forgetting some, I would like to thank them here. First and for all, I want to thank my supervisor Frank Piessens. You gave me the freedom to work on my own ideas, for which I am forever grateful. Your quick understanding of new ideas, insightful comments, and overall guidance has truly been inspiring. I would also like to thank the members of my jury, Frank Piessens, Christophe Huygens, Danny Hughes, Bart Preneel, and Kenny Paterson, for taking the time to read my dissertation, and providing me with helpful comments in preparation of this final version. And Paul Van Houtte, thank you for chairing the jury. Special thanks also goes to my office mates. Frédéric Vogels, you always made sure people felt welcome and enjoyed their day. Since I was new to Leuven, and the department, this was greatly appreciated. Thanks for all the moelleux, and for all the pedantic but entertaining discussions. Raoul Strackx, you have been a great colleague and friend. Thanks for always being willing to help out with things when needed. And of course, thanks for enduring all the witty remarks over the last few years, you have survived them well. Jesper Cockx, thanks for making the office a fun place, and for introducing us to D&D. May there be many more evil spiders and monsters to kill. A big thank you also goes to our lunch group: Pieter Agten, Sven Akkermans, Jesper Cockx, Milica Milutinović, Andreas Nuyts, Marco Patrignani, Rula Sayaf, Raoul Strackx, Jan Tobias Mühlberg, Jo Van Bulck, Gitte Vanwinckelen, i ii PREFACE Frédéric Vogels, and Neline van Ginkel. Thanks to all of you, lunch was always something to look forward to. I also enjoyed all our after work get-togethers, we should keep organizing them! I would also like to thank all the people I have met, or worked with, during my PhD. First, Kenny Paterson, thanks for your enthusiastic reaction to my initial but vague ideas about attacking RC4. Your positive reaction made me research RC4 in more detail! Tom Van Goethem, our recent collaborations, including late-night deadline work, clearly paid off. I hope we can continue this great work in the future. I also appreciated working with, and learning from, my fellow teaching assistants and lecturers: Yolande Berbers, Jasper Bogaerts, Philip Dutré, Wouter Franken, Roald Frederickx, Job Noorman, Steven Op de beeck, Willem Penninckx, Jan Smans, Eric Steegmans, and Thomas Winant. And of course I also enjoyed meeting all my other colleagues, who helped made every day at the department a pleasant one: Wilfried Danëls, Willem De Groef, Philippe De Ryck, Maarten Decat, Lieven Desmet, Dominique Devriese, Bart Jacobs, Wouter Joosen, Bert Lagaisse, Jef Maerien, Jonathan Merlevede, Nick Nikiforakis, Davy Preuveneers, Jose Proenca, Bob Reynders, Zubair Rafique, Jan Spooren, Klaas Thoelen, Gijs Vanspauwen, Thomas Vissers, and Rinde van Lon. Also a thank you to Bram Bonne, Mariano Di Martino, Pieter Robyns, and Dieter Vandenbroeck, for the discussions we had over the years. And of course there is Hacknamstyle, our capture the flag team. Steven Van Acker, thanks for blowing new life into this group, for all the discussions we had, and for showing me how to run experiments on all computers of the department. Tom Van Goethem and Neline van Ginkel, keep up the good work you are doing for Hacknamstyle! Without you the group just would not be the same. It has also been great to meet all the people who regularly participated in the workshops or CTFs: Pieter Agten, Jeroen Beckers, Mathias Bynens, Dieter Castel, Xavier Castermans, Anthony Clays, Thomas De Backer, Kevin Holvoet, Sophie Marien, Michiel Meersmans, Arne Swinnen, Bert Van de Poel, Jo Van Bulck, Tim Van den Eynde, Kobe Vrancken, Koen Yskout, and Bart van der Plancken. Thank you all for joining our activities and creating a fun atmosphere. And to all the people of the secretariat, administration, and business office, thank you for all the help and for keeping our paper work to a minimum: Katrien Janssens, Fred Jonker, Anne-Sophie Putseys, Esther Renson, Ghita Saevels, Marleen Somers, Karen Spruyt, and Annick Vandijck. This work also would not have been possible without the people that manage the computer infrastructure at our department. Even when I was running experiments on nearly every computer, and was heating up cold classrooms during the winter, at least according to students, they allowed me to keep running my computations. Thank you! PREFACE iii I would also like to thank the Research Foundation - Flanders (FWO) for granting me a PhD fellowship, and the Research Fund KU Leuven for their financial support. Als laatste, maar daarom zeker niet minder belangrijk, wil ik mijn ouders en familie bedanken voor alle steun doorheen de jaren. Zonder jullie was dit werk niet mogelijk! Aan mijn twee broers Peter en Erik, bedankt om mij van jongs af aan al een kritische ingesteldheid bij te brengen, en mij te laten prullen met jullie computers. Het heeft duidelijk zijn effect gehad! Thank you all! — Mathy Vanhoef Leuven, July 2016 Abstract This dissertation analyzes the security of popular network protocols. First we investigate the Wi-Fi Protected Access Temporal Key Integrity Proto- col (WPA-TKIP), and then we study the security of the RC4 stream cipher in both WPA-TKIP and the Transport Layer Security (TLS) protocol. We focus on these protocols because of their popularity. In particular, around November 2012, WPA-TKIP was used by two-thirds of encrypted Wi-Fi networks, and it is currently still used by more than half of all encrypted networks. Similarly, around 2013, RC4 was used in half of all TLS connections. Finally, with as goal to implement reliable proof-of-concepts for some of our attacks against WPA-TKIP, we also study physical layer security aspects of Wi-Fi. In the first part of this dissertation we focus on WPA-TKIP when used to protect unicast Wi-Fi traffic. Here we demonstrate how fragmentation of Wi-Fi frames can be used to inject an arbitrary number of packets, and we show how this attack can be applied in practice by performing a portscan on any client connected to the network. Then we propose a technique to decrypt arbitrary packets sent towards a client. Our technique first resets the internal state of the Michael algorithm, and abuses this to make victims forward packets to a server under control of the adversary, effectively decrypting the packets. We also present a novel Denial of Service (DoS) attack that requires the injection of only two frames every minute. Additionally, we discover that several network cards use flawed and insecure implementations of WPA-TKIP. In the second part of the dissertation, our goal is to attack WPA-TKIP when used to protect broadcast and multicast traffic, i.e., group traffic. This is important since, even in 2016, more than half of all encrypted Wi-Fi networks still protect group traffic using WPA-TKIP. To carry out our attack in a general setting, we must be able to reliably block certain packets from arriving at their destination, preferably using cheap commodity Wi-Fi devices. Hence we first study low-layer aspects of the Wi-Fi protocol. Surprisingly, we found that commodity devices allow us to violate several assumptions made by the Wi-Fi v vi ABSTRACT protocol. We show this enables us to implement a constant and selective jammer using commodity Wi-Fi devices. Although the selective jammer can block a large percentage of packets from arriving at their destination, we found that an even more effective method is to block packets by obtaining a channel-based man-in-the-middle (MitM) position. In such a position, packets are blocked by not forwarding them. Finally, we demonstrate that our MitM position allows us to attack WPA-TKIP, when used as a group cipher, within only 7 minutes. In the last part of the dissertation we attack RC4 in both WPA-TKIP and TLS.