If I want to rescue data from a compromised AppVM to another VM, it would be possible for an attacker to replace qvm-move with their own version. This version would then copy not only my data but also the attacker’s scripts.
If I only back up 10 text files, it’s immediately obvious if other files have been copied illegally.
But not if there are 1,000 files in 100 subfolders and somewhere in these 1,000 files, the attacker’s scripts are hidden!
How realistic is this attack scenario?
What would be the worst-case scenario?
Yes if youre qube has been hacked, hacker can modify ANY program in hacked qube
You can move youre files to network air gapped qube, and don`t run any scripts from hacked qube
Hacker by example can infect using unicode hideen symbols all executable code in you data
Just restart the AppVm.
That is the beauty of QubesOS. If you get compromised, you restart the AppVm and all system files are pulled from the template.
You’d only need to check the files in /home/user
I’d go a step further.. Do not start that thing anymore, attach the LVM with the /home to another VM (not sure how in commands but sure its possible), mount it very securely (noexec and bla), extract the data you need to another (disposable) VM where you install security-check tooling, inspect the extracted data for malware and alike, and then copy the data to your new VM where you use it again.
I wouldn’t trust that AppVM anymore, it still has persistent data, even if qvm-move would be restored from the trusted template… I’d consider all data in the AppVM persistent storage to be compromised until confirmed clean.
I’d recommend a memory dump too.. xl or something had a command for it, dont remember rn, but if there is fishy things going on, do a memorydump in dom0 and a forensic analysis on it as well later (before you kill it) - i’m pretty sure you can do a xl pause / qvm-pause BEFORE you do that memory dump as well.
Update: xl dump-core - run that on the paused VM.
I’d recommend writing a script for this, sth like h4x0r-check.sh , which does xl pause (or qvm-pause if you want), xl dump-core, creates a dd image of the LVM of private and root (root the snapshot if its an appvm, bcs you can still use the modified root vm snapshot to see what the malware did there).
Keep in mind that if you have this qvm-volume (or what it was) ephemeral encryption enabled, this might not work, and you have to find the key BEFORE you shutdown the VM - idk how that works, your LLM of choice can find out.
I’d go a step further.. Do not start that thing anymore, attach the LVM with the /home to another VM (not sure how in commands but sure its possible), mount it very securely (noexec and bla)
[… 16 lines elided]
I think qvm-console-dispvm is a good tool for this job.
But my question specifically concerns qvm-move/qvm-copy.
If compromised files are moved to another VM using these commands.
As far as I know, an attacker’s script can be copied, but it won’t run on the new AppVM unless I accidentally launch it myself.
Or is this AppVM already compromised and specifically looking for this new script to execute.
Correct, unless there is something parsing them automatically, such as GNOME tracker miner that they renamed for the 3rd time to something else. By default, Qubes disables that and the default template is Xfce nowadays.
Correct, unless there is something parsing them automatically,
And it bypasses several security checks done by qvm-(copy|move) to assert that the file is sane. So no, don’t assume copy can compromise the target. In fact, it is much safer to use qvm-copy than other copying methods, such as rsync, sftp, syncthing or whatever.
Although those only check that file names stay within a certain set of characters, and (edit: this filename character check is off by default) that any symlinks copied don’t point outside the ~/QubesIncoming/senderVM/ directory. Other than that, a malicious sender VM can send whatever it wants, with arbitrary changes to file content or with added/omitted files.
You trying to say that a malicious virus can also infect personal files? Yes, that is expected.
I really don’t get what this post is about!
AppVm are immutable. Which means that all you have to do is restart the VM. Personal files might still get infected.
This is a selling point for QubesOS, that is not easy to get hacked.