2 ms·
Try using libguestfs to isolate you from the drive: guestfish -a /dev/sdX ><fs> run ><fs> list-filesystems /dev/sda1 ><fs> mount /dev/sda1
by rwmj 13y ago
Try using libguestfs to isolate you from the drive:
guestfish -a /dev/sdX
><fs> run
><fs> list-filesystems
/dev/sda1
><fs> mount /dev/sda1 /
Libguestfs runs a tiny appliance containing a separate kernel and (if your host supports it) protects that in an LXC container and with SELinux. In any case it would be extremely difficult for a malformed filesystem to exploit the guest kernel, and escape from virtualization, SELinux and LXC to attack the host.
Note this doesn't help if your OS "helpfully" mounts the disk when you plug it in.
http://libguestfs.org/ http://libguestfs.org/
- mschuster91 13y agoDoes not help against malformed USB descriptors, which were used to pwn the PlayStation 3.
- rwmj 13y agoTrue enough, but look at the amount of code in parsing USB descriptors versus parsing filesystems: $ wc -l usb/core/*.c 21465 total $ wc -l `find fs -name '*.c'` 1016460 total Two orders of magnitude more. Now I'm not saying that USB descriptor parsing is free from problems, but there are an awful lot of obscure filesystem drivers in there ... Econet ADFS anyone? Another place where libguestfs can help is in parsing files from the filesystem. We provide trusted parsing libraries that run inside the VM, so parsing (say) Unix /etc configuration or Windows Registry files is much safer.