Created
February 1, 2012 22:22
-
-
Save grahamg/1719841 to your computer and use it in GitHub Desktop.
Check the progress of a currently running maldet malware session, if not start one up in the background
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
download_location=http://www.rfxn.com/downloads/maldetect-current.tar.gz | |
scan_location=/home?/? | |
maldet=/usr/local/sbin/maldet | |
dump_file='/root/maldet_$(pidof -x $maldet)_$(date +"%m-%d-%Y-%T").dump' | |
hash maldet 2>&- || { | |
echo >&2 "Maldetect not installed. Installing..."; | |
wget --progress=dot $download_location -O /root/maldetect-current.tar.gz | |
tar xzf /root/maldetect-current.tar.gz -C /root/maldetect-current | |
source /root/maldetect-current/install.sh | |
echo >&2 "Installed"; | |
} | |
if [ "$(pidof -x $maldet)" ] | |
then | |
i=$(grep maldet_$(pidof -x $maldet) /root/*) | |
if [ "$(i)" ] | |
then | |
cat $i | |
else | |
echo "Could not find maldet dump file in /root directory" | |
fi | |
else | |
source $maldet --update-ver > /dev/null | |
source $maldet --update > /dev/null | |
source $maldet -b -a $scan_location > $dump_file | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment