× Installation and guides about a great free, plesk and cpanel alternative project

How to scan CentOS server for malware

Περισσότερα
11 Μήνες 2 Εβδομάδες πριν - 11 Μήνες 2 Εβδομάδες πριν #294 από infogate
How to scan CentOS server for malware δημιουργήθηκε από infogate
ClamAVClamAV is a popular open-source antivirus engine available on a multitude of platforms including the majority of Linux distributions. Install it on CentOS 7 with the following command.
sudo yum install clamav clamav-update clamav-scanner-systemd clamav-server-systemd
Afterwards, you’ll need to edit the configuration a little by commenting out the Example text from two files, the simplest way to do so is to use sed for some fast editing with these commands.
sudo sed -i -e "s/^Example/#Example/" /etc/freshclam.conf
sudo sed -i -e "s/^Example/#Example/" /etc/clamd.d/scan.conf
With the required modules installed and configured, next, you should update the virus database for ClamAV.First, stop the related processes to allow for the update the proceed.
sudo systemctl stop clamav-freshclam
Then use the command below to run the updater application.
sudo freshclam
When you’ve finished updating the virus definitions, start and enable the services.
sudo systemctl start clamav-freshclam
sudo systemctl enable clamav-freshclam
Then do a test scan to your home directory just to make sure the scanning works as it should use the following command.
sudo clamscan -r /home
Granted that your home directory didn’t contain any viruses or other types of malware, the scan should come back empty.So how do you know it works?For this, you can download an anti-virus test file, which is a small completely harmless program that most anti-virus software report as infected, though with an obvious test file name EICAR-AV-Test. Use the following command to download the test file to your home directory.
wget -P ~/ http://www.eicar.org/download/eicar.com
Now scan your home folder again with the same command as above, you should receive notice of one infected file at the end summary after the scan is completed. When you’ve confirmed that ClamAV finds the test file correctly, use the command below to scan it again and remove the infected file once found.
sudo clamscan --infected --remove --recursive /home
Be careful when using the –remove parameter. First, run a broader scan without it, and then a more localized scan when removing files or removing them manually.To perform a complete scan of your cloud server, use this command.
sudo clamscan --infected --recursive --exclude-dir="^/sys" /
The scan goes through each directory in your system root recursively, but skips /sys just to avoid unnecessary warning printouts, as the virtual file system consists of some unreadable files, which could not contain viruses anyway.


Rkhunter

​​​​​​​
Rkhunter is a common option for scanning your system for rootkits and general vulnerabilities. It can be easily installed from the package manager on CentOS using the following command.
sudo yum install rkhunter
Once installed and before scanning, you’ll need to update the file properties database.
sudo rkhunter --propupd
This lets the scanner know the current state of certain files to prevent some false alarms. After the update, simply run the scanner with the following.
sudo rkhunter --checkall
The scanner goes through some system commands, checks for actual rootkits and some malware, network and local host settings, and then give you the summary as well as recording the findings to a log file.Afterwards, you can get a condensed look at the scan log with this command.
sudo cat /var/log/rkhunter/rkhunter.log | grep -i warning
Go through the output to get some tips on what you could do to improve your system security.


The best possible way to start your online marketing : fspirits.com/go/leadsleap-home
Explode Your Web Site Traffice: fspirits.com/go/sparktraffic
Start your affiliate journey here: fspirits.com/go/olsp-academy
Best Solution To Create Videos: fspirits.com/go/create-studio-pro
Best Solution To Create Graphics: fspirits.com/go/clickdesigns
Smart Chat Automation: fspirits.com/go/chatterpal
Multi-Purpose Video Maker: fspirits.com/go/avatar-builder
Multi-Purpose Video Creator: fspirits.com/go/video-creator
AI Human Spokesperson Videos: fspirits.com/go/humanpal

Last edit: 11 Μήνες 2 Εβδομάδες πριν by infogate.

Παρακαλούμε Σύνδεση ή Δημιουργία λογαριασμού για να συμμετάσχετε στη συζήτηση.

Χρόνος δημιουργίας σελίδας: 0.038 δευτερόλεπτα
Powered by Kunena Φόρουμ