Skip to main content

Checking the site for viruses and malicious code

To check, you can use any software, for example, PHP-Antimalware-Scanner, which is great for scanning files with PHP scripts and more.

Please note that installing and using additional software requires ssh access to the server, so this option is available to users of eVPS, dedicated servers + Smart panel, cloud and dedicated servers. If you have a "Mini", "Site", "Portal" tariff package - to scan files for virus code, please write a request to technical support.

Before using: pay attention to the presence of automatically created backup copies of your site, using instructions. Our system automatically creates backup copies of your site every night, and you have access to them from the control panel, where you can independently restore site files from backup copies for the last 10 days. If you want to restore data from older backups, you can contact our technical support. Our specialists will help you restore site files from the last 21 days.

Here is a short guide on how to use PHP-Antimalware-Scanner. For more detailed instructions, you can read the author's documentation

How to check a site for viruses and malware?

Step 1. To get started, you need to set up ssh access and [connect to the server via ssh](/support/hosting-technical/kak-podklyuchitsya -po-ssh)

Download phpScanner

Step 2. Download the program file by going to your site's directory in the command line (terminal) and executing the following command:

wget https://raw.githubusercontent.com/marcocesarato/PHP-Antimalware-Scanner/master/dist/scanner —no-check-certificate

Step 3. To start the process of checking the site for viruses, while in your site's directory, execute the command:

php scanner ./ -r --path-report ./virusscan.html

but if you have a current PHP version on your site 5.6 and below, we recommend running the scanner under a higher PHP version, for example

php7.4 scanner ./ -r --path-report ./virusscan.html

Scan PHP Antimalware scan where

  • ./ is the scan of the directory we are in
  • -r - report only about the scan mode without checking and removing malware
  • ./virusscan.html - save the results in the directory where you ran the scan, to the file virusscan.html. If you were in your site directory, the result will be available at the link: https://YOURSITE.UA/virusscan.html
  • php7.4 is the use of PHP version 7.4 to run the scanner Provide these results to your administrator or security specialist for analysis and removal of virus code, if present. Results PHP Antimalware scanner

General recommendations

In addition to checking your site for viruses, there are other important steps that can ensure the security of your site.

We recommend performing the following actions:

  • Ensure that your content management platform (CMS), themes, plugins, and other components are always updated to the latest versions.
  • Use only official versions of software and obtain updates from trusted sources.
  • Use only strong and complex passwords.
  • It is also recommended to periodically upload backups via FTP for example using FileZilla to your local computer or other resource.