-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathanonymouz
executable file
·644 lines (540 loc) · 30.1 KB
/
anonymouz
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
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
#!/bin/bash
# colors
GREEN=""
RED=""
REDB=""
YELLOW=""
BLUE=""
RESET=""
if [ -t 1 ]; then
if tput setaf 0 &>/dev/null; then
RESET="$(tput sgr0)"
BOLD="$(tput bold)"
GREEN="$(tput setaf 46)"
RED="$(tput setaf 1)"
REDB="${BOLD}${RED}"
YELLOW="$(tput setaf 3)"
BLUE="$(tput setaf 4)"
else
RESET="\e[0m"
BOLD="\e[1m"
GREEN="\e[32m"
RED="\e[31m"
REDB="${BOLD}${RED}"
YELLOW="\e[33m"
BLUE="\e[34m"
fi
fi
BACKUPDIR="/tmp/whoami"
MBACKUPDIR="/tmp/whoami/mac_addresses"
TORRC="/etc/tor/torrc"
err() {
echo "${RED}[-]${RESET} ${@}"
exit 1
}
warn() {
echo "${YELLOW}[!]${RESET} ${@}"
}
msg() {
echo "${GREEN}[+]${RESET} ${@}"
}
info() {
echo "${BLUE}[*]${RESET} ${@}"
}
input() {
echo -n "┌─[Anonymouz]
└─╼ $ "
}
banner() {
clear
echo "
${REDB}WARNING${RESET} The Author is not responsible for illegal users.
${GREEN}
AAA
AAAAA nn nnn oooo nn nnn yy yy mm mm mmmm oooo uu uu zzzzz
AA AA nnn nn oo oo nnn nn yy yy mmm mm mm oo oo uu uu zz
AAAAAAA nn nn oo oo nn nn yyyyyy mmm mm mm oo oo uu uu zz
AA AA nn nn oooo nn nn yy mmm mm mm oooo uuuu u zzzzz
yyyyy
${RESET}
${GREEN}Anonymouz${RESET} Tool makes the user as anonymous as possible on Linux systems.
"
}
# English notification variables
English() {
notification_1=("Anonymouz is already running!")
notification_2=("Check internet connection and try again!")
notification_3=("Tor is not installed on the system. Setup is starting!")
notification_4=("Tor could not be installed on the system!")
notification_5=("Backup is starting...")
notification_6=("System log files are destroying...")
notification_7=("Please wait this process may take some time...")
notification_8=("Anti-Cold Boot Attack is starting...")
notification_9=("Changing the hostname...")
notification_10=("Anonymous DNS servers are setting up...")
notification_11=("The MAC Address of all network interfaces is changing...")
notification_12=("The proper network interface could not be detected. Whoami continue to the next step...")
notification_13=("Browser anonymization is starting...")
notification_14=("Firefox could not be detected. Anonymouz takes to the next step...")
notification_13=("Time zone is setting to UTC...")
notification_16=("Anti-MITM is launching...")
notification_14=("IP address is changing with transparent proxy...")
notification_18=("Crash protection is starting...")
notification_15=("Anonymization is successful. Who are you?")
notification_16=("Anonymouz is not working anyway")
notification_17=("Restoring hostname from backups...")
notification_18=("DNS servers restoring from backups...")
notification_19=("Mac addresses of the network interfaces are restoring from backups...")
notification_24=("Browser settings set as default")
notification_20=("Time zone is set as default")
notification_26=("Anti-MITM is stopping...")
notification_21=("Transparent proxy is stopping...")
notification_22=("Anonymouz has been stopped. Be careful!")
lang_t=$(touch .English.txt)
}
# Thai notification variables
Thai() {
notification_1=("กำลังเรียกใช้ Anonymouz !")
notification_2=("ตรวจสอบการเชื่อมต่ออินเทอร์เน็ต และลองอีกครั้ง...")
notification_3=("ไม่พบ Tor บนระบบ กำลังเริ่มการติดตั้ง..")
notification_4=("การติดตั้ง Tor ล้มเหลว!")
notification_5=("กำลังเริ่มการสำรองข้อมูล (backup)...")
notification_6=("กำลังล้าง system log files...")
notification_7=("กระบวนการนี้อาจใช้เวลา โปรดรอสักครู่...")
notification_8=("กำลังเริ่ม Anti-Cold Boot Attack...")
notification_9=("กำลังเปลี่ยนชื่อโฮสต์...")
Notification_10=("กำลังตั้งค่า DNS Server ที่ไม่ระบุตัวตน...")
Notification_11=("กำลังเปลี่ยน MAC address ของ Network Interface ทั้งหมด...")
Notification_12=("ไม่พบ Network Interface ที่เหมาะสม เข้าสู่ขั้นตอนถัดไป...")
Notification_13=("กำลังลบข้อมูลการระบุตัวตนของเบราว์เซอร์...")
Notification_14=("ไม่พบ Firefox เข้าสู่ขั้นตอนถัดไป...")
Notification_15=("กำลังตั้งค่า Time zone เป็น UTC ...")
Notification_16=("กำลังเริ่ม Anti-MITM...")
Notification_17=("กำลังเปลี่ยนที่อยู่ IP เป็น Transparent proxy...")
Notification_18=("กำลังเริ่ม Crash protection...")
Notification_19=("การลบข้อมูลระบุตัวตนสำเร็จ")
Notification_20=("Anonymouz ไม่ทำงาน !")
Notification_21=("กำลังกู้คืนชื่อโฮสต์จากข้อมูลสำรอง...")
Notification_22=("กู้คืน DNS Server จากข้อมูลสำรอง...")
Notification_23=("กู้คืน MAC address ของ Network Interface จากข้อมูลสำรอง...")
Notification_24=("ตั้งค่าเบราว์เซอร์เป็นค่าเริ่มต้น...")
Notification_25=("กำหนด Time zone เป็นค่าเริ่มต้น...")
Notification_26=("Anti-MITM หยุดทำงาน...")
Notification_27=("Transparent proxy หยุดทำงาน...")
Notification_28=("หยุดการเรียกใช้ Anonymouz !")
lang_t=$(touch .Thai.txt)
}
start() {
# Ask to choose language
if [ $(id -u) -ne 0 ]; then
exit 1
else
sleep 0.1
fi
msg "Select a language to continue
[1] English
[2] ไทย
"
while :
do
command &&
input & read lang
if [ -z $lang ]; then
warn "Empty input"
elif [ $lang == 1 ]; then
English
break
elif [ $lang == 2 ]; then
Thai
break
else
[ $lang -le 5 ] &> /dev/null
warn "Incorrect input"
fi
done
# check backup directory
if [ ! -d $BACKUPDIR ]; then
mkdir -p $BACKUPDIR
mkdir -p $MBACKUPDIR
$lang_t
else
err "$notification_1"
exit 1
fi
# check network connection
info "$notification_2"
if ! curl ident.me &> /dev/null ; then
if [ ! -w /etc/resolv.conf ] ; then
chattr -i /etc/resolv.conf
elif [ ! -d /etc/resolv.conf ] ; then
touch /etc/resolv.conf
echo "nameserver 84.200.69.80" > /etc/resolv.conf
else
iptables -F
iptables -X
iptables -t nat -F
iptables -t nat -X
iptables -P INPUT ACCEPT
iptables -P FORWARD ACCEPT
iptables -P OUTPUT ACCEPT
fi
fi
# check and install tor
if ! tor -h &> /dev/null ; then
warn "$notification_3"
if ! apt-get install tor -y &> /dev/null ; then
err "$notification_4" && exit 1
fi
fi
info "$notification_5"
# backup hostname
cat /etc/hostname > $BACKUPDIR/hostname.bak
# backup resolv.conf
mv /etc/resolv.conf $BACKUPDIR/resolv.conf.bak
# backup mac addresses
IFACES=$(ip -o link show | awk -F': ' '{print $2}')
for IFACE in $IFACES; do
if [ $IFACE != "lo" ]; then
cat /sys/class/net/$IFACE/address > $MBACKUPDIR/$IFACE
fi
done
# backup timezone
timedatectl show | grep Timezone | sed 's/Timezone=//g' > $BACKUPDIR/timezone.bak
# check and backup torrc
if [ ! -d $TORRC ]; then
touch $TORRC
fi
mv "$TORRC" $BACKUPDIR/torrc.bak
# backup iptables
iptables-save > $BACKUPDIR/iptables.rules.bak
# clean system logs
info "$notification_6"
python - <<END
import os
global logs
global detected_logs
detected_logs = []
possible_logs_list = ['/var/adm/utmp','/usr/adm/utmp','/etc/utmp','/var/log/utmp','/var/run/utmp','/var/adm/utmp','/var/run/utmp','/usr/var/adm/utmp','/var/adm/wtmp','/usr/adm/wtmp','/etc/wtmp','/var/log/wtmp','/var/adm/wtmp','/var/run/wtmp','/usr/var/adm/wtmp','/var/adm/utmpx','/usr/adm/utmpx','/usr/run/utmpx','/etc/utmpx','/var/log/utmpx','/var/run/utmpx','/usr/var/adm/utmpx','/var/adm/wtmpx','/usr/adm/wtmpx','/etc/wtmpx','/var/log/wtmpx','/var/run/wtmpx','/usr/adm/wtmpx','/usr/var/adm/wtmpx','/var/adm/lastlog','/usr/adm/lastlog','/etc/lastlog','/var/log/lastlog','/usr/adm/lastlog','/usr/run/lastlog','/usr/var/adm/lastlog','/var/adm/pacct','/var/account/pacct','/var/log/acct','/var/log/pacct','/var/adm/acct','/var/adm/pacct','/var/account/acct','/usr/adm/acct','/var/log/prelude.log','/var/log/prelude/prelude.log','/var/adm/prelude/prelude.log','/var/adm/prelude/log/prelude.log','/var/adm/log/prelude.log','/var/ids/log/prelude.log','/var/ids/prelude/log/prelude.log','/var/ids/prelude.log','/var/prelude/prelude.log','/var/prelude/log/prelude.log','/home/log/prelude.log','/home/ids/log/prelude.log','/home/prelude/log/prelude.log','/home/ids/prelude.log','/home/prelude/prelude.log','/home/log/prelude.log','/usr/local/var/log/prelude.log','/var/log/prelude-xml.log','/var/log/prelude/prelude-xml.log','/var/adm/prelude/prelude-xml.log','/var/adm/prelude/log/prelude-xml.log','/var/adm/log/prelude-xml.log','/var/ids/log/prelude-xml.log','/var/ids/prelude/log/prelude-xml.log','/var/ids/prelude-xml.log','/var/prelude/prelude-xml.log','/var/prelude/log/prelude-xml.log','/home/log/prelude-xml.log','/home/ids/log/prelude-xml.log','/home/prelude/log/prelude-xml.log','/home/ids/prelude-xml.log','/home/prelude/prelude-xml.log','/home/log/prelude-xml.log','/usr/local/var/log/prelude-xml.log','/var/log/samba/log.smbd','/var/log/samba/log.nmbd','/var/log/log.smbd','/var/log/log.nmbd','/var/log/smb/log.smbd','/var/log/smb/log.nmbd','/home/samba/log.smbd','/home/samba/log.nmbd','/home/samba/log/log.smbd','/home/samba/log/log.nmbd','/home/samba/logs/log.smbd','/home/samba/logs/log.nmbd','/var/log/snort/snort.alert','/var/log/snort.alert','/var/log/ids/snort.alert','/var/ids/snort/snort.alert','/var/ids/snort.alert','/var/snort/snort.alert','/home/snort/snort.alert','/home/snort/log/snort.alert','/home/log/snort/snort.alert','/home/log/snort.alert','/home/ids/snort/snort.alert','/home/ids/snort.alert','/usr/local/ids/snort.alert','/usr/local/var/snort.alert','/usr/local/snort/snort.alert','/usr/local/var/log/snort.alert','/usr/local/snort/log/snort.alert','/usr/local/ids/log/snort.alert','/usr/local/log/snort.alert','/usr/local/log/snort/snort.alert','/var/log/apache2/audit_log','/var/log/apache1/audit_log','/var/log/apache/audit_log','/home/apache2/log/audit_log','/home/apache1/log/audit_log','/home/apache/log/audit_log','/home/http/log/audit_log','/home/httpd/log/audit_log','/var/log/http/audit_log','/var/log/httpd/audit_log','/usr/http/log/audit_log','/usr/httpd/log/audit_log','/usr/local/http/log/audit_log','/usr/local/httpd/log/audit_log','/usr/local/apache/log/audit_log','/usr/local/apache2/log/audit_log','/usr/local/apache1/log/audit_log','/var/www/log/audit_log','/var/http/log/audit_log','/var/httpd/log/audit_log','/var/apache/log/audit_log','/var/apache2/log/audit_log','/var/apache1/log/audit_log','/root/.bash_history','/root/.history','/root/.sh_history','/.bash_history','/.history','/.sh_history','/tmp/.bash_history','/tmp/.sh_history','/tmp/.history','/home/apache/.bash_history','/home/apache/.sh_history','/home/apache/.history','/home/apache1/.bash_history','/home/apache1/.sh_history','/home/apache1/.history','/home/apache2/.bash_history','/home/apache2/.sh_history','/home/apache2/.history','/home/httpd/.bash_history','/home/httpd/.sh_history','/home/httpd/.history','/home/ftpd/.bash_history','/home/ftpd/.sh_history','/home/ftpd/.history','/var/log/apache2/access_log','/var/log/apache2/access_log.1','/var/log/apache2/access_log.2','/var/log/apache2/error_log','/var/log/apache2/error_log.1','/var/log/apache2/error_log.2','/var/log/apache2/ssl_access_log','/var/log/apache2/ssl_access_log.1','/var/log/apache2/ssl_access_log.2','/var/log/apache2/ssl_error_log','/var/log/apache2/ssl_request_log','/var/log/apache2/request_log','/var/log/apache/access_log','/var/log/apache/access_log.1','/var/log/apache/access_log.2','/var/log/apache/error_log','/var/log/apache/error_log.1','/var/log/apache/error_log.2','/var/log/apache/ssl_access_log','/var/log/apache/ssl_error_log','/var/log/apache/ssl_request_log','/var/log/apache/request_log','/var/log/apache1/access_log','/var/log/apache1/error_log','/var/log/apache1/ssl_access_log','/var/log/apache1/ssl_error_log','/var/log/apache1/ssl_request_log','/var/log/apache1/request_log','/var/www/log/access_log','/var/www/log/error_log','/var/www/log/ssl_access_log','/var/www/log/ssl_error_log','/var/www/log/ssl_request_log','/var/www/log/request_log','/var/apache2/access_log','/var/apache2/error_log','/var/apache2/ssl_access_log','/var/apache2/ssl_error_log','/var/apache2/ssl_request_log','/var/apache2/request_log','/home/apache2/access_log','/home/apache2/error_log','/home/apache2/ssl_access_log','/home/apache2/ssl_error_log','/home/apache2/ssl_request_log','/home/apache2/request_log','/var/web/log/access_log','/var/web/log/error_log','/var/web/log/ssl_access_log','/var/web/log/ssl_error_log','/var/web/log/ssl_request_log','/var/web/log/request_log','/var/apache/access_log','/var/apache/error_log','/var/apache/ssl_access_log','/var/apache/ssl_error_log','/var/apache/ssl_request_log','/var/apache/request_log','/home/apache/access_log','/home/apache/error_log','/home/apache/ssl_access_log','/home/apache/ssl_error_log','/home/apache/ssl_request_log','/home/apache/request_log','/var/apache1/access_log','/var/apache1/error_log','/var/apache1/ssl_access_log','/var/apache1/ssl_error_log','/var/apache1/ssl_request_log','/var/apache1/request_log','/home/apache1/access_log','/home/apache1/error_log','/home/apache1/ssl_access_log','/home/apache1/ssl_error_log','/home/apache1/ssl_request_log','/home/apache1/request_log','/usr/apache1/error_log','/usr/apache1/ssl_access_log','/usr/apache1/ssl_error_log','/usr/apache1/ssl_request_log','/usr/apache1/request_log','/usr/local/apache1/error_log','/usr/local/apache1/ssl_access_log','/usr/local/apache1/ssl_error_log','/usr/local/apache1/ssl_request_log','/usr/local/apache1/request_log','/usr/apache2/error_log','/usr/apache2/ssl_access_log','/usr/apache2/ssl_error_log','/usr/apache2/ssl_request_log','/usr/apache2/request_log','/usr/local/apache2/error_log','/usr/local/apache2/ssl_access_log','/usr/local/apache2/ssl_error_log','/usr/local/apache2/ssl_request_log','/usr/local/apache2/request_log','/usr/apache/error_log','/usr/apache/ssl_access_log','/usr/apache/ssl_error_log','/usr/apache/ssl_request_log','/usr/apache/request_log','/usr/local/apache/error_log','/usr/local/apache/ssl_access_log','/usr/local/apache/ssl_error_log','/usr/local/apache/ssl_request_log','/usr/local/apache/request_log','/usr/local/httpd/access_log','/usr/local/httpd/ssl_access_log','/usr/local/httpd/error_log','/usr/local/httpd/ssl_error_log','/usr/local/httpd/ssl_request_log','/home/httpd/access_log','/home/httpd/ssl_access_log','/home/httpd/error_log','/home/httpd/ssl_error_log','/var/adm/SYSLOG','/var/adm/sulog','/var/adm/utmp','/var/adm/utmpx','/var/adm/wtmp','/var/adm/wtmpx','/var/adm/lastlog/username','/usr/spool/lp/log','/var/adm/lp/lpd-errs','/usr/lib/cron/log','/var/adm/loginlog','/var/adm/pacct','/var/adm/dtmp','/var/adm/acct/sum/loginlog','/var/adm/X0msgs','/var/adm/crash/vmcore','/var/adm/crash/unix','/var/adm/pacct','/var/adm/wtmp','/var/adm/dtmp','/var/adm/qacct','/var/adm/sulog','/var/adm/ras/errlog','/var/adm/ras/bootlog','/var/adm/cron/log','/etc/utmp','/etc/security/lastlog','/etc/security/failedlogin','/usr/spool/mqueue/syslog','/var/adm/messages','/var/adm/aculogs','/var/adm/aculog','/var/adm/sulog','/var/adm/vold.log','/var/adm/wtmp','/var/adm/wtmpx','/var/adm/utmp','/var/adm/utmpx','/var/adm/log/asppp.log','/var/log/syslog','/var/log/POPlog','/var/log/authlog','/var/log/auth1.log','/var/adm/pacct','/var/lp/logs/lpsched','/var/lp/logs/lpNet','/var/lp/logs/requests','/var/cron/log','/var/saf/_log','/var/saf/port/log','/var/adm/utmp','/var/log/utmp','/var/run/utmp','/var/adm/utmp','/var/run/utmp','/usr/var/adm/utmp','/var/adm/wtmp','/var/log/wtmp','/var/adm/wtmp','/var/run/wtmp','/usr/var/adm/wtmp','/var/adm/utmpx','/var/log/utmpx','/var/run/utmpx','/usr/var/adm/utmpx','/var/adm/wtmpx','/var/log/wtmpx','/var/run/wtmpx','/usr/var/adm/wtmpx','/var/adm/lastlog','/var/log/lastlog','/usr/var/adm/lastlog','/var/adm/pacct','/var/account/pacct','/var/log/acct','/var/log/pacct','/var/adm/acct','/var/adm/pacct','/var/account/acct','/var/log/prelude.log','/var/log/prelude/prelude.log','/var/adm/prelude/prelude.log','/var/adm/prelude/log/prelude.log','/var/adm/log/prelude.log','/var/ids/log/prelude.log','/var/ids/prelude/log/prelude.log','/var/ids/prelude.log','/var/prelude/prelude.log','/var/prelude/log/prelude.log','/usr/local/var/log/prelude.log','/var/log/prelude-xml.log','/var/log/prelude/prelude-xml.log','/var/adm/prelude/prelude-xml.log','/var/adm/prelude/log/prelude-xml.log','/var/adm/log/prelude-xml.log','/var/ids/log/prelude-xml.log','/var/ids/prelude/log/prelude-xml.log','/var/ids/prelude-xml.log','/var/prelude/prelude-xml.log','/var/prelude/log/prelude-xml.log','/usr/local/var/log/prelude-xml.log','/var/log/samba/log.smbd','/var/log/samba/log.nmbd','/var/log/log.smbd','/var/log/log.nmbd','/var/log/smb/log.smbd','/var/log/smb/log.nmbd','/var/log/snort/snort.alert','/var/log/snort.alert','/var/log/ids/snort.alert','/var/ids/snort/snort.alert','/var/ids/snort.alert','/var/snort/snort.alert','/usr/local/var/snort.alert','/usr/local/var/log/snort.alert','/var/log/apache2/audit_log','/var/log/apache1/audit_log','/var/log/apache/audit_log','/var/log/http/audit_log','/var/log/httpd/audit_log','/var/www/log/audit_log','/var/http/log/audit_log','/var/httpd/log/audit_log','/var/apache/log/audit_log','/var/apache2/log/audit_log','/var/apache1/log/audit_log','/var/log/apache2/access_log','/var/log/apache2/access_log.1','/var/log/apache2/access_log.2','/var/log/apache2/error_log','/var/log/apache2/error_log.1','/var/log/apache2/error_log.2','/var/log/apache2/ssl_access_log','/var/log/apache2/ssl_access_log.1','/var/log/apache2/ssl_access_log.2','/var/log/apache2/ssl_error_log','/var/log/apache2/ssl_request_log','/var/log/apache2/request_log','/var/log/apache/access_log','/var/log/apache/access_log.1','/var/log/apache/access_log.2','/var/log/apache/error_log','/var/log/apache/error_log.1','/var/log/apache/error_log.2','/var/log/apache/ssl_access_log','/var/log/apache/ssl_error_log','/var/log/apache/ssl_request_log','/var/log/apache/request_log','/var/log/apache1/access_log','/var/log/apache1/error_log','/var/log/apache1/ssl_access_log','/var/log/apache1/ssl_error_log','/var/log/apache1/ssl_request_log','/var/log/apache1/request_log','/var/www/log/access_log','/var/www/log/error_log','/var/www/log/ssl_access_log','/var/www/log/ssl_error_log','/var/www/log/ssl_request_log','/var/www/log/request_log','/var/apache2/access_log','/var/apache2/error_log','/var/apache2/ssl_access_log','/var/apache2/ssl_error_log','/var/apache2/ssl_request_log','/var/apache2/request_log','/var/web/log/access_log','/var/web/log/error_log','/var/web/log/ssl_access_log','/var/web/log/ssl_error_log','/var/web/log/ssl_request_log','/var/web/log/request_log','/var/apache/access_log','/var/apache/error_log','/var/apache/ssl_access_log','/var/apache/ssl_error_log','/var/apache/ssl_request_log','/var/apache/request_log','/var/apache1/access_log','/var/apache1/error_log','/var/apache1/ssl_access_log','/var/apache1/ssl_error_log','/var/apache1/ssl_request_log','/var/apache1/request_log','/var/log','/var/adm','/var/spool/mqueue','/var/mail','/var/log/emerge.log','/var/log/Xorg.0.log','/root/.bash_history','/root/.bash_logout','/usr/local/apache/logs','/usr/local/apache/log','/var/apache/logs','/var/apache/log','/var/run/utmp','/var/logs','/var/log','/var/adm','/etc/wtmp','/etc/utmp','/var/log/lastlog','/var/log/syslog','/var/log/messages','/var/log/httpd/access_log','/var/log/httpd/access.log','/var/log/httpd/error_log','/var/log/httpd/error.log','/var/log/apache2/access_log','/var/log/apache2/access.log','/var/log/apache2/error.log','/var/log/apache2/error_log','/var/log/wtmp','/var/log/secure','/var/log/xferlog','/var/log/auth.log','/var/log/lighttpd/lighttpd.error.log','/var/log/lighttpd/lighttpd.access.log','/var/run/utmp','/var/www/logs/access_log','/var/www/logs/access.log','/var/www/logs/error_log','/var/www/logs/error.log','/var/log/apache/access_log','/var/log/apache/access.log','/var/log/apache/error_log','/var/log/apache/error.log','/var/log/yum.log','/etc/httpd/logs/access_log','/etc/httpd/logs/access.log','/etc/httpd/logs/error_log','/etc/httpd/logs/error.log']
for x in possible_logs_list:
if os.path.isfile(x) == True:
detected_logs.append(x)
clean_detected_logs = "shred -vfzu " + x + " > /dev/null 2>&1 && touch " + x + " > /dev/null 2>&1"
os.system(clean_detected_logs)
END
info "$notification_7"
command &&
for logs in `find / -name "*.log"`; do
shred -vfzu $logs
touch $logs
done &> /dev/null
shred -vfzu Authentication.log Log.log Test Tests.log &> /dev/null
# Anti-Cold Boot Attack
info "$notification_8"
swapoff -a
swapon -a
echo 1024 >/proc/sys/vm/min_free_kbytes
echo 3 >/proc/sys/vm/drop_caches
echo 1 >/proc/sys/vm/oom_kill_allocating_task
echo 1 >/proc/sys/vm/overcommit_memory
echo 0 >/proc/sys/vm/oom_dump_tasks
# hostname change
info "$notification_9"
array[0]="Windows10-Enterprise "
array[1]="Windows10-Pro"
array[2]="Windows10-Enterprise-LTSC "
array[3]="Windows8.1O-EM"
array[4]="Windows8-Enterprise"
array[5]="Windows8.1-Pro"
array[6]="Windows7-Professional"
array[7]="Windows7-Enterprise"
array[8]="Windows7-Ultimate"
array[9]="Windows-Vista-Business"
array[10]="WindowsXP-Professional"
array[11]="macOS11"
array[12]="OSX10.11"
array[13]="MacBook-Air"
array[14]="MacBook"
array[15]="MacBook-Pro"
size=${#array[@]}
index=$(($RANDOM % $size))
echo "127.0.0.1 localhost ${array[$index]}
::1 localhost ip6-localhost ip6-loopback
fe00::0 ip6-localnet
ff00::0 ip6-mcastprefix
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters" > /etc/hosts
echo "${array[$index]}" > /etc/hostname
# configure nameservers
info "$notification_10"
cat >"/etc/resolv.conf" <<EOF
# generated by whoami
nameserver 84.200.69.80
nameserver 84.200.70.40
nameserver 91.239.100.100
nameserver 89.233.43.71
nameserver 208.67.222.222
nameserver 208.67.220.220
EOF
# check virtual machine and change mac address
info "$notification_11"
IFACES=$(ip -o link show | awk -F': ' '{print $2}')
changer_func(){
while :
do
command &&
RAND_MAC() {
gen() {
NUM="$(tr -dc '0-9a-f' </dev/urandom | head -c 2)"
echo -n "$NUM:"
}
for c in {1..6}; do
if [ "$c" -lt "6" ]; then
gen
else
gen | tr -d ':'
fi
done
}
out=$(RAND_MAC)
ip link set $IFACE down
if ip link set $IFACE address $out ; then
ip link set $IFACE up
break
fi
done
}
if [ "$(dmidecode -s system-manufacturer)" == "innotek GmbH" ] || [ "$(dmidecode -s system-manufacturer)" == "VMware, Inc." ] &>/dev/null; then
if nmcli dev | grep wifi &>/dev/null; then
for IFACE in $IFACES; do
if [ $IFACE != "lo" ] && [ $IFACE != "eth0" ]; then
channger_func
fi
done
else
warn "$notification_12"
fi
else
for IFACE in $IFACES; do
if [ $IFACE != "lo" ] ; then
changer_func
fi
done
fi
# check and configure browser anonymity settings
info "$notification_13"
if [ ! -d /etc/firefox-esr ]; then
warn "$notification_14"
else
cat >"/etc/firefox-esr/whoami.js" <<EOF
pref("privacy.firstparty.isolate", true);
pref("privacy.resistFİngerprinting", true);
pref("privacy.trackingprotection.fingerprinting.enabled", true);
pref("privacy.trackingprotection.cryptomining.enabled", true);
pref("privacy.trackingprotection.enabled", true);
pref("browser.send_pings", false);
pref("browser.urlbar.spectulativeConnect.enabled", false);
EOF
fi
# configure timezone
info "$notification_15"
timedatectl set-timezone UTC &> /dev/null
# active anti-mitm in background
info "$notification_16"
anti_mitm() {
python3 <<END
from scapy.all import Ether, ARP, srp, sniff, conf, os, subprocess
def get_mac(ip):
p = Ether(dst='ff:ff:ff:ff:ff:ff')/ARP(pdst=ip)
result = srp(p, timeout=3, verbose=False)[0]
return result[0][1].hwsrc
def process(packet):
if packet.haslayer(ARP):
if packet[ARP].op == 2:
try:
real_mac = get_mac(packet[ARP].psrc)
response_mac = packet[ARP].hwsrc
if real_mac != response_mac:
os.system("iptables -A INPUT -m mac --mac-source " + response_mac + " -j DROP")
except IndexError:
pass
sniff(store=False, prn=process)
END
}
anti_mitm &
# configuring transparent proxy for tor
info "$notification_17"
readonly tor_uid="$(id -u debian-tor)"
iptables -F
iptables -X
iptables -t nat -F
iptables -t nat -X
iptables -t nat -A OUTPUT -d 10.192.0.0/10 -p tcp -m tcp --tcp-flags FIN,SYN,RST,ACK SYN -j REDIRECT --to-ports 9040
iptables -t nat -A OUTPUT -d 127.0.0.1/32 -p udp -m udp --dport 53 -j REDIRECT --to-ports 5353
iptables -t nat -A OUTPUT -m owner --uid-owner $tor_uid -j RETURN
iptables -t nat -A OUTPUT -o lo -j RETURN
for lan in 127.0.0.0/8 10.0.0.0/8 172.16.0.0/12 192.168.0.0/16; do
iptables -t nat -A OUTPUT -d $lan -j RETURN
done
iptables -t nat -A OUTPUT -p tcp -m tcp --tcp-flags FIN,SYN,RST,ACK SYN -j REDIRECT --to-ports 9040
iptables -A INPUT -m state --state ESTABLISHED -j ACCEPT
iptables -A INPUT -i lo -j ACCEPT
iptables -A INPUT -j DROP
iptables -A FORWARD -j DROP
iptables -A OUTPUT -m conntrack --ctstate INVALID -j DROP
iptables -A OUTPUT -m state --state INVALID -j DROP
iptables -A OUTPUT -m state --state ESTABLISHED -j ACCEPT
iptables -A OUTPUT -m owner --uid-owner $tor_uid -p tcp -m tcp --tcp-flags FIN,SYN,RST,ACK SYN -m state --state NEW -j ACCEPT
iptables -A OUTPUT -d 127.0.0.1/32 -o lo -j ACCEPT
iptables -A OUTPUT -d 127.0.0.1/32 -p tcp -m tcp --dport 9040 --tcp-flags FIN,SYN,RST,ACK SYN -j ACCEPT
iptables -A OUTPUT -j DROP
iptables -P INPUT DROP
iptables -P FORWARD DROP
iptables -P OUTPUT DROP
cat >"/etc/tor/torrc" <<EOF
VirtualAddrNetworkIPv4 10.192.0.0/10
AutomapHostsOnResolve 1
TransPort 9040 IsolateClientAddr IsolateClientProtocol IsolateDestAddr IsolateDestPort
SocksPort 9050
DNSPort 5353
EOF
cat >"/etc/resolv.conf" <<EOF
# This file was edited by Whoami. Do not change manually!
nameserver 127.0.0.1
EOF
systemctl --system daemon-reload
if systemctl is-active tor.service >/dev/null 2>&1; then
systemctl stop tor.service
fi
sysctl -w net.ipv6.conf.all.disable_ipv6=1 &> /dev/null
sysctl -w net.ipv6.conf.default.disable_ipv6=1 &> /dev/null
systemctl start tor.service &>/dev/null
# crash protection
info "$notification_18"
while :
do
sleep 5
if ! ping -c 2 ident.me &> /dev/null ; then
notify-send Whoami "Crash detected."
if [ ! -w /etc/resolv.conf ] ; then
chattr -i /etc/resolv.conf
elif [ ! -d /etc/resolv.conf ] ; then
touch /etc/resolv.conf
elif ! grep 127.0.0.1 /etc/resolv.conf ; then
echo "nameserver 127.0.0.1" > /etc/resolv.conf
elif ! systemctl is-active tor &> /dev/null ; then
systemctl start tor
fi
fi
done &
msg "$notification_19"
}
stop() {
# detect language and check whoami status
if [ -e .English.txt ]; then
English
elif [ -e .Thai.txt ]; then
Thai
else
err "$notification_20" && exit 1
fi
# restore all settings
info "$notification_21"
restore_hostname=$(cat $BACKUPDIR/hostname.bak)
echo "127.0.0.1 localhost $restore_hostname
::1 localhost ip6-localhost ip6-loopback
fe00::0 ip6-localnet
ff00::0 ip6-mcastprefix
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters" > /etc/hosts
echo "$restore_hostname" > /etc/hostname
info "$notification_22"
rm -f /etc/tor/torrc /etc/resolv.conf
mv $BACKUPDIR/resolv.conf.bak /etc/resolv.conf
info "$notification_23"
for device in $(ls $MBACKUPDIR) ; do
ip link set $device down
ip link set $device address $(cat $MBACKUPDIR/$device)
ip link set $device up
done
info "$notification_24"
rm -fr /etc/firefox-esr/whoami.js
info "$notification_25"
restore_timezone=$(cat $BACKUPDIR/timezone.bak) && timedatectl set-timezone $restore_timezone
info "$notification_26"
killall python3
info "$notification_27"
mv $BACKUPDIR/torrc.bak /etc/tor/torrc
iptables -F
iptables -X
iptables -t nat -F
iptables -t nat -X
iptables -P INPUT ACCEPT
iptables -P FORWARD ACCEPT
iptables -P OUTPUT ACCEPT
systemctl stop tor.service
iptables-restore <$BACKUPDIR/iptables.rules.bak
sysctl -w net.ipv6.conf.all.disable_ipv6=0 &> /dev/null
sysctl -w net.ipv6.conf.default.disable_ipv6=0 &> /dev/null
rm -fr $BACKUPDIR/
rm -fr $MBACKUPDIR/
rm -fr .Thai.txt || rm -fr .English.txt
msg "$notification_28"
}
status() {
banner
RADDR=$(curl -s ip-api.com | sed 's/\"//g;s/\,//g;s/{//g;s/}//g')
TORSTATUS=$(systemctl is-active tor)
if [[ "${TORSTATUS}" == "active" ]]; then
msg "${TORSTATUS} (everything is OK)"
else
warn "${TORSTATUS} (dead)"
fi
echo "$RADDR"
}
help() {
banner
echo " --start : After choosing the language, it will make backups and start the program.
--stop : Closes the program using a backup.
--status : Provides information about IP address and working status.
--help : This shows the menu."
}
main() {
banner
if [[ "$#" -eq 0 ]]; then
warn "Anonymouz: Argument required"
info "Run' anonymouz --help' for more information."
exit 1
fi
while [[ "$#" -gt 0 ]]; do
# run with a root privilege
if [ $(id -u) -ne 0 ]; then
sudo bash anonymouz "$1" && exit 1
else
sleep 0.1
fi
case "$1" in
--start)
start 2> /dev/null && exit 1
;;
--stop)
stop 2> /dev/null && exit 1
;;
--status)
status 2> /dev/null && exit 1
;;
--help)
help
exit 1
;;
-- | -* | *)
warn "Anonymouz: Invalid option '$1'"
info "Run 'anonymouz --help' parameter for more information."
exit 1
;;
esac
shift
done
}
# call main
main "${@}"
# EOF