How to use the EICAR test file with our products


Environment

Endpoint Security (ENS) Threat Prevention 10.x
VirusScan Enterprise (VSE) 8.8

European Institute for Computer Anti-Virus Research (EICAR) antimalware test file

Summary

EICAR developed the EICAR antimalware test file. The EICAR test file is a legitimate DOS program that's detected as malware by antivirus software. When the test file runs successfully (if it isn't detected and blocked), it prints the message "EICAR-STANDARD-ANTIVIRUS-TEST-FILE!"

There are two ways to obtain the standard EICAR test file:
  • Download the file directly from the EICAR website.
  • Use a text editor to create the file:
     
    1. Open a text editor such as Notepad.
    2. Copy the following string into the new file:

      X5O!P%@AP[4\PZX54(P^)7CC)7}$EICAR-STANDARD-ANTIVIRUS-TEST-FILE!$H+H*

      NOTE: The third character is the capital letter 'O,' and not the digit zero.
       
    3. Save the file as eicar.com.
There are multiple ways to use the EICAR test file to verify that your security software is working correctly.

NOTES:
  • If you use an EICAR test file, it's important to note that although you can detect and block or quarantine the file, you can't clean it. The reason is because the EICAR file doesn't contain any 'real' viral code. The EICAR test file is designed to make most antivirus products react to it as if it were a real virus. But, any attempt to clean the EICAR file fails. This behavior is as expected.
  • The EICAR test string is detected in any file that starts with the above mentioned 68 characters and is exactly 68 bytes long. Modifying or adding strings/text could result in the test file not being detected.
Contents
Click to expand the section you want to view:
To verify that your on-access scanner is working, disable on-access scanning. Then, copy the EICAR test file to your system and try to run it.
  1. Disable on-access scanning.

    NOTE: This procedure varies, depending on your operating system and product. See the appropriate product guide for your software.

    For product documents, go to the Product Documentation portal.

     
  2. Save or create a copy of the EICAR test file.
  3. Enable on-access scanning.
  4. Try to start the EICAR file.
If the on-access scanner is functioning correctly, it's detected as malware.
To verify that your on-demand scanner is working, copy the EICAR test file to your system. Then, run a right-click scan on it.
  1. Save or create a copy of the EICAR test file.
  2. Enable on-demand scanning.
  3. Right-click the EICAR file and select Scan for threats from the pop-up menu.
If the on-demand scanner is functioning correctly, it's detected as malware.
To verify that your On-Delivery Email Scanner is working, use a Telnet utility. Use Telnet to send the EICAR test string to a known recipient. If you try to send an email that contains the EICAR test string from your local mail client, your antivirus software detects the test string and blocks it.
  1. Press Windows+R, type cmd, and press Enter.
  2. Type telnet <server.com> 25 (where <server.com> is the name of the SMTP (outgoing) server of your mail server or provider) and press Enter.
  3. Type HELO <server.com> or "EHLO <server.com>" and press Enter.
  4. Type MAIL FROM:you@server.com and press Enter. You receive the response: 250 ok
  5. Type RCPT TO:yourname@yourserver.com and press Enter. You receive the response: 250 ok
  6. Type DATA and press Enter to write the message.
  7. On the first line, type SUBJECT:yoursubject and press Enter twice.
  8. Type your message, in this case the EICAR test string, and press Enter:

    X5O!P%@AP[4\PZX54(P^)7CC)7}$EICAR-STANDARD-ANTIVIRUS-TEST-FILE!$H+H*
     
  9. Type a single full stop (.) on a line by itself and press Enter to send your message. You receive a response similar to one of the following examples:
    • Message accepted for delivery
    • 250 OK id=`a long id`
       
  10. To exit Telnet, type QUIT and press Enter.
If the On-Delivery Email Scanner is functioning correctly, it's detected as malware.
To verify whether VSE exclusions are correctly configured, copy the EICAR file to an excluded folder and try to run it. For more information about exclusions in VSE, see KB50998 - How to manage file and folder exclusions using wildcards.
  1. Disable the Access Protection rule to prevent our services from being stopped:
    1. Click Start, Programs, McAfee, VirusScan Console.
    2. Right-click Access Protection and select Properties.
    3. Click the Access Protection tab.
    4. In the lower left corner, deselect Prevent McAfee services from being stopped.
    5. Click Apply and then OK. 
  2. Stop the McShield Service:
    1. Press Windows+R, type services.msc, and click OK.
    2. Right-click McAfee McShield and select Stop.
  3. Save a copy of EICAR.COM to your local hard disk.
  4. Copy EICAR.COM to each excluded folder that you want to test.
  5. Start the McShield Service: 
    1. Press Windows+R, type services.msc, and click OK.
    2. Right-click McAfee McShield and choose Start.
    3. Close the Services Window.
  6. Run EICAR.COM:
    1. Browse to each folder where EICAR.COM is copied.
    2. Double-click EICAR.COM in each excluded folder. If the exclusions are configured properly, EICAR.COM runs without being detected. You can verify this result by also running the file in a non-excluded location to verify that the EICAR sample that you're using is detected. VSE detects EICAR.COM as a virus and prevents its execution.
  7. Re-enable the Access Protection rule to prevent our services from being stopped:
    1. Click Start, Programs, McAfee, VirusScan Console.
    2. Right-click Access Protection and select Properties.
    3. Click the Access Protection tab.
    4. In the lower left corner, select Prevent McAfee services from being stopped.
    5. Click Apply and then OK.
    6. Close the VirusScan Console.
To test whether your antispyware software is working correctly, create an EICAR-PUO test file. The EICAR-PUO test file functions in the same way as the standard EICAR test string. But, antispyware detects it as a potentially unwanted program instead of a virus.

To create the EICAR-PUO test file:
  1. Open a text editor such as Notepad.
  2. Copy the following string into the new file:

    X5]+)D:)D<5N*PZ5[/EICAR-POTENTIALLY-UNWANTED-OBJECT-TEST!$*M*L 
     
  3. Select File, Save.
  4. Type the file name and click Save.

    NOTES:
    • To make the file easily recognizable, Technical Support recommends that you save the file as EICAR-PUO.COM. The saved file size is about 68–70 bytes.
    • All features of the standard EICAR detection remain true for EICAR-PUO.
    • The EICAR-PUO test file is identified under the test category in the same way as the standard EICAR test file.
    • EICAR-PUO is an antispyware test file. So, you must enable potentially unwanted program detection to be successful.
To verify that AMSI scanning is working correctly, enable AMSI in the ENS policy and run an EICAR PowerShell command on the system.
 
NOTE: AMSI only works with an operating system that supports it (for example, Windows 10 and Windows Server 2016).
  1. Enable AMSI integration in ENS.
  2. Start PowerShell and run the following command:

    powershell echo '"X5O!P%@AP[4\PZX54(P^)7CC)7}$EICAR-STANDARD-ANTIVIRUS-TEST-FILE!$H+H*"'
     
  3. Verify that a detection is triggered for the threat: EICAR!ams!XXXXX
To verify that ScriptScan scanning is working correctly, enable ScriptScan in the ENS policy, and create an EICAR HTML file:
  1. Enable ScriptScan in the ENS policy.
  2. Enable the ScriptScan plug-in in the browser.
  3. Open a text editor, such as Notepad.
  4. Create an eicar.html file. Add the content below in the file:

    NOTE: Modify the source path in the HTML. Reference the location where eicar.html is created (for example, C:\temp\eicar.html).

    <!DOCTYPE html>
    <html>

    <head>
    <script type='text/javascript' src='file:///C:/temp/eicar.js'></script>
    </head>
    <body>
    <h1>An Eicar Test</h1>
    <p id="demo">Click the button</p>
    <button type="button" onclick="eicar()">Try it</button>

    </body>
    </html>

     
  5. Create an exclusion in the on-access scan policy for eicar.js. If the exclusion isn't created, the on-access scan detects EICAR instead of ScriptScan.
  6. Open a text editor, such as Notepad.
  7. Create an eicar.js file in C:\temp. Add the content below in the file.

    function eicar() {
      alert("X5O!P%@AP[4\PZX54(P^)7CC)7}$EICAR-STANDARD-ANTIVIRUS-TEST-FILE!$H+H*");
    }

     
  8. Open Internet Explorer and open C:\temp\eicar.html. Click Try it.
  9. Verify that a pop-up message displays. The message states "Internet Explorer restricted this webpage from running scripts or ActiveX controls."
  10. Verify that a detection is triggered for the threat: JC/Eicar

Previous Document ID (Secured)

613376