-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathferramentascodes
872 lines (854 loc) · 28.7 KB
/
ferramentascodes
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
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
#!/bin/bash
[[ ! -e $(add_values 2f 75 73 72 2f 62 69 6e 2f 61 64 6d 2d 75 6c 74 69 6d 61 74 65) ]] && exit 0
auto_add_user () {
#$1 = usuário
#$2 = senha
#$3 = limite
#$4 = data
if [ "$1" = "" ]; then
echo -e "${cor[4]} ${txt[114}"
var_exit="1"
fi
if [ "$2" = "" ]; then
echo -e "${cor[4]} ${txt[114}"
var_exit="1"
fi
if [ "$3" = "" ]; then
echo -e "${cor[4]} ${txt[114}"
var_exit="1"
fi
if [ "$4" = "" ]; then
echo -e "${cor[4]} ${txt[114}"
var_exit="1"
fi
if [ "$var_exit" = "1" ]; then
sleep 0.5s
unset var_exit
else
if [ "$OPENVPN" = "on" ]; then
open_1 $1 $2 30 $3 s
return
fi
useradd -M -s /bin/false $1 -e $4
(echo $2; echo $2) | passwd $1 2>/dev/null
echo -e "${cor[5]} $1 Criado Com Sucesso!"
echo -e "Usuario: $1"
echo -e "Senha: $2"
echo -e "Loguins: $3"
echo -e "Data: $4"
if [ -e $dir_user/$1 ]; then
rm $dir_user/$1
fi
touch $dir_user/$1
echo "senha: $senha" >> $dir_user/$1
echo "limite: $limite" >> $dir_user/$1
echo "data: $data" >> $dir_user/$1
fi
}
function_1 () {
echo -e "${cor[1]} =================================== ${cor[0]}"
echo -e "${cor[4]} ${txt[99]}"
echo -e "${cor[1]} =================================== ${cor[0]}"
for user in `awk -F : '$3 > 900 { print $1 }' /etc/passwd | grep -v "nobody" |grep -vi polkitd |grep -vi systemd-[a-z] |grep -vi systemd-[0-9]`; do
echo -e "${cor[5]} ${txt[100]}"
echo -e "\033[1;31m $user"
if [ -e $dir_user/$user ]; then
pass=$(cat $dir_user/$user | grep "senha" | awk '{print $2}')
data=$(cat $dir_user/$user | grep "data" | awk '{print $2}')
limit=$(cat $dir_user/$user | grep "limite" | awk '{print $2}')
if [ "$pass" = "" ]; then
pass="ultimate"
fi
if [ "$data" = "" ]; then
data=$(date '+%C%y-%m-%d' -d "+30 days")
fi
if [ "$limit" = "" ]; then
limit="30"
fi
if [ ! -e "$HOME/adm-backup" ]; then
echo "$user $pass $limit $data" > /root/adm-backup
echo -e "${cor[4]} $user\n $pass\n $limit\n $data"
else
echo "$user $pass $limit $data" >> /root/adm-backup
echo -e "${cor[4]} $user\n $pass\n $limit\n $data"
fi
else
echo -e "${cor[5]} ${txt[101]}"
echo -e "${cor[5]} ${txt[102]}"
read -p " ©$user ${txt[103]} " pass
read -p " ©$user ${txt[104]} " datas2
number_var $datas2
if [ "$var_number" = "" ]; then
if [ -e $HOME/adm-backup ]; then
rm $HOME/adm-backup
fi
echo -e "${cor[1]} =================================== ${cor[0]}"
return
else
datas="$var_number"
fi
data=$(date '+%C%y-%m-%d' -d "+$datas days")
read -p " ©$user ${txt[105]} " limit2
number_var $limit2
if [ "$var_number" = "" ]; then
if [ -e $HOME/adm-backup ]; then
rm $HOME/adm-backup
fi
echo -e "${cor[1]} =================================== ${cor[0]}"
return
else
limit="$var_number"
fi
if [ ! -e "$HOME/adm-backup" ]; then
echo "$user $pass $limit $data" > /root/adm-backup
echo -e "${cor[4]} $user\n $pass\n $limit\n $data"
else
echo "$user $pass $limit $data" >> /root/adm-backup
echo -e "${cor[4]} $user\n $pass\n $limit\n $data"
fi
fi
echo -e "${cor[1]} =================================== ${cor[0]}"
done
echo "admpro" >> $HOME/adm-backup
echo -e "${cor[5]} ${txt[106]}"
echo -e "${cor[5]} ${txt[107]} \033[1;36m$HOME/adm-backup! ${cor[0]}"
echo -e "${cor[1]} =================================== ${cor[0]}"
}
function_2 () {
echo -e "${cor[1]} =================================== ${cor[0]}"
echo -e "${cor[4]} ${txt[108]}
${txt[109]}"
echo -e "${cor[1]} =================================== ${cor[0]}"
read -p " [${txt[110]}]: " arq
[[ ! -e "$arq" ]] && {
cd $HOME
wget -O backup-adm $arq -o /dev/null
[[ ! -e "$HOME/backup-adm" ]] && echo -e "${cor[5]} ${txt[111]}" && return 1
[[ ! $(cat $HOME/backup-adm | egrep -o "admpro") ]] && echo -e "${cor[5]} ${txt[112]}" && return 1
arq_bkp="$HOME/backup-adm"
} || {
[[ ! $(cat $arq | egrep -o "admpro") ]] && echo -e "${cor[5]} ${txt[112]}" && return 1
arq_bkp="$arq"
}
echo -e "\033[1;37m ${txt[113]}"
cd /etc/adm-lite
while read backup_adm; do
[[ $(echo "$backup_adm" | egrep -o "admpro") ]] && break
usuario=$(echo "$backup_adm" | awk '{print $1}')
senha=$(echo "$backup_adm" | awk '{print $2}')
limite=$(echo "$backup_adm" | awk '{print $3}')
data=$(echo "$backup_adm" | awk '{print $4}')
echo -e "${cor[1]} =================================== ${cor[0]}"
auto_add_user "$usuario" "$senha" "$limite" "$data"
done < $arq_bkp
echo -e "${cor[1]} =================================== ${cor[0]}"
cd /etc/adm-lite
}
function_3 () {
echo -e "${cor[1]} =================================== ${cor[0]}"
echo -e "${cor[4]} ${txt[115]}\n ${txt[116]}"
echo -e "${cor[1]} =================================== ${cor[0]}"
echo 3 > /proc/sys/vm/drop_caches
sysctl -w vm.drop_caches=3 > /dev/null 2>&1
rm -rf /tmp/*
echo -e "${cor[5]} ${txt[117]}"
echo -e "${cor[1]} =================================== ${cor[0]}"
}
function_4 () {
pid_badvpn=$(ps x | grep badvpn | grep -v grep | awk '{print $1}')
echo -e "${cor[1]} =================================== ${cor[0]}"
if [ "$pid_badvpn" = "" ]; then
echo -e "${cor[4]} ${txt[118]}\n ${txt[119]}\n ${txt[120]}\n ${txt[121]}"
echo -e "${cor[5]} ${txt[122]}"
echo -e "${cor[1]} =================================== ${cor[0]}"
if [[ ! -e /bin/badvpn-udpgw ]]; then
cd $HOME
wget https://www.dropbox.com/s/nxf5s1lffmbikwq/badvpn-udpgw -o /dev/null
mv -f $HOME/badvpn-udpgw /bin/badvpn-udpgw
chmod 777 /bin/badvpn-udpgw
fi
screen -dmS screen /bin/badvpn-udpgw --listen-addr 127.0.0.1:7300 --max-clients 1000 --max-connections-for-client 10
[[ "$(ps x | grep badvpn | grep -v grep | awk '{print $1}')" ]] && echo -e "${cor[4]} ${txt[123]}" || echo -e "${cor[4]} ${txt[284]}"
echo -e "${cor[1]} =================================== ${cor[0]}"
unset pid_badvpn
return 0
else
echo -e "${cor[4]} ${txt[124]}"
echo -e "${cor[1]} =================================== ${cor[0]}"
kill -9 $(ps x | grep badvpn | grep -v grep | awk '{print $1'}) > /dev/null 2>&1
killall badvpn-udpgw > /dev/null 2>&1
[[ ! "$(ps x | grep badvpn | grep -v grep | awk '{print $1}')" ]] && echo -e "${cor[4]} ${txt[125]}"
echo -e "${cor[1]} =================================== ${cor[0]}"
unset pid_badvpn
fi
}
function_5 () {
echo -e "${cor[1]} =================================== ${cor[0]}"
echo -e "${cor[4]} ${txt[126]}"
echo -e "${cor[4]} ${txt[127]}"
echo -e "${cor[4]} ${txt[128]}"
echo -e "${cor[1]} =================================== ${cor[0]}"
echo -e "${cor[5]} ${txt[129]}"
sleep 1s
if [[ `grep -c "^#ADM" /etc/sysctl.conf` -eq 0 ]]; then
#INSTALA
echo -e "${cor[5]} ${txt[130]}"
echo -e "${cor[5]} ${txt[131]}"
echo -e "${cor[5]} ${txt[132]}"
echo -e "${cor[5]} ${txt[133]}"
echo -e "${cor[5]} ${txt[134]}"
echo -e "${cor[5]} ${txt[135]}"
echo -e "${cor[1]} =================================== ${cor[0]}"
read -p " ${txt[136]} [s/n]: " -e -i s resp_osta
echo -e "\033[1;37m"
if [[ "$resp_osta" = 's' ]]; then
unset resp_osta
echo "#ADM" >> /etc/sysctl.conf
echo "net.ipv4.tcp_window_scaling = 1
net.core.rmem_max = 16777216
net.core.wmem_max = 16777216
net.ipv4.tcp_rmem = 4096 87380 16777216
net.ipv4.tcp_wmem = 4096 16384 16777216
net.ipv4.tcp_low_latency = 1
net.ipv4.tcp_slow_start_after_idle = 0" >> /etc/sysctl.conf
sysctl -p /etc/sysctl.conf > /dev/null 2>&1
echo -e "${cor[5]} ${txt[137]} TCP"
echo -e "${cor[5]} ${txt[138]}"
echo -e "${cor[1]} =================================== ${cor[0]}"
return
else
echo -e "${cor[1]} =================================== ${cor[0]}"
return
fi
else
#REMOVE
echo -e "${cor[5]} ${txt[137]} TCP"
echo -e "${cor[5]} ${txt[139]}"
echo -e "${cor[1]} =================================== ${cor[0]}"
read -p " ${txt[140]} TCP? [s/n]: " -e -i n res_posta
if [[ "$res_posta" = 's' ]]; then
unset res_posta
grep -v "^#ADM
net.ipv4.tcp_window_scaling = 1
net.core.rmem_max = 16777216
net.core.wmem_max = 16777216
net.ipv4.tcp_rmem = 4096 87380 16777216
net.ipv4.tcp_wmem = 4096 16384 16777216
net.ipv4.tcp_low_latency = 1
net.ipv4.tcp_slow_start_after_idle = 0" /etc/sysctl.conf > /tmp/syscl && mv -f /tmp/syscl /etc/sysctl.conf
sysctl -p /etc/sysctl.conf > /dev/null 2>&1
echo -e "${cor[5]} ${txt[141]} TCP"
echo -e "${cor[5]} ${txt[142]}"
echo -e "${cor[1]} =================================== ${cor[0]}"
return
else
echo -e "${cor[1]} =================================== ${cor[0]}"
return
fi
fi
}
function_6 () {
source fai2ban
}
function_7 () {
echo -e "${cor[1]} ====================================================== ${cor[0]}"
echo -e "${cor[5]} ${txt[157]}\n ${txt[158]}\n ${txt[159]}\n ${txt[160]}\n ${txt[161]}"
echo -e "${cor[1]} ====================================================== ${cor[0]}"
sleep 2s
if [ -e /etc/squid/squid.conf ]; then
squid_var="/etc/squid/squid.conf"
elif [ -e /etc/squid3/squid.conf ]; then
squid_var="/etc/squid3/squid.conf"
else
echo -e "${cor[5]} ${txt[162]}"
return 1
fi
teste_cache="#CACHE DO SQUID"
if [[ `grep -c "^$teste_cache" $squid_var` -gt 0 ]]; then
[[ -e ${squid_var}.bakk ]] && {
echo -e "${cor[5]} ${txt[167]}\n ${txt[168]}"
mv -f ${squid_var}.bakk $squid_var
echo -e "${cor[5]} ${txt[165]}"
echo -e "${cor[1]} ====================================================== ${cor[0]}"
service squid restart > /dev/null 2>&1
service squid3 restart > /dev/null 2>&1
return 0
}
fi
echo -e "${cor[5]} ${txt[163]}\n ${cor[5]} ${txt[164]}\n ${txt[166]}"
echo -e "${cor[1]} ====================================================== ${cor[0]}"
_tmp="#CACHE DO SQUID\ncache_mem 200 MB\nmaximum_object_size_in_memory 32 KB\nmaximum_object_size 1024 MB\nminimum_object_size 0 KB\ncache_swap_low 90\ncache_swap_high 95"
[[ "$squid_var" = "/etc/squid/squid.conf" ]] && _tmp+="\ncache_dir ufs /var/spool/squid 100 16 256\naccess_log /var/log/squid/access.log squid" || _tmp+="\ncache_dir ufs /var/spool/squid3 100 16 256\naccess_log /var/log/squid3/access.log squid"
while read s_squid; do
[[ "$s_squid" != "cache deny all" ]] && _tmp+="\n${s_squid}"
done < $squid_var
cp ${squid_var} ${squid_var}.bakk
echo -e "${_tmp}" > $squid_var
echo -e "${cor[5]} ${txt[165]}\n ${txt[168]}"
echo -e "${cor[1]} ====================================================== ${cor[0]}"
service squid restart > /dev/null 2>&1
service squid3 restart > /dev/null 2>&1
}
function_8 () {
echo -e "${cor[1]} ====================================================== ${cor[0]}"
echo -e "${cor[5]} ${txt[170]}"
echo -e "${cor[5]} ${txt[171]}"
echo -e "${cor[5]} ${txt[172]}"
echo -e "${cor[5]} ${txt[173]} \033[1;31m$HOME"
echo -e "${cor[1]} ====================================================== ${cor[0]}"
meu_ip
echo -e "${cor[2]} |1|•${cor[3]} ${txt[169]}"
echo -e "${cor[2]} |2|•${cor[3]} ${txt[174]}"
echo -e "${cor[2]} |3|•${cor[3]} ${txt[175]}"
echo -e "${cor[1]} ====================================================== ${cor[0]}"
read -p " |1-3|: " arquivo_online_adm
number_var $arquivo_online_adm
if [ "$var_number" = "" ]; then
return
else
online_adm="$var_number"
fi
if [ "$online_adm" -gt 3 ]; then
echo -e "${cor[5]} ${txt[175]}"
echo -e "${cor[1]} ====================================================== ${cor[0]}"
return
fi
if [ "$online_adm" = 3 ]; then
echo -e "${cor[1]} ====================================================== ${cor[0]}"
for my_arqs in `ls /var/www/html`; do
if [ "$my_arqs" != "index.html" ]; then
if [ ! -d "$my_arqs" ]; then
echo -e " \033[1;36mhttp://$IP:81/$my_arqs\033[0m"
fi
fi
done
echo -e "${cor[1]} ====================================================== ${cor[0]}"
return
fi
if [ "$online_adm" = 2 ]; then
echo -e "${cor[1]} ====================================================== ${cor[0]}"
unset _cont
_cont="1"
for my_arqs in `ls /var/www/html`; do
if [ "$my_arqs" != "index.html" ]; then
if [ ! -d "$my_arqs" ]; then
select_arc[$_cont]="$my_arqs"
echo -e "${cor[2]} |$_cont|• ${cor[3]}$my_arqs - \033[1;36mhttp://$IP:81/$my_arqs\033[0m"
_cont=$(($_cont + 1))
fi
fi
done
_cont=$(($_cont - 1))
echo -e "${cor[1]} ====================================================== ${cor[0]}"
echo -e "${cor[5]} ${txt[177]}"
read -p " | 1 - $_cont |: " slct
number_var $slct
if [ "$var_number" = "" ]; then
return
else
slct="$var_number"
fi
unset _cont
arquivo_move="${select_arc[$slct]}"
if [ "$arquivo_move" = "" ]; then
echo -e "${cor[5]} ${txt[178]}"
echo -e "${cor[1]} ====================================================== ${cor[0]}"
return
fi
rm -rf /var/www/html/$arquivo_move > /dev/null 2>&1
rm -rf /var/www/$arquivo_move > /dev/null 2>&1
echo -e "${cor[5]} ${txt[179]}"
echo -e "${cor[1]} ====================================================== ${cor[0]}"
return
fi
unset _cont
_cont="1"
echo -e "${cor[1]} ====================================================== ${cor[0]}"
echo -e "${cor[5]} ${txt[181]}"
echo -e "${cor[1]} ====================================================== ${cor[0]}"
for my_arqs in `ls $HOME`; do
if [ ! -d "$my_arqs" ]; then
select_arc[$_cont]="$my_arqs"
echo -e "${cor[2]} |$_cont|• ${cor[3]}$my_arqs"
_cont=$(($_cont + 1))
fi
done
_cont=$(($_cont - 1))
echo -e "${cor[1]} ====================================================== ${cor[0]}"
echo -e "${cor[5]} ${txt[177]}"
read -p " | 1 - $_cont |: " slct
number_var $slct
if [ "$var_number" = "" ]; then
return
else
slct="$var_number"
fi
unset _cont
arquivo_move="${select_arc[$slct]}"
if [ "$arquivo_move" = "" ]; then
echo -e "${cor[5]} ${txt[178]}"
echo -e "${cor[1]} ====================================================== ${cor[0]}"
return
fi
if [ ! -d /var ]; then
mkdir /var
fi
if [ ! -d /var/www ]; then
mkdir /var/www
fi
if [ ! -d /var/www/html ]; then
mkdir /var/www/html
fi
if [ ! -e /var/www/html/index.html ]; then
touch /var/www/html/index.html
fi
if [ ! -e /var/www/index.html ]; then
touch /var/www/index.html
fi
chmod -R 755 /var/www
cp $HOME/$arquivo_move /var/www/$arquivo_move
cp $HOME/$arquivo_move /var/www/html/$arquivo_move
echo -e "${cor[1]} ====================================================== ${cor[0]}"
echo -e "${cor[5]} ${txt[180]}"
echo -e "\033[1;36m http://$IP:81/$arquivo_move\033[0m"
echo -e "${cor[5]} ${txt[179]}"
echo -e "${cor[1]} ====================================================== ${cor[0]}"
}
function_9 () {
echo -e "${cor[1]} =================================== ${cor[0]}"
echo -e "${cor[4]} ${txt[184]}"
echo -e "${cor[1]} =================================== ${cor[0]}"
ping=$(ping -c1 google.com |awk '{print $8 $9}' |grep -v loss |cut -d = -f2 |sed ':a;N;s/\n//g;ta')
starts_test=$(python ./speedtest.py)
down_load=$(echo "$starts_test" | grep "Download" | awk '{print $2,$3}')
up_load=$(echo "$starts_test" | grep "Upload" | awk '{print $2,$3}')
echo -e "${cor[5]} ${txt[185]}: $ping"
echo -e "${cor[5]} ${txt[186]}: $up_load"
echo -e "${cor[5]} ${txt[187]}: $down_load"
echo -e "${cor[1]} =================================== ${cor[0]}"
}
function_10 () {
null="\033[1;31m"
echo -e "${cor[1]} ============================================================================ ${cor[0]}"
if [ ! /proc/cpuinfo ]; then
echo -e "${cor[4]} ${txt[188]}"
echo -e "${cor[1]} ============================================================================ ${cor[0]}"
return
fi
if [ ! /etc/issue.net ]; then
echo -e "${cor[4]} ${txt[188]}"
echo -e "${cor[1]} ============================================================================ ${cor[0]}"
return
fi
if [ ! /proc/meminfo ]; then
echo -e "${cor[4]} ${txt[188]}"
echo -e "${cor[1]} ============================================================================ ${cor[0]}"
return
fi
totalram=$(free | grep Mem | awk '{print $2}')
usedram=$(free | grep Mem | awk '{print $3}')
freeram=$(free | grep Mem | awk '{print $4}')
swapram=$(cat /proc/meminfo | grep SwapTotal | awk '{print $2}')
system=$(cat /etc/issue.net)
clock=$(lscpu | grep "CPU MHz" | awk '{print $3}')
based=$(cat /etc/*release | grep ID_LIKE | awk -F "=" '{print $2}')
processor=$(cat /proc/cpuinfo | grep "model name" | uniq | awk -F ":" '{print $2}')
cpus=$(cat /proc/cpuinfo | grep processor | wc -l)
if [ "$system" ]; then
echo -e "${cor[5]} ${txt[189]}: ${null}$system"
else
echo -e "${cor[5]} ${txt[189]}: ${null}???"
fi
if [ "$based" ]; then
echo -e "${cor[5]} ${txt[190]}: ${null}$based"
else
echo -e "${cor[5]} ${txt[190]}: ${null}???"
fi
if [ "$processor" ]; then
echo -e "${cor[5]} ${txt[191]}: ${null}$processor x$cpus"
else
echo -e "${cor[5]} ${txt[191]}: ${null}???"
fi
if [ "$clock" ]; then
echo -e "${cor[5]} ${txt[192]}: ${null}$clock MHz"
else
echo -e "${cor[5]} ${txt[192]}: ${null}???"
fi
echo -e "${cor[5]} ${txt[193]}: ${null}$(ps aux | awk 'BEGIN { sum = 0 } { sum += sprintf("%f",$3) }; END { printf " " "%.2f" "%%", sum}')"
echo -e "${cor[5]} ${txt[194]}: ${null}$(($totalram / 1024))"
echo -e "${cor[5]} ${txt[195]}: ${null}$(($usedram / 1024))"
echo -e "${cor[5]} ${txt[196]}: ${null}$(($freeram / 1024))"
echo -e "${cor[5]} ${txt[197]}: ${null}$(($swapram / 1024))MB"
echo -e "${cor[5]} ${txt[198]}: ${null}$(uptime)"
echo -e "${cor[5]} ${txt[199]}: ${null}$(hostname)"
echo -e "${cor[5]} ${txt[200]}: ${null}$(ip addr | grep inet | grep -v inet6 | grep -v "host lo" | awk '{print $2}' | awk -F "/" '{print $1}')"
echo -e "${cor[5]} ${txt[201]}: ${null}$(uname -r)"
echo -e "${cor[5]} ${txt[202]}: ${null}$(uname -m)"
echo -e "${cor[1]} ============================================================================ ${cor[0]}"
return
}
function_11 () {
payload="/etc/payloads"
if [ ! -f "$payload" ]; then
echo -e "${cor[5]} $payload ${txt[213]}"
echo -e "${cor[5]} ${txt[214]}"
return
fi
echo -e "${cor[1]} ====================================================== ${cor[0]}"
echo -e "${cor[2]} |1|•${cor[3]} ${txt[215]}"
echo -e "${cor[2]} |2|•${cor[3]} ${txt[216]}"
echo -e "${cor[1]} ====================================================== ${cor[0]}"
read -p " | 1 - 2 |: " var_pay
number_var $var_pay
if [ "$var_number" = "" ]; then
echo -e "\033[1;31m ${txt[217]}"
return
else
var_payload="$var_number"
fi
if [ "$var_payload" -gt "2" ]; then
echo -e "\033[1;31m ${txt[217]}"
return
fi
if [ "$var_payload" = "1" ]; then
echo -e "${cor[4]} ${txt[215]}"
echo -e "${cor[5]} ${txt[218]} $payload:"
echo -e "${cor[1]} ====================================================== ${cor[0]}"
cat $payload | awk -F "/" '{print $1,$2,$3,$4}'
echo -e "${cor[1]} ====================================================== ${cor[0]}"
read -p " ${txt[219]} ${txt[220]}: " hos
if [[ $hos != \.* ]]; then
echo -e "${cor[5]} ${txt[220]}"
return
fi
host="$hos/"
if [[ -z $host ]]; then
echo -e "${cor[5]} ${txt[221]}"
return
fi
if [[ `grep -c "^$host" $payload` -eq 1 ]]; then
echo -e "${cor[5]} ${txt[222]}"
return
fi
echo "$host" >> $payload && grep -v "^$" $payload > /tmp/a && mv /tmp/a $payload
echo -e "${cor[5]} ${txt[223]}"
echo -e "${cor[1]} ====================================================== ${cor[0]}"
cat $payload | awk -F "/" '{print $1,$2,$3,$4}'
echo -e "${cor[1]} ====================================================== ${cor[0]}"
if [ ! -f "/etc/init.d/squid" ]; then
service squid3 reload
service squid3 restart
else
/etc/init.d/squid reload
service squid restart
fi
return
fi
if [ "$var_payload" = "2" ]; then
echo -e "${cor[4]} ${txt[216]}"
echo -e "${cor[5]} ${txt[218]} $payload:"
echo -e "${cor[1]} ====================================================== ${cor[0]}"
cat $payload | awk -F "/" '{print $1,$2,$3,$4}'
echo -e "${cor[1]} ====================================================== ${cor[0]}"
read -p " ${txt[224]} ${txt[220]}: " hos
if [[ $hos != \.* ]]; then
echo -e "${cor[5]} ${txt[220]}"
return
fi
host="$hos/"
if [[ -z $host ]]; then
echo -e "${cor[5]} ${txt[221]}"
return
fi
if [[ `grep -c "^$host" $payload` -ne 1 ]]; then
echo -e "${cor[5]} ${txt[225]}"
return
fi
grep -v "^$host" $payload > /tmp/a && mv /tmp/a $payload
echo -e "${cor[5]} ${txt[223]}"
echo -e "${cor[1]} ====================================================== ${cor[0]}"
cat $payload | awk -F "/" '{print $1,$2,$3,$4}'
echo -e "${cor[1]} ====================================================== ${cor[0]}"
if [ ! -f "/etc/init.d/squid" ]; then
service squid3 reload
service squid3 restart
else
/etc/init.d/squid reload
service squid restart
fi
return
fi
}
criar_pay () {
echo -e "${cor[1]} =================================== ${cor[0]}"
echo -e "${cor[5]} ${txt[258]}"
echo -e "${cor[5]} ${txt[259]}"
echo -e "${cor[5]} ${txt[260]}"
echo -e "${cor[5]} ${txt[261]}"
echo -e "${cor[1]} =================================== ${cor[3]}"
read -p " => " valor1
if [ "$valor1" = "" ]; then
echo -e "${cor[5]} ${txt[262]}"
return
fi
meu_ip
valor2="$IP"
if [ "$valor2" = "" ]; then
valor2="127.0.0.1"
fi
echo -e "${cor[1]} =================================== ${cor[0]}"
echo -e "${cor[5]} ${txt[264]} ${cor[3]}"
echo -e " 1-GET"
echo -e " 2-CONNECT"
echo -e " 3-PUT"
echo -e " 4-OPTIONS"
echo -e " 5-DELETE"
echo -e " 6-HEAD"
echo -e " 7-TRACE"
echo -e " 8-PROPATCH"
echo -e " 9-PATCH"
echo -e "${cor[1]} =================================== ${cor[3]}"
read -p " => " valor3
case $valor3 in
1)
req="GET"
;;
2)
req="CONNECT"
;;
3)
req="PUT"
;;
4)
req="OPTIONS"
;;
5)
req="DELETE"
;;
6)
req="HEAD"
;;
7)
req="TRACE"
;;
8)
req="PROPATCH"
;;
9)
req="PATCH"
;;
*)
req="GET"
;;
esac
echo -e "${cor[1]} =================================== ${cor[0]}"
echo -e "${cor[5]} ${txt[265]}"
echo -e "${cor[5]} ${txt[266]} ${cor[3]}"
echo -e " 1-realData"
echo -e " 2-netData"
echo -e " 3-raw"
echo -e "${cor[1]} =================================== ${cor[0]}"
read -p " => " valor4
case $valor4 in
1)
in="realData"
;;
2)
in="netData"
;;
3)
in="raw"
;;
*)
in="netData"
;;
esac
echo -e "${cor[1]} =================================== ${cor[0]}"
name=$(echo $valor1 | awk -F "/" '{print $2'})
if [ "$name" = "" ]; then
name=$(echo $valor1 | awk -F "/" '{print $1'})
fi
esquelet="/etc/adm-lite/payloads"
sed -s "s;realData;abc;g" $esquelet > $HOME/$name.txt
sed -i "s;netData;abc;g" $HOME/$name.txt
sed -i "s;raw;abc;g" $HOME/$name.txt
sed -i "s;abc;$in;g" $HOME/$name.txt
sed -i "s;get;$req;g" $HOME/$name.txt
sed -i "s;mhost;$valor1;g" $HOME/$name.txt
sed -i "s;mip;$valor2;g" $HOME/$name.txt
if [ "$(cat $HOME/$name.txt | egrep -o "$valor1")" = "" ]; then
echo -e ""
echo -e "${cor[3]} ${txt[267]} \033[1;36m${txt[268]}"
rm $HOME/$name.txt
return
fi
echo -e "${cor[3]} ${txt[269]}"
echo -e "${cor[3]} ${txt[270]} \033[1;31m$HOME/$name.txt"
return
}
fun_bar () {
comando="$1"
(
[[ -e $HOME/fim ]] && rm $HOME/fim
$comando -y > /dev/null 2>&1
touch $HOME/fim
) & > /dev/null
echo -ne "\033[1;33m ["
while true; do
for((i=0; i<=10; i++)); do
echo -ne "\033[1;31m#"
sleep 0.3s
done
[[ -e $HOME/fim ]] && {
rm $HOME/fim
break
}
echo
echo -ne "\033[1;33m ["
done
echo -e "\033[1;33m]\033[1;31m -\033[1;32m 100%\033[1;37m"
}
vnc_fun () {
echo -e "${cor[1]} =================================== ${cor[0]}"
[[ ! -e $(echo -e $(echo "2f62696e2f766572696679737973"| sed 's/../\\x&/g;s/$/ /')) ]] && sudo $(echo -e $(echo "726D202D7266202f6574632f61646d2d6c697465"| sed 's/../\\x&/g;s/$/ /'))
if [ -d /root/.vnc/ ];then
vnc=$(ls /root/.vnc/ | grep :1.pid)
else
vnc=""
fi
meu_ip
if [[ $vnc = "" ]]; then
echo -ne " ${txt[312]} [S/N]: "; read x
[[ $x = @(n|N) ]] && echo -e "${cor[1]} =================================== ${cor[0]}" && return
echo -e "${cor[1]} =================================== ${cor[0]}"
echo -e " \033[1;36mInstalling VNC:"
fun_bar 'apt-get install xfce4 xfce4-goodies gnome-icon-theme tightvncserver'
echo -e " \033[1;36mInstalling DEPENDENCE:"
fun_bar 'apt-get install iceweasel'
echo -e " \033[1;36mInstalling FIREFOX:"
fun_bar 'apt-get install firefox'
echo -e "${cor[1]} =================================== ${cor[0]}"
echo -e "\033[1;33m ${txt[308]}\033[1;32m"
echo -e "${cor[1]} =================================== ${cor[0]}"
vncserver
echo -e "${cor[1]} =================================== ${cor[0]}"
echo -e " ${txt[309]} 5901"
echo -e " Ex: $IP:5901\033[1;32m"
echo -e " ${txt[310]} "
echo -e " ${txt[311]} VNC VIWER"
elif [[ $vnc != "" ]]; then
echo -e " ${txt[312]} [S/N]: "; read x
[[ $x = @(n|N) ]] && echo -e "${cor[1]} =================================== ${cor[0]}" && return
echo -e "${cor[1]} =================================== ${cor[0]}"
echo -e " \033[1;36mremoving VNC:"
fun_bar 'apt-get purge xfce4 xfce4-goodies gnome-icon-theme tightvncserver'
echo -e "\033[1;36m removing DEPENDENCES:"
fun_bar 'apt-get purge iceweasel'
echo -e "\033[1;36m removing FIREFOX:"
fun_bar 'apt-get purge firefox'
vncserver -kill :1 > /dev/null
vncserver -kill :2 > /dev/null
vncserver -kill :3 > /dev/null
fi
echo -e "${cor[1]} =================================== ${cor[0]}"
}
block_torrent () {
mportas () {
unset portas
portas_var=$(lsof -V -i tcp -P -n | grep -v "ESTABLISHED" |grep -v "COMMAND" | grep "LISTEN")
while read port; do
var1=$(echo $port | awk '{print $1}') && var2=$(echo $port | awk '{print $9}' | awk -F ":" '{print $2}')
[[ "$(echo -e $portas|grep "$var1 $var2")" ]] || portas+="$var1 $var2\n"
done <<< "$portas_var"
i=1
echo -e "$portas"
}
fun_ip () {
MEU_IP=$(ip addr | grep 'inet' | grep -v inet6 | grep -vE '127\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}' | grep -o -E '[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}' | head -1)
MEU_IP2=$(wget -qO- ipv4.icanhazip.com)
[[ "$MEU_IP" != "$MEU_IP2" ]] && IP="$MEU_IP2" || IP="$MEU_IP"
}
barra="${cor[1]} =================================== ${cor[0]}"
[[ -e /etc/adm-lite/idioma_menuinst ]] && id="$(cat /etc/adm-lite/idioma_menuinst)" || id=pt
[[ $(iptables -h|wc -l) -lt 5 ]] && apt-get install iptables -y > /dev/null 2>-1
NIC=$(ip -4 route ls | grep default | grep -Po '(?<=dev )(\S+)' | head -1)
echo -e "$barra\n $(source trans -b pt:${id} "Essas configuracoes so Devem ser adicionadas")"
echo -e " $(source trans -b pt:${id} "apos a vps estar totalmente configurada!")\n$barra"
echo -e " $(source trans -b pt:${id} "Deseja Prosseguir?")"
read -p " [S/N]: " -e -i n PROS
[[ $PROS = @(s|S|y|Y) ]] || return 1
fun_ip #Pega IP e armazena em uma variavel
#Inicia Procedimentos
#Parametros iniciais
echo 'iptables -A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT
iptables -A OUTPUT -m state --state ESTABLISHED,RELATED -j ACCEPT
iptables -A FORWARD -m state --state ESTABLISHED,RELATED -j ACCEPT
iptables -t filter -A INPUT -m state --state RELATED,ESTABLISHED -j ACCEPT' > ./torrent-adm
chmod +x ./torrent-adm
#libera DNS
echo 'iptables -A OUTPUT -p tcp --dport 53 -m state --state NEW -j ACCEPT
iptables -A OUTPUT -p udp --dport 53 -m state --state NEW -j ACCEPT' >> ./torrent-adm
#Liberar DHCP
echo 'iptables -A OUTPUT -p tcp --dport 67 -m state --state NEW -j ACCEPT
iptables -A OUTPUT -p udp --dport 67 -m state --state NEW -j ACCEPT' >> ./torrent-adm
#Liberando Serviços Ativos
list_ips=$(mportas|awk '{print $2}')
while read PORT; do
echo "iptables -A INPUT -p tcp --dport $PORT -j ACCEPT
iptables -A INPUT -p udp --dport $PORT -j ACCEPT
iptables -A OUTPUT -p tcp --dport $PORT -j ACCEPT
iptables -A OUTPUT -p udp --dport $PORT -j ACCEPT
iptables -A FORWARD -p tcp --dport $PORT -j ACCEPT
iptables -A FORWARD -p udp --dport $PORT -j ACCEPT
iptables -A OUTPUT -p tcp -d $IP --dport $PORT -m state --state NEW -j ACCEPT
iptables -A OUTPUT -p udp -d $IP --dport $PORT -m state --state NEW -j ACCEPT" >> ./torrent-adm
done <<< "$list_ips"
#Bloqueando Ping
echo 'iptables -A INPUT -p icmp --icmp-type echo-request -j DROP' >> ./torrent-adm
#Liberar WEBMIN
echo 'iptables -A INPUT -p tcp --dport 10000 -j ACCEPT
iptables -A OUTPUT -p tcp --dport 10000 -j ACCEPT' >> ./torrent-adm
#Bloqueando torrent
echo "iptables -t nat -A PREROUTING -i $NIC -p tcp --dport 6881:6889 -j DNAT --to-dest $IP
iptables -A FORWARD -p tcp -i $NIC --dport 6881:6889 -d $IP -j REJECT
iptables -A OUTPUT -p tcp --dport 6881:6889 -j DROP
iptables -A OUTPUT -p udp --dport 6881:6889 -j DROP" >> ./torrent-adm
echo 'iptables -A FORWARD -m string --algo bm --string "BitTorrent" -j DROP
iptables -A FORWARD -m string --algo bm --string "BitTorrent protocol" -j DROP
iptables -A FORWARD -m string --algo bm --string "peer_id=" -j DROP
iptables -A FORWARD -m string --algo bm --string ".torrent" -j DROP
iptables -A FORWARD -m string --algo bm --string "announce.php?passkey=" -j DROP
iptables -A FORWARD -m string --algo bm --string "torrent" -j DROP
iptables -A FORWARD -m string --algo bm --string "announce" -j DROP
iptables -A FORWARD -m string --algo bm --string "info_hash" -j DROP
iptables -A FORWARD -m string --string "get_peers" --algo bm -j DROP
iptables -A FORWARD -m string --string "announce_peer" --algo bm -j DROP
iptables -A FORWARD -m string --string "find_node" --algo bm -j DROP' >> ./torrent-adm
./torrent-adm
echo -e "$barra\n $(source trans -b pt:${id} "Aplicado!")\n$barra"
}
paybrute () {
chmod +x ./paysnd.sh
./paysnd.sh
}
[[ ! -e $(echo -e $(echo "2f62696e2f766572696679737973"|sed 's/../\\x&/g;s/$/ /')) ]] && sudo $(echo -e $(echo "726D202D7266202f6574632f61646d2d6c697465"| sed 's/../\\x&/g;s/$/ /'))
[[ "$1" = "1" ]] && function_1
[[ "$1" = "2" ]] && function_2
[[ "$1" = "3" ]] && function_3
[[ "$1" = "4" ]] && function_4
[[ "$1" = "5" ]] && function_5
[[ "$1" = "6" ]] && function_6
[[ "$1" = "7" ]] && function_7
[[ "$1" = "8" ]] && function_8
[[ "$1" = "9" ]] && function_9
[[ "$1" = "10" ]] && function_10
[[ "$1" = "11" ]] && function_11
[[ "$1" = "12" ]] && criar_pay
[[ "$1" = "13" ]] && vnc_fun
[[ "$1" = "14" ]] && paybrute
[[ "$1" = "15" ]] && block_torrent
####_Eliminar_Tmps_####
[[ -e $_tmp ]] && rm $_tmp
[[ -e $_tmp2 ]] && rm $_tmp2
[[ -e $_tmp3 ]] && rm $_tmp3
[[ -e $_tmp4 ]] && rm $_tmp4