Malware Scanning#
Malware Scanning, a section of Preferences, decides whether uploads are scanned for malware, by which scanners, and what happens to a file a scanner refuses or cannot judge. How an upload is held until its verdict, and what each kind of client is told, is on Malware scanning of uploads.

The section has three tabs. Save at the bottom saves all three (saving).
| Tab | Holds |
|---|---|
| Malware scanning | the switch, the scanners, and the buttons that try a scanner out |
| Policy | what happens when no scanner answers, with large files and files a scanner cannot read; quarantine, bans, jobs, lists of files known by their SHA-256, and the content rules |
| Status and detections | each scanner as it is now, today's counts, the latest refused files, and the quarantine |
Malware scanning#
| Field | What it does | On a new server |
|---|---|---|
| Scan uploads | every upload, over every protocol, is held until a scanner says it is clean. Off: nothing is scanned, whatever the folders say. | off |
| the line under it | says in one sentence what an upload does with the settings on the screen, such as "Uploads wait for a clean verdict from one of 2 scanners; if none answers they are refused." It turns orange when uploads are stored unscanned or every upload would be refused. | |
| Scanners | the list of scanners, see below | empty |
ICAP server, ClamAV (clamd) and Command line add a scanner of that kind and open it below the list. Each row of the list has:
| Column | What it is |
|---|---|
| Order | the arrows move the scanner up or down. With The first that answers, in order (Policy) the first one is asked first. |
| Name | your name for the scanner; it is the name in the status, the detections and the alerts |
| Type | ICAP, ClamAV clamd or Command line |
| Address | icap://host:1344/avscan (or icaps:// with TLS), clamd's address, or the program |
| On | an unticked scanner is kept but never asked |
| Edit, Remove | open the scanner below the list, or take it out of the list |
A scanner that does not answer, or answers with an error, is skipped for 30 seconds and the next one is asked. With no scanner left, When no scanner answers (Policy) decides.
With Scan uploads on and no scanner in the list, every upload is refused, unless When no scanner answers is Store it unscanned (noted).
A scanner#

The fields depend on the kind of scanner.
ICAP server: a virus scanner that is asked over the network with ICAP (RFC 3507). Most commercial scanners offer it (McAfee/Trellix, Kaspersky, Sophos, Symantec, Trend Micro, ESET), and c-icap does with ClamAV.
| Field | What it does | Default |
|---|---|---|
| Name | as above | ICAP |
| ICAP server | the scanner's host name or address | empty |
| Port | its ICAP port | 1344 (11344 with ICAPS) |
| Service | the service on the scanner that scans files: the path of its address | avscan |
| Connect timeout (s) | how long to wait for the connection | 5 |
| Answer timeout (s) | how long the scanner may stay silent while it scans. A large file gets 1 second more for every 10 MB, at most 30 minutes. | 60 |
| At most at once | the most files sent to this scanner at the same time. The scanner's own limit (its Max-Connections) wins when it is lower. |
16 |
| ICAPS (TLS, port 11344 by default) | the connection is encrypted. The scanner's certificate is checked as for every other connection CrushMFT makes, see Certificate pinning. | off |
| Trust the certificate the scanner shows at the first connection | for a scanner whose certificate no trusted authority issued: the certificate it shows the first time is remembered, and a different one later is refused | off |
| Echo mode: store only what the scanner returns | for scanners that clean files (they remove macros or active content and send the file back): the scanner is asked for the whole file back, and what it returns is stored instead of what was uploaded. A changed file is handled as A file an echo-mode scanner changed (Policy) says. | off |
The connections to an ICAP scanner are kept open and used again, and the scanner's description of itself (its OPTIONS) is asked again only when the time it gives runs out, not for every file. The scanner is told the user, the client's address and the file's path, so its own log names who sent the file.
ClamAV (clamd): the ClamAV daemon, on the server machine or another.
| Field | What it does | Default |
|---|---|---|
| clamd address | host:port for a clamd that listens on TCP (TCPSocket in clamd.conf), or unix:/var/run/clamav/clamd.ctl for its local socket |
127.0.0.1:3310 |
| Connect timeout (s), Answer timeout (s) | as for ICAP | 5, 60 |
| At most at once | as for ICAP | 8 |
clamd refuses a file longer than its StreamMaxLength in clamd.conf. Such a file is handled as Larger files (or too large for the scanner) says: refused on a new server. Raise StreamMaxLength (and MaxFileSize, MaxScanSize) to scan larger files.
Command line: a scanner that is a program, such as Microsoft Defender's MpCmdRun.exe, clamdscan, Sophos savscan or ESET odscan.
| Field | What it does | Default |
|---|---|---|
| Program | the program's full path | empty |
| Arguments | its arguments, separated by spaces. {file} is the file to scan. |
{file} |
| Clean exit codes | the exit codes that mean clean, separated by commas | 0 |
| Infected exit codes | the exit codes that mean infected. Any other code is a failure of the scanner. | 1 |
| Threat name in its output | a pattern (a Java regular expression) whose first group is the threat's name in what the program prints | empty |
| Timeout (s) | how long the program may run | 300 |
| At most at once | how many copies of the program may run at the same time | 4 |
A program can only read a file. For it, the upload is written in plain to a folder only the server's account may read (scan_staging/…/cmd/ in the CrushMFT folder), and removed when the program ends. The scanner's form says so. ICAP and ClamAV get the file over their connection and nothing is written in plain.
For Microsoft Defender:
| Field | Value |
|---|---|
| Program | C:\Program Files\Windows Defender\MpCmdRun.exe |
| Arguments | -Scan -ScanType 3 -File {file} -DisableRemediation |
| Clean exit codes | 0 |
| Infected exit codes | 2 |
| Threat name in its output | Threat\s*:\s*(\S+) |
Trying a scanner out#
The three buttons under a scanner use the fields as they are on the screen, before Save, so a scanner can be set up and tried before anything is stored.
| Button | What it does | What you want to see |
|---|---|---|
| Test | asks the scanner to describe itself: for ICAP its service, signature tag (ISTag), methods, preview size, connection limit and how long the description holds; for clamd its version; for a program that it exists |
"Answered in … ms." |
| Send EICAR | sends the EICAR test file, a harmless file every scanner reports as a virus | "As expected: the EICAR test file found", with the threat's name, such as Eicar-Test-Signature |
| Send a clean file | sends a short text file | "As expected: the clean file passed" |
The answer is shown under the buttons, green when it is what was expected. "Not as expected" names the verdict the scanner gave, and "No answer" the error, such as a refused connection or a timeout.
An ICAPS scanner whose certificate no trusted authority issued for its host name is not asked: the answer shows the certificate's SHA-256. Compare it with the scanner's own, then tick Trust the certificate the scanner shows at the first connection and try again.
Done closes the scanner. Its changes are kept on the page until Save or Cancel.
Policy#

| Field | What it does | On a new server |
|---|---|---|
| When no scanner answers | Refuse the upload, or Store it unscanned (noted): the file is stored and listed under Detections as not scanned, and the Malware Scanner Unavailable alert fires | Refuse the upload |
| With more than one scanner | The first that answers, in order, or Each in turn (the uploads are spread over the scanners that answer) | The first that answers, in order |
| Size limit (MB, 0 = any size) | files larger than this are handled as the next field says | 0 |
| Larger files (or too large for the scanner) | Refuse them, or Scan the first part, store the rest unscanned (noted) | Refuse them |
| Files the scanner cannot read | a scanner said it could not scan the file, such as an archive with a password. Store them (noted) or Refuse them. | Store them (noted) |
| A file an echo-mode scanner changed | Refuse it, or Store what the scanner returned | Refuse it |
| Held in memory per upload (MB) | how much of each upload is held in memory while it waits for its verdict. Beyond it, and beyond 256 MB for all uploads together, the rest goes to an encrypted file in scan_staging/ in the CrushMFT folder, whose key is only in memory. |
8 |
| Remember a verdict for (hours, 0 = never) | a file that was scanned is known by its SHA-256 for this long: the same file uploaded again, or to 500 users, is not sent to a scanner again. An ICAP or ClamAV scanner's verdict is forgotten as soon as its signatures change. Infected verdicts are remembered too. | 24 |
| Keep refused uploads in quarantine | a refused upload is kept, still encrypted, in scanning/quarantine/ in the CrushMFT folder, to be scanned again, released or deleted under Status and detections. Off: a refused upload is dropped. |
off |
| Also scan what jobs write | a job's copies and moves are held and scanned as uploads are, and a refused file fails the job's task. See Jobs. | off |
| Keep them for (days) | quarantined uploads older than this are removed | 30 |
| Ban an address after this many infected uploads in an hour (0 = never) | the address is banned, with the reason "malware uploads", in the Temporary list of Banning | 0 |
| For (minutes) | how long such a ban lasts | 60 |
| Always refuse (SHA-256, one a line, # for a note) | files known by their SHA-256 that are refused without asking a scanner. Text after # on a line is a note. |
empty |
| Always store, whatever a scanner says (SHA-256) | files that are stored even when a scanner refuses them, such as a tool of your own that a scanner takes for malware | empty |
A file stored without a full scan (too large, unreadable for the scanner, or stored while no scanner answered) is "noted": it is listed under Detections with the reason, and the log says so.
Content rules#
Checks of a file's own bytes, made beside the scanners as the upload arrives. They are checked while Scan uploads is on, together with the scanners in the list; they do not replace a scanner. Each rule is Off, Store, and list it under Detections, or Refuse. All are off on a new server.
| Rule | What it finds |
|---|---|
| Programs and scripts | a program by its first bytes, whatever its name: Windows (PE), Linux (ELF), macOS (Mach-O), Java classes, and scripts that start with #!; and files named as programs, scripts or shortcuts, such as .exe, .msi, .ps1, .vbs, .js, .bat, .cmd, .hta, .lnk, .jar, .sh |
| Office files with macros | Word, Excel and PowerPoint files with a macro project, in the old formats (.doc, .xls, .ppt) and the new ones (.docm, a .docx renamed from one) |
| PDFs with JavaScript, a launch action or an embedded file | a PDF that holds /JavaScript, /JS, /Launch or /EmbeddedFile in its uncompressed parts |
| Archive bombs | a zip with more than 10 000 entries, more than 100 archives inside, or that unpacks to more than 100 MB and more than 100 times its own size |
| Archives with encrypted entries | a zip with an entry that has a password |
A refused file's message names the rule: "Rejected by the malware scanning's content rules: a Windows program (PE)". When a scanner refuses the file too, the scanner's refusal is the one reported.
Status and detections#

The tab is refreshed every 5 seconds while it is open.
The line at the top counts today: uploads scanned and their size, infected, refused in all, stored without a full scan, scanner failures, how long an upload waited on average after its last byte, and how many verdicts came from memory instead of a scanner.
| Column (scanners) | What it shows |
|---|---|
| Scanner | its name |
| State | answering, or not answering with the last error |
| Scanned, Infected, Errors | since the server started, or since the scanners were last changed and saved |
| In use | connections or programs busy now, of the most allowed |
| Average | how long a scan took on average |
| Version | the scanner's signature tag or version: it changes when its signatures are updated |
Detections lists the latest uploads that were refused or stored without a full scan, newest first: the time, user, address, protocol, file, verdict, threat or note, and what was done: refused, quarantined, stored, not fully scanned, stored, on the allow list, stored as the scanner returned it, or stored, listed by a content rule. A file whose verdict was remembered from an earlier scan of the same file is a clean upload, not a detection. The list is also written to scanning/detections.log in the CrushMFT folder, one line of JSON each, and read back at start. At 10 MB the file is moved to detections.log.1; five old ones are kept.
| Verdict | Meaning |
|---|---|
infected |
a scanner found malware; the threat's name is beside it |
not_scannable |
a scanner could not read the file |
oversize |
larger than the size limit or the scanner's own limit |
modified |
an echo-mode scanner changed the file |
blocked |
a content rule, or the Always refuse list |
error |
no scanner answered |
clean |
stored, with a note: why it was not fully scanned, the allow list, or the content rule that listed it |
Quarantine#
With Keep refused uploads in quarantine on (Policy), each refused upload is listed here with the time, user and address, file, threat, and the verdict of the last Scan again.
| Button | What it does |
|---|---|
| Scan again | asks today's scanners again, not the remembered verdict: useful after a scanner's signatures were updated |
| Release | scans it again and, only when it is clean now, stores it where the upload was going |
| Release anyway | stores it where the upload was going without a clean scan, after asking "Store this file where it was going without a clean scan? The scanner refused it." The log records who did it. |
| Delete | removes it, after asking |
A release refuses to overwrite: when a file of that name is there now, nothing is written. A file is kept in quarantine encrypted, with its key encrypted by the server's own key, so the quarantine folder holds nothing a scanner on the machine would react to. An upload refused because no scanner answered is not quarantined: the client was told to try again.
Jobs#
Also scan what jobs write makes a job's Copy, Move and other writes go through the same scanning as an upload: a refused file is not stored, and the task fails with the reason. Files that other software puts into a folder are never uploaded, so nothing scans them on the way in: a job with the MalwareScan task scans them where they are.
One folder without scanning#
A folder can be left unscanned: in the User Manager, the folder's Advanced button, Extra Permissions, Do not scan uploads to this folder for malware (Extra Permissions). Only an administrator who may change the Malware Scanning settings can set it; when another administrator saves the user, a switch they added is dropped, and one the folder already had is kept.
Who may see and change it#
The Administrator, and roles with the permission of the scanning settings: prefs.scanning.view for the page and its status, prefs.scanning.edit to change it, try scanners and act on the quarantine.
Keys#
scan_uploads, scan_engines (the list of scanners), scan_balance, scan_fail_mode, scan_max_mb, scan_oversize, scan_unscannable, scan_modified, scan_ram_mb, scan_cache_hours, scan_quarantine, scan_quarantine_days, scan_ban_after, scan_ban_minutes, scan_jobs, scan_hash_block, scan_hash_allow, scan_rule_executables, scan_rule_macros, scan_rule_pdf_active, scan_rule_archives, scan_rule_encrypted_archives.
After an upgrade#
The earlier Virus scanning (ICAP) panel of Misc is gone. At the first start of this version its settings become this page's: Scan uploads with an ICAP server becomes Scan uploads, and the ICAP server and service become one ICAP scanner. Do not scan files larger than left at its old 100 MB becomes no limit (the whole file is scanned); another value becomes the Size limit with Scan the first part, store the rest unscanned (noted), which is what it did. A folder that was set not to be scanned stays so.