Computer Security 2020
Total Page:16
File Type:pdf, Size:1020Kb
Computer Security 2020 Lab 1: Passwords, access control, and remote exploitation of Windows • This lab will be done in groups of 2 people. • There are preparatory assignments for this lab, read through the complete lab guide carefully, and bring your written answers to the lab. • During the lab, write down answers to all problems, so you remember them when it is time to discuss them with your lab assis- tant. Learning goals: • Get to know the Windows login proce- dure. • Know how passwords are stored in Win- dows, and how they can be cracked. • Understand the different access control settings in Windows. • Use Metasploit to remotely gain access to a vulnerable Windows host. EITA25 EITF05 Computer Security Web Security (Datas¨akerhet) (Webbs¨akerhet) EITN50 EITN41 Advanced Com- Advanced puter Security Web Security (Avancerad (Avancerad datas¨akerhet) webbs¨akerhet) EDIN01 EITF55 Cryptography Data Security (Kryptoteknik) (S¨akerhet)Helsingborg Read this earlier than one day be- fore the lab! Note that you will not have any internet access during the lab, so come prepared. You may bring as many books and printed materials as you can carry. Study the questions in this lab manual, consider what you will need to be able to solve them, and make sure you bring that information with you. Alternatively, if you feel confident in the availability of eduroam, you may bring your own laptop, smartphone, or tablet to get Internet access. There are preparatory assignments for this lab, make sure you understand them, there will be a short individual quiz in the beginning of the lab session. For most students, these assignments take more than a couple of minutes. Read through this lab manual, and make sure you know the an- swers to the preparatory assignments. During the lab, write down answers to all problems, so you remember them when it is time to discuss them with your lab assistant. To prepare yourself, you can for example read Chapter 3 (\User Authentication"), Chapter 4 (\Access Control"), and Online Chapter 26 (\Windows and Windows Vista Secu- rity") from the Computer Security course book by Stallings and Brown. Some of the preparatory assignments will re- quire you to look for information outside the book. Any well-known search engine will turn out to be valuable then. If you are not acquainted with the Windows operating sys- tem, you should make sure you are before the laboratory lesson. Startup During this lab, you will use Windows 10 inside a virtual machine. Start by logging in on the host machine, start Vir- tualBox, and launch the virtual machine called ACE-#-W10, which should show up in the list. 1 The logon procedure and secu- rity of passwords Although many new technologies for authentication have been developed|such as smart cards and use of biometric data|the most commonly used method is still to authen- ticate a user with a username and password. In this sec- tion we will study some authentication procedures used in Windows-based networks, and see why it is important to be aware of the available weaknesses as a system administrator. This Windows installation is part of a Domain (COMPSEC). A domain is a group of computers, all administered by a do- main controller. From the domain controller, the adminis- trator can manage each computer and every user and group. When logging in, Windows 10 will by default ask for the password of the last logged in user. If you want to log in as another user, you must click Other User in the bottom-left menu. By default, the computer will try to authenticate against the domain, which can be seen on the logon screen as \Sign in to: COMPSEC" if you are at the \Other user" screen. You can also login to the local domain by prepending ACE-#-W10n in front of the username, where ACE-# is the computer name as indicated on the computer. However, in this lab you will use domain accounts. The username is printed on top of your monitor. Login to COMPSEC using: User name: lina## Password: Kanejbytas123 This makes the login manager in Windows contact the do- main controller for an authentication of your account. First, we want to check who belongs to the local group Ad- ministrators. These users have unrestricted access to the computer. Click the start menu and search for Computer Management (just start typing on the keyboard). Then open System Tools!Local Users and Groups!Groups, and double click Administrators to see who belongs to that group. Problem 1 Which users and groups have administra- tive access to the machine? Now, check which Users that exist on the machine. As you can see there are several local accounts (not domain accounts) on your computer called labuserXY, where X is a number in f1; 2g and Y is a letter in fa; : : : ; fg. There are also six prouserZ accounts. For example, labuser1f, labuser2a, and prouser3 are three accounts. A local user or group is an account that can be granted permissions and rights from your computer. Domain or global users and groups are managed by your network administrator. 1.1 Browser passwords The major browsers today have a feature to save the user's passwords on websites, so that they do not have to be en- tered every time. In this lab, we will look at how the pass- words in two popular browsers|Mozilla Firefox and Google Chrome|can be accessed. We will first look at Mozilla Firefox: Start Firefox from the Start Menu or Desktop shortcut. Go to the options menu, by clicking the menu button in the top-right corner inside Firefox. Then go to Options!Privacy & Security and scroll down to and click the button Saved logins.... Problem 2 What passwords can you find in Firefox? (Write down at least one) Now, let's move on to Google Chrome. Start by opening Chrome, then click the menu button in the top-right corner of Chrome. Click Settings and then click Passwords. Problem 3 What passwords can you find in Chrome? (Write down at least one) Problem 4 What is the difference between the two browsers? Does any browser handle the passwords more securely than the other? Explain! As you could see, both browsers could reveal the passwords in clear-text. During the course, we have put great emphasis that passwords should be hashed, and if the browsers would have used a hash function, it would not have been possible to get the clear-text passwords back. Problem 5 Why don't they hash the passwords? In summary, and depending on your browser, leaving your computer unattended for only a short period of time may compromise your passwords if an attacker is nearby! 1.2 Windows passwords In this section we will look at the different possible ways that Windows stores your login passwords. We will also use a tool called Cain & Abel to try and crack passwords in different ways. Preparatory assignment 1 • What is a brute force attack? • What is a dictionary attack? • What is a time memory tradeoff attack? (see e.g., http://www.cs.miami.edu/~burt/learning/ Csc609.122/doc/36.pdf) • What is the difference between a rainbow table and an ordinary time memory tradeoff table? (see e.g., http://lasecwww.epfl.ch/pub/lasec/doc/Oech03. pdf) Cain & Abel is a password recovery tool for Windows. It allows easy recovery of various kind of passwords by sniff- ing the network; cracking encrypted passwords using Dic- tionary, Brute-Force, and Rainbow table attacks; recording VoIP conversations; decoding scrambled passwords; recov- ering wireless network keys; uncovering cached passwords; and analyzing routing protocols. In this laboratory we will focus on the Protected Storage recovery and the Hash Cracking utilities in Cain & Abel. Start Cain & Abel, by finding it on the Desktop or Start menu. A warning from the Windows User Account Control will show, since Cain & Abel requires Administrator rights. Allow this, and ignore the following warning from Windows Firewall. 1.2.1 Cracking LM/NTLM Hash Values Cain includes a cracker for different kinds of hash functions. Basically, three kind of attacks are supported: brute force, dictionary, and rainbow table attacks (the latter is called Cryptanalysis attack in Cain). Preparatory assignment 2 • How is the LAN Manager (LM) hash produced, how is this hash used to authenticate a user, and what is the effective security of LM? • How is the NT LAN Manager version 1 (NTLM) hash produced, how is this hash used to authenticate a user, and what is the effective security of NTLM? User records are stored in the security accounts manager (SAM) database for local accounts, and in the Active Di- rectory database for domain users. Passwords are hashed and also stored in the SAM database or in the Active Di- rectory database together with the user record. By default, Windows XP and previous versions of Windows stored both the LM and NTLM hash for backward compat- ibility reasons, i.e., both hashes was stored in the SAM file and Active Directory. This was a devastating mistake as we will soon see, and as an administrator of older systems it is very important to know about this fact. Starting with Windows Vista and Windows Server 2008, the calculation of the LM hash is disabled by default, but it can still be activated by changing a registry value. In this lab, some passwords will { for demonstration purposes { have a calculated LM hash even though we use Windows 10. On your computer there are several local user accounts called labuserXY whose passwords you should try to crack. The accounts labuser1Y will have LM-hashes in addition to NTLM, the other accounts will only have NTLM hashes.