V1rus Private
User / IP
:
216.73.217.108
Host / Server
:
190.92.174.125 / aerosofthealthcare.com
System
:
Linux s3739.bom1.stableserver.net 4.18.0-513.24.1.lve.2.el8.x86_64 #1 SMP Fri May 24 12:42:50 UTC 2024 x86_64
Cmd
|
Upload
|
Mass Deface
|
Create
|
Sym
:
/
lib64
/
nagios
/
plugins
/
Viewing: check_md5files
#!/bin/bash # Name: check_md5files # Author: Tsvetan Gerov <tsvetan@worldhost.group> # Version 0.2 # # Description: Check the md5sum of a multiple files stored in a file # Usage: To add a file/files to a list, run: # md5sum /path/to/file >> /usr/lib64/nagios/plugins/md5list MD5=$(which md5sum) MD5_LIST="/usr/lib64/nagios/plugins/md5list" MD5_LIST_CUSTOM="/usr/lib64/nagios/plugins/md5list.custom" if [ -f "$MD5_LIST_CUSTOM" ]; then MD5_LIST="$MD5_LIST_CUSTOM" fi # Initialize flags and error message CRITICAL=false ERROR_MESSAGE="" # Check for deps DEPS="$MD5 $MD5_LIST" for DEP in $DEPS; do if [ ! -f "$DEP" ]; then echo "[UNKNOWN] Not found $DEP" exit 3 fi done # Check MD5 sum of files for FILE in $(cat $MD5_LIST | awk '{print$2}'); do MD5SUM=$(grep $FILE $MD5_LIST | awk '{print$1}') if [ ! -f $FILE ]; then CRITICAL=true ERROR_MESSAGE+="$FILE does not exists!, " else LMD5=$($MD5 $FILE | awk '{print$1}') if [ $MD5SUM != $LMD5 ]; then CRITICAL=true ERROR_MESSAGE+="$FILE has been modified!, " fi fi done # Return final state if [ "$CRITICAL" = true ]; then echo "[CRITICAL] ${ERROR_MESSAGE%, }" exit 2 else echo "[OK] All files match their MD5SUM" exit 0 fi
Coded With 💗 by
HanzOFC