368 points · by furcyd · 5y ago · 195 comments
How on earth can this be effective? It is trivial to create customized binaries in the installer, so no two users have the same file checksum. With a bit of work, one can rig their download server so each user has a completely different installer checksum as well.
I remember reading about polymorphic viruses back in the 1990’s - not only those had different checksums for each computer, they also had no long-ish substrings common between two versions, making signature analysis ineffective. Did malware authors just forgot about all those and went back to trivial “everyone gets the same image” strategy?
In short, md5 sums and signatures are there to protect against the low hanging fruit, spray and pray type malware that's pretty common. If someone wants to target you with uniquely signatured malware they can. Identifying it isn't going to be what stops it, but proper opsec can.
It seems to me like it trivial to create a webserver which says "serve the same binary, but put a random ASCII string in bytes 40-48". Or make malware installer which says, "write out the executable file to disk, but put a random value in bytes 80-88". Sure, it won't help against good YARA rule, but it seems really easy to do, and it will frustrate researchers, and even defeat some endpoint protection software, like [0] and [1].
[0] https://help.symantec.com/cs/ATP_3.2/ATP/v106632175_v1273003...
[1] https://docs.mcafee.com/bundle/network-security-platform-9.2...
Could they do this? Sure, but it would be a lot more complex than the current method of just finding any target where they can upload files, and the payloads do change very often anyway (sometimes daily) so there is no real need for them to change dynamically
Anyone in particular you recommend following?
Many systems already do something similar, e.g. I think I've seen Chrome put speed bumps and scary warnings on rare files.
This forces malware authors to choose between the "hey this is the first time we see this file on the planet, it's probably bad" warning and serving the same hash to many victims.
A more extreme approach is binary whitelisting - if the hash isn't explicitly approved, it doesn't run at all.
Hashes are also useful to uniquely identify what you're talking about. Even for a fully polymorphic sample, being able to tell other researchers/defenders "hey, I found ab512f... on my network, and it does X" is useful even if nobody else has the same hash, because then they can get a copy of that sample and analyze it themselves.
It feels like most malware is going backwards from the elaborate schemes of the past to "hey user, please run my malware".
Of course, state sponsored malware _can_ be the exception, although it often uses the same patterns, because they apparently work well enough against most targets.
It's not.
> Did malware authors just forgot about all those and went back to trivial “everyone gets the same image” strategy?
No. But if you make your thing as polymorphic as possible and deliver that automated, i take 1000 samples and look what doesn't change to make a signature.
Also these things exist as webservices these days and criminals pay per use to generate fresh undetected executables.
Just makes more sense to only release a new binary once it had been detected, even if it's just a button click and could be easily automated.
There's fully metamorphic viruses where even the code mutating part is changed. Algorithmically it's equivalent but there's no "static" portion of the virus.
Never seen it play out that way. There's always something in practice. See you just talked about randomizing the code. But a windows PE isn't just code. It also has an icon. And yes i've seen AVs detect specific icons.
In theory it's easy to not have anything static, in practice, that's the cat and mouse game you're playing.
I bet most researchers have tools to bin files together automatically based on the same MD5. Why make their life easier when this is so easy to defeat?
It's a pure whitelisting solution where every single executable and kernel driver needs to have an approved digital signature or matching hash value or they won't be permitted to run.
It's virtualization assisted and can't be disabled without rebooting and if you use a digitally signed policy and someone tries to remove it, the machine will refuse to boot.
The coolest thing is, it even expands to the scripting languages built-in to Windows so PowerShell execution is restricted according to policy etc.
In practice of course, it's a big pain in the ass to manage - many software are not digitally signed etc.
Every single artifact of every program needs to be digitally signed or have a matching hash in the policy or they won't be permitted to run.
For example, suppose a software installer: the .msi itself is digitally signed so can easily be permitted to run... But then, during installation it unpacks an .exe into %temp% that isn't digitally signed and attempts to run that - oops, won't run. I've come across even Microsoft software that does this.
https://docs.microsoft.com/en-us/windows/security/threat-pro...
A positive result means an immediate call to action, and a known type of malware. Chances that malware authors would produce a different malware with the same MD5 is close to zero (though, if pulled, it would be quite a practical joke).
At the end of https://redcanary.com/blog/clipping-silver-sparrows-wings/
For even more protection, I flat out locked the folders ~/Library/LaunchAgents and ~/Library/LaunchDaemons in Finder, though this could interfere with some software you use.
https://www.peterborgapps.com/lingon/
https://www.peterborgapps.com/lingon/#preferencesnotificatio...
Also, Little Snitch will show you the connections it makes every hour. Before anyone says it - in macOS 11.2, Apple removed the exclusion list that allowed their own software to bypass firewalls.[1]
> ~/Library/._insu (empty file used to signal the malware to delete itself)
> /tmp/agent.sh (shell script executed for installation callback)
> /tmp/version.json (file downloaded from from S3 to determine execution flow)
> /tmp/version.plist (version.json converted into a property list)
We saw just recently the likely Russian backed attack on a wide net of US companies and even government agencies.
I doubt Macs are used often in US gov agencies but they are used in tech companies for example. That latest attack hit a lot of seemingly random US companies but if you want to destabilise and cause loss of trust it is a very effective strategy.
I happen to know someone who works high up in one of the affected companies where the malware had been sitting on the server for a few months passively gathering information before the attack. They struck in the middle of the night local time and erased all the backups before they begun running ransomware across the entire corporate network.
Thankfully the attack was caught within 10 minutes and they were able to recover fairly quickly once the dust settled, but they've got especially good security. Such an attack could have done far more damage to a company.
And if, like me, your first thought was "you're seriously saying they have good security but no off-site backups?" Yeah, I know. I'd bet they have regular off-site backups now though...
Also I notice that Homebrew packages run just fine without needing to be signed by Apple, not sure how but that's a possibility if you really don't want to jump through Apple's hoops.
~/Library/LaunchDaemons ~/Library/LaunchAgents /Library/LaunchDaemons /Library/LaunchAgents
Not to mention Login Items under System Settings.
Finally, I hope it's obvious if you're infected for all you know all your legitimate looking launch agents could be infected and secretly run the malware in a background process upon execution.
Launch daemons are installed for the system only. Normal users can only run agents.
What? Even random hackforums bots have this feature.
The article apparently doesn't explain how to protect against the malware?
Cannot hurt to manually create ~/Library/._insu right? (not that it seems to offer great protection but I take it cannot hurt?)
Anyone got any idea as to how to harden OS X a bit against this malware?
There'd be no point manually creating the file, by the time the malware sees it, you are already infected.
My advice: keep your OS and browser and everything else updated, use uBlock Origin in the browser, and use a network-wide ad blocker (Pi Hole, AdGuard Home - personally I prefer the latter) with a few malware blocklists and keep them updated.
Malwarebytes were the ones who discovered how big this thing is so you can install that on your Mac and run scans.
You may also want to invest in Little Snitch which won't necessarily protect you against an infection but it will alert you to the calls the malware keeps making to its C&C servers. It's also entirely possible the self-destruct mechanism they found is triggered by such software being installed on the machine. Past Mac malware often removes itself if it detects Little Snitch.
And, obviously, don't install random software from shady sources, but I assume anyone on HN knows this already.
Bonus: Avoid a lot of low-quality content.
No word in this article about the infection vector.
Honestly, I'm tired of HN users downvoting anything critical of Apple. It only further confirms how much of an echo chamber this place can be.
For instance there were headlines around the internet not too long ago stating Android is more secure than iOS based on claims made by Zerodium.
Any Android user who read that may well have the same attitude you've described from iOS users. And it's potentially far more dangerous on Android because it allows you to sideload apps.
You can even extend it to Windows. Your average user will buy a laptop preinstalled with McAfee [1] and think "no need to worry about viruses now because I've got an antivirus."
Don't get me wrong I agree it's perfectly reasonable to be critical of Apple when it's warranted, but we don't yet know if it is in this case. It's entirely possible (and fairly likely) this malware was delivered as a trojan using pop ups the user had to interact with. If that's the case you can't blame Apple for user error, especially when trojans exist for every single OS that allow the user to install software from the internet.
> most users perform two types of installs: relatively safe ones through the App Store, or venturing out into the wild west of the internet and bringing home a random binary that hopefully does what it says.
This seems to imply any software installed from the App Store is safe while anything from outside the App Store is dangerous.
Isn't the implication that App Store downloads must automatically be safe falling into the same trap you're criticising here?
Quotes from the article:
> Developer ID Saotia Seay (5834W6MYX3) – v1 bystander binary signature revoked by Apple
> Developer ID Julie Willey (MSZ3ZH74RK) – v2 bystander binary signature revoked by Apple
So both of these malware packages were signed by Apple.
Seems like relying on Apple's review processes to determine how safe a particular binary is only provides the same false sense of security you're describing.
[1] https://www.youtube.com/watch?v=bKgf5PaBzyg (sorry, couldn't resist)
Since this didn’t go through the App Store it probably wasn’t reviewed but the developer’s certificate would be checked when it’s run - hence the revocation now.
No kidding I saw that first hand while naively asking a harmless question about Cuda support on M1. Got downvoted to oblivion and added the comment later: https://news.ycombinator.com/item?id=26149344
> Amazon Web Services and the Akamai content delivery network
Why isn‘t AWS investigating?
This kind of affair usually gets escalated to CEO level. Bezos will pick up the phone if Cook calls. But usual plebs business goes via abuse notices as I described.
For all we know, this software could just be quietly collecting wallet passwords waiting for an opportune moment to attack.
With the sophistication of red team hackers from Russia, China, NK, and Iran, why would we want to computers for such critical infrastructure as payment?
That feature still makes them desirable...especially in places like frozen Texas this past week.
There was no cell service and the place could only take cash. It was a 30 minute wait in the cold, but I used the water both for drinking, and so I could flush my toilets (city water was not working).
So if you disagree, fine - in fact share your opinion - I’ll probably learn something. But by downvoting it showed ignorance.
> “To me, the most notable [thing] is that it was found on almost 30K macOS endpoints... and these are only endpoints the MalwareBytes can see, so the number is likely way higher,” Patrick Wardle [...] wrote in an Internet message.
So it seems MalwareBytes detected it on 30k customers' Macs.
I really need a new app. Any recommendations?
I’m not sure how relevant the difference is considering most valuable data is owned by the user, but also because MacOS has evolved the security model well beyond the UnIX standard.
Zoom used that hole to gain admin permissions and install itself before the user even completed the installation process if the user was admin[1] (and we know most people use admin accounts as their main ones). I'm sure plenty of other malware has done this as well.
If this was simply delivered as a trojan with one of those fake "Flash Player needs updating" type popups, it could have very well abused that.
If it's installing without user interaction the attack vector is a far more advanced 0day exploit chain.
I'll be very interested to find out.
I am also curious about how they can get away with using AWS and Akamai as C&C. Surely now this malware has been found, those providers will just shut down the accounts being used? They'll also have some kind of trail towards whoever's behind it, it's not like AWS takes payment in crypto.
Can you link me to an article or a piece of documentation that would explain it to a non-mac-developer?
Or for a GUI option: Pacifist from https://www.charlessoft.com/
I also chown + chmod LanchAgents and LauchDaemons in both libraries so that only root may write to it.
Kinda parallels some of the theories about COVID...