-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathapt-simulator.sh
More file actions
142 lines (131 loc) · 4.97 KB
/
apt-simulator.sh
File metadata and controls
142 lines (131 loc) · 4.97 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
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
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
#!/bin/bash
# ============================================================================
# APT Cyber Killchain Simulator - TUI Launcher
# ============================================================================
# Simple menu to launch Red/Blue Team scripts
# ============================================================================
VERSION="1.0.0"
SCRIPTS_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
DIALOG=${DIALOG=dialog}
# ============================================================================
# CHECK DIALOG
# ============================================================================
check_dialog() {
if ! command -v dialog &> /dev/null; then
echo "Installing dialog..."
if command -v apt &> /dev/null; then
sudo apt install -y dialog
elif command -v brew &> /dev/null; then
brew install dialog
else
echo "❌ Please install dialog: sudo apt install dialog"
exit 1
fi
fi
}
# ============================================================================
# MAIN MENU
# ============================================================================
main_menu() {
while true; do
CHOICE=$(dialog --clear --backtitle "APT Simulator v$VERSION" \
--title "[ MAIN MENU ]" \
--menu "Choose operation:" 15 60 5 \
1 "🔴 Red Team" \
2 "🛡️ Blue Team" \
3 "❌ Exit" \
3>&1 1>&2 2>&3)
case $? in
0)
case $CHOICE in
1) red_team_menu ;;
2) blue_team_menu ;;
3) clear; exit 0 ;;
esac
;;
*)
clear
exit 0
;;
esac
done
}
# ============================================================================
# RED TEAM MENU
# ============================================================================
red_team_menu() {
CHOICE=$(dialog --clear --backtitle "APT Simulator - Red Team" \
--title "[ SELECT APT GROUP ]" \
--menu "Choose attack simulator:" 20 70 10 \
1 "🇷🇺 APT28 (Fancy Bear)" \
2 "🇷🇺 APT29 (Cozy Bear)" \
3 "🇰🇵 Lazarus Group" \
4 "🇨🇳 APT41 (Winnti)" \
5 "🇷🇺 Sandworm" \
6 "🇻🇳 APT32 (Ocean Lotus)" \
7 "🇺🇸 Equation Group" \
8 "🇷🇺 Turla" \
9 "← Back" \
3>&1 1>&2 2>&3)
case $CHOICE in
1) run_script "red-team/apt28-killchain.sh" ;;
2) run_script "red-team/apt29-killchain.sh" ;;
3) run_script "red-team/lazarus-killchain.sh" ;;
4) run_script "red-team/apt41-killchain.sh" ;;
5) run_script "red-team/sandworm-killchain.sh" ;;
6) run_script "red-team/apt32-killchain.sh" ;;
7) run_script "red-team/equation-killchain.sh" ;;
8) run_script "red-team/turla-killchain.sh" ;;
9) return ;;
esac
}
# ============================================================================
# BLUE TEAM MENU
# ============================================================================
blue_team_menu() {
CHOICE=$(dialog --clear --backtitle "APT Simulator - Blue Team" \
--title "[ SELECT DEFENSE SCENARIO ]" \
--menu "Choose defense simulator:" 20 70 10 \
1 "🛡️ APT28 Defense" \
2 "🛡️ APT29 Defense" \
3 "🛡️ Lazarus Defense" \
4 "🛡️ APT41 Defense" \
5 "🛡️ Sandworm Defense" \
6 "🛡️ APT32 Defense" \
7 "🛡️ Equation Defense" \
8 "🛡️ Turla Defense" \
9 "← Back" \
3>&1 1>&2 2>&3)
case $CHOICE in
1) run_script "blue-team/blueteam-apt28-defense.sh" ;;
2) run_script "blue-team/blueteam-apt29-defense.sh" ;;
3) run_script "blue-team/blueteam-lazarus-defense.sh" ;;
4) run_script "blue-team/blueteam-apt41-defense.sh" ;;
5) run_script "blue-team/blueteam-sandworm-defense.sh" ;;
6) run_script "blue-team/blueteam-apt32-defense.sh" ;;
7) run_script "blue-team/blueteam-equation-defense.sh" ;;
8) run_script "blue-team/blueteam-turla-defense.sh" ;;
9) return ;;
esac
}
# ============================================================================
# RUN SCRIPT
# ============================================================================
run_script() {
local script="$SCRIPTS_DIR/$1"
if [ -f "$script" ]; then
clear
bash "$script"
echo ""
read -p "Press Enter to return to menu..."
else
dialog --title "[ NOT IMPLEMENTED ]" \
--msgbox "Script not found:\n$script\n\nCreate it to enable this simulator!" 10 60
fi
}
# ============================================================================
# MAIN
# ============================================================================
check_dialog
mkdir -p "$SCRIPTS_DIR/red-team" "$SCRIPTS_DIR/blue-team"
main_menu