9 ms·
Mashing Enter to bypass full disk encryption with TPM, Clevis dracut and systemd
- LinuxBender 3y agoMirror [1] [1] - https://archive.ph/zr3Zf https://archive.ph/zr3Zf
- knodi123 3y agoinfinite captcha loop
- LinuxBender 3y agoInteresting. I've never seen a captcha on that domain. Maybe uBlock or NoScript is preventing it for me. The admin is on HN so maybe they will see this.
- trillic 3y agoAre you using Cloudflare's DNS? Archive.is purposefully gives bad results to Cloudflare's DNS resolvers as they do not respect and pass along EDNS subnet information which Archive wants to run their own CDN. https://jarv.is/notes/cloudflare-dns-archive-is-blocked/ https://jarv.is/notes/cloudflare-dns-archive-is-blocked/
- causi 3y agoCloudflare also gives captcha loops if you have a number of different VPN extensions installed.
- Helmut10001 3y agoAlso seeing infinite Captcha loop, not on Cloudflare DNS.
- CatWChainsaw 3y agoTrying to access Archive on Mozilla with my only extension disabled (uBO) also results in captcha loop...
- Dalewyn 3y agoThe problem is probably Mozilla (Firefox?), it's a third-class citizen these days.
- Helmut10001 3y agoI am on Chrome.
- Dalewyn 3y agoI'm using Chromium, uBO, and 8.8.8.8 with no issues regarding archive.is, so... ┐( ̄ー ̄)┌
- CatWChainsaw 3y agoI tried it in a pretty vanilla Edge and it worked. I guess that's two reasons to keep Edge around: download browser of choice, and use Archive.
- Helmut10001 3y agoToday it works for me, same setup, same DNS, same browser. :???:
- deleted 3y ago[deleted]
- dpkirchner 3y ago.ph was working for me yesterday and is working today but most of the time I'm stuck in an infinite captcha loop. I'm using Google DNS, Safari on iOS, and no extensions. I dunno. I figure Cloudflare is just broken sometimes.
- betaby 3y agoI don't see any encryption bypass there. Encrypted partition stays encrypted.
- LinusU 3y agoDid you read the article? ;) > From here it’s easy to manually use the TPM to unlock the disk with the Clevis tooling and mount the root volume for hacking (it takes a few tries sometimes, but it gets there in the end): They use the exploit to get dropped into a root shell, and then asks the TPM to unlock the disk for them, which it promptly does.
- Guvante 3y agoTechnically, but really the fault lies in the OS for providing an exploitable prompt that doesn't break the chain of custody of the boot process on failure.
- formerly_proven 3y agoThis is one of those designs where you skim a description and already know it’s going to break in a million different ways.
- AshamedCaptain 3y agoI still don't understand why people believe that you can have any expectation in these ludicrous scenarios. Like, you are dropping a general purpose computer into the middle of Russia, expect to be able to command it remotely to do anything, even remotely update it and reboot it; and at the same time never bother to come check it up in person or even have minimum chassis intrussion detection. Do people really expect this to work just by adding some TPM craziness? The article is just connecting a keyboard sniffer/simulator but it would have been as easy to do anything to the network traffic, SSD, motherboard/CPU JTAGs, RTC, etc.
- michaelt 3y ago
- alexvitkov 3y agoThere's no viable reason to reboot a Linux box. Even for kernel upgrades you have kexec, and there are ways (hacks) to hand over the LUKS keys to the new kernel. If you need to reboot an encrypted box remotely AND have it automatically decrypt without you knowing the key, you've already lost the game.
- SomeoneOnTheWeb 3y agoI used to have a custom NAS with full disk encryption, whose bootloader would spin up a tiny SSH server with very few features, mainly only access to an unlock function that would allow to transmit the encryption passphrase over the said SSH tunnel. Then the SSH connection would be closed by the server and it would startup with the decryption key. That way, it was impossible to access the data physically, but I was still able to reboot the box whenever I wanted without any problem.
- alexvitkov 3y agoThat's sensible, unlike trusting that TPM+GRUB+dracut+systemd+getty+logind+whatever all work fine and won't leak your key. Rebooting a box is often the easiest way to get something done if you can't be bothered with exotic configs, I just don't believe that remotely rebooting a encrypted box for which you dont have the key is ever a reasonable thing to do, and that's the assumptuon this article is based on.
- teddyh 3y agoMight I suggest that Mandos might be a slightly easier version of a solution to that problem? (Disclosure: I am a co-author of Mandos.)
- webstrand 3y agoMy experience with kexec has been poor. Every time I kexec, I have to load and unload a bunch of drivers to restore the system to a functional state. Critically i915 sometimes needs to be reloaded after boot to get the display to actually work. And on a VM I had issues with the `cirrus` display driver failing to unload correctly leaving the system unable to boot. Its random and totally unreliable for desktop use. Aside, this is a nice script that prompts for the LUKS password _before_ kexec: https://gist.github.com/webstrand/381307348e24c28d5c4c9a5981871bd7 https://gist.github.com/webstrand/381307348e24c28d5c4c9a5981... it does assume you're using opensuse's naming convention of calling the root partition cr_root. I used this because my bootloader was also encrypted, so rebooting into an initramfs with ssh was impossible.
- gameoverhumans 3y agoMeh, it's an interesting exploit for sure (the USB key simulating Enter key being pressed every 15ms is cute). But IMO unless you run a very hardened setup, protecting against evil maid attacks (wherein the attacker has physical access to your machine in its entirety) is really hard, and possibly always will be. In a hardened setup you lock down the emergency initrd shell - either it's not allowed at all, or it uses a password which hopefully is a little more secure against an attacker pressing the Enter key a lot ;) The real eye opener for me is what Ventoy can do. You can plug it into a computer with Secure Boot enabled, and it will give you a nice user-friendly way to just ... completely and trivially bypass Secure Boot protection. Yes, really: https://www.ventoy.net/en/doc_secure.html https://www.ventoy.net/en/doc_secure.html It won't work for every mobo/firmware combo. It worked first try for me on some used Lenovo ThinkCentre M710q I bought on eBay, though. Even with the latest June 2023 BIOS installed. Ventoy does this by using a known exploit in a GRUB shim that is signed with the official Microsoft certs (that ones that are embedded in virtually every mobo sold with Secure Boot support), in order to pop the KeyEnroll UEFI application and then enroll its own keys in there. Or something like that. Sure, M$ put out a windows update ages ago that updates the DBX to prevent this particular signed shim with known vulnerabilities: https://support.microsoft.com/en-us/topic/kb5012170-security-update-for-secure-boot-dbx-72ff5eed-25b4-47c7-be28-c42bd211bb15 https://support.microsoft.com/en-us/topic/kb5012170-security... ... but who knows how many more are out there in the wild? Once you've pwned Secure Boot (and I'm making the case here that any script kiddy can do this on a vast majority of commonly available/used mobos, let alone a professional cybercrime gang/local LE division or, god-forbid, 3 letter agency), then you can simply pop in your favourite (Arch, obviously) Linux live USB and `cryptsetup open` your favourite encrypted drive in seconds. For unattended machines, especially if you've already bothered to stick a Clevis in there, you really ought to blend your TPM ping with a SSS (min 2) one-two combo-punch of a Tang pin. But again, if the attacker is literally sitting at your desk typing in your computer connected to your trusted networks and such, you're always gonna be pretty screwed.
- chatmasta 3y agoYou raise a valid point, but this attack is particularly alarming because it circumvents a TPM, which is a hardware module that was specifically designed to protect against evil-maid class of attacks, e.g. every iPhone after the 5S uses its Secure Enclave (a TPM) to enforce time delays between passcode attempts [0], so that a physical attacker can't brute force the passcode. (Incidentally, the attack described in the OP is reminiscent of some early attacks against the iPhone that used an HID device to circumvent passcode rate limiting.) IMO, the continuing difficulty that the FBI has breaking into seized iPhones is proof that it's possible to ship a device with hardware that is sufficiently secure to mitigate against any physical exfiltration of data, but this is probably only possible because of the fully vertical integration of Apple hardware, firmware, and software (and even then - it's still a cat and mouse game, bugs will eventually be exposed, etc.). For open source software that runs on any arbitrary assemblage of hardware components, I suspect it's nigh impossible to achieve this same level of physical security. [0] https://support.apple.com/en-gb/guide/security/sec20230a10d/1/web/1#:~:text=How%20escalating%20time%20delays https://support.apple.com/en-gb/guide/security/sec20230a10d/...
- hedora 3y agoThey suggest modifying the kernel commandline to disable the root fallback. Does secure boot include a hash of grub boot parameters? Couldn't the attacker just change the command line back (or to an even easier to exploit config?)
- gameoverhumans 3y agoIn a "properly" hardened setup, you would protect the GRUB command line with ... yet another password! :) https://help.ubuntu.com/community/Grub2/Passwords https://help.ubuntu.com/community/Grub2/Passwords But see my sibling comment about the possibilities of trivially bypassing Secure Boot.
- hedora 3y agoGrub passwords don't protect against the attack I was thinking of, since you can just pop the drive + edit the grub config: "Errors in creating a password-protected GRUB 2 menu may result in an unbootable system. To restore a system with broken passwords, access and edit the GRUB 2 configuration files using the LiveCD or another OS." However, it didn't occur to me that you can just press "e" at the grub prompt, then modify the command line without physical access. "Trivial" indeed.
- autumn-antlers 3y ago> since you can just pop the drive + edit the grub config My current Secure Boot configuration only allows booting a signed GRUB EFI image which contains the configuration. Modifying it on disk would invalidate the signature, causing Secure Boot would fail. My `/boot` isn't encrypted, but each file that GRUB accesses (eg. the initrd image, vmlinux, background.png...) also has a `.sig` file and GRUB refuses to load any unsigned (or invalid) resources. This means that GRUB doesn't need a password to get into the initrd, and I can just enter one password from in there. Next, I'm considering tying user data decryption to login and allowing the root system to be unlocked by the TPM. It seems like a good compromise to me, as I don't keep persistent data on `/` anyways. The host SSH key will be there, but still protected by the TPM and the above chain. Edit: This would be better with aggressive measured boot parameters-- I don't care about losing `/` to a tempermental TPM, and that SSH host key is otherwise somewhat vulnerable. I'll have to learn more about measured boot and PCR.
- Galanwe 3y agoThe best hacker I know is my 12 month old. Give him any kind of device for 2 minutes and you will discover a plethora of UI issues, hidden menus, and security bypasses.
- ddtaylor 3y agoI came home one day and my cat was laying on my keyboard. Above her was a screen with a large amount of random control characters in a terminal with a kernel panic screen. So there's some series of buttons you can press that will crash a Linux desktop from a lock screen.
- buildbot 3y agoAt least for my cat and sad surfacebook Windows machine, I figured it was the device literally cooking it’s ram into a bitflip that caused it to bsod. The cat loves how toasty it gets!
- trelane 3y ago> I figured it was the device literally cooking it’s ram into a bitflip that caused it to bsod. Funny, that's exactly how I push "control" in emacs. Ref: https://xkcd.com/1172/ https://xkcd.com/1172/
- buildbot 3y agoReal programmers induce brainwaves into their cats telepathically so they sit just so to flip the required bit
- LinuxBender 3y agoPossibly sysrq if you have the key + c or m [1]. Good kitty. [1] - https://www.kernel.org/doc/Documentation/admin-guide/sysrq.rst https://www.kernel.org/doc/Documentation/admin-guide/sysrq.r...
- wolfgang42 3y ago
- twitchyliquid64 3y agoA simple fix might be to bind the encrypted value to a PCR (hopefully one that isnt too fragile, but prefs one that measures the initrd) and then to invalidate that PCR when you drop to the recovery shell (by extending some junk bytes to it). But if you can't find a PCR thats both not too fragile and measures the initrd, then youll have to settle for sealing the encryption key to a fairly static PCR, in which case the attacker could just boot into another OS and then do the right PCR extend dance to get the disk unlock key. Its the combo of secure boot + disk unlock sealed to a PCR that is meant to get you most of the way there. Agree with other comments that evil-maid style hardware mod attacks are basically impossible to defend against, and practically most ppl attack model this as whether you can pull the disk key in X minutes rather than at all.
- patrakov 3y agoOn my laptop I have custom Secure Boot keys. I know I did not sign any other OS (well, I did - but with a different key), so this attack won't work, unless the attacker can somehow trick the unmodified previous version of the kernel + initrd combo into asking my passphrase and saving it somewhere, which is highly unrealistic.
- privacyking 3y agoIf they have physical access as per this scenario, they can just install a hardware keylogger and get access with your login credentials.
- jcelerier 3y agoOr even just hit OP repeatedly until they tell the password which is likely how many of the cases end
- arianvanp 3y agoThere's a WIP PR in the systemd repo that does exactly that. it's called pcrlock. Will come to your local distro soon :)
- tedunangst 3y agoAdditional prior art: https://www.jwz.org/blog/2021/01/i-told-you-so-2021-edition/ https://www.jwz.org/blog/2021/01/i-told-you-so-2021-edition/
- temp_gnuser 3y agoI have long advocated for disabling tpm in bios, uefi-boot raw dm-crypt to even get grub much less init. This is also how I have done encrypted disks in the cloud using dropbear ssh as an initram shim for key/pass entry. Bios boot pass is annoying but required. Watch your acess/auth logs. Run a HIDS. Isolate your procs and especially their network comms. Security is an onion, not that most c-suites have any idea these days, blinded by fast talkers.
- jiveturkey 3y agoif security is an onion, why do you advocate for throwing the baby out with the bathwater?
- temp_gnuser 3y agoCould you be more specific please?
- CoolCold 3y agoWhat's your way of providing laptops to your employees? For simplicity, let's assume everyone is located in the same country.
- temp_gnuser 3y agoSetup in house via imaging then control once vpn is established via cac tooling. I've run all linux laptop fleets this way before so it does work but I have some ideas on improvement. PXE is a weak protocol in the stack for example.
- Groxx 3y agoSo to double check my understanding of this article and the linked one that led to it[1], the issue is: 1. the TPM does not require a password to get the decryption keys 2. bootup decryption passwords are checked by code, before asking (using?) the TPM's data (passwordless, because the bootup code is trusted) 3. exhausting multiple layers of retries causes ^ part 2's code to accidentally get/use the decryption data from the TPM And assuming that's correct.... WTF Isn't that stupidly insecure design, because even with trusted-boot checks it's probably trivially bypassed with hardware access (edit: like cutting traces)? Why even offer a bootup password if that's how it's implemented? Like... at the absolute minimum, a sane design would not completely trust the TPM. Combine the TPM's key with the password to get the real key. No additional steps for users, and it eliminates all TPM-only attacks (subject to your password strength... but currently that is 0 so anything is an improvement). [1]: https://hmarco.org/bugs/CVE-2016-4484/CVE-2016-4484_cryptsetup_initrd_shell.html https://hmarco.org/bugs/CVE-2016-4484/CVE-2016-4484_cryptset...
- deleted 3y ago[deleted]
- brenns10 3y agoTPMs typically won't give out a secret unless all of the software which has been loaded and executed was "measured" and found to be unmodified from when the secret was stored. So you couldn't simply stick your own hard disk or USB disk into the computer and then ask the TPM for the secret: the running software wouldn't match, and the TPM would refuse. This is a problem because the "approved" software has this strange vulnerability to get into the rescue shell, right at the point where the TPM would be happy to give you the secret because the software is unmodified.
- Groxx 3y agoWhich wouldn't really be an issue if all the trust wasn't unnecessarily put on a single system, yes. This is the equivalent of a rubber hose attack, where your OS vendor is being threatened and can give away your information retroactively. That's ridiculous to even consider allowing if you're selling something as "securely encrypted", just make it E2EE (derive the key rather than directly using the TPM's data).
- kaylynb 3y agoThe article title is very misleading. This isn't bypassing FDE in any way. It's just getting a root shell on a machine you have physical access to with a particular boot configuration. Clever? Yes. But no encryption is bypassed. Most systems will only be listening to PCR 7 anyway, so a similar attack could be done by loading your own custom bootloader, or possibly reading messages on the SPI bus when booting. This is just a nice trick that's easier/faster. There is a balance of convenience versus security and this could be prevented easily by disabling recovery shell or registering more PCRS (with correct boot setup), but would be much more annoying to remotely administer since you could get failure states where the TPM won't release the keys in a variety of situations. Ultimately TPM-only unlock is a significant increase in security vs unsophisticated attackers and probably fine for 99% of people, but isn't something to rely on if you are concerned about sophisticated attackers. Even with perfect PCR setup and enrolling only custom keys in UEFI, a running machine is still vulnerable. Cold boot or DMA attacks (Thunderbolt or PCI) are just a few that come to mind. These sound extremely sophisticated but are easily done even with hobbyist equipment. Any running machine with currently unlocked disks should be assumed to be possible to compromise with physical access. If interested in Linux boot chain Poettering has a good read: https://0pointer.net/blog/brave-new-trusted-boot-world.html https://0pointer.net/blog/brave-new-trusted-boot-world.html There are a lot of interesting talks around Linux boot security in the upcoming All Systems Go! conference: https://all-systems-go.io/ https://all-systems-go.io/ Microsoft has info regarding boot security in BitLocker Countermeasures: https://learn.microsoft.com/en-us/windows/security/operating-system-security/data-protection/bitlocker/bitlocker-countermeasures https://learn.microsoft.com/en-us/windows/security/operating...
- deleted 3y ago[deleted]
- Klasiaster 3y agoSounds like it would have also worked to replace the hard drive with an own one where the OS directly gives a root shell to read the TPM secret. The solution is to bind the TPM secret to a measured boot state, but that requires a way of precalculation of the expected measurement values. Read more about signatures for these precalcuated measurement values here: https://0pointer.net/blog/brave-new-trusted-boot-world.html https://0pointer.net/blog/brave-new-trusted-boot-world.html (TLDR: The publishing of prebuilt OS vendor kernel+initrds and signed PCR policies allows to bind the secret to the signature being valid, so that it still works when auto updates change the measurement as long as the vendor signature is also there.)
- arjvik 3y agoThe point of this article is that this attack doesn't change any of the TPM measurements.
- dhon_ 3y agoI'm imagining a scene in a Bond movie where 007 casually bypasses encryption by mashing the enter key. Actually I don't think even movie studios would think that looks realistic.
- fiedzia 3y agoIt's not the first bug of this type: https://www.engadget.com/2015-12-18-log-into-most-any-linux-system-by-hitting-backspace-28-times.html https://www.engadget.com/2015-12-18-log-into-most-any-linux-... I recall Gnome had similar issue, though can't find a link right now.
- LanternLight83 3y agoTher, was this awsome passkey I saw recently that you could only use by uploading programs to it (vs. using the TPM API), and then that program's hash would occupy a PCR slot. This would allow minimal protocols, specialized to their use cases, with updatable API's-- but I'm blanking on the name!
- guilhas 3y agoFull disk encryption is definitely more work than profit Unless you really need it, prioritize convenience and data recoverability Better to have an encrypted volume with sensible data