Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Mail to RootKits and Crontab #1

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 25 additions & 2 deletions README.MD
Original file line number Diff line number Diff line change
Expand Up @@ -416,8 +416,29 @@ Install docker-compose
###### Check for rootkits
install

apt-get install rkhunter chkrootkit
apt-get install chkrootkit


###### Install RKhunter by source

read -P "What is RKHunter Download Link? ( example: 1.4.6 )" RKPKG
RKLNK="https://sourceforge.net/projects/rkhunter/files/rkhunter/$RKPKG/rkhunter-$RKPKG.tar.gz/download"
wget -P /usr/local/src $RKLNK
tar -zxvf rkhunter-$RKPKG.tar.gz --directory /usr/local/src
cd rkhunter-$RKPKG.tar.gz
./installer.sh --layout default --install /usr/local/bin/rkhunter --update /usr/local/bin/rkhunter --propupd
rm -rf /usr/local/src/rkhunter*

###### Add mail on rootkiits on crontab

crontab -l > crontab.bak
cat<<EOF> /etc/cron.daily/rkhunter.sh
#!/bin/sh(/usr/local/bin/rkhunter --versioncheck/usr/local/bin/rkhunter --update/usr/local/bin/rkhunter --cronjob --report-warnings-only)
/bin/mail -s 'rkhunter Daily Run ($HOSTNAME)' $MY_EMAIL
EOF
chmod 700 /etc/cron.daily/rkhunter.sh


now test

chkrootkit
Expand All @@ -427,12 +448,14 @@ now test 2
rkhunter --update
rkhunter --propupd
rkhunter --check
rkhunter -c -sk





>todo:

* add to cron: check rootkits with mail
* add to cron: check rootkits with mail - DONE !?
* Tiger and Tripwire
* https://www.digitalocean.com/community/questions/best-practices-for-hardening-new-sever-in-2017