eid-ops/global/overlay/usr/local/sbin/secreport.sh

52 lines
927 B
Bash
Executable file

#!/bin/bash
echo "### $HOSTNAME"
grep 127.0.1.1 /etc/hosts
echo "### SUID binaries"
find / -perm -4000 -ls
echo "### World writable files"
find / -type f -a -perm -o=w -ls
echo "### lines in authorized_keys"
for h in `awk -F: '{print $6}' /etc/passwd`; do
echo "-- $h"
if [ -f $h/.ssh/authorized_keys ]; then
cat $h/.ssh/authorized_keys
fi
done
echo "### cronjobs"
for u in `awk -F: '{print $1}' /etc/passwd`; do
echo "-- $u"
crontab -u $u -l
done
echo "### cronjobs in /etc"
find /etc/cron.*
echo "### Nyligen ändrade filer i systemet"
find / -type f -mtime 1 -ls
echo "### Installerade paket och versioner"
dpkg -l
echo "### Portar som lyssnar lsof alt netstat"
netstat -lp
echo "### Entropy"
cat /proc/sys/kernel/random/entropy_avail
echo "### fstab"
cat /etc/fstab
echo "### arp-tabell"
arp -na
echo "### processlista"
ps -eo euser,ruser,suser,fuser,f,comm,label
echo "### lsmod"
lsmod