5 ms·
This doesn't help if an attacker modifies the kernel to provide the correct data regardless of the actual filesytem contents. You really need either UEFI Secure
by mjg59 11y ago
This doesn't help if an attacker modifies the kernel to provide the correct data regardless of the actual filesytem contents. You really need either UEFI Secure Boot or a TPM-based measured boot to have confidence that /boot hasn't been tampered with.
- rogerbinns 11y agoLike all tamper detection it can be subverted as you describe. However it does raise the bar/costs for the attacker since their subversion has to be larger and more complex as it takes longer to write, needs more skill, more places to have bugs etc.
- 616c 11y agoI think what you are looking for is TRESOR. https://www1.informatik.uni-erlangen.de/tresor https://www1.informatik.uni-erlangen.de/tresor It has been on HN before. I doubt anyone is running it on tablet to secure their lights, TV, and toiles though. (Everyone, forgive the joke; but I loved this presumed user's artcile on Android light controls in hotels: https://news.ycombinator.com/item?id=11266796 https://news.ycombinator.com/item?id=11266796)
- jakobdabo 11y agoIf the attacker can modify the kernel then I think you have already lost the battle. This script, as it says in README, checks that the files in /boot have not been altered between reboots.
- mjg59 11y ago> If the attacker can modify the kernel then I think you have already lost the battle. By that argument, if the attacker can modify the contents of /boot then you've lost and this doesn't buy you anything.
- jakobdabo 11y agoMy understanding is (I may be wrong) that this script protects from physical attacks when the attacker covertly modifies your /boot partition (where the kernel resides along with the initramfs) while your computer is turned off. The attacker can not modify the other partitions because they are encrypted.
- mjg59 11y agoThe attacker modifies the on-disk copy of the kernel such that when userspace tries to read the kernel it gets given a backed up copy of the unmodified kernel. Chkboot says everything is fine, but in reality the system is backdoored.
- jakobdabo 11y agoI agree then, sorry I failed to see your point in your first comment.
- keeperofdakeys 11y agoHere is a great talk by mjg59 about using the TPM, and why it's required https://www.youtube.com/watch?v=rML5DfYUh_k https://www.youtube.com/watch?v=rML5DfYUh_k
- zokier 11y agoCould you comment on my idea of slight extension of chkboot-style verification: a) Use signatures instead of hashes and keep the "correct" signature secret. This would prevent attacker from hard-coding correct looking output into the tampered system. b) Do not store the correct signature anywhere where the potentially tampered system could read it. I'm thinking using smartphone or possibly some usb module for verification, or maybe just rely on users memory (assisted with something akin to SSH randomart fingerprints) c) Fill free space on /boot with random data and calculate the signature for the whole partition. This is to detect if attacker attempts to store backup copies of untampered files. To me it's not immediately obvious how attacker could tamper with boot files without detection, presuming that their ability to tamper is restricted to the hard drive (i.e. no firmware attacks etc). edit: for clarification, I'm talking only hypothetically here, I'm not considering this sort of system for personal use nor would I be recommending it to anyone else.
- ycmbntrthrwaway 11y agoThe attacker can compress non-random part of /boot partition to free some space for his "rootkit". The rootkit will reconstruct hard drive contents before running OS or just make it look like it is reconstructed through virtualization.
- rdancer 11y agoThe attacker is not going to keep the SHA256 hashes, but the whole of the original /boot. (Where, you're asking? Anywhere you forgot Ring 0 could store data, and a few places you never even knew about.) Subsequently, he will intercept system calls to open(2) and friends, and serve the saved data. This is a fairly old technique: on the first page of a Google search[1], you can find a Phrack article from 2009[2]. In fact the seminal work I believe is Reflections on Trusting Trust by Ken Thompson, set in print in 1984. [1] https://www.google.co.uk/search?q=rootkit+intercepting+open+calls https://www.google.co.uk/search?q=rootkit+intercepting+open+... [2] http://phrack.org/issues/66/16.html http://phrack.org/issues/66/16.html [3] https://www.ece.cmu.edu/~ganger/712.fall02/papers/p761-thompson.pdf https://www.ece.cmu.edu/~ganger/712.fall02/papers/p761-thomp...
- 11y ago