clamscan使用maldet错误:服务名称不支持ai_socktype

所以我已经安装了Linux Malware Detect(maldet)来扫描一个服务器,一切都安装正常,但是当我运行它时,我得到一个错误。 一堆错误和扫描只是closures它。

这里是我运行maldet扫描特定文件夹的命令:

sudo maldet -a /opt/lampp/ Linux Malware Detect v1.5 (C) 2002-2014, R-fx Networks <[email protected]> (C) 2014, Ryan MacDonald <[email protected]> This program may be freely redistributed under the terms of the GNU GPL v2 maldet(4954): {scan} signatures loaded: 10728 (8824 MD5 / 1904 HEX / 0 USER) maldet(4954): {scan} building file list for /opt/lampp/, this might take awhile... maldet(4954): {scan} setting nice scheduler priorities for all operations: cpunice 19 , ionice 6 maldet(4954): {scan} file list completed in 1s, found 132591 files... maldet(4954): {scan} found clamav binary at /usr/bin/clamdscan, using clamav scanner engine... maldet(4954): {scan} scan of /opt/lampp/ (132591 files) in progress... maldet(4954): {scan} clamscan returned an error, check /usr/local/maldetect/logs/clamscan_log for more details! maldet(4954): {scan} scan completed on /opt/lampp/: files 132591, malware hits 0, cleaned hits 0, time 28s maldet(4954): {scan} scan report saved, to view run: maldet --report 150321-0045.4954 

这基本上是扫描lampp安装文件夹,我得到一个错误,当我打开一个日志文件的clamscan_log我得到这个:

 ERROR: Could not lookup : Servname not supported for ai_socktype 

该列表非常长,如100000行这些错误,并且由于错误而比扫描结束。

在我安装maldet之前,我安装了clamavclamtkclamtk for clamav),并且运行扫描没有问题。

我也安装了rkhunter并运行没有问题。

重点是我有服务器上的恶意WordPress的文件,没有clamav和rkhunter发现,但我知道该文件是在那里,恶意,因为我正在看它。 恶意代码实际上是在wordpress的index.php中。

所以我想检查maldet也扫描代码,看看它是否会检测到恶意代码。 但我无法扫描它由于某种原因,我得到上述错误,并没有在networking上的search给我一个修复和解决scheme。

编辑:只是为了使用: sudo clamscan ,clamscan工作正常,并正常扫描文件。

我认为你的问题在于,有两个扫描可执行文件: clamscanclamdscan 。 第二个依赖于clamav-daemon系统服务。 事实上,如果closures此服务并尝试使用clamdscan可执行文件扫描文件,实际上您将获得:

'错误:无法查找:服务名称不支持ai_socktype'。

我从来没有使用maldet,因为你可以在你的日志中读取:

maldet(4954): {scan} found clamav binary at /usr/bin/clamdscan, using clamav scanner engine...

实际上是使用需要上述服务的二进制运行。

我不能保证我的用例与你的这个错误是一样的:

ERROR: Could not lookup : Servname not supported for ai_socktype

但简而言之,我发现以下几点:

  1. root可以成功运行/bin/clamdscan <a file>
  2. clamscan(clamd守护进程所有者)能够成功运行/bin/clamdscan <a file>

但是,与其他任何用户一样执行上述操作会生成上述错误,无论执行用户对被扫描文件及其包含目录的权限如何。

我的解决scheme: usermod --groups clamscan --append <user>我想要能够运行clamdscan的任何用户。 现在它工作100%。

我希望这对你的情况有所帮助。

在我的情况下,当我的守护进程closures时,我收到了这个错误。

我的解决scheme如下简单:

 service clamav-daemon start 

注意:更新后的freshclam不会启动守护进程。