A Better Antivirus Download

Canary files against infostealers

A canary file (also called a decoy file, honeyfile or honeytoken) looks valuable, but nothing legitimate has a reason to open it. If a program opens it, that is the signal. Infostealers are a good match: they go through the same known places on every PC, and they open everything they find there.

Updated

Why canary files work against infostealers

What makes a good canary file

Canary tokens and local canary files

Canary tokens, such as the free ones from canarytokens.org, are fake credentials, links and documents that alert you when someone uses them2. A local canary file alerts on the PC itself, the moment a program opens it. They catch different moments:

Canary tokensLocal canary files (ABA)
When you find outWhen someone uses the stolen token, which can be days laterWhen a program opens a bait, about 0.1 s after the open
What happens to the stealerNothing on your PCFrozen, cut off from the internet, killed if you choose
What you learnThat a token was used, and from whereWhich program, what started it, what it read and sent
Works if the PC is offline or wiped laterYesOnly while ABA runs on the PC

They work well together. ABA can use both: with canary tokens turned on in setup, its fake AWS keys and a link in its fake password list are real canarytokens.org tokens.

Set one up yourself on Windows

Windows' own file auditing can make a basic canary file. It records which program opened the file in the Security event log. It doesn't stop anything. You need an administrator account.

  1. Make a believable file, for example passwords.txt on your Desktop, with a few made-up logins in it.
  2. Turn on file system auditing. In a terminal opened as administrator (on Windows in another language, the subcategory has that language's name):
    auditpol /set /subcategory:"File System" /success:enable
  3. Add an audit entry to the file: right-click it › Properties › Security › Advanced, open the Auditing tab (Continue if asked), then Add. Select Everyone as the principal, type Success, and tick the read permissions3.
  4. Read the log: each time a program opens the file, Windows writes event 4663 (“An attempt was made to access an object”) to Event Viewer › Windows Logs › Security, with the program's full path as the process name4.

What this doesn't do: nothing happens on its own, so by the time you read the log, the stealer is long done. Explorer, search and your antivirus may show up too, and you have to tell them apart yourself. On Linux, fanotify can report opens and even hold them; on macOS, Apple's eslogger reports them.

How ABA does it

ABA is a set of canary files with the rest built around them:

It works next to your antivirus, not instead of it. It only catches a stealer that opens a bait: the limits, in plain words.

Sources

  1. MITRE ATT&CK, Credentials from Web Browsers (T1555.003).
  2. Thinkst, Canarytokens documentation.
  3. Microsoft Learn, Apply a basic audit policy on a file or folder.
  4. Microsoft Learn, 4663(S): An attempt was made to access an object.

More guides