Effective Password Cracking
Total Page:16
File Type:pdf, Size:1020Kb
Effective Password Cracking An Offline Attack on Norwegian Passwords Nicklas Mortensen Hamang Thesis submitted for the degree of Master in Network and system administration 60 credits Department of Informatics Faculty of mathematics and natural sciences UNIVERSITY OF OSLO Autumn 2019 Effective Password Cracking An Offline Attack on Norwegian Passwords Nicklas Mortensen Hamang © 2019 Nicklas Mortensen Hamang Effective Password Cracking http://www.duo.uio.no/ Printed: Reprosentralen, University of Oslo Abstract This thesis focuses on studying characteristics of Norwegian passwords as a means to find the best way of attacking them. This was done by using a password-cracking tool to attack offline copies of several password data breaches. We found that a majority of Norwegian passwords use long passwords but equally as many of them still use passwords found in known password leaks. In conclusion we recommend that Norwegians can strengthen their passwords by increasing their passwords length, add more special Norwegian characters and most importantly check their passwords against lists of leaked passwords. i ii Contents 1 Introduction1 1.1 Motivation and Background.....................1 1.2 Research Questions..........................1 1.3 Structure of Thesis..........................2 1.4 Research Method...........................2 2 The Principle of Passwords3 2.1 History of the Password.......................3 2.1.1 Passwords and Cryptography Prior to Computers....3 2.1.2 In the information age....................4 2.2 Password storage...........................5 2.2.1 Plain-Text...........................5 2.2.2 MULTIC Scrambler and PNT................6 2.2.3 Hash..............................6 2.2.4 Salted Hash..........................7 2.2.5 Shadowed Files........................7 2.2.6 SAM File............................8 2.2.7 Password Managers.....................8 2.3 Password Guidelines.........................9 2.4 Psychology of Password Creation.................. 10 3 Cryptography 11 3.1 Symmetric Cryptography...................... 11 3.1.1 DES............................... 12 3.1.2 Triple DES........................... 13 3.1.3 AES............................... 14 3.2 Asymmetric Cryptography..................... 15 3.3 Cryptographic Hash Functions................... 15 3.3.1 SHA X............................. 17 3.3.2 MD4 and MD5........................ 17 3.3.3 LMHash and NTHash.................... 18 3.3.4 Crypt.............................. 18 4 User Authentication 21 4.1 What is user authentication?..................... 21 4.2 The types of User Authentication.................. 21 4.2.1 Knowledge/memorization-based authentication..... 21 4.2.2 Possession-Based Authentication.............. 22 4.2.3 Inheritance-Based Authentication............. 23 4.2.4 Multi Factor.......................... 23 4.3 NIST.................................. 23 4.3.1 SP 800-63B Authentication & Lifecycle Management.. 24 iii 5 Attacking Passwords 29 5.1 Password Attacks........................... 29 5.1.1 Password cracking...................... 30 5.1.2 MITM - Man-in-the-Middle................. 35 5.1.3 Key Logger.......................... 36 5.1.4 Social Engineering...................... 36 5.2 Data Breaches............................. 39 5.3 Password Attack Tools........................ 42 5.3.1 Brutus............................. 43 5.3.2 Cain & Abel.......................... 44 5.3.3 John the Ripper........................ 45 5.3.4 Hash Suite........................... 46 5.3.5 THC Hydra.......................... 46 5.3.6 RainbowCrack........................ 47 5.3.7 Hashcat............................ 48 5.3.8 AirCrack NG......................... 49 5.3.9 WinDump........................... 49 5.3.10 Wireshark........................... 50 5.3.11 Gophish............................ 50 5.3.12 Social Engineer Toolkit (SET)................ 51 6 Experiment 53 6.1 The Machine and Software...................... 53 6.2 Datasets................................ 53 6.2.1 Hemmelig.com........................ 55 6.3 More on Hashcat........................... 55 6.3.1 Test Case............................ 57 6.4 Going on the Attack.......................... 57 6.4.1 Brute.............................. 57 6.4.2 Numbers............................ 58 6.4.3 Existing Lists......................... 61 6.4.4 Norwegian.......................... 64 6.4.5 English............................. 78 6.4.6 Rounding off the Attacks.................. 85 7 Conclusion 87 8 Glossary 89 8.1 Avalanche effect............................ 89 8.2 CAPTCHA............................... 89 8.3 cygwin................................. 89 8.4 Feistel Structure............................ 89 8.5 Iterations................................ 89 8.6 Key Stretching............................. 90 8.7 Offline Attack............................. 90 8.8 Online attack.............................. 90 8.9 Regex.................................. 90 A All Result Outputs 99 A.1 Experiment Files........................... 99 A.2 Numbers................................ 99 A.3 Brute-force............................... 101 A.4 Existing Lists.............................. 102 A.5 Norwegian Names.......................... 103 iv A.6 Sports.................................. 110 A.7 Country- or Place-name....................... 113 A.8 Norwegian Words........................... 116 A.8.1 All Norwegian Dictionaries................. 119 A.9 English Names............................ 121 A.10 Country- or Place-name in English or Native Languages.... 126 A.11 Movies................................. 129 A.12 English Dictionary.......................... 131 A.13 Norwegian After English....................... 134 v vi List of Figures 2.1 MULTICS Scrambler notation [16].................6 2.2 Hash Salting [17]...........................7 2.3 Shadow File Entry...........................7 2.4 Generic Shadow File Entry......................7 3.1 Principle of a symmetric-key cipher [26].............. 11 3.2 Caesar cipher Shift [28]........................ 12 3.3 DES with round function components; the key splitter KS, the bit expansion E, the S-boxes S, and the bit permutation P [29].. 13 3.4 encrypting and decrypting using Triple DES [30]......... 14 3.5 A asymmetric key cipher [26].................... 15 3.6 An illustration of a Hash function [33]............... 16 3.7 Illustration of the properties of a hash function.......... 16 3.8 bcrypt [40]............................... 19 4.1 Examples of some common patterns [42].............. 22 4.2 Authenticators............................. 22 4.3 Biometrics............................... 23 4.4 Summery of AAL requirements [41]................ 26 5.1 Simple Rainbow reduction [56]................... 34 5.2 A password reset attack with CAPTCHA and a security question [57]................................... 35 5.3 Example of phising email, claiming to be PayPal [60]...... 37 5.4 A couple of tools to identify possible password leaks...... 42 5.5 Brutus on Windows [81]....................... 44 5.6 Cain & Abel on Windows [82].................... 45 5.7 John the Ripper on Linux [86].................... 46 5.8 THC Hydra on Unix [88]....................... 47 5.9 RainbowCrack on Windows [90].................. 47 5.10 Raibow table generation with RainbowCrack [90]........ 48 5.11 HashCat MD5 Benchmark on Windows.............. 49 5.12 Start monitoring wireless adapter in aircrack using backtrack [93] 49 5.13 Wireshark sniffing packets [95]................... 50 5.14 Gophish result template [96]..................... 51 5.15 Social Engineer Toolkit main manu [98].............. 52 6.1 Breakdown of Numbers Recovered................. 61 6.2 Breakdown of Names recovered................... 69 6.3 Breakdown of Norwegian Words.................. 76 6.4 Breakdown of Names Recovered.................. 80 6.5 Breakdown of English Attack.................... 85 6.6 A Breakdown of all Attacks..................... 86 vii 8.1 Hash iterations............................ 90 viii List of Tables 2.1 Hash examples............................6 2.2 UK top 10 passwords.........................9 3.1 The search space of a Hash...................... 17 3.2 SHA Properties [36].......................... 17 5.1 Password combinations, Time with our machine in mind.... 31 5.2 examples of using mangling rules.................. 32 5.3 Hash suite supported Hashes.................... 46 6.1 Attack Options............................ 55 6.2 A selection of supported encryption scheme............ 56 6.3 The Debug Option For Hashcat................... 57 6.4 Simple rules used rockyou.txt.................... 64 8.1 Hashcat Word Mangling Rules................... 91 ix x Chapter 1 Introduction 1.1 Motivation and Background The Internet has become part of our daily lives, and encompasses more and more of our activities. This includes things like how we read about current events trough blogs and news sites, how we socialize using social media and web forums, as well as to how we conduct our finances with online banking websites and payment apps like vipps. All these services require some form of user authentication, which usually takes the form of user names and passwords. As people register to new websites this can lead to the need for each person to maintain a relatively large number of passwords. The password-manager developer Dashlane reported in 2018 that the average user has over 200 different digital accounts using passwords [1], which can lead to negligent password hygiene. With this many accounts a user is likely