After Shane's comments on the Authenticode and Antivirus Detection post I thought I'd run some more tests. I wanted to try and figure out how much of the observed detection difference were because some extra bytes had been added and how much was due to special handling of signed binaries.
I found an archive of malware online and created four sets of samples. Set one was the malware without any changes, set two was after the binaries had been signed with the TEST1 certificate, set three was signed with a TEST2 certificate that was similar to TEST1 but was only valid from 1975 - 2009 and set four had a random blob of 32 bytes appened to the end. Using the VirusTotal API and Bryce Boe's python script I ran each of the sets against the VirusTotal antivirus suite.
The resulting statistics are here, showing the number of AV positives, the format is:
"HASH [SET1, SET2, SET3, SET4] [SET1 - SET2, SET1 - SET4]"
And here are the first 10 entries (ordered by decreasing "SET1 - SET2" value):
DB1D5E...34573 ['28', '10', '16', '22'] ['18', '6'] FDFB86...1FE0C ['34', '18', '18', '27'] ['16', '7'] 6D48A7...F4880 ['36', '20', '22', '33'] ['16', '3'] CA9C3E...ED072 ['31', '16', '16', '23'] ['15', '8'] 8798FA...8755B ['35', '20', '20', '32'] ['15', '3'] 1011ED...0DB18 ['35', '20', '20', '33'] ['15', '2'] DA01D0...C899D ['31', '17', '16', '28'] ['14', '3'] CC3B7D...228D1 ['37', '23', '23', '34'] ['14', '3'] CADD90...CE9C4 ['35', '21', '21', '31'] ['14', '4'] B6BBE8...8CD10 ['32', '18', '18', '29'] ['14', '3']
- Adding either an authenticode signature or random data would defeat several engines
- Very rarely would the signing certificate's validity influence the score
- For some reason adding the random data occasionally resulted in more signatures being hit and considering that the same data was added to each sample I'm not sure what happened there.
- This test primarily tests the AV signature engines and not their runtime or heuristic scanners
- The VirusTotal API limit of 20 requests each 5 minutes sounds like a lot until you run tests like this.
Really what I've learnt from this is that AV signatures are even more fragile than I realised. To get a proper look at how AV treats authenticode signed binaries I think I'd need to evaluate all of each AV's modules and not just the signature engine.