-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
73 additions
and
0 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,3 @@ | ||
# Checksummer | ||
|
||
Script to create checksums (MD5) of static files. Useful for firewall installations to detect root kits. |
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,39 @@ | ||
#!/usr/local/bin/bash | ||
|
||
# | ||
# Simple md5 Chechsum Builder for *BSD | ||
# | ||
|
||
STATICDIRS="/bin /boot /etc /sbin /usr" | ||
#STATICDIRS="/etc" | ||
|
||
CFV="/usr/local/bin/cfv" | ||
|
||
if [ "$UID" != "0" ]; then | ||
echo -e "\033[40m\033[1;31mERROR: Root check FAILED (you MUST be root to use this script)!\033[0m" | ||
exit 1 | ||
fi | ||
|
||
case "$1" in | ||
create) | ||
for dir in ${STATICDIRS} | ||
do | ||
find "$dir" -type f \! \( -path "/usr/ports/*" \ | ||
-or -path "/usr/src/*" \ | ||
-or -path "/usr/local/man/*" \ | ||
-or -path "/usr/local/lib/perl5/5.6.1/man/*" \ | ||
-or -path "/usr/share/openssl/man/*" \ | ||
-or -path "/usr/share/man/*" \) \ | ||
-exec $CFV -t md5 -C -VV -f - \{\} \; | ||
done | ||
;; | ||
check) | ||
$CFV -t md5 -f - | ||
;; | ||
*) | ||
echo "Usage:" | ||
echo "Create: $0 create > file" | ||
echo "Check: $0 check < file" | ||
exit 1 | ||
;; | ||
esac |
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,31 @@ | ||
#!/bin/bash | ||
|
||
# | ||
# Simple md5 Chechsum Builder | ||
# | ||
|
||
#STATICDIRS="/bin /boot /etc /sbin /lib /opt /usr" | ||
STATICDIRS="/bin" | ||
|
||
if [ "$UID" != "0" ]; then | ||
echo -e "\033[40m\033[1;31mERROR: Root check FAILED (you MUST be root to use this script)!\033[0m" | ||
exit 1 | ||
fi | ||
|
||
case "$1" in | ||
create) | ||
for dir in ${STATICDIRS} | ||
do | ||
find "$dir" -mount -type f -exec md5sum \{\} \; | ||
done | ||
;; | ||
check) | ||
md5sum -c | ||
;; | ||
*) | ||
echo "Usage:" | ||
echo "Create: $0 create > file" | ||
echo "Check: $0 check < file" | ||
exit 1 | ||
;; | ||
esac |