I came across this article when looking for ways of hardening my laptop, and this guide seemed extremely thorough. It is perhaps overly paranoid, but it will be good to have a guide I can trust should I come in a position, most likely work related, that requires this level of protection.

My questions are: are there any holes in the above guide that the author has failed to mention that would allow an attacker access? And to what lengths would a would be attacker have to go to gain access, without resorting to beating you with a spanner?

5 Answers 5


Some commentary:

Defending from common thieves

Rather than wiping Windows 7, I've left it as a honeypot operating system. If a thief steals the laptop, when they turn it on, it will automatically boot up into Windows, without so much as even being prompted for a password. I installed a free application called Prey which will allow me to grab loads of information from the laptop, such as its location, and pictures from the built in webcam.

Unlikely. Most laptop thieves have been in prison at one point in their lives, so they've learnt a thing or two from their fellow inmates. They are wise to this trick. When they steal electrical items that can communicate, they take batteries out (and SIM cards if applicable). Most mobile phone thieves carry opening tools for iPhones, so they can quickly remove the SIM. They'll then sell the laptop onto a fence (someone who sells on stolen goods) who will take out the drive and wipe it, and install a new OS on it. Usually a pirated copy of Windows.

Defending from experts

I consider full disk encryption to be essential if you want to secure your laptop. However, there are several attacks against machines that use full disk encryption; I decided to address as many of them as possible.

Agreed that full-disk crypto is good! Let's move on...

Evil maid attacks

Even if you have a machine which uses full disk encryption, the boot partition and boot loader need to be stored somewhere unencrypted. Typically, people store it on the hard drive along with the encrypted partitions. The problem with doing this is, whenever you go to your machine, you don't know if somebody has tampered with the unencrypted data to install a software keylogger to capture your password. To get around this, I installed my boot partition and boot loader on a Corsair Survivor USB stick. I wanted a USB stick which would never leave my side.

This is a real threat, albeit rather unlikely. However, the USB stick booter does not protect you. It makes the bad guy's job more difficult, but if they're going to the trouble of tampering with hardware, they could just as easily install a hardware keylogger under your keyboard. Lock the laptop in a case when it's out of your sight. I always do this in hotels, because it helps prevent theft too. I also suggest investing in a decent Kensington lock, which can be attached around pipes and various other strong fixtures.

On a typical system with disk encryption, the encryption key is stored in RAM. This would be fine, if it weren't for the fact that there are several ways for an attacker with physical access, to read the contents of the RAM on a machine which is running, or which has been running recently. You might think that your machine's RAM is wiped as soon as it loses power, but that is not the case. It can take several minutes for the RAM to completely clear after losing power. Cooling the RAM with spray from an aircan, can extend that time period.

This is misleading. At room temperature, modern DDR3 loses integrity below the 50% confidence mark at around 3-15 seconds after power-down. DDR2 tends to do so at around 20-30 seconds. This makes a cold-boot attack on DRAM modules very unlikely, even if you almost immediately leave the room and someone jumps in and drops your laptop into a convenient vat of liquid nitrogen. It's just not going to happen. However, you should avoid sleep mode, which puts the system in a low-power state and continues to refresh the RAM. In such a case, an attacker could freeze the DRAM modules on-site and take them to a lab for analysis. Hibernate isn't a problem if you're using full-disk encryption - the machine state is stored on disk and the system is completely shut down.

You could password protect the BIOS and disable booting from anything other than the hard drive, but that still doesn't protect you.

It won't protect against coldboot attacks, but it protects against a lot of other stuff. You'll also find that a lot of BIOS implementations offer a boot password too, which will make things more difficult for an attacker or thief, since the machine won't even POST without the password.

The second defence I used is far more interesting. I use something called TRESOR. TRESOR is an implementation of AES as a cipher kernel module which stores the keys in the CPU debug registers, and which handles all of the crypto operations directly on the CPU, in a way which prevents the key from ever entering RAM.

This only prevents your crypto keys from being stolen. The RAM will still contain all sorts of other important data, such as file system cache. It'll also contain your LSA keys, LSA vault and in-memory SAM (or the equivalent structures in Linux) which can be used to recover account password hashes. If these are cracked, it might give an attacker an idea of what your disk encryption password is. As such, I highly recommend using a unique password for your disk encryption.

Attacks via firewire

If a machine has a firewire port, or a card slot which would allow an attacker to insert a firewire card, then there's something else you need to address. It is possible to read the contents of RAM via a firewire port.

Yep, and the same is possible via cardbus. If you're paranoid, you'll need to physically disable these interfaces.

So instead, I built firewire as a set of kernel modules, and prevent the modules from loading under normal circumstances using /etc/modprobe.d/blacklist.

Won't work. The OS can't interact with the device if you disable support or remove drivers, but a firewire device or cardbus module can still function in any way it likes at the hardware level - it just can't interact directly with your OS software. DMA requests and interrupts can still be sent by the device, allowing it to read memory. This allows the attacker to collect it later, or have it transmitted over RF.

Preparing for disk encryption

you should completely wipe a new hard drive with random data before setting up disk encryption. This is to make it impossible for somebody to be able to detect which parts of the drive have had encrypted data written to them. Doing this, is as simple as creating a partition on the space you want to fill with random data, and then using the "dd" command to copy data directly to that partition device in /dev/ from /dev/urandom. This took a few hours to run on my system.

This is a silly way to do it. TrueCrypt automatically wipes the entire disk with random data as part of the volume creation wizard. It's also faster than direct reads from /dev/urandom, because TC does its own strong AES-based random data generation on top of what the system provides. Don't bother doing it manually with dd - you might get it wrong.

I complicated this procedure slightly by using something I purchased called an EntropyKey. The EntropyKey provides a much larger source of "real" random data, as opposed to the much more limited "pseudo" random data that is generated by the operating system.

This is maybe a good idea. I don't see any real technical analysis of this device, so I can't really say whether it's good or not. Passing various statistical checks doesn't really mean a whole lot. It uses avalanche noise from the P-N junction of a transistor, which is a known good source of random noise, since it is created by the probabilistic effect of quantum tunnelling. However, the noise isn't without bias. Due to various electrical properties of a circuit, such as inductance and capacitance, you'll see small biases towards particular waveforms that "resonate" with various power planes and loops within the board's copper pathways. This bias can be reduced with a software filter called von Neumann whitening, which involves translating bit pairs from 01 to 0, 10 to 1, and discarding 11 and 00 bit pairs. This reduces the output speed of the generator by a factor of at least 1/4 (for an idea random source), but removes bias. I can't tell if this is being done within the EntropyKey.

More on disk encryption

When I initially did the installation, I chose to protect the full disk encryption key with a passphrase. It is also possible to protect it with a keyfile. The advantage of using a keyfile is that you can store it on an external device. An attacker can't just observe you entering the password, they also need to get hold of the keyfile. It's also much more difficult to brute force.

This is fine as long as you have both the keyfile and a password. It essentially provides two-factor authentication.

If you need to use swap. Make sure it is encrypted too. The easiest way to make sure everything is encrypted is to create an encrypted device, and then use LVM on top of that so that all of your partitions and swap end up on top of the same encrypted device.

Wise words. On Windows you should configure your virtual memory (swap) to be placed only on disks that are part of your full-disk encryption regime.

The laptop I purchased has something called a Trusted Platform Module. This TPM can handle a number of crypto operations it's self. It also provides a random number generator similar to the EntropyKey. Apparently a lot of modern laptops contain one of these.

I'd avoid this, due to past problems with TPMs and government backdoors. Whilst I can't cite any concrete evidence, it makes me nervous enough to avoid it.

I use Firefox as my web browser. Surfing the web scares me; the browser strikes me as the most likely way in for a remote attacker. And yet, most people run the browser under the same user id as the rest of their programs. So if the browser is compromised, all of the files that your user can access are also instantly compromised. To try and minimise any damage if this happens, I decided to run Firefox in its own account.

Again, smart. It'd be even smarter to sandbox it entirely, as well as run it under its own user. This is more difficult for Windows, so I'd say your best bet is to have your user account set as a limited user for most tasks (with UAC switched on!) and only switch to an admin account when you actually need to. Something like Sandboxie can also help.

All of my incoming email is encrypted using my public GPG key. I detailed how I do this here. This means that I need to store my private GPG keys on my laptop. They're protected by a passphrase, but is this enough? If my account was compromised, an attacker could key log my passphrase and then steal my keys. Luckily, when I purchased my laptop, I ticked the "Smartcard Reader" option. I then purchased an OpenPGP Smartcard. My encryption and signing subkeys have been transferred to the smartcard, and the master key has been removed from my laptop.

Useful, but this fails to take into account the "evil maid" attack mentioned earlier. It's possible to sniff the card's communications, or tamper with it so that it stores the keys for later retrieval.

I use the following Firefox addons to minimise the chance of MITM attacks against my browsing, and to prevent most XSS/CSRF attacks: Certificate Patrol, Cipherfox, DNSSEC Validator, HTTPS Everywhere, HTTPS Finder, NoScript, Perspectives and Request Policy.

Good list! I'd also include Collusion, AdBlock Plus and Greasemonkey. Collusion catches various tracking cookies and allows you to block them. AdBlock Plus is useful for killing off ads, which can be a source of various nasties from tracker cookies to malware. Greasemonkey is a user-script addon which lets you inject your own JavaScript into selected sites or pages. It can be useful for disabling various functionality on particular pages, or adding your own functionality. For example, I have a script that looks for various URL shortener links and replaces their target with a JavaScript popup box, allowing me to decide what to do with the link.

I installed an application called blueproximity. It detects when my phone is in range, via bluetooth. If my phone moves out of range, the screen automatically locks. I've no doubt that this can be prevented via spoofing my phone, but it adds another layer of security.

A cool gimmick, but easily spoofed. Bluetooth security is crap.

All in all, a pretty neat article. It has its flaws, but it also has a lot of sound advice. If you follow even half of it you should be secure against all but the most determined attackers. At the end of the day, it's a balancing act between the risks you care about and the time/money you want to put into it.

  • are those tresor vulnerabilities applicable to linux?
    – user24408
    Commented May 30, 2013 at 2:40
  • @Sulla Linux has plenty of sensitive data in RAM, so yes.
    – Polynomial
    Commented May 30, 2013 at 9:18

Polynomial has already written a very good analysis, but there are a few extra points worth mentioning.

Partial analysis

Defending from common thieves

Case 1: the thief is after the hardware. He's going to fence it and reinstall the OS first thing. The odds that he'll boot into Windows and try using it are low (not zero: there is such a thing as a dumb thief). A person booting into Windows may also be someone trying to find out who you are because you lost the laptop and it's been found.

Case 2: the thief is after the data. Not for himself of course, but for resale: there is a market for stolen corporate or government laptops. That kind of thief (or the person employing him) knows not to boot the device, but to transplant the disk and look at the data from outside.

I consider the Windows installation as presented here a pure waste of disk space.

Evil maid attacks

Defending against these attacks has a limited scope. The evil maid could plant a hardware keylogger, or could install a firmware rootkit.

The problem with a “USB stick which would never leave my side” is that it's actually pretty easy to lose one. Most people are vulnerable to competent pickpockets. It's somewhat easier to lose a USB stick in a crowd without noticing than a bulky laptop.

Cold boot attack

The proposed defense introduces a vulnerability: kernel upgrades take a lot longer when you need to download the new source, reapply the patch and recompile. That's often not something you can conveniently do while on the go, which is when cold boot attacks matter.

By the way, apply security updates promptly is an elementary piece of advice that's missing from the article.

Trusted Platform Modules

For better security against information leakage, put the encryption key in a TPM or a smart card. This introduces a serious risk of losing the device that contains a key. If your motherboard is fried (TPM) or you lose the card (smart card), you won't be able to access your data any more. So make real sure you've backed up the key. Think of what you'll do if you lose your key while traveling.

Securing the web browser

There's a big whooper here. Running the browser as a separate user only protects against a few vulnerabilities, such as local file access vulnerabilities. For added benefits, define a more restrictive AppArmor policy for Firefox. However, if the attacker can run arbitrary code as mike.firefox, he pwns the mike account as well. X servers don't provide much in the way of isolation. mike.firefox can stuff input into other applications and run a keylogger. mike.firefox can also run local attacks, including exploiting unpatched local vulnerabilities (how much are you willing to bet you don't have any?), and side channels attacks on any crypto. At a minimum, Firefox should be executed in a virtual machine to provide some actual isolation.

PGP smart cards

(see “Trusted Platform Modules” (sic) above)

What's missing

There is no risk and cost assessment. How much time has been spent doing extra configuration? (Mike answers below: “a month researching”, “a week or two trying things out”. So yes, it was a learning experience, but I for one could not afford to waste a month and a half when I get a new computer.) How much hindrance will the tightened security be to getting work done?

Another lack is any consideration for anything other than data leakage. In particular, availability always takes a bit hit whenever someone tries to “secure” something. Encrypted disks and reinforced authentication mean longer recovery times if hardware fails.

This doesn't apply to everybody, but there are cases where you can't avoid giving up something. If a border guard says “give me your laptop and your decryption keys or we won't let you into the country”, what do you do? It may be possible not to directly reveal the passwords and only type them in yourself (but consider that airports have cameras all over the place). What if you need to get inside a tech company who wants you to leave all your electronics at the entrance, including any USB key? (Yes, they exist. You may not be the most paranoiac person around!) If you really really can't afford to leak the data, don't carry it with you! Do your sensitive stuff at home (on a desktop, inside an area with physical security) and only bring a minimum amount of low-value stuff with you.


Nevertheless I found this article interesting, but I have some concerns regarding the part:

Defending from common thieves When a thief is stealing your device most probably he is not doing this to play games on it, or because he desperately needed to check his FB account. They also do not steal your laptop to read your mail or other info. So I highly doubt that he will start to boot windows. Most probably (at least in my country it is this way) the thief is doing this because he needs money and his first step will be trying to sell it. This people has knowledge who will be able to buy it in a quick time for 4-8 times cheaper than it costs. And in cases of laptops and mobile phones this second person the will delete everything right when he gets the device.


if they're going to the trouble of tampering with hardware, they could just as easily install a hardware keylogger under your keyboard. Lock the laptop in a case when it's out of your sight. I always do this in hotels, because it helps prevent theft too. I also suggest investing in a decent Kensington lock, which can be attached around pipes and various other strong fixtures.

A Kensington lock won't protect against a physically installed keylogger (it's good advice though). There are also times when you cannot lock the laptop inside a case (or you forget to, or it's inconvenient, etc), and I don't put much faith in the 'locks' on most cases/luggage.

Try this:

  1. Get some glittery nail-polish and paint it over the screws on the bottom of your laptop.
  2. Use a high resolution camera and photograph each of the glitter painted screws.
  3. Put the photos on another device you'll always have with you (i.e. your smart phone).

Now, you can easily check the glitter painted screws against your photos.

This low-tech defense significantly raises the bar for attacks that require access to the laptop's internal components. Now any attacker has to check your laptop, get matching nail-polish, clean off your nail-polish, install the key-logger (insert other nefarious "evil maid" activity here), re-paint the screws, photograph the new glitter patterns, hack your phone, and replace your photos (all before you get back to your laptop). At that level, we're talking about a team operation, or a very very dedicated and patient individual.

Extra Paranoid Bonus Plan: Use some of that UV hardening nail-polish/clear-coat they have at nail salons. It won't wear off with day-to-day activity. Now, any attacker also has to carry acetone (which takes 5-10 min to dissolve your nail-polish), UV lights (to harden the new nail-polish), and literally has to stand around watching the paint dry...


My two cents: The write-up focuses too much on physical security and not enough on hacking. I would worry more about exploits in the browser and email application, mitigating those by using a more secure browser (cough), sandboxes, and virtual machines.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .