-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathscanner6.sh
executable file
·64 lines (53 loc) · 1.88 KB
/
scanner6.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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
# This file calls all the scanners based on the configuration in the config.sh file
#! /bin/bash
source config.sh
echo $PWD
TIME_STAMP="$(date +"%H%M%S")"
export TIME_STAMP
export OutputPath
export summaryDirPath
echo "" >> $OutputPath/config.txt
echo "********************************************************************" >> $OutputPath/config.txt
echo TimeStamp : $TIME_STAMP >> $OutputPath/config.txt
echo "" >> $OutputPath/config.txt
cat config.sh >> $OutputPath/config.txt
echo "******************* $TIME_STAMP *******************" >> $summaryDirPath/complete.json
echo "*** Start Time : "$(date +"%d-%m-%Y:%H:%M:%S")" *****" >> $summaryDirPath/complete.json
echo Start Time : "$(date +"%d-%m-%Y:%H:%M:%S")"
startTime="$(date +%s)"
source pre_scan_scripts.sh
echo scan starts with processed hitlist present at ${processed_hitlist_path}
if [ $SCAN_XMPP_FLAG = $ENABLED ]; then
./scan_xmpp.sh
fi
if [ $SCAN_MQTT_FLAG = $ENABLED ]; then
./scan_mqtt.sh
fi
if [ $SCAN_AMQP_FLAG = $ENABLED ]; then
./scan_amqp.sh
fi
if [ $SCAN_OPCUA_FLAG = $ENABLED ]; then
./scan_opcua.sh
fi
if [ $SCAN_TELNET_FLAG = $ENABLED ]; then
./scan_telnet.sh
fi
if [ $SCAN_COAP_FLAG = $ENABLED ]; then
./scan_coap.sh
fi
if [ $SCAN_DTLS_FLAG = $ENABLED ]; then
./scan_dtls.sh
fi
if [ $POST_SCAN_SCRIPTS = $ENABLED ]; then
./post_scan_scripts.sh
fi
endTime="$(date +%s)"
deltaTime=$(expr $endTime - $startTime)
scanDays="$(expr $deltaTime / 86400)"
scanHours="$(expr $(expr $deltaTime % 86400) / 3600)"
scanMinutes="$(expr $(expr $(expr $deltaTime % 86400) % 3600) / 60)"
echo Time Elapsed : Days $scanDays, Hours $scanHours, minutes $scanMinutes
echo End Time : "$(date +"%d-%m-%Y:%H:%M:%S")"
echo "*** End Time : "$(date +"%d-%m-%Y:%H:%M:%S")" *****" >> $summaryDirPath/complete.json
echo Time Elapsed : Days $scanDays, Hours $scanHours, minutes $scanMinutes >> $summaryDirPath/complete.json
# EOF