
Linux 서버에서 바이러스, 맬웨어 및 루트킷을 검사하는 세 가지 도구
이러한 모든 스캐너는 루트 사용자로 실행해야 합니다. 실행하기 전에 루트로 로그인하십시오. Ubuntu에서는 다음을 사용합니다.
sudo -s
루트 사용자가 됩니다.chkrootkit - 리눅스 루트킷 스캐너
Chkrootkit은 고전적인 루트킷 스캐너입니다. 의심스러운 루트킷 프로세스가 있는지 서버를 확인하고 알려진 루트킷 파일 목록을 확인합니다.
배포판과 함께 제공되는 패키지를 설치하거나(Debian 및 Ubuntu에서
apt-get install chkrootkit

) 또는 www.chkrootkit.org에서 소스를 다운로드하고 수동으로 설치합니다.
wget --passive-ftp ftp://ftp.pangeia.com.br/pub/seg/pac/chkrootkit.tar.gz
tar xvfz chkrootkit.tar.gz
cd chkrootkit-*/
make sense

그 후에 chkrootkit 디렉토리를 다른 곳으로 이동할 수 있습니다./usr/local/chkrootkit으로:
cd ..
mv chkrootkit-<version>/ /usr/local/chkrootkit
쉽게 액세스할 수 있도록 심볼릭 링크를 만듭니다.ln -s /usr/local/chkrootkit/chkrootkit /usr/local/bin/chkrootkit
chkrootkit으로 서버를 확인하려면 다음 명령을 실행하십시오.chkrootkit
일반적인 위양성 보고서는 다음과 같습니다.Checking `bindshell'... INFECTED (PORTS: 465)
Don't worry when you get this message on an email server, this is the SMTPS (Secure SMTP) port of your mail system and a well known false positive.
You can even run chkrootkit by a cron job and get the results emailed to you. First, find out the path where chkrootkit is installed on your server with:
which chkrootkit
예시:[email protected]:/tmp/chkrootkit-0.52# which chkrootkit
/usr/sbin/chkrootkit
Chkrootkit is installed in the path /usr/sbin/chkrootkit, we need this path in the cron line below:
Run:
crontab -e
다음과 같이 크론 작업을 생성하려면:0 3 * * * /usr/sbin/chkrootkit 2>&1 | mail -s "chkrootkit output of my server" [email protected])
That would run chkrootkit every night at 3:00. Replace the path to chkrootkit with the path you received from the above command and exchange the email address with your actual address.
Lynis - 범용 보안 감사 도구 및 루트킷 스캐너
Lynis (formerly rkhunter) is a security auditing tool for Linux and BSD-based systems. It performs detailed auditing of many security aspects and configurations of your system. Download the latest Lynis sources from https://cisofy.com/downloads/lynis/:
cd /tmp
wget https://downloads.cisofy.com/lynis/lynis-3.0.7.tar.gz
tar xvfz lynis-3.0.7.tar.gz
mv lynis /usr/local/
ln -s /usr/local/lynis/lynis /usr/local/bin/lynis

그러면 Lynis가/usr/local/lynis 디렉토리에 설치되고 쉽게 액세스할 수 있도록 심볼릭 링크가 생성됩니다. 이제 실행
lynis update info
최신 버전을 사용 중인지 확인합니다.
이제 다음을 실행하여 시스템에서 루트킷을 스캔할 수 있습니다.
lynis audit system
Lynis는 몇 가지 검사를 수행한 다음 결과를 읽을 시간을 주기 위해 중지합니다. 스캔을 계속하려면 [ENTER]를 누르십시오.
마지막으로 스캔 요약이 표시됩니다.

비대화식으로 Lynis를 실행하려면 --quick 옵션으로 시작합니다.
lynis --quick
야간에 자동으로 Lynis를 실행하려면 다음과 같이 cron 작업을 생성합니다.0 3 * * * /usr/local/bin/lynis --quick 2>&1 | mail -s "lynis output of my server" [email protected])
This will run Lynis every night a 3:00h. Replace the email address with your real address.
ISPProtect - 웹사이트 맬웨어 스캐너
ISPProtect is a malware scanner for web servers, it scans for malware in website files and CMS systems like WordPress, Joomla, Drupal etc. If you run a web hosting server, then the hosted websites are the most attacked part of your server and it is recommended to do sanity checks on them regularly. ISPProtect contains 5 scanning engines:
- Signature-based malware scanner.
- Heuristic malware scanner.
- A scanner to show the installation directories of outdated CMS systems.
- A scanner that shows you all the outdated WordPress plugins of the whole server.
- A database content scanner that checks MySQL databases for potentially malicious content.
ISPProtect is not free software, but there is a free trial that can be used without registration to check your server for malware or clean an infected system. The free license key to use the full version of the software once on your server is simply 'trial'.
ISPProtect requires PHP and ClamAV to be installed on the server, this should be the case on most hosting systems. ClamAV is used by ISPProtect in the first scan level with ISPProtect's own Malware signature set. In case you don't have a command-line PHP installed yet, execute:
sudo apt install php7.4-cli php7.4-curl clamav
데비안 11 또는 우분투 20.04 또는yum install PHP php-curl
AlmaLinux, Fedora, CentOS 또는 Rocky Linux에서.다음 명령을 실행하여 ISPProtect를 설치하십시오.
mkdir -p /usr/local/ispprotect chown -R root:root /usr/local/ispprotect chmod -R 750 /usr/local/ispprotect cd /usr/local/ispprotect wget http://www.ispprotect.com/download/ispp_scan.tar.gz tar xzf ispp_scan.tar.gz rm -f ispp_scan.tar.gz ln -s /usr/local/ispprotect/ispp_scan /usr/local/bin/ispp_scan
To start ISPProtect, run:
ispp_scan
스캐너는 자동으로 업데이트를 확인한 다음 키를 묻고(여기에 "시험판"이라는 단어를 입력) 웹사이트의 경로(일반적으로/var/www)를 묻습니다.
Please enter scan key: <-- trial
Please enter path to scan: <-- /var/www
The scanner will now start the scan. Scanning progress is shown. The names of the infected files are shown on the screen at the end of the scan and the results are stored in file in the ISPProtect install directory for later use:
To update ISPProtect, run the command:
ispp_scan --update
ISPProtect를 야간 크론 작업으로 자동 실행하려면 nano로 크론 파일을 만드세요.nano /etc/cron.d/ispprotect
다음 줄을 삽입하십시오.0 3 * * * root /usr/local/ispprotect/ispp_scan --update && /usr/local/ispprotect/ispp_scan --path=/var/www [email protected] --non-interactive --scan-key=AAA-BBB-CCC-DDD
Replace "[email protected]" with your email address, the scan report is sent to this address. Then exchange "AAA-BBB-CCC-DDD" with your license key. You can get a license key here.
A full list of command-line options of ISPProtect ispp_scan command can be obtained with:
ispp_scan --help