-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathKrasue.sh
More file actions
63 lines (52 loc) · 1.31 KB
/
Krasue.sh
File metadata and controls
63 lines (52 loc) · 1.31 KB
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
#!/bin/bash
#$t@$h
# This script modifies your system when
# it writes the results to report.txt
# But otherwise tidies up when finished
# Run as root. It's the only way
DEPENDENCIES=(chkrootkit nmap john)
installed_packages=()
install_dependencies() {
for pkg in "${DEPENDENCIES[@]}"; do
if ! dpkg -s "$pkg" &> /dev/null; then
sudo apt-get install -y "$pkg"
installed_packages+=("$pkg")
fi
done
}
system_calls() {
grep -v '^#' /proc/kallsyms | grep sys_call_table
}
network_traffic() {
sudo tcpdump -i any 'port 554' -w rtsp_traffic.pcap -v
}
detect_rootkits() {
chkrootkit
}
patch_system() {
sudo apt-get update
sudo apt-get upgrade -y
}
password_strength() {
sudo john --test # TODO: implement this
}
endpoint_security() {
sudo nmap -sS -O localhost
}
generate_report() {
system_calls > security_report.txt
network_traffic >> security_report.txt
detect_rootkits >> security_report.txt
password_strength >> security_report.txt
endpoint_security >> security_report.txt
}
cleanup_dependencies() {
for pkg in "${installed_packages[@]}"; do
sudo apt-get remove --purge -y "$pkg"
done
}
install_dependencies
patch_system
generate_report
cleanup_dependencies
echo "Krasue checks complete. security_report.txt written."