Security & Forensic Analysis of an Internet of Things Smart Home
Total Page:16
File Type:pdf, Size:1020Kb
DEGREE PROJECT IN COMPUTER SCIENCE AND ENGINEERING, SECOND CYCLE, 30 CREDITS STOCKHOLM, SWEDEN 2020 Security & Forensic Analysis of an Internet of Things Smart Home Ecosystem JOHANNES OLEGÅRD KTH ROYAL INSTITUTE OF TECHNOLOGY SCHOOL OF ELECTRICAL ENGINEERING AND COMPUTER SCIENCE Security & Forensic Analysis of an Internet of Things Smart Home Ecosystem JOHANNES OLEGÅRD Master’s Programme, Computer Science, 120 credits Date: December 14, 2020 Supervisor: Asif Iqbal Examiner: Mathias Ekstedt School of Electrical Engineering and Computer Science Swedish title: Säkerhets- & Digital-forensisk Analys av ett Sakernas Internet smarthemsekosystem 4 Abstract Abstract The Internet of Things (IoT) is an ongoing trend where a multitude of internet- connected devices become more common. Many of these devices have easily exploitable security vulnerabilities. This has led to large-scale cyberattacks such as the Mirai botnet Distributed Denial of Service (DDOS) attacks. More cybercrime can be expected in the future, especially as the number and types of IoT devices grow. In this work, the security of an IoT ecosystem was investigated from two perspectives: security testing and Digital Forensics (DF). Security testing was used to search the Application Programming Interfaces (APIs) of the IoT ecosystem for security vulnerabilities. Three Static Application Security Testing (SAST) Tools were used to search the source code of the cloud part of the system. A manual review was done to search the system as whole, with the guide of common vulnerability lists from the Open Web Application Security Project (OWASP). As a result, severe security vulnerabilities were found. A DF experiment was conducted where actions were taken in five Android smartphone apps to control six IoT devices (two are from aforementioned IoT ecosystem). The contents of the smartphone was then examined for forensic evidence of those actions. Additionally the contents one of the IoT devices was also examined for evidence. It was concluded that only limited evidence of the actions could be found. Additionally, various challenges were identified. i Sammanfattning Sammanfattning Det så kallade Sakernas Internet (eng. Internet of Things, IoT) området är en pågående och ökande trend. Trenden handler om att olika enklare enheter ansluts mot internet i stort antal. IoT-enheter har utsatts för, och utnyttjats i, cyber attacker som i exempelvis det så kallade “Mirai botnet”. Allt fler IoT-relaterade brott kan förväntas i framtiden, speciellt eftersom antalet IoT- enheter blir allt fler och mer diversifierade. I den här uppsatsen undersöks säkerheten i ett IoT ekosystem utifrån två aspekter: “security testing” (säkerhetstesting) och “digital forensics”. På svenska kalls digital forensics för “IT-forensik” (kriminalteknik inom informationsteknik) eller digital-forensik. Säkerhetstestning användes för att hitta sårbarheter i det undersökta IoT ekosystemets olika applikationsprogrammeringsgränssnitt. Tre olika verktyg av typen Static Application Security Testing (SAST) användes i undersökningen för att granska den kod som motsvarar moln-delen av systemet. Utöver de tre verktygen, undersöktes systemet också manuellt. Den manuella undersökning utgick från de listor av vanliga typer av sårbarheter som finns publicerade av organisationen Open Web Application Security Project (OWASP).Resultatmässigt hittades flera allvarliga sårbarheter i systemet. Digital forensics-delen av projektet bestod av ett experiment där en Android telefon, sex IoT-enheter (två från det ovannämnda IoT ekosystemet) och fem motsvarande Android-appar undersöktes. Experimentet bestod av att utföra olika handlingar i apparna (till exempel att skicka ett kommando till en IoT- enhet), och sedan av att leta bevis för de handlingarna. För att hitta bevis undersöktes innehållet på telefonen och innehållet på en av IoT-enheterna. Slutsatsen av experimentet är att bara få och begränsade bevis kunde hittas. Utmaningarna som påträffades i experimentet jämfördes med utmaningarna beskrivna i forskningslitteraturen inom digital forensics. ii Acknowledgments Acknowledgments I would like to thank my supervisor Asif Iqbal for his guidance, patience, dedication and generosity. He got me interested in the topics of the thesis, and helped in every single part of the work. He also managed to borrow some of the IoT devices for the experiment on my behalf. Thanks are also due to the anonymous people at the company for giving me this opportunity. They gave me access to their system, guided me through it and lent me the related IoT devices. I would like to thank my coauthors of [1, 2] for involving me in two of my first published papers. Last but not the least, many thanks to my family for their support in these strange times. Stockholm, December 2020 Johannes Olegård iii Acknowledgments iv Contents 1 Introduction 1 1.1 Problem statement ....................... 2 1.2 Research question ........................ 2 1.3 Hypothesis ........................... 2 1.4 Evaluation ............................ 3 1.5 Scope and limitations ...................... 3 1.6 Thesis structure ......................... 4 2 System architecture 5 2.1 Overview ............................ 5 2.2 IoT devices ........................... 5 2.3 The server ............................ 7 2.4 The app ............................. 9 2.5 Protocols ............................ 9 2.5.1 The HTTPS API .................... 10 2.5.2 The AMQP APIs .................... 11 2.5.3 The UDP-based protocol . 12 3 Security testing 15 3.1 What is software testing? .................... 15 3.2 What is security testing? .................... 16 3.3 Security standards ........................ 18 3.4 OWASP lists ........................... 18 3.4.1 OWASP top ten ..................... 19 3.4.2 OWASP API top ten . 19 3.4.3 OWASP IoT top ten ................... 20 3.5 API security testing ....................... 20 3.6 Automating security ....................... 28 3.7 What security measures are currently taken at the company? . 28 v CONTENTS 3.8 Method ............................. 29 3.9 Results .............................. 32 3.10 Example exploits ........................ 37 3.10.1 Firmware update MITM . 37 3.10.2 Update device directly . 37 3.10.3 Upload firmware to server . 39 3.10.4 Steal shared key ..................... 42 3.10.5 Capture ApiService ................... 45 3.10.6 Example exploit 6 Crack unsalted passwords . 46 3.10.7 Steal app signing keys . 47 3.11 Discussion ............................ 48 3.11.1 Vulnerabilities ..................... 48 3.11.2 Security testing tools . 48 3.11.3 Solutions ........................ 48 3.11.4 Future work ....................... 49 3.11.5 Ethics .......................... 50 3.11.6 Sustainability ...................... 50 3.12 Conclusion ........................... 51 4 Digital forensics 53 4.1 Introduction ........................... 53 4.2 What is digital forensics? .................... 54 4.3 The digital forensic process ................... 55 4.4 Challenges to digital forensics . 56 4.5 Related work .......................... 59 4.5.1 Android app digital forensics . 59 4.5.2 IoT digital forensics ................... 61 4.6 Method ............................. 64 4.6.1 Overview ........................ 64 4.6.2 Scope and limitations . 64 4.6.3 Hardware ........................ 65 4.6.4 Software ........................ 66 4.6.5 Activities ........................ 67 4.6.6 Acquisition ....................... 73 4.6.7 Analysis ......................... 74 4.7 Results .............................. 77 4.7.1 Port scanning results . 77 4.7.2 X app .......................... 78 4.7.3 Mydlink (D-link) .................... 80 vi Contents 4.7.4 Kasa (TP-Link) ..................... 81 4.7.5 Telldus live ....................... 82 4.7.6 Alexa (Amazon) .................... 84 4.7.7 “Sense” device ..................... 85 4.8 Discussion ............................ 88 4.8.1 Evidence ........................ 88 4.8.2 Challenges ....................... 89 4.8.3 Future work ....................... 90 4.8.4 Ethics .......................... 91 4.8.5 Sustainability ...................... 91 4.8.6 Conclusion ....................... 92 References 93 A App file structures 113 vii Contents viii List of Figures 2.1 System architecture ....................... 6 2.2 Simplified overview of AMQP data flow between services. 13 3.1 Illustrations of OWASP WEB01 through WEB04. 21 3.2 Illustrations of OWASP WEB05 through WEB08. 22 3.3 Illustrations of OWASP WEB09, WEB10, API01 and API03. 23 3.4 Illustrations of OWASP API04, API05, API06 and API09 . 24 3.5 Illustrations of OWASP IOT01 through IOT04 . 25 3.6 Illustrations of OWASP IOT05 through IOT08 . 26 3.7 Illustration of OWASP IOT09 and IOT10. 27 3.8 Illustration of an MITM attack exploiting V01 and V05. 37 3.9 Illustration of firmware installation by exploiting V04. 38 3.10 Illustration of exploiting V36 and V01 to install malicious firmware on multiple devices. 42 4.1 Overview of the digital forensic process [2]. 55 4.2 Summary of Digital Forensic challenges [2]. 57 4.3 X app, X plug and X “sense” activities. 68 4.4 Mydlink app and D-link plug activities. 68 4.5 Kasa app and TP-Link plug activities. 69 4.6 Telldus live app, Telldus gateway and Telldus plug activities. 69 4.7 Alexa app and Amazon plug activities. 69 4.8 Access Point MITM network setup in the configuration mode [2]. ............................... 70 4.9 Ettercap MITM network setup in the configuration mode [2]. 70 4.10 Access Point MITM network setup [2]. 71 4.11 Telldus MITM