Will encrypting a dual boot OS prevent viruses from spreading between the two? Also does linux have any MBR viruses? Will locking the bios in Windows and GRUB stop viruses from attaching and infecting them?
-
2I guess one answer is: "It depends on the virus." OTOH, I would expect that most viruses aren't super interested in moving from one OS to another non-booted OS regardless of whether or not it is encrypted. Encryption would certainly make it harder for a virus to jump from a booted OS to an unbooted different OS.– hftApr 9, 2021 at 0:48
-
Use Secure Boot. It will nullify a large number of low level malware that starts before the OS loads. If anyone tells you to "Just disable secure boot", ignore them.– john doeApr 9, 2021 at 19:52
1 Answer
Viruses are not an issue when dealing with dual-boot OSes, because usually viruses are single-platform; a Windows virus won't run on Linux and vice versa.
Ransomware on the other hand only cares about data, so if you have a Windows partition that is understood by the Linux filesystem, or vice versa, and you get a ransomware capable of running in the active OS (much more likely for Windows than for Linux, but possible on the latter nonetheless), that ransomware will undoubtedly attempt to lock and ransom both partitions, assuming it has access to the data on them.
Encrypting the partition prevents this from happening, since the encrypted partition will not be readable. On a stock Windows/Linux installation this is a non-issue for Windows programs since Windows has no native support for extfs, btrfs, xfs or any FS that Linux is likely to be installed on.
It is of course possible that a ransomware attempts "blind", whole disk encryption. However, on most OSes this requires a high level access, and some level of understanding of what is being encrypted - attempting to encrypt a swap partition for example would lead to an immediate system crash. So, while possible - which makes encrypted dual boot not an absolute protection - I feel this is an edge case.
MBR virus are quite rare nowadays, and in most cases they won't be able to cope with GRUB and the like. They will probably either not infect the disk at all, or damage the boot loader making one (or both) OSes unbootable except from a rescue disk.
-
2Not entirely correct. Every ransomware is different and will most likely deliver different results. How data being unreadable prevents it from being encrypted? I've seen ransomware attempting full disk encryption of non system drives.– netheroApr 11, 2021 at 20:46
-
2@KamilKurzynowski good point. I don't think it's your typical case, but you're right that it is possible. Amending answer.– LSerniApr 12, 2021 at 7:01