- Mar 6, 2022
- 3
I have developed a scheme to detect a type of ransomware. It seems that my scheme may have a hole.
The general idea is that I calculate SHA-512 values for each file on a source data drive; I compare those values against SHA-512 values for each file on a backup drive; and I review discrepancies to see whether they are highlighting ransomware activity. In theory, this should detect the type of ransomware that silently encrypts data files, decrypting them on the fly, on demand, so that the user will have no notice that files on the source drive are gradually being encrypted.
I am told that such ransomware may prevent the operating system from recognizing that encrypted files have changed. But if I calculate the source drive hashes on a Windows system, and calculate the backup drive hashes on a Linux system, then (assuming the malware is not cross-platform) I should see discrepancies in hash values. The ransomware may fool the Windows OS, but the Linux hashing tool will hash the file as altered by ransomware, not merely its decrypted contents.
The problem is that, to update the backup drive, I am using software that detects file changes as indicated by timestamps and file sizes. I assume that (perhaps with the aid of compression) ransomware could manipulate both of those indicators, so that my backup software would see no change, and therefore would not reflect the actual condition of ransomware-encrypted files on the source (Windows) drive. I assume that a byte-for-byte comparison would detect the fact of change, but such comparisons are very slow, discouraging frequent use.
Am I wrong about any of this? I like the idea of being able to compare hash values to detect ransomware, but I'm afraid I may be going to a lot of trouble to achieve nothing.
The general idea is that I calculate SHA-512 values for each file on a source data drive; I compare those values against SHA-512 values for each file on a backup drive; and I review discrepancies to see whether they are highlighting ransomware activity. In theory, this should detect the type of ransomware that silently encrypts data files, decrypting them on the fly, on demand, so that the user will have no notice that files on the source drive are gradually being encrypted.
I am told that such ransomware may prevent the operating system from recognizing that encrypted files have changed. But if I calculate the source drive hashes on a Windows system, and calculate the backup drive hashes on a Linux system, then (assuming the malware is not cross-platform) I should see discrepancies in hash values. The ransomware may fool the Windows OS, but the Linux hashing tool will hash the file as altered by ransomware, not merely its decrypted contents.
The problem is that, to update the backup drive, I am using software that detects file changes as indicated by timestamps and file sizes. I assume that (perhaps with the aid of compression) ransomware could manipulate both of those indicators, so that my backup software would see no change, and therefore would not reflect the actual condition of ransomware-encrypted files on the source (Windows) drive. I assume that a byte-for-byte comparison would detect the fact of change, but such comparisons are very slow, discouraging frequent use.
Am I wrong about any of this? I like the idea of being able to compare hash values to detect ransomware, but I'm afraid I may be going to a lot of trouble to achieve nothing.