 We should start. So, this is the very last lecture of the class, sadly, but we're going to end in a terrible place, which is the sorry state of computer security, and my goal is to make you all, if not paranoid, at least aware of your own footprint when it comes to security and privacy. The world, as the first line says, the world is a scary place and everyone is out to get you. It's not paranoid, they're actually coming after you. Remember that always. It's not actually that bad. In general, the first thing you should do when trying to figure out what to do about security and privacy in your life is to figure out what trade-off is worth it for you. Like figure out what your threat model is, because that is the only thing that matters in terms of figuring out what is worth doing and what is not worth doing. Generally, you're going to be paying for security, whether that's in terms of usability, flexibility, the ability to recover when things fail. It might even be in terms of monetary value. You will be paying for it at one way or another, and there's going to come a point where you have to balance these. You have to figure out how much am I willing to pay in terms of my own time, in terms of usability, compared to what the security advice me. For example, if your threat model is like someone steals your laptop while it's off, that's pretty easy to defend against and you don't have to do all that much to protect against it. If your threat model is like the NSA or Mossad, then you have a problem. This is going to be very expensive to be defending against. It might not even be possible. The other thing to be aware of is that security is an ongoing process. If you configured your computer to be secure 10 years ago, it will no longer be secure today. And so you actually need to stay updated on these security topics. And that is why the very first thing in this election is a list of people that it's worthwhile to follow if you are interested in security. So these people are various kinds of people interested or working on or researching security. These are the trigger profiles. Many of them have websites as well, or blogs and those kinds of things. Following them is something I recommend because they will often just keep you on price for the things that are happening in the security world. Troy Hunt was listed at the top there also has a website called Have I Been Pawn, which is basically a giant database of all the data breaches that are happening. In both emails and passwords that lets you basically get an email alert whenever your email appears in any of the like breaches that happen all the way. Moxie at the bottom of the list is one of the inventors of Signal, which is something we might do. Those are a lot of these people I recommend following them highly. First of like general security advice. There are a lot of good articles and there are a lot of really bad articles out there on how to do security and how not to do security. I've listed to a write up by Tech Solidary that's pretty good that's on sort of the do's and don'ts for journalists online. And if it's secure for journalists it will probably work out for you as well because you are probably less of a target than journalists are. There's also some really good travel and security advice there. I'll get back to some of it later on in the lecture. But I recommend that you read through these just to put you in the right mindset what kind of security issues you have to keep in mind and what is bad security advice. One thing I will say that comes up in some of these is do not trust USB cables. If you ever plug your device like your phone or your laptop or anything into like a USB socket, it's a terrible idea. Takeovers over USB are surprisingly simple. You should buy one of these things. This is a USB data blocker. It's just a USB plug on both sides. You plug it in, you plug your cable in here and now you're fine because the only pins that it lets through are the power pins. So nothing else can exploit your device. They're handy to use. They're super cheap. It's worthwhile to get one if you travel a lot. The first thing we're going to talk about is authentication. So very often whether you're on the web or in person or whatever you usually be on the web, you're going to have to authenticate one way or another. The very first step to massively improve your security is to get a password manager if you don't already have one. You should not be making up your own passwords. You should not be remembering your passwords and you should certainly not be writing down your passwords. So there are lots of password managers out there. Some are good, some are bad. One password or the Linux standard password manager pass are both really good options. One password is a lot easier to use across many devices because it's built to do sync and all of that. Pass is very simple and straightforward and works with Git and encrypted files, but also works easy as well. You should use these applications to generate passwords for all of the sites you care about and you should probably change all those passwords today if you have not been using them so far. If there's any service you can log into that you care about where you know the password in your head, that is the problem and you should fix that. So I mentioned this might have been pawned. There's also a website called, has my password been pawned? Which is a similar website to the other one where you can type in your password and it will tell you whether that password has appeared in any of the data breaches over the past few years. Chances are that it has. Certainly if that website says yes, you should definitely change your password. But even if it doesn't, use a generated password, use one that's like 32 characters long or something, there's no reason for you to be remembering your passwords anymore. The second thing you can do that also massively improves your security is to enable two-factor authentication. Two-factor authentication is basically the idea that in addition to logging in with your password, you have to provide some other thing. Usually the way to think about this is something you know and something you have. So your password is something you know and your second factor authentication is something you have, like a phone or a USB dongle or something like that. There are a lot of schemes for this. The most common one you see is a mess authentication where they will send you an SMS message with some kind of text code. That works at a pinch but it's a terrible security mechanism. It turns out that these kind of mechanisms are really easy to subvert if someone actually wanted to attack you. Mobile device-based things like Google Authenticator, Duo, many of these kinds of things where you have an app or a little device that gives you a code. All of those things are better than SMS but they're still not great because they're still vulnerable to what's known as phishing attacks. So phishing attack is basically, many of you may have noticed already, there is a real website that's like your bank. And then someone sets up another website that looks just like your bank but actually it's not your bank, it's actually a malicious attacker. And somehow they make you visit this page and you think you're on your bank website, you input your login credentials and whatnot. And behind the scenes the attacker just sends those login credentials to the real bank and now they're logged in as evil. If you add a two-factor authentication mechanism that uses some kind of code, then the attacker can do the exact same attack. They show you this bank website, you put in your username and password, they send it to the bank. The bank says we sent you an SMS message. This website tells you, I sent you an SMS message, you get a code, it's actually from your bank. You put that code into this website, the attacker points it to the bank and now they're logged in as evil. So these mechanisms do not provide any sort of serious defense against phishing attacks. What you really want is something called U2F or FIDO. This is a relatively new two-factor authentication standard that basically is sort of the best practices we know of in terms of how to use a two-factor authentication scheme correctly. It will protect against phishing attacks like this. It's basically a little dongle like this. You stick it into your USB port, it has a little button on it. You stick it into your USB port when the website asks you to log in. And at that point the button will start flashing, you press the button and now you're logged in. It turns out this can be done extremely securely and without the website knowing anything about you. Without it knowing anything about being able to correlate these keys. If someone steals this team, they will still need your password, hence the two-factor open. And basically what it does is that this device in my pocket does a cryptographic handshake with the web server. And in that process it also checks that the web server knows some secret that it knew the first time I authenticated with it. So it is both the server authenticating my device and my device authenticating the web server. And so this prevents phishing attacks. Also MIT IS&T gives away free UV keys, so there's no reason to not use one. And should you want, so I have bought one and the reason is because I wanted one that also works with my phone. So this supports NFC, the near field communication. So I can use it with my phone like this and therefore get two-factor authentication on my phone as well. And they have like 20% off for students, so they're pretty cheap to get. Whenever you enable to, yeah, sorry, go ahead. Is there anything to do yet with Windows, Bluetooth, so in other words the phone would authenticate your login with Bluetooth? They've been waiting for that for a long time. I don't know that you can use your phone as a second-factor dongle. I think in theory your phone could implement U2F, but they don't generally. Part of the reason you want a device like this, like you don't want a general commuting device, is because with this the key can sort of be burned into the firmware of the device. So like this is not running an operating system of any like meaningful capacity. It's a tiny device, but that's very specialized. And so it's very hard to get the key out of this. If you're trying to stick the key into a regular phone, like if the phone got compromised in some way, like the operating system of the phone got compromised, you may be able to get the key back to your phone. Are you aware of any USB dongles for the laptop that would kind of sit flush against the laptop that would give you the NFC reader capability that phones are giving you? In other words, could you move the... Sometimes to insert it and it would be nice to be able to just kind of... So you don't want it to always be in? No, I know that. I'm saying you can put a generic NFC reader in a USB, plug up a USB port permanently, with an NFC reader and then be able to authenticate using that NFC capability. So it might mean that you can get an NFC reader for your laptop, and that way you never have to like plug it in, you just like hold it underneath. I don't know. So usually when you set up two factor authentication, the website will give you some kind of recovery code. There's usually some like sequence of numbers that usually give you more than one. And they said that if you forget your second factor authentication, here are some paper codes or backup codes. The reason you have these is in case you lose your second factor. You should generally have more than one of them, and like keep one in a secure place in case you lose the other, but should you for some reason not have access to your second factor, like all of them burned down in a house fire or something, then you want some way to recover your account. Because generally once you turn on two factor authentication, there's like no more recovering your account. There's no other way to get it back except by having the second factor. If the website allows you to recover your account without that, I would consider that a bug of the website. So these paper codes, they're intended to actually be paper codes. They're intended to never be stored on a computer, be printed out and like put in a safe somewhere. Because you should generally never have to use them. If you have to use them, it's an exceptional case. This is one of those cases where you get to a trade-off of what your threat model is like. So I actually keep my backup codes in my password manager. This is a weaker form of defense, because it means that if my password story gets compromised, they also get my second factor codes. And so that is a compromise that I've chosen that I'm willing to make. Because it means that if I lose my two factor off, but I have my laptop, I can use that to get a recovery code. The reason I believe that this is okay is because in general, if someone gets my password, it's not because they've hacked my password manager. It's because the website has been compromised or someone is looking at the link between me and the website. There's some kind of malware in the browser. That's where the leak would happen, where if password database gets compromised or someone guesses my password, it will not be that they've decoded my password database. It could be, but that is an attack that I'm willing to be subject to, because of the convenience it gives me. But this is what I mean by set up the right model and stick to it, because that way you can analyze whether you're willing or not to make these kind of compromises. For private communication, the answer is basically use signal. If you want to have something that gives you secure and private communication, signal is a really well-developed piece of software. It is also like the protocol has been well vetted. It is also what is used by WhatsApp. Not for group chats, I think, but for one-to-one chats. Wire is fine too, if you've heard about it. In general, I would say stick to one of those two. There is one called Telegram that is pretty popular. Telegram has a spotty track record when it comes to cryptography, so I would recommend staying away from that. Most of these also have a desktop version, like you can install signal for desktop or wired for desktop or whatnot. I would recommend that you don't do that. The reason is because your laptop is much easier to compromise than a phone. Generally, embedded devices, or phones, or tablets, things that have constrained computing environments are a lot more secure than your laptop is. But once you install one of these desktop messengers, they also have access to your key material or indirectly to your messages. So if they get compromised, you're host. And often the way that these services are implemented, the desktop applications is through some like embedded browser like Electron or something like that, which also then expands the trust base you have for that software a lot. So I would recommend staying away from that. Email is particularly problematic if you're dealing with sensitive content. I would say don't use it if you have something that actually needs to be secure and private. You can encrypt email. It is possible to encrypt and sign email. The technology works just fine. It's pretty awkward to set up. It has some problems like not generally being forward secure. So if someone compromises your email later, sorry, your key material, like your GPG keys or something later, they can then decrypt emails. They have seen you send them in the past. And so there are some of these problems. Key distribution is also really hard like learning someone else's key in the first place. If you're using public, private key pairs. Keybase.io is a pretty good initiative to try to verify online identities and their associations with keys. So I recommend you take a look at that if you haven't heard about it before. But generally like try to stick to signal or do something like wire if you actually want secure communication. While we're on the topic of laptops sort of being in a relatively insecure computing environment, I recommend that if you really care about security and privacy, you should get something like a Chromebook which does not give you in general at least low level access to the hardware and the operating system. The more locked away you are from the underlying stuff of the device, the more the attacker is also locked away. So you want something where it's harder for the attacker to attack the underlying problem. File security. So file security is really hard because this is a well-known XKCD about this problem of you can have the most secure encryption in the world on your file. If there's a password that you know and the person in addition to have the encrypted files also has you, they can probably get the stuff if you want to do it. All they have to do is like hit you over the head until you give them the password and now they have the confidence of your files. It costs them like five dollars. And so this is another place where you've worked. If all you're trying to defend against is offline attacks like someone steals your laptop and runs away with it while it's off, that is pretty easy to defend against. You turn on full disk encryption. There's like Crip set up and locks on Linux. There's BitLocker on Windows and there's FileWalt on Mac. Just turn it on. Now all your files are encrypted. There's going to be some like passphrase you need to get when you boot up or it's tied to your user password. This works perfectly fine but the problem is what if your laptop is on? If someone actually is out to get you which is sort of the threat model space we're in and someone steals your laptop while it's on or you walk away and they walk up to your laptop. Then now you have a bigger problem or there's malware in your machine because now the disk is now decrypted and they can do whatever they want with the files. Your disk encryption does not help you at all. For online attacks you generally want to use file encryption and there are two ways you can do online file encryption. One of them is to have an encrypted volume. An encrypted volume is basically an encrypted volume is basically you create a file on your hard drive on your regular file system so I would have something like in my home directory I would have a folder called a file called like secure that's not how that is built a file called secure but it's like 10 gigabytes large and this file is actually an encrypted file system so I use a tool like there's a bunch of those like eCryptifest or Hankifest or some of the most well known for Linux you point it at this file and say hey this is an encrypted file this is an encrypted file system contained within a file and it will mount this file as a directory somewhere that you can then like it's going to ask you for the password and then it's going to decrypt this encrypted volume and it's going to let you browse the files and then when you unmount this file again when you like say I no longer want these files then this file is sort of encrypted again or it's encrypted on the fly and now you no longer have access to the files so you sort of unlock a directory if you will whenever you meet the stuff inside of it and then lock it again when you're done that protects to some extent against online attacks but of course if the directory is unlocked when someone gets your laptop you're still kind of posed how would you suggest backing that up because if you want to back it up on cloud services presumably it's important data you want to back it up I mean the whole file can sometimes change geographic algorithms so in general when it comes to backing up an encryption it is very hard to combine incremental backups with encryption because if you you're leaking information about the contents of your backup if you're allowing it to be incremental ideally like the entire file should change no matter what you've changed inside of it so I would say that if you were using something like this and wanted to do a backup of it you would just be backing up the entire file each time there is software called Duplicate I don't know if I'm saying it right Duplicate tries to solve that problem so we'll get to the encrypted backup the other approach you have so instead of using the sort of encrypted volume is you can have individually encrypted files so for example the standard Linux password manager, the one called pass basically creates in your home directory it creates a directory called .passwordstore and this is a git repository and inside of here you have files for like Facebook for example and it will be called something like .gpg this is an encrypted file that contains my password to Facebook so it generates some long password and cryptids usually with some randomly generated key or with my public key in such a way that only I can read this file back later and so now this file will basically only be decrypted when I need its contents apart from that it will always stay encrypted now the question of course is do I have to type my password to unlock it every time? now I probably have like some session manager short amount of time and like now you run into the issue what if someone get like you type the password to decrypt this file and then like moments later the attack to your snatches the laptop away from you can they now like read the value of this password or the password for decrypting all of these files that they all share the same sort of master password can they extract that from the memory of the machine and so now the question is how what's your timeout for remembering these passwords to in general storing files that are encrypted it's just a matter of you encrypt them usually using a program like GPG GPG has two different modes so it can operate in private public key pair encryption mode so asynchronous encryption asynchronous a symmetrical encryption or you can run it with dash c to encrypt a file just with a regular passphrase so then we'll use symmetric encryption and that way there are no other files involved it's just the one file that you choose to encrypt or decrypt and then you will have to give the password every time to encrypt or decrypt one of the reasons that people often do encryption is because they want they sort of don't want other people to see their files but sometimes you want to go even further than that you want like if you're doing you're like crossing the US border with your device and you don't want them to know that there even is anything encrypted on it because if there is they might take you aside and be like what is this stuff like give us the passphrase and unlock it so we can see that you're not carrying government secrets or something in that case once they see that you have something encrypted they sort of have the grounds potentially to basically tell you to give them the password and have you unlock it you might refuse and there are also legal questions around that but they at least know that they should look for a password so some software tries to give you what's known as plausible deniability so the idea of possible deniability is that if someone looks at the bits on your hard drive or they might look through your file system they won't see anything weird anything weird that they see can easily be explained by other things and so they have no reason to suspect that anything is off possible deniability is really hard to provide if I have a hard drive that's like a terabyte large and I have a partition that's 500 gigabytes and then just no partition for the rest of the drive it could be that I legitimately don't have anything there but it seems mighty suspicious and so plausible deniability gets into weird legal territory as well but in general there are tools to try to provide this usually through some kind of steganography so they try to hide things inside of other files so you can't tell that they're there but then now you have like a jpeg that looks like a cat but it's like 10 gigabytes large that's not right either there are also usually other costs like lower performance it's easier to lose data because smaller corruptions can basically damage the entire file system there are tools to try to give this such as varicrypt which is a successor to truecrypt it tries to give you basically an encrypted partition on your machine that also provides plausible deniability how well it works, I'll let you decide on your own, there's a discussion that's linked there from Stackoverflow that has some pretty good reasons for why plausible deniability even with this kind of software is pretty hard probably still relevant to some Lafayette guy who made the threatens to hit you over the head and you don't get the password but there was a Supreme Court ruling recently that said law enforcement cannot force you to open up so I read that as well so the comment just for audio the comment was that there was recently a Supreme Court decision that the basically US border control law enforcement in general I think cannot require you to give over your password because it's basically the right to not self incriminate I think was what it was based on and this applies also to like if you have a phone they can't ask you to unlock it for them I would say that if you can provide if you can ensure your security in a way that's not tied to whether they're allowed to do it or not that is better so it definitely comes down to your threat model again if I have a system that is secure even if they make me do something that is better than one that relies on the fact that they can't tell me to do something but again it comes down to whether you think your a medical attacker will coerce you or not the other thing is if you want to do encrypted backups so your backups basically contain a lot of sensitive material there are tools that let you do this like duplicity you might try to like grow something yourself with like tar and rsync and GPG don't do it if you want encrypted backups there's a website and a tool called tar snap it has been there for a long time and they've really done the work to make sure that it gives good encrypted backups with support for incremental to the point where it's okay to do so it is a great service I recommend you use that and don't try to make up your own thing are they using rsync or the back end? no I don't actually know what tar snap does under the hood they have a description of their protocol online but in general they pretty much try to chunk up your backup and then do deduplication of the encrypted blobs so as long as you try to cut your backup in the same place each time those blobs will be uploaded but then be deduplicated so you don't pay for the storage so the optimal for what I understand the state of the art right there is duplicacy he actually compares his algorithms to all the competition out there and presumably he I don't actually know how to pronounce duplicacy duplicacy there are a bunch of these he was too nice for using a word that's too close to the competition so in general that I use that tool in the past as well and it seems nice I would recommend that you use tar snap instead the reason for this is because it means that you are not rolling anything yourself you're not relying on your own configuration anywhere like duplicacy for example there's a bunch of configuration parameters you can set for example how to encrypt the files you should not be making those decisions I think a duplicacy does it does work with this standard cloud providers with tar snap you've got to essentially use their storage if you rely on it so it is true that it is a little attractive to be able to use whatever cloud provider you want with encrypted backup it should not matter because your backup is encrypted so it shouldn't matter what cloud providers use in case a provider were to go down if you're doing it to two different cloud providers so tar snap already does distributed backup on their backend the alternative that I use the things I don't remember but in the state of the art for now if you want to roll your own solution it's called BOR which pretty much does what all tar snap is doing pretty similarly it doesn't do this d with it you have I think it's something Windows only and duplicacy actually is kind of in the same class as BOR I know what you're talking about BOR does deduplication it's actually able to work across what they call block boundaries so I guess what I would say is you can choose whatever provider you want whatever software you use just the less configuration you have to do the better because configuration of cryptography and any kind of scheme that involves cryptography you can very easily shoot yourself in the foot without realizing it BOR also one thing that when it comes to security and backups separately from the old encryption issue is that you really want to think about how your backups are stored because for example if your backup is set up in such a way that if someone gets access to your laptop or your desktop or whatever machine you're using to backup and from there they can delete all your backups that is a major problem for most software that you install today for backups this is trivially true if they get your machine you can either login to the service or use the UI to delete all the old backups or if you have something where like the last n are backed up they just empty whatever folder is being backed up and then run 100 backups of that folder and now the other things have just been run off the stack so you really want to think through what is your mechanism for dealing with a malicious person getting access to the source of your backups and that is also something that charts that pass the story for generally the way that you do this if you were to roll your own is you give your machines a pen to only support so they have cryptographic keys that can only append to the data store they cannot remove anything so if someone gets hold of my laptop all they have is the ability to create more backups they cannot delete old ones and then there's a separate key that you can like print out and put on paper if you need it you can also like give a particular machine delete only access and have that machine like only be on every now and again to delete old backups or something like that but you really want to think through what scheme you're using to ensure that someone can't just wipe your backups if you choose to also go on the internet then there's a bunch of other things that are also insecure it turns out the internet is also a really scary place there's a bunch of links and this text that I recommend you go read if you sort of look through this later that have really interesting descriptions of the kind of attacks that you can see on the web this is not web specific but about the internet in general first of all open Wi-Fi networks are really scared this is for a number of reasons it's not just because you don't trust the underlying network but it's because when you connect to an open Wi-Fi network so one without encryption when you later disconnect from that network and go somewhere else your phone is constantly broadcasting the name of that network looking for it again and whenever it finds it it's going to auto connect to it this applies to your laptop as well so there are devices out there there's one called the Wi-Fi pineapple which you can set up you basically plug it in and it will look for any device that's asking whether a Wi-Fi network exists and reply yep that's me and just give itself that name and the device is going to connect to it and there's no password so you can tributally just pretend to be that network and now you get lots of people just auto connecting to this thing and all of their traffic goes through you this is scary the other thing is in general open Wi-Fi networks do no encryption of the wireless traffic and this also means that people can just sniff whatever is on the like going over the wireless signals and just tributally sniff that using a laptop so if you ever want to have some fun go to an airport turn on sniffing mode for your Wi-Fi card and just look at all the stuff that you can see a surprising amount of it is plain text so therefore for open Wi-Fi networks if you do have to connect to them make sure you delete them from your list of like known Wi-Fi networks afterwards so your phone will not try to auto connect same for your laptop as well like go through the same networks and delete anything that doesn't have a password if you ever on a network that you don't trust it will not be an open Wi-Fi network or even a network that has a key but it's like a hotel network an airport network like a conference network a Starbucks network whatever and you don't trust the underlying network then VPN may be what you want I want to be really hesitant I am really hesitant about recommending using a VPN because you're just shifting who you trust using a VPN that means you trust the VPN provider more than whatever your internet service provider is right so if you use some free VPN you found online that means you're trusting this free company more than Starbucks maybe that's reasonable or the Starbucks employees in that store for that matter so like maybe that's reasonable maybe it's not but this is really a trade-off you have to decide of who do you trust more it is very very unlikely that they are more trustworthy than like Comcast when it comes to your traffic when it comes to handling your traffic and not storing that traffic from later for example what you can do if you sort of trust yourself is you could set up your own VPN by starting a server somewhere whether it's like an MIT server park on EC2 or some other cloud provider you could totally do that this comes back to the configuration issue whenever there's anything that's involved in security if you are told that you have to configure things yourself you will probably get it wrong unless you do a lot of research and understand the underlying protocols so open VPN which is one of the most common use services for this is like a server client pair has a lot of configuration and I don't know how good the default configuration is but getting it wrong is problematic and even there you are now trusting whoever is hosting that server more than your ISP which may or may not be what you want to do if you do want to run this I recommend you take a look at WireGuard which is a new sort of VPN implementation that is really good and has almost no configuration it works exclusively with like modern cryptographic primitives and a very easy key set up it just sort of works very easily out of the box on Linux and macOS you need a kernel module there is also if you are configuring your own servers or your own clients for most servers and clients you configure there are various settings you can change if you do have to set these settings there is a website called CypherList that has recommended secure configurations for a bunch of software basically which types of key exchanges and hashing mechanisms the server and client should use for example they have a configuration for your SSH client you can block Cypers that are insecure key exchanges that are insecure that kind of stuff if you are very privacy oriented then there is a website called PrivacyTools.io which gives you both a list of browser extensions that we talked about earlier it gives you configuration settings programs you might want to install it mentions like VPN providers it mentions Tor which we will get back to in a second so that is a good resource if you just want to see what kind of tools are out there and so I mentioned Tor Tor is a little weird because Tor caters to a very particular use case a particular threat model it turns out the Tor is not particularly resistant to powerful global attackers like if the government is out to get here Tor is unlikely to really save you all that much it is pretty weak against things like traffic analysis attacks it is mostly useful for hiding traffic on the small scale and hiding who you are from the server or hiding the server from you this is what onion services are but in general it is useful for hiding your identity from the server but that is just about it it is not hiding your identity from anyone else the other thing that is worth all to know is that even when trying to hide from the server all Tor really does that obscures your IP address right one of the biggest problems is that there is a lot of sensitive material that your browser sends on every request that might make it easier to figure out who you are so if there is a server over here and then your machine over here what Tor does is basically route your traffic through a bunch of intermediate nodes before it gets to the server and so what the server sees as the source IP is just whatever this machine is it does not see your IP address but included in the request that you sent along here if this is a request for a website for example it might include things like which fonts are installed on your machine well this might be something the server can put up on their website right they run some JavaScript here that your browser is going to execute and they can send requests back and that might query for what fonts you have installed might query for the size of your browser window it might query for your operating system version your exact browser version what cookies are installed locally for that website the like the size of your caches they might profile your browser to see how fast they can do certain tasks and take it together all of these things basically almost uniquely identify who you are like your browser will have a fingerprint that's almost unique and so if you then later on connect through Tor to the same website through a different path then they might still recognize that you're the same person who logged in over from over there because your browser fingerprint is the same Tor the Tor project does distribute this thing called the Tor browser that tries to sort of mask as many of these signals as it can but it is not perfect and so this is why Tor is useful for guarding against very particular types of setups sort of almost like accidental sniffing from the server but that is just about it so it is not sort of a magic ball that dissolves all your issues so you want to actually access the internet and access websites and then that makes things a lot worse than what we just talked about so what we talked about so far was general internet traffic the web is a pain because everything also goes through your browser and your browser is basically an operating system that will randomly execute whatever program the other side tends to there are a couple of ways that we talked about that Jose also talked about earlier like plugins that could help deal with this the first one is HTTPS everywhere what it does is it enables it basically goes to the TLS or SSL enabled version of a website first and then only if that is not available does it go to the non-HTPS version this is only a very weak defense it only protects against very specific types of attacks but in general though you really want TLS to be enabled so TLS is the underlying security mechanism behind HTTPS you want to enable on everything and that is not just to encrypt your traffic so it is not just let's ignore tour for a second I have a connection directly to the server and the middle sits my ISP or my VPN provider or whatever, Starbucks if I send information plain text over here that includes my usernames, my passwords then if an attacker is sitting here instead of observing the middle then what they can do sure that's a lie if the attacker sits in the middle there they can just observe your username and password so that's not okay so what TLS does is it adds encryption on that connection so that anything you send and receive cannot be observed by someone in the middle if all they can do is observe they cannot look inside this channel they can only see the bytes on the outside the problem is encryption on its own is not sufficient because if I'm the attacker and if I'm like someone working at the coffee shop you're at then what I can do is at this point you're talking to so I'll just pretend to be the server and when you connect to me you're actually establishing a secure connection to me and then I establish a secure connection to the server but that means that in the middle here I get to observe everything in plain text and so the other mechanism and arguably one of the more important mechanisms of TLS is that it also has these certificates that the server has to present you can think of it as a signed document that has like a stamp on it it's a stamp that says like I represent google.com and it's been stamped by someone that your browser trusts so your browser has a list of what are known as certificate authorities there's basically a list of companies that and their keys where if the server presents one of these forms that's stamped by something that's in your list then the browser will trust that whoever sent that thing is actually google.com right? the attacker can no longer do this attack because I connected to google.com so I expect to get back a signed document for google.com the attacker they can produce a document they might even be able to stamp it with some stamp they made up when my browser gets it and checks this against the list it's a dot match and therefore this connection the browser can tell me this is not google.com and this is where you might see in your browser this like little red square this is not secure or this website is malicious or it's like trying to steal all your stuff that is because it detected that something like this happened it might not be an attacker it might be the website administrator forgot to get their things stamped or it's like the stamp is expired or something like that and this is one of the ways we can start dealing with phishing attacks of course the other thing that might happen and the other thing that modern TLS implementations do is imagine that I'm at some coffee shop and I connect to the network and I ask for google.com and I ask for the TLS port I'm the attacker I just say couldn't connect couldn't connect to port 443 I'm running on the hdbs port my browser is going to go I better try port 80 than regular hdb and your browser goes that worked and now the attacker of course sees everything in play packs they just downgraded your connection so there's no longer TLS so the way to defeat this is included in this signed statement the website can also say they can do what's known as pinning so if you have pinning turned on then if the browser ever gets a signed statement like this that includes a pin from a website it will refuse to connect to that website in the future unless it is over TLS and so that way this downgrade attack will also not work but it does assume that you have in some point in the past connected to the website with TLS if the first time you connect to it is not then like all bets are off and it turns out this this protocol is old over many many many years to try to get it to this point and it's still not perfect there's still ways in which you can exploit the system but slowly but surely you can get better if you are really paranoid then you might even walk through this list of what stamps your browser trust and sort of remove any that you don't need by default your machine or your browser comes with about like 200 of these pre-installed many of them have slightly shady track records and so one thing you can do is just like empty this list and then start browsing the internet and your browser will say none of these websites are trustworthy and just whitelist the ones that you see that you need so that's what I do at my laptop you should only do this if you are truly paranoid or if you just want to figure out how this works but then you can go through and like I need this one because Google uses that one I need this one because Github uses that one Twitter and Facebook use that one but these like 197 others they don't they aren't responsible for the stamps for any websites I care about and so therefore I'm just not going to trust them and now this does mean that every now and again if you go to like some random event booking site or like you're trying to buy a movie ticket or something your browser is going to say not secure and you have to go through this process and like check mark that thing again but it does mean that it really limits the kind of attacks that can be done against you just in terms of certificates the other extension that was mentioned was Ublock Origin so Ublock Origin in addition to being an ad blocker it's actually what's known as a wide spectrum blocker it lets you block pretty much everything it uses a technology that was originally invented for websites to say to the user to the browser don't allow anyone to execute on my site or only allow scripts from this URL to execute JavaScript and what you can do is you can it basically has a bunch of modes for how a parallel you want it to be so I recommend that if you just want to like be a little bit more secure then just turn it on and everything will be fine until you use the default block lists there's also a link here to medium mode and hard mode if you go to medium mode it will basically block all third party JavaScript this saves you from a bunch of attacks it also happens to also reduce a bunch of ads that would otherwise ads in tracking code that would otherwise be let through but once you enable medium or hard mode a bunch of websites are going to stop working because they rely on some third party JavaScript or CSS or like frames from some other site and so these modes will require you to do a little bit more engineering yourself so for example so I have a hard mode turned on and here you can see that inline scripts on websites I don't think I can make this larger sadly oh I can but in a really helpful way I guess actually I can do that great so for this URL it's telling me that inline scripts I've disabled globally third party scripts so scripts that are loaded from a domain that is not the same as this one blocked globally frames from any website that is not this one blocked globally and then it says I loaded something from hacker tools on github.io which is fine because it's the same domain I loaded something from fonts on googleapis.com that happens to be on one of my white lists so that's why I love that I blocked something from google tag manager.com that's some kind of tracking script and I allowed an image from xkcd.com and that's because I haven't disabled third party images I can then go through it override and say for this website I want to allow it to load something from google tag manager for this website only I want to allow inline scripts because it happens to need it this does mean that you have to do a bunch more stuff yourself actually websites will not work flight bookings are the worst because you go through the process and you click next and then nothing happens because you blocked the script and then you go back and the form is clear we have to do it all again so it's an absolute pain but it does really increase your security so again this is where that balance comes off are you willing to incur this cost to increase your security and so hard mode is even worse than media mode because it blocks even more things by default the other thing I recommend that you look into is so in Firefox it's called multi-account containers and Chrome is called like Chrome profiles it's basically a way to create multiple copies of your browser that are sort of independent so cookies state, caches everything is just kept separated so for example I have one container that is for all my banking related sites and I have one container that's for all my work related sites one for all social networking one for like sensitive stuff like encrypted backups and those are all entirely separated this means that if there's some malicious script that runs on facebook or something it cannot get my bank login details cannot get my cookies for my bank so as far as that that version of my browser is concerned I'm not logged into my bank or similarly if I so most tabs are open to this extra container that has no name and that is separate from everything else so if this site for example tried to authenticate me through Google it would see that I'm not logged in but if I open a new tab and I go to google.com you'll see that the tab you can see at the bottom here I have a pink tint to it and it says personal here so that tab is associated with the personal profile of the personal account and so within this tab I am logged into Google and I've set that whenever I open Google I want that tab to open in this but if this page which is not in the personal container tries to check whether I'm logged into Google it will get a no and this lets you very nicely segregate your web experiences so that it's much harder to get the cross contamination or cross database and in Google Chrome you can use Chrome profiles to sort of get the same thing although I think they need to be different browser windows I don't think they can be per tab I'm not sure I think you have to log out yeah from memory in Chrome it's basically you choose which profile you have to open so if you switch profiles the window will be replaced by a window from that profile with the tabs from that profile as opposed to here where I can have multiple tabs open that are all in different containers that said Chrome is generally a more secure browser than Firefox sort of from a historical perspective that has been true so I don't know which one to recommend but I've been using Firefox and been doing something with it I think that's all I wanted to cover when it comes to security I think the takeaway should be figure out what kind of things you're worried about when it comes to security and then figure out what you have to do to defend against those things what you should definitely do though is install a password manager make sure all your passwords are like random and generated by the password manager and enable due factor authentication and with that I think we're done with Hacker Tools for IV thanks for all of you who sort of showed up and thanks for the people who are not here it's been fun, we will probably do this again sometime Anish is currently compiling or rather compressing and transcoding all the video material so we'll have that up on the website or on YouTube as soon as we can the initial few lectures have already been posted on Piazza so feel free to ask more questions there if you think of something later and sort of watch that space or the YouTube channel for the videos from the upcoming lectures from the ones that we've already posted which are now in the past so yeah, thanks for coming hope you learned something I didn't record but I have the window open although I guess for this there is talk yeah I didn't type anything in my terminal except SL except SL which is unimportant also if you're interested in security 6858 just running this in my search you can also take 6858 and John is dating my boss which I do