-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathsecuriScan.sh
37 lines (36 loc) · 990 Bytes
/
securiScan.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#!/bin/bash
EMAIL="[email protected]"
#add your websites here
sites[0]="www.celebrityspeakersbureau.com"
sites[1]="sports-speakers-bureau.com"
sites[2]="celebritychefnetwork.com"
sites[3]="pmgsports.com"
sites[4]="celebexperts.com"
#...
SENDEMAIL=0
for s in "${sites[@]}"
do
WARNING=0
> /tmp/malwarecheck.txt
curl https://sitecheck.sucuri.net/results/$s | sed -n "/Security report/,/Spam/p" >> /tmp/malwarecheck.txt
while read line; do
if [[ "$line" == *error* ]]
then
WARNING=1
fi
done < /tmp/malwarecheck.txt
if [ $WARNING -eq 1 ]
then
SENDEMAIL=1
echo "https://sitecheck.sucuri.net/results/$s:" >> /tmp/malwarecheckemail.txt
cat /tmp/malwarecheck.txt >> /tmp/malwarecheckemail.txt
echo "" >> /tmp/malwarecheckemail.txt
echo "" >> /tmp/malwarecheckemail.txt
fi
done
if [ $SENDEMAIL -eq 1 ]
then
mail -s "URGENT: Malware detected!" $EMAIL < /tmp/malwarecheckemail.txt
fi
rm /tmp/malwarecheck.txt 2> /dev/null
rm /tmp/malwarecheckemail.txt 2> /dev/null