Sub topic 5
Warning signs of fake sites and malicious installers
This chapter assumes you can find files in Finder and open Terminal. It also assumes you know what a .dmg (disk image) and a .pkg (installer package) are. Earlier chapters covered how to vet a legitimate site. This chapter covers the opposite case: what a bad site or installer looks like, and how to confirm your suspicion before anything runs.
How people end up on fake sites
Attackers rarely break into Apple's systems. They get you to install the software yourself. The common routes are:
- Malicious ads. A sponsored search result for "download Example app" sits above the real link and points to a lookalike site.
- Typosquatting. The domain is one character off, such as
examp1e.comorexample-app-download.com. - Cracked or "free" versions of paid software. Torrent sites and forums bundle malware with the crack.
- Fake update prompts. A web page claims your browser, Flash-style plugin, or "Mac cleaner" is out of date.
- Copy-and-paste instructions. A page tells you to paste a line into Terminal to "fix" something or "verify you are human."
In every case, the attacker needs you to bypass a protection. That need is the best signal you have.
Warning signs on the website
No single sign proves a site is fake, but several together should stop you.
| Sign | What it suggests | What to do |
|---|---|---|
| The URL differs slightly from the developer's known domain | Typosquatting | Type the domain yourself or use the link from the developer's official documentation |
| The link came from an ad or a sponsored result | Malvertising | Scroll to the organic result, or go through the Mac App Store |
| The site is brand new or has no history, support page, or privacy policy | Throwaway site | Look for independent reviews and the developer's presence elsewhere |
| The page says your Mac is infected or needs a "cleaner" | Scareware | Close the tab and do not download anything |
| The download button is one of several large, similar buttons | Decoy buttons | Hover to check where each link goes |
| The download is a `.zip` or `.dmg` that the developer does not normally offer | Wrong file type | Compare with the developer's real install instructions |
| The site is the only place offering a "free" version of paid software | Malware bundle | Do not download it |
A padlock icon and https:// only mean the connection is encrypted. Attackers get HTTPS certificates for their fake domains too, so HTTPS says nothing about whether the site is honest.
Warning signs in the installer
Once you have a download, the file itself often gives it away.
- Instructions to bypass macOS. A disk image that shows a background telling you to "right-click and choose Open," or to run a command to remove a protection, is trying to defeat Gatekeeper. Real developers who notarize their apps do not need this.
- An immediate password request. An installer that asks for an administrator password before showing any license or install options deserves suspicion. This is especially true for an app that has no reason to change system files.
- A package that installs far more than you expected. Bundled "helper" apps, browser extensions, or launch items that you did not ask for are typical of adware.
- A Terminal one-liner that downloads and runs code. Anything shaped like
curl ... | bashorcurl ... | shruns whatever the server sends, with no signature check. Legitimate tools sometimes document this, but then it must come from the project's own verified documentation, not from a pop-up or a forum reply. - An unsigned or oddly signed file. The tools below show who signed it.
Triage before you open anything
You can run a few read-only checks on a download. The script below combines the commands from earlier chapters. Save it as triage.sh, make it executable with chmod +x triage.sh, and run it with the app's path.
#!/bin/bash
# triage.sh - inspect an app before opening it
app="$1"
if [ -z "$app" ]; then
echo "usage: $0 /path/to/App.app"
exit 1
fi
echo "== Quarantine attribute =="
xattr -l "$app" | grep com.apple.quarantine || echo "no quarantine attribute"
echo "== Signature validity =="
codesign --verify --deep --strict --verbose=2 "$app"
echo "== Signer =="
codesign -dv --verbose=4 "$app" 2>&1 | grep -E 'Authority|TeamIdentifier'
echo "== Gatekeeper assessment =="
spctl --assess --type execute --verbose=4 "$app"For an installer package, check it separately:
pkgutil --check-signature ~/Downloads/Example.pkgRead the results this way:
codesign --verifyprints an error such as "a sealed resource is missing or invalid" if files were changed after signing. Treat that as a hard stop.- The
Authoritylines show the certificate chain. A normal Developer ID app lists a "Developer ID Application" certificate, then "Developer ID Certification Authority", then "Apple Root CA". A signature that is "ad-hoc" or missing means nobody accountable vouched for it. - The
TeamIdentifiershould match what the developer publishes. If the site names one company but the Team ID belongs to another, the file is not what it claims to be. spctlreportsacceptedwith a source such asNotarized Developer ID, orrejected.
Limits of these checks
The checks narrow the risk but do not remove it. Know where they fall short.
- A valid signature is not a safety guarantee. It proves who signed the file and that nothing changed afterward. Criminals sometimes obtain Developer ID certificates, and Apple has notarized malware before it was caught. Apple can revoke certificates later, and XProtect can then block the app. This is why you should still weigh the source and the app's behavior.
- A missing quarantine attribute means Gatekeeper never looked. Files fetched with
curl, some command-line tools, or certain archive utilities may not carrycom.apple.quarantine. The first-launch check is then skipped, so runspctlyourself. - A checksum only helps if it comes from somewhere else. If the fake site publishes both the file and its hash, they will match. Compare against a value on the developer's real site, reached by a path you trust.
- A real site can be compromised. If something looks wrong on a trusted site, such as a new unannounced download host or a changed Team ID, check the developer's social accounts or support channel before proceeding.
If you already ran something suspicious
- Disconnect from the network if you were asked for a password or ran a Terminal command.
- Do not run the file again. Quit it from Activity Monitor if it is still running.
- Delete the installer and the app. Check System Settings, then General, then Login Items & Extensions, and remove anything you do not recognize.
- Change passwords for important accounts from a different, clean device. Treat saved browser passwords as exposed if you entered an administrator password.
- Run available macOS updates so XProtect and other protection data are current.
Exercise
You search for a popular video editor and click the first result, a sponsored ad. The site offers a .dmg whose window says "Right-click the app and choose Open to install." The page also shows the developer's SHA-256 hash. Name three warning signs, and explain why matching the hash would not make the file safe.
Show answer
First, the link came from a sponsored ad, a common malvertising route. Second, the instructions tell you to bypass Gatekeeper by right-clicking, which a properly signed and notarized app does not need. Third, the site may be a lookalike domain, which you should check against the developer's real domain. Matching the hash would not help because the same fake site published both the file and the hash, so they would agree even if the file is malicious. You would need a hash from a separate, trusted source, and you should also check the signature with codesign and spctl.