-
-
Notifications
You must be signed in to change notification settings - Fork 118
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #332 from extremeshok/dev
7.2
- Loading branch information
Showing
24 changed files
with
2,770 additions
and
1,376 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
# These are supported funding model platforms | ||
|
||
github: extremeshok | ||
custom: ['https://paypal.me/AdrianKriel', 'https://www.extremeshok.com'] |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"MD013": false | ||
} |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,77 @@ | ||
#!/bin/sh | ||
################### | ||
# This is property of eXtremeSHOK.com | ||
# You are free to use, modify and distribute, however you may not remove this notice. | ||
# Copyright (c) Adrian Jon Kriel :: [email protected] | ||
# License: BSD (Berkeley Software Distribution) | ||
################## | ||
export PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:/usr/local/musl/bin:$HOME/bin | ||
|
||
pwd | ||
|
||
echo "Installing default Clamav" | ||
|
||
# Create clamav user and group | ||
dscl . create /Groups/clamav | ||
dscl . create /Groups/clamav RealName "Clam Antivirus Group" | ||
dscl . create /Groups/clamav gid 799 | ||
dscl . create /Users/clamav | ||
dscl . create /Users/clamav RealName "Clam Antivirus User" | ||
dscl . create /Users/clamav UserShell /bin/false | ||
dscl . create /Users/clamav UniqueID 599 | ||
dscl . create /Users/clamav PrimaryGroupID 799 | ||
|
||
# Create the dirs | ||
mkdir -p /usr/local/var/clamav/run | ||
mkdir -p /usr/local/var/clamav/log | ||
mkdir -p /usr/local/var/clamav/db | ||
mkdir -p /Library/LaunchDaemons | ||
|
||
ls -laFh /usr/local/etc/clamav/ | ||
|
||
# Generate the configs | ||
if [ ! -f "/usr/local/etc/clamav/clamd.conf.sample" ] ; then | ||
echo "Missing: /usr/local/etc/clamav/clamd.conf" | ||
exit 1 | ||
fi | ||
cp "/usr/local/etc/clamav/clamd.conf.sample" "/usr/local/etc/clamav/clamd.conf" | ||
sed -e "s|# Example config file|# Config file|" \ | ||
-e "s|^Example$|# Example|" \ | ||
-e "s|^#MaxDirectoryRecursion 20$|MaxDirectoryRecursion 25|" \ | ||
-e "s|^#LogFile .*|LogFile /usr/local/var/clamav/log/clamd.log|" \ | ||
-e "s|^#PidFile .*|PidFile /usr/local/var/clamav/run/clamd.pid|" \ | ||
-e "s|^#DatabaseDirectory .*|DatabaseDirectory /usr/local/var/clamav/db|" \ | ||
-e "s|^#LocalSocket .*|LocalSocket /usr/local/var/clamav/run/clamd.socket|" \ | ||
-e "s|^#FixStaleSocket|FixStaleSocket|" \" | ||
-i -n "/usr/local/etc/clamav/clamd.conf" | ||
|
||
# Fix permissions | ||
chown -R clamav:clamav /usr/local/var/clamav | ||
|
||
# Clamd socket | ||
touch /usr/local/var/clamav/run/clamd.socket | ||
chown clamav:clamav /usr/local/var/clamav/run/clamd.socket | ||
|
||
tee "/Library/LaunchDaemons/clamav.clamd.plist" << EOF > /dev/null | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | ||
<plist version="1.0"> | ||
<dict> | ||
<key>Label</key> | ||
<string>clamav.clamd</string> | ||
<key>ProgramArguments</key> | ||
<array> | ||
<string>/usr/local/sbin/clamd</string> | ||
<string>--foreground</string> | ||
</array> | ||
<key>KeepAlive</key> | ||
<true/> | ||
<key>StandardErrorPath</key> | ||
<string>/usr/local/var/clamav/log/clamd.error.log</string> | ||
</dict> | ||
</plist> | ||
EOF | ||
|
||
|
||
chown root:wheel "/Library/LaunchDaemons/clamav.clamd.plist" | ||
chmod 0644 "/Library/LaunchDaemons/clamav.clamd.plist" |
This file contains 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
File renamed without changes.
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,87 @@ | ||
#!/bin/sh | ||
################### | ||
# This is property of eXtremeSHOK.com | ||
# You are free to use, modify and distribute, however you may not remove this notice. | ||
# Copyright (c) Adrian Jon Kriel :: [email protected] | ||
# License: BSD (Berkeley Software Distribution) | ||
################## | ||
export PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:/usr/local/musl/bin:$HOME/bin | ||
|
||
pwd | ||
|
||
echo "running script verbose default curl" | ||
bash /usr/local/bin/clamav-unofficial-sigs.sh --verbose | ||
if [ "$?" -eq "0" ] ; then | ||
echo .. OK | ||
else | ||
echo .. ERROR | ||
exit 1 | ||
fi | ||
|
||
echo "check signature placed correctly" | ||
if [ -e "/usr/local/var/clamav/db/sanesecurity.ftm" ] ; then | ||
echo .. OK | ||
else | ||
echo .. ERROR | ||
exit 1 | ||
fi | ||
# | ||
# echo "check database integrity test" | ||
# bash clamav-unofficial-sigs.sh --test-database sanesecurity.ftm | ||
# if [ "$?" -eq "0" ] ; then | ||
# echo .. OK | ||
# else | ||
# echo .. ERROR | ||
# exit 1 | ||
# fi | ||
# | ||
# echo "check gpg verify test" | ||
# bash clamav-unofficial-sigs.sh --gpg-verify scam.ndb | ||
# if [ "$?" -eq "0" ] ; then | ||
# echo .. OK | ||
# else | ||
# echo .. ERROR | ||
# exit 1 | ||
# fi | ||
|
||
# echo "check clamav-daemon service will start" | ||
# service clamav-daemon stop | ||
# service clamav-daemon start | ||
# if [ "$?" -eq "0" ] ; then | ||
# echo .. OK | ||
# else | ||
# echo .. ERROR | ||
# exit 1 | ||
# f | ||
|
||
echo "===== HIGH /var/lib/clamav/ =====" | ||
ls -laFh /var/lib/clamav/ | ||
echo "================" | ||
|
||
echo "running script verbose with LOW ratings" | ||
cp -f .t/tests/user_low.conf /usr/local/etc/clamav-unofficial-sigs/user.conf | ||
bash /usr/local/bin/clamav-unofficial-sigs.sh --verbose | ||
if [ "$?" -eq "0" ] ; then | ||
echo .. OK | ||
else | ||
echo .. ERROR | ||
exit 1 | ||
fi | ||
echo "===== LOW /var/lib/clamav/ =====" | ||
ls -laFh /var/lib/clamav/ | ||
echo "================" | ||
|
||
echo "Was /var/lib/clamav-unofficial-sigs/dbs-ss/jurlbl.ndb removed ?" | ||
if [ ! -e "/var/lib/clamav-unofficial-sigs/dbs-ss/jurlbl.ndb" ] ; then | ||
echo .. OK | ||
else | ||
echo .. ERROR | ||
exit 1 | ||
fi | ||
echo "Was /var/lib/clamav/phish.ndb removed ?" | ||
if [ ! -e "/var/lib/clamav/phish.ndb" ] ; then | ||
echo .. OK | ||
else | ||
echo .. ERROR | ||
exit 1 | ||
fi |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,203 @@ | ||
#!/bin/sh | ||
################### | ||
# This is property of eXtremeSHOK.com | ||
# You are free to use, modify and distribute, however you may not remove this notice. | ||
# Copyright (c) Adrian Jon Kriel :: [email protected] | ||
# License: BSD (Berkeley Software Distribution) | ||
################## | ||
export PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:/usr/local/musl/bin:$HOME/bin | ||
|
||
pwd | ||
|
||
echo "Remove test signature if it exists. " | ||
if [ -e "/var/lib/clamav/sanesecurity.ftm" ] ; then | ||
rm -f /var/lib/clamav/sanesecurity.ftm | ||
fi | ||
|
||
echo "running script verbose and force_wget" | ||
cp -f .t/tests/user_wget.conf /etc/clamav-unofficial-sigs/user.conf | ||
bash /usr/sbin/clamav-unofficial-sigs --verbose | ||
if [ "$?" -eq "0" ] ; then | ||
echo .. OK | ||
else | ||
echo .. ERROR | ||
exit 1 | ||
fi | ||
|
||
echo "running script verbose default curl" | ||
cp -f .t/tests/user.conf /etc/clamav-unofficial-sigs/user.conf | ||
bash /usr/sbin/clamav-unofficial-sigs --verbose | ||
if [ "$?" -eq "0" ] ; then | ||
echo .. OK | ||
else | ||
echo .. ERROR | ||
exit 1 | ||
fi | ||
|
||
echo "running script as clamav and silence" | ||
sudo -u clamav [ -x /usr/sbin/clamav-unofficial-sigs ] && bash /usr/sbin/clamav-unofficial-sigs --force --silence | ||
if [ "$?" -eq "0" ] ; then | ||
echo .. OK | ||
else | ||
echo .. ERROR | ||
exit 1 | ||
fi | ||
|
||
echo "check signature placed correctly" | ||
if [ -e "/var/lib/clamav/sanesecurity.ftm" ] ; then | ||
echo .. OK | ||
else | ||
echo .. ERROR | ||
exit 1 | ||
fi | ||
|
||
echo "check cron file generation" | ||
bash clamav-unofficial-sigs.sh --install-cron | ||
if [ "$?" -eq "0" ] ; then | ||
if [ -e "/etc/cron.d/clamav-unofficial-sigs" ] ; then | ||
echo .. OK | ||
else | ||
echo .. ERROR | ||
exit 1 | ||
fi | ||
else | ||
echo .. ERROR | ||
exit 1 | ||
fi | ||
|
||
echo "check logrotate file generation" | ||
bash clamav-unofficial-sigs.sh --install-logrotate | ||
if [ "$?" -eq "0" ] ; then | ||
if [ -e "/etc/logrotate.d/clamav-unofficial-sigs" ] ; then | ||
echo .. OK | ||
else | ||
echo .. ERROR | ||
exit 1 | ||
fi | ||
else | ||
echo .. ERROR | ||
exit 1 | ||
fi | ||
|
||
echo "check man file generation" | ||
bash clamav-unofficial-sigs.sh --install-man | ||
if [ "$?" -eq "0" ] ; then | ||
if [ -e "/usr/share/man/man8/clamav-unofficial-sigs.8" ] ; then | ||
echo .. OK | ||
else | ||
echo .. ERROR | ||
exit 1 | ||
fi | ||
else | ||
echo .. ERROR | ||
exit 1 | ||
fi | ||
|
||
echo "check database integrity test" | ||
bash clamav-unofficial-sigs.sh --test-database sanesecurity.ftm | ||
if [ "$?" -eq "0" ] ; then | ||
echo .. OK | ||
else | ||
echo .. ERROR | ||
exit 1 | ||
fi | ||
|
||
echo "check gpg verify test" | ||
bash clamav-unofficial-sigs.sh --gpg-verify scam.ndb | ||
if [ "$?" -eq "0" ] ; then | ||
echo .. OK | ||
else | ||
echo .. ERROR | ||
exit 1 | ||
fi | ||
|
||
echo "check clamav-daemon service will start" | ||
service clamav-daemon stop | ||
service clamav-daemon start | ||
if [ "$?" -eq "0" ] ; then | ||
echo .. OK | ||
else | ||
echo .. ERROR | ||
exit 1 | ||
fi | ||
echo "===== HIGH /var/lib/clamav/ =====" | ||
ls -laFh /var/lib/clamav/ | ||
echo "================" | ||
|
||
echo "running script verbose with LOW ratings" | ||
cp -f .t/tests/user_low.conf /etc/clamav-unofficial-sigs/user.conf | ||
bash /usr/sbin/clamav-unofficial-sigs --verbose | ||
if [ "$?" -eq "0" ] ; then | ||
echo .. OK | ||
else | ||
echo .. ERROR | ||
exit 1 | ||
fi | ||
echo "===== LOW /var/lib/clamav/ =====" | ||
ls -laFh /var/lib/clamav/ | ||
echo "================" | ||
|
||
echo "Was /var/lib/clamav-unofficial-sigs/dbs-ss/jurlbl.ndb removed ?" | ||
if [ ! -e "/var/lib/clamav-unofficial-sigs/dbs-ss/jurlbl.ndb" ] ; then | ||
echo .. OK | ||
else | ||
echo .. ERROR | ||
exit 1 | ||
fi | ||
echo "Was /var/lib/clamav/phish.ndb removed ?" | ||
if [ ! -e "/var/lib/clamav/phish.ndb" ] ; then | ||
echo .. OK | ||
else | ||
echo .. ERROR | ||
exit 1 | ||
fi | ||
|
||
echo "running script verbose with malware expert databases" | ||
cp -f .t/tests/user_malwareexpert.conf /etc/clamav-unofficial-sigs/user.conf | ||
bash /usr/sbin/clamav-unofficial-sigs --verbose | ||
if [ "$?" -eq "0" ] ; then | ||
echo .. OK | ||
else | ||
echo .. ERROR | ||
exit 1 | ||
fi | ||
echo "===== MALWAREEXPERT /var/lib/clamav/ =====" | ||
ls -laFh /var/lib/clamav/ | ||
echo "================" | ||
|
||
echo "Was /var/lib/clamav-unofficial-sigs/dbs-ss/jurlbl.ndb removed ?" | ||
if [ ! -e "/var/lib/clamav-unofficial-sigs/dbs-ss/jurlbl.ndb" ] ; then | ||
echo .. OK | ||
else | ||
echo .. ERROR | ||
exit 1 | ||
fi | ||
|
||
echo "Was /var/lib/clamav/malware.expert.hdb added ?" | ||
if [ -e "/var/lib/clamav/malware.expert.hdb" ] ; then | ||
echo .. OK | ||
else | ||
echo .. ERROR | ||
exit 1 | ||
fi | ||
echo "Was /var/lib/clamav/malware.expert.fp added ?" | ||
if [ -e "/var/lib/clamav/malware.expert.fp" ] ; then | ||
echo .. OK | ||
else | ||
echo .. ERROR | ||
exit 1 | ||
fi | ||
echo "Was /var/lib/clamav/malware.expert.ldb added ?" | ||
if [ -e "/var/lib/clamav/malware.expert.ldb" ] ; then | ||
echo .. OK | ||
else | ||
echo .. ERROR | ||
exit 1 | ||
fi | ||
echo "Was /var/lib/clamav/malware.expert.ndb added ?" | ||
if [ -e "/var/lib/clamav/malware.expert.ndb" ] ; then | ||
echo .. OK | ||
else | ||
echo .. ERROR | ||
exit 1 | ||
fi |
Oops, something went wrong.