0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

ubuntu(virtual box)にClamAVをインストールしてみた

Last updated at Posted at 2023-09-13

参照サイト
https://self-development.info/%E3%80%90ubuntu%E3%80%91%E3%82%A6%E3%82%A4%E3%83%AB%E3%82%B9%E5%AF%BE%E7%AD%96%E3%82%BD%E3%83%95%E3%83%88clamav%E3%81%AE%E3%82%A4%E3%83%B3%E3%82%B9%E3%83%88%E3%83%BC%E3%83%AB/

インストール・設定

clamav clamav-daemonをインストール

terminal
sudo apt install -y clamav clamav-daemon

clamav-freshclamを停止(ウイルス定義データベース更新のため)

terminal
sudo systemctl stop clamav-freshclam

ウイルス定義データベースを更新

terminal
sudo freshclam

freshclamをOS起動時に実行するよう設定

terminal
sudo systemctl enable clamav-freshclam 

clamav-freshclamを実行

terminal
sudo systemctl start clamav-freshclam

動作検証

テキストファイルを生成する

terminal
cd ../Document
vi test.txt
ls -la 
total 24
drwxr-xr-x  2 user user 4096  9月 13 21:57 .
drwxr-x--- 14 user user 4096  9月 13 22:13 ..
-rw-rw-r--  1 user user    5  9月 13 21:51 testfile.txt

スキャンを実行する

terminal
clamscan
/home/user/Documents/testfile.txt: OK

----------- SCAN SUMMARY -----------
Known viruses: 8672382
Engine version: 0.103.9
Scanned directories: 1
Scanned files: 1
Infected files: 0
Data scanned: 0.00 MB
Data read: 0.00 MB (ratio 0.00:1)
Time: 12.172 sec (0 m 12 s)
Start Date: 2023:09:13 21:52:07
End Date:   2023:09:13 21:52:20
  • Infected files: 0(感染ファイル0)を確認する

テスト用ウイルスファイルをダウンロードする

terminal
wget http://www.eicar.org/download/eicar.com
ls -la
total 24
drwxr-xr-x  2 user user 4096  9月 13 21:57 .
drwxr-x--- 14 user user 4096  9月 13 22:13 ..
-rw-rw-r--  1 user user   68  5月  3  2022 eicar.com
-rw-rw-r--  1 user user    5  9月 13 21:51 testfile.txt

スキャンを実行する

terminal
/home/user/Documents/eicar.com: Win.Test.EICAR_HDB-1 FOUND
/home/user/Documents/testfile.txt: OK

----------- SCAN SUMMARY -----------
Known viruses: 8672382
Engine version: 0.103.9
Scanned directories: 1
Scanned files: 2
Infected files: 1
Data scanned: 0.00 MB
Data read: 0.00 MB (ratio 0.00:1)
Time: 12.587 sec (0 m 12 s)
Start Date: 2023:09:13 21:57:00
End Date:   2023:09:13 21:57:12
  • Infected files: 1(感染ファイル1)を確認する

正常に動作していることを確認できた。

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?