共享主机上的Linux恶意软件检测

问题描述:

我试图在共享主机上安装优秀的http://www.rfxn.com/projects/linux-malware-detect/共享主机上的Linux恶意软件检测

我已将inspath更改为我的本地目录,但它创建符​​号链接时出错,只能读取/ usr/lib /,最后找不到/usr/local/maldetect/conf.maldet。

感谢您的任何帮助。我认为解决这个问题对很多人来说都是非常有用的。

这里的错误:

./install.sh 
ln: creating symbolic link `/usr/local/sbin/maldet' to `/home6/anton/mal/maldet': No such file or directory 
ln: creating symbolic link `/usr/local/sbin/lmd' to `/home6/anton/mal/maldet': No such file or directory 
cp: cannot create regular file `/usr/lib/libinotifytools.so.0': Read-only file system 
Linux Malware Detect v1.3.9 
      (C) 2002-2011, R-fx Networks <[email protected]> 
      (C) 2011, Ryan MacDonald <[email protected]> 
inotifywait (C) 2007, Rohan McGovern <[email protected]> 
This program may be freely redistributed under the terms of the GNU GPL v2 

maldet(15528): {glob} /usr/local/maldetect/conf.maldet not found, aborting. 

installation completed to /home6/anton/mal 
config file: /home6/anton/mal/conf.maldet 
exec file: /home6/anton/mal/maldet 
exec link: /usr/local/sbin/maldet 
exec link: /usr/local/sbin/lmd 
cron.daily: /etc/cron.daily/maldet 

.ca.def: line 1: /usr/local/maldetect/conf.maldet: No such file or directory 
imported config options from /home6/anton/mal.last/conf.maldet 

maldet(15578): {glob} /usr/local/maldetect/conf.maldet not found, aborting. 

而这里的安装的bash:

#!/bin/bash 
# 
## 
# Linux Malware Detect v1.3.9 
#    (C) 2002-2011, R-fx Networks <[email protected]> 
#    (C) 2011, Ryan MacDonald <[email protected]> 
# inotifywait (C) 2007, Rohan McGovern <[email protected]> 
# This program may be freely redistributed under the terms of the GNU GPL v2 
## 
# 
inspath=/home6/anton/mal 
logf=$inspath/event_log 
cnftemp=.ca.def 

if [ ! -d "$inspath" ] && [ -d "files" ]; then 
    mkdir -p $inspath 
    chmod 750 $inspath 
    cp -pR files/* $inspath 
    chmod 750 $inspath/maldet 
    ln -fs $inspath/maldet /usr/local/sbin/maldet 
    ln -fs $inspath/maldet /usr/local/sbin/lmd 
    cp $inspath/inotify/libinotifytools.so.0 /usr/lib/ 
else 
    $inspath/maldet -k >> /dev/null 2>&1 
    mv $inspath $inspath.bk$$ 
    rm -f $inspath.last 
    ln -fs $inspath.bk$$ $inspath.last 
     mkdir -p $inspath 
     chmod 750 $inspath 
     cp -pR files/* $inspath 
     chmod 750 $inspath/maldet 
    ln -fs $inspath/maldet /usr/local/sbin/maldet 
    ln -fs $inspath/maldet /usr/local/sbin/lmd 
    cp $inspath/inotify/libinotifytools.so.0 /usr/lib/ 
    cp -f $inspath.bk$$/sess/* $inspath/sess/ >> /dev/null 2>&1 
    cp -f $inspath.bk$$/tmp/* $inspath/tmp/ >> /dev/null 2>&1 
    cp -f $inspath.bk$$/quarantine/* $inspath/quarantine/ >> /dev/null 2>&1 
fi 

if [ -d "/etc/cron.daily" ]; then 
    cp -f cron.daily /etc/cron.daily/maldet 
    chmod 755 /etc/cron.daily/maldet 
fi 
    touch $logf 
    $inspath/maldet --alert-daily 
    $inspath/maldet --alert-weekly 
     echo "Linux Malware Detect v1.3.9" 
     echo "   (C) 2002-2011, R-fx Networks <[email protected]>" 
     echo "   (C) 2011, Ryan MacDonald <[email protected]>" 
     echo "inotifywait (C) 2007, Rohan McGovern <[email protected]>" 
     echo "This program may be freely redistributed under the terms of the GNU GPL" 
    echo "" 
    echo "installation completed to $inspath" 
    echo "config file: $inspath/conf.maldet" 
    echo "exec file: $inspath/maldet" 
    echo "exec link: /usr/local/sbin/maldet" 
    echo "exec link: /usr/local/sbin/lmd" 
    echo "cron.daily: /etc/cron.daily/maldet" 
    echo "" 
    if [ -f "$cnftemp" ] && [ -f "$inspath.bk$$/conf.maldet" ]; then 
     . files/conf.maldet 
     . $inspath.bk$$/conf.maldet 
     . $cnftemp 
     echo "imported config options from $inspath.last/conf.maldet" 
    fi 
    $inspath/maldet --update 1 

大多数共享主机不允许其用户访问系统文件夹。

/usr/lib/ 
/usr/local/ 

是系统文件夹的一个例子。所以,我猜你不能安装该软件,因为这个限制。

+0

谢谢沉默。难道不能改变,所以它会在本地安装? – Anton 2011-03-31 00:03:47

+0

我已经使用该代码更新了帖子。也许这可能有帮助。 – Anton 2011-03-31 00:16:56