-
Notifications
You must be signed in to change notification settings - Fork 165
/
kali-whoami
186 lines (149 loc) · 5.41 KB
/
kali-whoami
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
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
#!/bin/bash
# Whoami | Coded by Ömer Doğan
#check source files
source /usr/share/kali-whoami/assets/sources/config 2> /dev/null || { clear;echo -e "\e[31m [-] FATAL ERROR: MAIN CONFIG COULD NOT BE SOURCED!\e[0m";exit 1;}
banner
# run with a root privilege
[ $UID != 0 ] && err "Whoami must be run as root. ${GREEN}'sudo $(basename ${0})'${RESET}"
src_check() {
check_status="1"
for i in $(seq 1 ${#}) ; do
if [ -f $SRCDIR/scripts/${@:i:1} ];then
source $SRCDIR/scripts/${@:i:1}
else
warn "The source file could not be found. Please re-install the tool. (Module: ${@:i:1})"
check_status="0"
fi
done
if [ "${check_status}" = "0" ] ; then
err "Please run this command:\n'${GREEN}git clone https://github.com/omer-dogan/kali-whoami && cd kali-whoami && sudo make reinstall${RESET}'"
fi
}
src_check fix log_killer ip_changer dns_changer mac_changer anti_cold_boot hostname_changer timezone_changer browser_anonymization
#check dependences function
dep_check() {
check_status="1"
for i in $(seq 1 ${#}) ; do
[ $(command -v ${@:i:1}) ] || { warn "${@:i:1}: could not be found." ; check_status="0" ; }
done
if [ "${check_status}" = "0" ] ; then
err "Please run this command: '${GREEN}sudo apt update && sudo apt install tar tor curl python3 python3-scapy network-manager${RESET}'"
fi
}
start(){
#check dependences
dep_check tar tor curl python3 scapy
#get a backup to fix it in case of a possible error
if [ ! -f $BACKUPDIR/whoami_fix_backups.tar.gz ]; then
get_backups
fi
options=("Anti Mitm" "Log killer" "Ip changer" "Dns changer" "Mac changer" "Timezone changer" "Hostname changer" "Browser anonymization" "Anti cold boot")
menu() {
info "Avaliable features:\n"
for opt in ${!options[@]}; do
printf "[%s] %s\n" $((opt+1)) "${options[opt]} ${choices[opt]}"
done
[[ "$stat" ]] && msg "$stat"; :
}
while banner && menu && input && read -r num && [[ "$num" ]]; do
[[ "$num" != *[![:digit:]]* ]] &&
(( num > 0 && num <= ${#options[@]} )) ||
{ stat="Invalid option: $num"; continue; }
((num--)); stat="${options[num]} was ${choices[num]:+un}checked"
[[ "${choices[num]}" ]] && choices[num]="" || choices[num]="✓"
done
banner
#detect selected features and run
for opt in ${!options[@]}; do
start_anti_mitm(){
python3 /usr/share/kali-whoami/assets/scripts/anti_mitm &
antimitmpid="$!"
sed -i 's/anti_mitm_pid="0"/anti_mitm_pid="'$antimitmpid'"/g;s/anti_mitm_status="Disable"/anti_mitm_status="Enable"/g' $SRCDIR/sources/config
info "Anti mitm successfully enabled"
}
for st in $(seq 0 $(( ${#options[@]} - 1 ))) ; do
if [[ "${choices[opt]}" ]] && [[ "${options[opt]}" == ${options[st]} ]]; then
$(echo start_${options[st]} | sed -e 's/ /_/g;s/\(.*\)/\L\1/;s/ı/i/g')
fi
done
done
}
stop(){
#detect enable features and stop
if $(cat $SRCDIR/sources/config | grep Enable &>/dev/null);then
options=("anti_mitm" "ip_changer" "dns_changer" "mac_changer" "timezone_changer" "hostname_changer" "browser_anonymization")
stop_anti_mitm(){
kill $anti_mitm_pid
sed -i 's/anti_mitm_pid="'$anti_mitm_pid'"/anti_mitm_pid="0"/g;s/anti_mitm_status="Enable"/anti_mitm_status="Disable"/g' $SRCDIR/sources/config
info "Anti mitm successfully disabled"
}
for st in $(seq 0 $(( ${#options[@]} - 1 ))) ; do
status="${options[st]}_status"
if [[ ${!status} == "Enable" ]] ; then
stop_${options[st]}
fi
done
else
err "No features are active. (Run to activate '${GREEN}sudo kali-whoami --start${RESET}')"
fi
}
status(){
msg "Kali Whoami status:
${GREEN}Anti Mitm :${RESET} $anti_mitm_status
${GREEN}Ip changer :${RESET} $ip_changer_status
${GREEN}Dns changer :${RESET} $dns_changer_status
${GREEN}Mac changer :${RESET} $mac_changer_status
${GREEN}Timezone changer :${RESET} $timezone_changer_status
${GREEN}Hostname changer :${RESET} $hostname_changer_status
${GREEN}Browser anonymization :${RESET} $browser_anonymization_status"
}
fix(){
#repair system with backups received for a possible bug
if [ -f $BACKUPDIR/whoami_fix_backups.tar.gz ]; then
restore_system
msg "System successfully repaired"
else
err "Whoami backup file not found"
fi
}
help() {
msg "Usage : sudo kali-whoami ${GREEN}[option]${RESET}
${GREEN}--start :${RESET} It will make backups and start the program.
${GREEN}--stop :${RESET} Closes the program using a backup.
${GREEN}--status :${RESET} Provides information about IP address and working status.
${GREEN}--fix :${RESET} Used to repair the system in case of a possible bug.
${GREEN}--help :${RESET} This shows the menu."
}
main() {
if [[ "$#" -eq 0 ]]; then
warn "Whoami: Argument required"
info "Run ${GREEN}'kali-whoami --help'${RESET} for more information."
exit 1
fi
case "$1" in
--[sS][tT][aA][rR][tT]|-[sS][tT])
start
;;
--[sS][tT][oO][pP]|-[sS][pP])
stop
;;
--[sS][tT][aA][tT][uU][sS]|-[sS][sS])
status
;;
--[fF][iI][xX]|-[fF])
fix
;;
--[hH][eE][lL][pP]|-[hH])
help
exit 1
;;
*)
warn "Whoami: Invalid option ${RED}'$1'${RESET}"
info "Run ${GREEN}'kali-whomai --help'${RESET} parameter for more information."
exit 1
;;
esac
}
# call main
main "${@}"
# EOF