-
Notifications
You must be signed in to change notification settings - Fork 0
/
syscheck.sh
executable file
·98 lines (69 loc) · 2.21 KB
/
syscheck.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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
#!/bin/bash
DATE=$(date +%Y%m%d)
# Get System Info
#lsb_release -a
#uname -a
################################
#
# Scans
#
################################
# List all netstat ports
# -t == --tcp
# -a == --all
# -u == --udp
# -p == --program
# -e == --extend
# -n == --numeric
#sudo netstat -taupen
#sudo netstat --tcp --udp --all --udp --program --extend --numeric
#nmap --iflist
#nmap -sL 192.168.0.0/24
#sudo nmap -sS -sU -PN -p 1-65535 192.168.0.0/24
#nmap --reason --osscan-guess -oA ~/nmap 192.168.0.0/24
# Port Scan Internal Network
sudo nmap -v -iL iprange -A -oG /opt/syscheck/nmapscan -oX /opt/syscheck/nmapscan.xml
# Update Nikto Library Definitions
sudo perl /opt/nikto/nikto.pl -update
# Run Nikto on all hosts identified on the local network
sudo perl /opt/nikto/nikto.pl -Format html -maxtime 600s -output /opt/syscheck/nikto.html -C all -host /opt/syscheck/nmapscan
# Run Tiger
sudo /usr/sbin/tiger -l /opt/syscheck -H -e
################################
#
# Assign Permissions
#
################################
sudo chmod go+r -R /opt/syscheck/
sudo chown root:adm -R /opt/syscheck/
################################
#
# Copy Reports
#
################################
# NMAP Reports
# Convert xml output into html
sudo xsltproc /opt/syscheck/nmapscan.xml -o /opt/syscheck/nmapscan.html
# Copy html report to our reports directory.
sudo cp /opt/syscheck/nmapscan.html /var/log/reports/nmap.html
# Nikto Reports
sudo cp /opt/syscheck/nikto.html /var/log/reports/nikto.html
# Tiger Reports
sudo cp /opt/syscheck/security.report* /var/log/reports/tiger.html
################################
#
# Clean up reports
#
################################
# Remove old xml file
sudo rm -f /opt/syscheck/nmapscan.xml
# Backup NMAP Reports
sudo mv /opt/syscheck/nmapscan.html /opt/syscheck/nmap/scan_$DATE.html
sudo mv /opt/syscheck/nmapscan /opt/syscheck/nmap/scan_$DATE
# Backup Nikto Reports
sudo mv /opt/syscheck/nikto.html /opt/syscheck/nikto/nikto_$DATE.html
# Backup Tiger Reports
sudo mv /opt/syscheck/security.report* /opt/syscheck/tiger/
#execute
#sudo /usr/bin/nikto -Format html -h 192.168.0.199 -p 80,443,8080,8081,9091,5050,10000,32400 -o /var/log/reports/Nikto.html -C all
#sudo /usr/sbin/tiger -l /opt/syscheck -H -E -e