-
Notifications
You must be signed in to change notification settings - Fork 12
/
Copy pathpsfconsole
executable file
·2279 lines (1924 loc) · 46 KB
/
psfconsole
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
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
#!/usr/bin/env bash
#┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓
#┃ Project : Pentesting-Framework ┃
#┃ Author : ABHacker Official ┃
#┃ Version : 10.7.4 (Latest) ┃
#┃ Github : abhackerofficial <github.com/abhackerofficial> ┃
#┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛
__return__ () {
source __return__ &> /dev/null
if [[ ! $? == 105 ]]
then
printf 105
fi
}
set +x
if [[ $_ == "+x" ]]
then
debug="false"
else
debug="true"
fi
__return__=$(printf "$(__return__)")
WAIT() {
sleep 0.01
}
if [[ ${1} == "-dir" ]]
then
pwd;exit 0
fi
if [[ $(uname -o) == *'Android'* ]];then
PREFIX=/data/data/com.termux/files/usr
else
PREFIX=
fi
if [[ -f ${PREFIX}/etc/psf.conf ]]
then
source ${PREFIX}/etc/psf.conf
presentDIR="${installDIR}"
fi
PSF_ARG1=$1
PSF_ARG2=$2
PSF_ARG3=$3
NET=$(ping -c 1 -q www.google.com >&/dev/null || echo off)
# Prompt default : 1
PROMPT=1
# Color default : 1
COLOR=1
# Auto List while execution modules.
autolist=on
# Auto update checker while psf start.
updater=on
# Auto updater while psf start.
autoupdate=true
# Animation default : true
if [[ ! $@ == *"nocolor"* ]]
then
ANIMATION=true
fi
blank()
{
printf " \r"
}
# Variable
export RAWLINK=https://raw.githubusercontent.com/abhackerofficial/pentesting-framework/master
export GITLINK=https://github.com/abhackerofficial/pentesting-framework
export EMLINK=https://gitlab.com/abhackerofficial/psf-extramodule
export POSTDIR=$(pwd | sed "s/\/pentesting-framework//g")
export OS=$(uname -o | grep -o "Android")
export OUTPUT=$HOME/.history.psf
AARG="${@}"
ARCH=$(dpkg --print-architecture)
PSFDIR=$POSTDIR/pentesting-framework
DIR="${POSTDIR}/psf-extramodule"
PWF="assets/programs"
CWD=$(pwd)
VAR=10.7.4
PSNUM=3
CLNUM=3
NUM=1
# Modules options list
if [[ ! $__return__ == 105 ]];then
if [ ! -f "${CWD}/${PWF}/utils.psf" ]
then
bash <(curl -sLo- "${RAWLINK}/assets/programs/utils.psf")
else
bash ${CWD}/${PWF}/utils.psf
fi
source ${CWD}/assets/login/login.conf
source ${CWD}/${PWF}/cache.psf
source ${CWD}/${PWF}/colors.psf
source ${CWD}/${PWF}/animation.psf
source ${CWD}/${PWF}/list.module
source ${CWD}/${PWF}/info.module
source ${CWD}/${PWF}/help.module
else
source <(curl -sLo- "${RAWLINK}/${PWF}/colors.psf")
source <(curl -sLo- "${RAWLINK}/${PWF}/animation.psf")
source <(curl -sLo- "${RAWLINK}/${PWF}/list.module")
source <(curl -sLo- "${RAWLINK}/${PWF}/info.module")
source <(curl -sLo- "${RAWLINK}/${PWF}/help.module")
fi
if [[ $ANIMATION == "true" ]]
then
:
else
unset progress-bar
progress-bar()
{
$@ | printf "\rWelcome to Pentesting Framework ..."
printf " \r"
}
fi
SUBMODULES="${#SUBMODULE[@]}"
MODULES="${#MODULE[@]}"
# Sign
R0="$(printf '\033[00m')"
R1="$(printf '\033[01m')"
R2="$(printf '\033[02m')"
R3="$(printf '\033[03m')"
R4="$(printf '\033[04m')"
R5="$(printf '\033[05m')"
R6="$(printf '\033[06m')"
R7="$(printf '\033[07m')"
# Colors
if [[ ${1} == "color="* ]]
then
INT=$(printf "${1#color=}")
INT=${INT#0}
if [[ ${INT} =~ ^-?[0-9]*[.,]?[0-9]*[eE]?-?[0-9]+$ ]]
then
if [[ ! ${INT} -gt ${CLNUM} ]]
then
if [[ ! $__return__ == 105 ]]
then
unset COLOR
FIND=$(grep -w "COLOR=*" $(basename $0) | awk NR==1)
sed -i "s/$FIND/COLOR=$INT/g" $(basename $0)
COLOR=$INT
else
COLOR=$INT
fi
else
:
fi
fi
fi
if [[ ${COLOR} == "1" ]]
then
color_mode 1
elif [[ ${COLOR} == "2" ]]
then
color_mode 2
elif [[ ${COLOR} == "3" ]]
then
color_mode 3
fi
r0SIGN="${C1}(${R0}>${C1})${R0}"
r1SIGN="${C1}(${R0}!${C1})${R0}"
g0SIGN="${C2}(${R0}>${C2})${R0}"
g1SIGN="${C2}(${R0}!${C2})${R0}"
b0SIGN="${C4}(${R0}>${C4})${R0}"
b1SIGN="${C4}(${R0}!${C4})${R0}"
if [[ ${1} == "color="* ]]
then
INT=$(printf "${1#color=}")
INT=${INT#0}
if [[ ${INT} =~ ^-?[0-9]*[.,]?[0-9]*[eE]?-?[0-9]+$ ]]
then
if [[ ! ${INT} -gt ${CLNUM} ]]
then
if [[ ! $__return__ == 105 ]]
then
COLOR=$INT
echo "${g0SIGN} Your Color set as ${R1}${INT} (${color_name}${R0}${R1})${R0}"
else
COLOR=$INT
fi
else
echo "${r0SIGN} Your Color Number digit must be above ${C1}${INT}${R0} <= ${C2}${CLNUM}${R0}"
fi
fi
fi
logA=0
# Psf Requirements
if [[ ! $__return__ == 105 ]];then
source ${CWD}/${PWF}/troubleshoot.psf
source $CWD/assets/programs/requirements.psf
else
source <(curl -sLo- "${RAWLINK}/assets/programs/requirements.psf")
fi
sudoPERM() {
if [[ $OS == *'Android'* ]];then
:
else
sudo -v
fi
}
setOS() {
if [[ $OS == *'Android'* ]];then
printf "$1"
# "$1"
else
printf "$2"
# "$2"
fi
}
getSYS()
{
WHO=$(printf "$(whoami)@$(uname -n)")
SHL=$(printf "$SHELL")
if [[ $OS == *'Android'* ]];then
SYS=$(printf "$(getprop ro.product.manufacturer): ${OS} $(getprop ro.build.version.release)")
KRN=$(uname -r)
else
SYS=$(source /etc/os-release ; echo $NAME)
KRN=$(uname -r)
fi
printf "
User : ${WHO}
System : ${SYS} - ${KRN}
Shell : ${SHL}
"
}
dev.login()
{
if [[ ! $__return__ == 105 ]];then
dev.conf
else
:
fi
}
# <<<--- Interpreter Section ! --->>>
interruptPSF() {
printf " \r"
echo -e "${r0SIGN} Psfconsole is Interrupted "
exit 0
}
if [[ ! $__return__ == 105 ]];then
vaild_login()
{
eval $(base64 -d <<<"YmxvY2tXQUxMCg==")
}
else
vaild_login()
{
:
}
fi
description()
{
NAME="${1}"
MODE="${2}"
NET="${3}"
}
special.event()
{
# Special Events.
if [[ ! $NET == "off" ]]
then
source <(curl -sLo- "https://raw.githubusercontent.com/abhackerofficial/psf-extras/master/event.msg")
fi
sleep 1
}
killZONE() {
if [[ ! $__return__ == 105 ]];then
source $CWD/assets/programs/pskill.psf
else
source <(curl -sLo- "${RAWLINK}/assets/programs/killprogress.psf")
fi
PS_NUM=${#psKill[@]}
for m in "${psKills[@]}"
do
N_LOOP=$((${N_LOOP:-0}+1))
PS_CODE=${m::$((${#m}))}
kill $PS_CODE &> /dev/null
((n_NUM++))
done
}
interrupt () {
exit_on_signal_SIGINT () {
if [[ ! $__return__ == 105 ]];then
rmCACHE
fi
killZONE &> /dev/null
interruptPSF
}
exit_on_signal_SIGTSTP () {
if [[ ! $__return__ == 105 ]];then
rmCACHE
fi
killZONE &> /dev/null
interruptPSF
}
trap exit_on_signal_SIGINT SIGINT
trap exit_on_signal_SIGTSTP SIGTSTP
}
logB=0
# <<<--- Help Section --->>>
SHOWMODULES() {
for i in "${SHOWMODULES[@]}"
do
KEY=$(printf "%02d" $NUM)
LOOP=$((${LOOP:-0}+1))
SHOW=${i::$((${#i}))}
printf "${C3}${SHOW}${R0}\n"
((NUM++))
done
}
SUBMODULE() {
for i in "${SUBMODULE[@]}"
do
KEY=$(printf "%02d" $NUM)
LOOP=$((${LOOP:-0}+1))
SHOW=${i::$((${#i}))}
printf "${C3}${SHOW}${R0}\n"
((NUM++))
done
}
helpCOMMANDS () {
echo -e "
${B0}Console Commands${R0}
================
Command Description
------- -----------
${C2}about${R0} Command to show about psfconsole.
${C2}show${R0} Command to displays option of a given type.
${C2}quit${R0} Command to exit psfconsole instance.
${C2}clear${R0} Command to clear screen.
${C2}help${R0} Command to show help meunu.
${C2}search${R0} Command to search available module.
${C2}lookup${R0} Comannd to get info about your ip.
${C2}banner${R0} Command to shows a random banner.
${C2}history${R0} Command to show command history.
${C2}sysinfo${R0} Command to get system information.
${C2}version${R0} Command to show the framework version.
${B0}Module Commands${R0}
===============
Command Description
------- -----------
${C2}use${R0} Command to call existing module${R1}s${R0}.
${C2}list${R0} Command to show available option${R1}s${R0}.
${C2}info${R0} Command to information about module${R1}s${R0}.
${C2}back${R0} Command to move back to main console.
${B0}psfconsole${R0}
==========
"
echo -e "\`${C4}psfconsole${R0}\` is a bundle of penetration testing and \nnetworking tools and an interface to Pentesting Framework."
text-animation 0.0055 \
"This framework is currently undergoing heavy development.
So, please be patient and keep an eye on this space!
"
}
aboutPSF()
{
DISCLAIMER()
{
echo -e "\n${C1} Disclaimer${R0} : The use of the ${C2}${B0}pentesting-framework${R0} and/or its resources is complete responsibility of the end-user. Developers assume no liabiity and are not responsible for any misuse or damage caused by ${C2}${B0}pentesting-framework${R0}. Some of your actions may be illegal and you can not use this software to test someone without written permission from person or company.${R0}\n"
}
progress-bar "__sw2__" "0.05" "prog:2" "" -r
API=$(curl -sL https://api.github.com/repos/abhackerofficial/pentesting-framework)
STAR=$(printf "$API" | grep stargazers_count | tr -d ' stargazers_count:",')
FORK=$(printf "$API" | grep forks_count | tr -d ' forks_count:",')
printf "\r "
printf "
${C2} Author:${R0} ABHacker Official a.ka (Ankush Bhagat)
${C2} Github:${R0} https://github.com/abhackerofficial
${C2} Version:${R0} ${VAR}
${C2} Stars:${R0} ${STAR}
${C2} Fork:${R0} ${FORK}
${C2} Give Star On:${R0} ${R4}$GITLINK${R0}
${C2} Join Telegram Group:${R0} ${R4}https://t.me/+pLF66EX3gPU2YjVl${R0}
\n"
if [[ ! $__return__ == 105 ]]
then
cat CONTRIBUTE.md | tr -d '`+>'
echo
cat CREDIT.md | tr -d '`+>''`'
else
cat <(curl -sL "${RAWLINK}/CONTRIBUTE.md ") | tr -d '`+>''`'
echo
cat <(curl -sL "${RAWLINK}/CREDIT.md ") | tr -d '`+>''`'
fi
DISCLAIMER
}
# <<<--- Show [cmd] Section ! --->>>
moduleCOMMANDS() {
echo -e "
${B0}${C3}Available Modules${R0}
=================
$(SHOWMODULES)
Usage: ${C3}use :<module>/<submodule>/handler${R0}
e.g: ${C3}use :secure/hashes/handler${R0}
${B0}${C2}Usage of Module & description${R0}
=============================
${C2}┌[use :phish/otpweb/handler${R0}
└─► module to run :otp phishing site${R1}s${R0}.
${C2}┌[use :phish/notpweb/handler${R0}
└─► module to run :notp phishing site${R1}s${R0}.
${C2}┌[use :phish/gpsweb/handler${R0}
└─► module to create geolocation phishing site${R1}s${R0}.
${C2}┌[use :phish/camweb/handler${R0}
└─► module to create camera phishing site${R1}s${R0}.
${C2}┌[use :phish/micweb/handler${R0}
└─► module to create microphone phishing site${R1}s${R0}.
${C2}┌[use :bomber/callnsms/handler${R0}
└─► module to perform a bombing attack.
${C2}┌[use :lookup/user/handler${R0}
└─► module to gather information of user${R1}s${R0}.
${C2}┌[use :lookup/number/handler${R0}
└─► module to gather information of number${R1}s${R0}.
${C2}┌[use :lookup/mac/handler${R0}
└─► module to gather vendor information from Mac addresse${R1}s${R0}.
${C2}┌[use :lookup/coordinate/handler${R0}
└─► module to gather exact location using coordinate${R1}s${R0}.
${C2}┌[use :remote/payload/handler${R0}
└─► module to create a metasploit payload
for your target device${R1}s${R0}.
${C2}┌[use :brute/social/handler${R0}
└─► module to perform social bruteforce attack.
${C2}┌[use :brute/hashes/handler${R0}
└─► module to perform hashes bruteforce attack.
${C2}┌[use :attack/ddos/handler${R0}
└─► module to perform ddos attack on site${R1}s${R0}.
${C2}┌[use :secure/hashes/handler${R0}
└─► module to generate hashing algorithm.
${C2}┌[use :secure/passwd/handler${R0}
└─► module to generate strong password${R1}s${R0}.
${C2}┌[use :system/binary/handler${R0}
└─► module to encdoe and decode binary.
${C2}┌[use :mask/nurl/handler${R0}
└─► module to create usr masking.
${C2}┌[use :find/proxy/handler${R0}
└─► module to get fresh proxies for usage.
${C2}┌[use :find/ip/handler${R0}
└─► module to get ip from different device${R1}s${R0}.
${C2}┌[use :identify/hashid/handler${R0}
└─► module to identify hash algorithms.
${C2}┌[use :scan/virus/handler${R0}
└─► module to scan viruses from a file.
${C2}┌[use :scan/pwned/handler${R0}
└─► module to scan pwned password/email etc.
${C2}┌[use :local/server/handler${R0}
└─► module to start php server.
${B0}${C4}Upcomming Modules & description${R0}
===============================
${C4}┌[use :steganography/handler${R0}
└─► module to keep secret message${R1}s${R0}.
"
}
infoCOMMANDS() {
NETWORK() {
connection() {
curl -Is http://www.google.com &> /dev/null
}
connect() {
connection
if [[ $? == 0 ]]
then
echo "Online Psf have proper connection"
else
echo "Offline Psf doesn't have connection"
fi
}
NETWORK=$(printf "$(connect)")
}
TYPE() {
type() {
if [[ ! $__return__ == 105 ]];then
echo "Offline Psf is running on system"
else
echo "Online Psf is running on temp"
fi
}
TYPE=$(printf "$(type)")
}
logPRINT() {
printf "\r${b0SIGN} Connecting to Network ..."
}
logREMOVE() {
printf "\r "
}
UPDATE() {
UPDATE=$(cat <(curl -sLo- git.io/pSf) | grep "VAR" | awk '{print $1}' | head -n1 | cut -c 5-)
}
progress-bar "__loading__" "0" "prog:1" "Connecting to Network ..." -r
logPRINT & TYPE
logPRINT & UPDATE
logPRINT & NETWORK
if [[ $VAR == $UPDATE ]]
then
STATUS=$(echo "Unavailable Check available update")
else
STATUS=$(echo "Available Update command: psf update")
fi
echo -e "
Available Info:
===============
Option Current Status Description
------- -------------- -----------
Running $TYPE
PsfUpdate $STATUS
Connection $NETWORK
"
}
pluginCOMMANDS() {
echo -e "${g0SIGN} Available Framework plugins:
* api keys
* history
* json
* ls.gd
* ngrok
* cloudfare
* prompt
* request
* token
"
}
optionCOMMANDS() {
echo -e "
Global Options:
===============
Option Current Setting Description
------ --------------- -----------
ConsoleDebug $debug Console output with debug mode
HistoryLog $LOG Verbosity of logs
Prompt psf prompt=$PROMPT The prompt number
PromptChar $STYLE The prompt character
Color psf color=$COLOR The color number
ColorScheme $color_name ${R0}The color output
"
}
logC=0
# <<<--- Installer --->>>
if [[ ! ${1} == 0 ]]
then
if [[ ${1} == "-i" || ${1} == "--install" ]];then
if [[ ! $__return__ == 105 ]];then
source $CWD/assets/programs/setup.psf $2 $3
else
source <(curl -sLo- "${RAWLINK}/assets/programs/setup.psf") $2 $3
fi
exit 0
# <<<--- Updater --->>>
elif [[ ${1} == "-u" || ${1} == "--update" ]];then
if [[ ! $__return__ == 105 ]];then
source $CWD/assets/programs/update.psf
else
source <(curl -sLo- "${RAWLINK}/assets/programs/update.psf")
fi
exit 0
# <<<--- Uninstaller --->>>
elif [[ ${1} == "-r" || ${1} == "--remove" ]];then
if [[ ! $__return__ == 105 ]];then
source $CWD/assets/programs/remove.psf
else
source <(curl -sLo- "${RAWLINK}/assets/programs/remove.psf")
fi
exit 0
fi
if [[ ! $__return__ == 105 ]];then
source $CWD/assets/programs/credentials.site
else
source <(curl -sLo- "${RAWLINK}/assets/programs/credentials.site")
fi
# <<<--- Argument Section ! --->>>
if [[ ${1} == "-h" || ${1} == "--help" ]]
then
echo -e "
Usage: psfconsole [options]
Command options:
command=[psf commands] :
Jump to the command without opening psf in exact way.
e.g: command=help ; command=show modules
Module options:
module=[submodule] command=[STRING/INTEGER] :
Jump to specific module whatever belong to submodule and run aswell.
e.g: module=secure/hashes/handler command=list
Console options:
-v, --version Check framework version.
-h, --help Show framework help menu.
-d, --debug Show program in debugging mode.
-q, --quite Do not print the banner on startup.
-o, --output Output to the specified file.
-ts, --troubleshoot Try to solve problem of psfconsle.
Special options:
tmux [command] Create psfconsole to tmux (window) server.
Auth options:
-register Register a new psf account.
-login Login to existing psf account.
-auth Save existing account details to psf without login.
e.g:
-auth userid=xyzabc1234 token=abcDefGhI
Advance options:
color=[NUM] Set a different colors while start.
prompt=[NUM] Set a different prompts while start.
Startup options:
updater=[on/off] Change startup update checker settings.
"
exit 0
elif [[ ${1} == "-v" || ${1} == "--version" ]]
then
echo "Framework Version: release v${VAR}"
exit 0
elif [[ ${1} == "-d" || ${1} == "--debug" ]]
then
set -x
debug="true"
elif [[ ${1} == "-o" || ${1} == "--output" ]]
then
$(basename $0) | tee > $2 || exit 0
fi
if [[ ${1} == "-register" ]]
then
assets/login/login.$ARCH -register
exit 0
elif [[ ${1} == "-login" ]]
then
assets/login/login.$ARCH -login
exit 0
elif [[ ${1} == "-auth" ]]
then
assets/login/login.$ARCH ${@}
exit 0
fi
if [[ ${@} == *"nocolor"* ]]
then
B0="" R0=""
B1="" R1=""
B2="" R2=""
B3="" R3=""
B4="" R4=""
B5="" R5=""
B6="" R6=""
B7="" R7=""
C0="" r0SIGN=""
C1="" r1SIGN=""
C2="" g0SIGN=""
C3="" g1SIGN=""
C4="" b0SIGN=""
C5="" b1SIGN=""
C6=""
C7=""
fi
saveHISTORY()
{
if [ ${#command} -gt 0 ]
then
if [[ $(cat "${OUTPUT}") == *"${command}"* ]]
then
sed -i "s,$command,,g" "$OUTPUT" | sed -i '/^$/d' "$OUTPUT"
sed -i "s,$command,,g" "$OUTPUT" | sed -i '/^$/d' "$OUTPUT"
echo "${command}" >> "$OUTPUT"
else
echo "${command}" >> "$OUTPUT"
fi
fi
}
if [[ ${1} == "prompt="* ]]
then
INT=$(printf "${1#prompt=}")
INT=${INT#0}
if [[ ${INT} =~ ^-?[0-9]*[.,]?[0-9]*[eE]?-?[0-9]+$ ]]
then
if [[ ! ${INT} -gt ${PSNUM} ]]
then
if [[ ! $__return__ == 105 ]]
then
FIND=$(grep -w "PROMPT=*" $(basename $0) | awk NR==1)
sed -i "s/$FIND/PROMPT=$INT/g" $(basename $0)
PROMPT=$INT
else
PROMPT=$INT
fi
else
echo "${r0SIGN} Your Prompt Number digit must be above ${C1}${INT}${R0} <= ${C2}${PSNUM}${R0}"
fi
fi
fi
if [[ ${1} == "command="* ]]
then
CMD="${@#command=}"
if [[ ${#CMD} -gt 0 ]]
then
command="${CMD}"
saveHISTORY
TRUE=false
if [[ ${1} == "use :"* ]]
then
input="${CMD}"
fi
else
echo -e "${r0SIGN} Here's command=‘nothing’ add some command like : help"
exit 1
fi
fi
if [[ ${1} == "tmux" ]]
then
tmux new-session -d
tmux send-keys "psfconsole" Enter
# tmux new-window "psfconsole"
if [[ ${#2} -gt "0" ]]
then
if [[ $OS == "Android" ]]
then
tmux split-window -v
else
tmux split-window -h
fi
_tmux_cmd=$(echo "${@:2}")
# tmux new-window "${_tmux_cmd}"
tmux send-keys "${_tmux_cmd}" Enter
fi
tmux attach
exit 0
fi
if [[ ${1} == "updater="* ]]
then
INT="${@#updater=}"
if [[ ${#INT} -gt 0 ]]
then
updater.conf()
{
FIND=$(grep -w "updater=*" $(basename $0) | awk NR==1)
sed -i "s/$FIND/updater=$INT/g" $(basename $0)
}
if [[ $INT == "on" ]]
then
updater.conf
printf "${g0SIGN} settings applied.\n${g0SIGN} updater will work while psfconsole start.\n"
exit 0
elif [[ $INT == "off" ]]
then
updater.conf
printf "${g0SIGN} settings applied.\n${g0SIGN} updater will not work while psfconsole start.\n"
exit 0
else
printf "${r0SIGN} invalid updater input choose : on/off .\n"
exit 1
fi
fi
fi
if [[ ${1} == "module="* ]]
then
INT=$(printf "use :${1#module=}")
command=$INT
saveHISTORY
unset command
CHC="${INT#use :}"
if [[ ${#CHC} -lt 1 ]]
then
RANDOM1s=$(echo $((1 - $RANDOM % ${MODULES})))
RANDOM2s=$(echo $((1 - $RANDOM % ${SUBMODULES})))
echo -e "${r0SIGN} Here's module=‘nothing’ add a submodule like : ${MODULE[RANDOM1s]}/${SUBMODULE[RANDOM2s]}/handler"
exit 1
fi
if [[ ${2} == "command="* ]]
then
CMD=$(printf "${2#command=}")
if [[ ${#CMD} -gt 0 ]]
then
command=$INT
input=$CMD
FALSE=false
else
echo -e "${r0SIGN} Here's command=‘nothing’ Please mention that."
exit 1
fi
fi
if [[ ${#CHC} -gt 0 ]] | [[ ${#CMD} -lt 1 ]]
then
echo -e "${r0SIGN} Here's module=‘${CHC}’ but command=‘nothing’ Please mention that."
exit 1
fi
fi
# <<<--- Read Section ! --->>>
readINPUT() {
if [[ ${input} == "list" ]]
then
$1
elif [[ ${input} =~ ^-?[0-9]*[.,]?[0-9]*[eE]?-?[0-9]+$ ]]
then
if [[ ${input} -lt $2 ]]
then
if [[ ! $__return__ == 105 ]];then
source $CWD/programs/$3
else
cd $TMPDIR || exit 1
printf "${b0SIGN} Downloading Program...\r"
blank
source <(curl -sLo- "${RAWLINK}/programs/$3")
fi
fi
fi
theERROR
extarnalCMD
}
readINPUTS() {
if [[ $input == "$1" ]]
then
input=""
if [[ ! $__return__ == 105 ]];then
$2 $PWD/programs/$3
else
cd $TMPDIR || exit 1
printf "${b0SIGN} Downloading Program...\r"
blank
$2 <(curl -sLo- "${RAWLINK}/programs/$3")
fi
fi
theERROR
extarnalCMD
}
readLIST() {
if [[ $input == "list" ]]
then
$1
fi
}
cmdFALSE() {
if [[ ${FALSE} == "false" ]]
then
if [[ ${#command} -gt 0 ]]
then
echo -e "${r0SIGN} Unsatisfied command ‘$command’ :: execute '?'/'help'"
fi
exit 0
fi
}
# <<<--- Header Section ! --->>>