forked from Dewalt-arch/pimpmykali
-
Notifications
You must be signed in to change notification settings - Fork 0
/
pimpmykali.sh
executable file
·1568 lines (1438 loc) · 73.8 KB
/
pimpmykali.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
#
# pimpmykali.sh Author: Dewalt
# git clone https://github.com/Dewalt-arch/pimpmykali
# Usage: sudo ./pimpmykali.sh ( defaults to the menu system )
# command line arguments are valid, only catching 1 arguement
#
# Full Revision history can be found in changelog.txt
# Standard Disclaimer: Author assumes no liability for any damage
# revision var
revision="1.6.2"
# unicorn puke:
red=$'\e[1;31m'
green=$'\e[1;32m'
blue=$'\e[1;34m'
magenta=$'\e[1;35m'
cyan=$'\e[1;36m'
yellow=$'\e[1;93m'
white=$'\e[0m'
bold=$'\e[1m'
norm=$'\e[21m'
reset=$'\e[0m'
# more unicorn puke...*sigh* added for senpai, taste the rainbow!
# now with 100% more unicorn puke! enjoy a color for no color!!
color_nocolor='\e[0m'
color_black='\e[0;30m'
color_grey='\e[1;30m'
color_red='\e[0;31m'
color_light_red='\e[1;31m'
color_green='\e[0;32m'
color_light_green='\e[1;32m'
color_brown='\e[0;33m'
color_yellow='\e[1;33m'
color_blue='\e[0;34m'
color_light_blue='\e[1;34m'
color_purple='\e[0;35m'
color_light_purple='\e[1;35m'
color_cyan='\e[0;36m'
color_light_cyan='\e[1;36m'
color_light_grey='\e[0;37m'
color_white='\e[1;37m'
# nuke impacket function launch_code generator
launch_codes_alpha=$(echo $((1 + RANDOM % 9999)))
launch_codes_beta=$(echo $((1 + RANDOM % 9999)))
launch_codes_charlie=$(echo $((1 + RANDOM % 9999)))
# status indicators
greenplus='\e[1;33m[++]\e[0m'
greenminus='\e[1;33m[--]\e[0m'
redminus='\e[1;31m[--]\e[0m'
redexclaim='\e[1;31m[!!]\e[0m'
redstar='\e[1;31m[**]\e[0m'
blinkexclaim='\e[1;31m[\e[5;31m!!\e[0m\e[1;31m]\e[0m'
fourblinkexclaim='\e[1;31m[\e[5;31m!!!!\e[0m\e[1;31m]\e[0m'
# variables needed in the script
# wait_time=10 # 2nd warning screen wait time (disabled)
force=0
check=""
section=""
type=""
menu=""
pipnowarn="--no-python-version-warning" # turn off all python2.7 deprecation warnings in pip
export PYTHONWARNINGS="ignore"
# variables moved from local to global
finduser=$(logname)
detected_env=""
pyver=$(python3 --version | awk '{print$2}' | cut -d "." -f1-2)
archtype=$(uname -m)
if [[ "$archtype" == "aarch64" ]];
then
arch="arm64"
fi
if [[ "$archtype" == "x86_64" ]];
then
arch="amd64"
fi
# for vbox_fix_shared_folder_permission_denied
findgroup=$(groups $finduser | grep -i -c "vboxsf")
# Logging
LOG_FILE=pimpmykali.log
exec > >(tee ${LOG_FILE}) 2>&1
# silent mode
silent='' # uncomment to see all output
# silent='>/dev/null 2>&1' # uncomment to hide all output10
export DEBIAN_FRONTEND=noninteractive
export PYTHONWARNINGS=ignore
# 02.02.21 - rev 1.1.8 - fix_xfce_root fix_xfce_user fix_xfcepower external configuration file
raw_xfce="https://raw.githubusercontent.com/Dewalt-arch/pimpmyi3-config/main/xfce4/xfce4-power-manager.xml"
check_distro() {
distro=$(uname -a | grep -i -c "kali") # distro check
if [ $distro -ne 1 ]
then echo -e "\n $blinkexclaim Kali Linux Not Detected - WSL/WSL2/Anything else is unsupported $blinkexclaim \n"; exit
fi
}
check_for_root () {
if [ "$EUID" -ne 0 ]
then echo -e "\n\n Script must be run with sudo ./pimpmykali.sh or as root \n"
exit
else
# 02.19.21 - Kali 2021.1 + MSF 6.0.30-DEV Released
# Remove any prior hold on metasploit-framework at startup
eval apt-mark unhold metasploit-framework >/dev/null 2>&1
fi
}
fix_section () {
if [ $check -ne 1 ]
then
# sanity check : force=0 check=0 or force=1 check=0
echo -e "\n $greenplus install : $section"
eval apt -o Dpkg::Progress-Fancy="1" -y install $section $silent
elif [ $force = 1 ]
then
# sanity check : force=1 check=1
echo -e "\n $redstar reinstall : $section"
eval apt -o Dpkg::Progress-Fancy="1" -y reinstall $section $silent
else
# sanity check : force=0 check=1
echo -e "\n $greenminus $section already installed"
echo -e " use --force to reinstall"
fi
check=""
type=""
section=""
}
apt_update() {
echo -e "\n $greenplus running: apt update \n"
eval apt -y update -o Dpkg::Progress-Fancy="1"
}
apt_upgrade() {
echo -e "\n $greenplus running: apt upgrade \n"
eval apt -y upgrade -o Dpkg::Progress-Fancy="1"
}
apt_autoremove() {
echo -e "\n $greenplus running: apt autoremove \n"
eval apt -y autoremove -o Dpkg::Progress-Fancy="1"
}
apt_update_complete() {
echo -e "\n $greenplus apt update - complete"
}
apt_upgrade_complete() {
echo -e "\n $greenplus apt upgrade - complete"
}
apt_autoremove_complete() {
echo -e "\n $greenplus apt autoremove - complete"
}
apt_fixbroken() {
apt -y --fix-broken install
}
apt_fixbroken_complete() {
echo -e "\n $greenplus apt -y --fix-broken install - complete"
}
fix_missing () {
fix_kali_lightdm_theme_and_background
fix_sources
fix_hushlogin # 06.18.2021 - added fix for .hushlogin file
apt_update && apt_update_complete
fix_libwacom
apt_autoremove && apt_autoremove_complete
eval apt -y remove kali-undercover $silent
# 02.01.2020 - Added cifs-utils and libguestfs-tools as they are require for priv escalation
# 10.05.2021 - Added dbus-x11 as it has become a common problem for those wanting to use gedit
# 01.15.2023 - Added libu2f-udev and moved virt-what to an earlier section of the script
eval apt -o Dpkg::Progress-Fancy="1" -y install libu2f-udev virt-what neo4j dkms build-essential autogen automake python-setuptools python3-setuptools python3-distutils python$pyver-dev libguestfs-tools cifs-utils dbus-x11 $silent
# check_python # 07.02.21 - check_python check if python is symlinked to python2 if not, make it point to python2
python-pip-curl
python3_pip $force
fix_gedit $force # restored to its former glory
fix_root_connectionrefused
fix_htop $force
fix_golang $force
fix_nmap
fix_rockyou
fix_theharvester # 02.02.2021 - added theharvester to fix_missing
silence_pcbeep # 02.02.2021 - turn off terminal pc beep
disable_power_checkde # 06.18.2021 - disable gnome or xfce power management based on desktop environment detection
fix_python_requests
fix_pipxlrd # 12.29.2020 added xlrd==1.2.0 for windows-exploit-suggester.py requirement
fix_spike
fix_set
fix_pyftpdlib # 09.01.21 - added pyftpdlib for python2
fix_amass # 09.02.21 - added amass precompiled binary
fix_httprobe # 01.04.22 - added httprobe precompiled binary
fix_assetfinder # 03.17.22 - added assetfinder precompiled binary
check_chrome
fix_gowitness # 01.27.2021 added due to 404 errors with go get -u github.com/sensepost/gowitness
fix_mitm6 # 05.09.2022 - added mitm6 to fix missing
}
fix_all () {
fix_missing $force
apt_autoremove && apt_autoremove_complete
apt_fixbroken && apt_fixbroken_complete
make_rootgreatagain $force
seclists
fix_flameshot $force
fix_grub
fix_smbconf
fix_impacket
# ID10T REMINDER: DONT CALL THESE HERE THEY ARE IN FIX_MISSING!
# python-pip-curl python3_pip fix_golang fix_nmap
# fix_upgrade is not a part of fix_missing and only
# called as sub-function call of fix_all or fix_upgrade itself
}
fix_kali_lightdm_theme_and_background () {
# set kali lightdm login theme from Kali-Light to Kali-Dark
sed s:"Kali-Light":"Kali-Dark":g -i /etc/lightdm/lightdm-gtk-greeter.conf
# dark to light theme
# set kali login-theme to Kali-Light from Dark theme
# sed s:"Kali-Dark":"Kali-Light":g -i /etc/lightdm/lightdm.conf
# set kali background to solid black color
# sed s:"background = /usr/share/desktop-base/kali-theme/login/background":"background = #000000":g
}
fix_libwacom() {
eval apt -y install libwacom-common
# fix for missing libwacom9 requires libwacom-common
}
fix_assetfinder () {
echo -e "\n $greenplus Installing Assetfinder precompiled binary for $arch ... "
[[ -f /usr/bin/assetfinder ]] && rm -f /usr/bin/assetfinder || echo > /dev/null
eval apt -y install assetfinder
}
fix_httprobe() { # 01.04.22 - added httprobe precompiled binary to fix_missing
if [ -f /usr/bin/httprobe ];
then
echo -e "\n $greenminus skipping httprobe... already installed"
else
echo -e "\n $greenplus installing httprobe"
eval apt -y install httprobe
echo -e "\n $greenplus installed httprobe"
fi
}
fix_amass() {
echo -e "\n $greenplus installing amass for $arch "
# 01.15.2023 rev 1.6.0 - Function updated for $arch detection amd64 or arm64
echo apt -y install amass
echo -e "\n $greenplus amass installed"
}
fix_pyftpdlib() {
echo -e "\n $greenplus installing pyftpdlib"
eval pip install pyftpdlib
echo -e "\n $greenplus pyftpdlib installed"
}
# 04.06.21 - rev 1.2.2 - add google-chrome due to gowitness dependancy
check_chrome(){
[[ -f "/usr/bin/google-chrome" ]] && echo -e "\n $greenminus google-chrome already installed - skipping \n" || fix_chrome;
}
# 04.06.21 - rev 1.2.2 - add google-chrome due to gowitness dependancy
fix_chrome() {
if [[ "$arch" == "arm64" ]];
then
echo -e "\n $redexclaim Google-Chrome is not available for this platform $arch -- skipping"
elif [[ "$arch" == "amd64" ]];
then
# need if statement here if arm64 , chrome does not exist in kali linux on arm64 as of yet
echo -e "\n $greenplus Gowitness dependancy fix: Downloading - google-chrome for $arch \n"
eval wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb -O /tmp/google-chrome-stable_current_amd64.deb
#eval wget https://dl.google.com/linux/deb/pool/main/g/google-chrome-stable/google-chrome-stable_109.0.5414.74-1_amd64.deb -O /tmp/google-chrome-stable_current_amd64.deb
echo -e "\n $greenplus Gowitness dependancy fix: Installing - google-chrome for $arch \n"
eval dpkg -i /tmp/google-chrome-stable_current_amd64.deb
rm -f /tmp/google-chrome-stable_current_amd64.deb
fi
}
# 06.18.2021 - fix_hushlogin rev 1.2.9
fix_hushlogin() {
echo -e "\n $greenplus Checking for .hushlogin"
if [ $finduser = "root" ]
then
if [ -f /root/.hushlogin ]
then
echo -e "\n $greenminus /$finduser/.hushlogin exists - skipping"
else
echo -e "\n $greenplus Creating file /$finduser/.hushlogin"
touch /$finduser/.hughlogin
fi
else
if [ -f /home/$finduser/.hushlogin ]
then
echo -e "\n $greenminus /home/$finduser/.hushlogin exists - skipping"
else
echo -e "\n $greenplus Creating file /home/$finduser/.hushlogin"
touch /home/$finduser/.hushlogin
fi
fi
}
# 06.18.2021 - disable_power_gnome rev 1.2.9
disable_power_gnome() {
# CODE CONTRIBUTION : pswalia2u - https://github.com/pswalia2u
fix_hushlogin
echo -e "\n $greenplus Gnome detected - Disabling Power Savings"
# ac power
sudo -i -u $finduser gsettings set org.gnome.settings-daemon.plugins.power sleep-inactive-ac-type nothing # Disables automatic suspend on charging)
echo -e " $greenplus org.gnome.settings-daemon.plugins.power sleep-inactive-ac-type nothing"
sudo -i -u $finduser gsettings set org.gnome.settings-daemon.plugins.power sleep-inactive-ac-timeout 0 # Disables Inactive AC Timeout
echo -e " $greenplus org.gnome.settings-daemon.plugins.power sleep-inactive-ac-timeout 0"
# battery power
sudo -i -u $finduser gsettings set org.gnome.settings-daemon.plugins.power sleep-inactive-battery-type nothing # Disables automatic suspend on battery)
echo -e " $greenplus org.gnome.settings-daemon.plugins.power sleep-inactive-battery-type nothing"
sudo -i -u $finduser gsettings set org.gnome.settings-daemon.plugins.power sleep-inactive-battery-timeout 0 # Disables Inactive Battery Timeout
echo -e " $greenplus org.gnome.settings-daemon.plugins.power sleep-inactive-battery-timeout 0"
# power button
sudo -i -u $finduser gsettings set org.gnome.settings-daemon.plugins.power power-button-action nothing # Power button does nothing
echo -e " $greenplus org.gnome.settings-daemon.plugins.power power-button-action nothing"
# idle brightness
sudo -i -u $finduser gsettings set org.gnome.settings-daemon.plugins.power idle-brightness 0 # Disables Idle Brightness
echo -e " $greenplus org.gnome.settings-daemon.plugins.power idle-brightness 0"
# screensaver activation
sudo -i -u $finduser gsettings set org.gnome.desktop.session idle-delay 0 # Disables Idle Activation of screensaver
echo -e " $greenplus org.gnome.desktop.session idle-delay 0"
# screensaver lock
sudo -i -u $finduser gsettings set org.gnome.desktop.screensaver lock-enabled false # Disables Locking
echo -e " $greenplus org.gnome.desktop.screensaver lock-enabled false\n"
}
# 06.18.2021 - disable_power_xfce rev 1.2.9 replaces fix_xfce_power fix_xfce_user and fix_xfce_root functions
disable_power_xfce() {
if [ $finduser = "root" ]
then
echo -e "\n $greenplus XFCE Detected - disabling xfce power management \n"
eval wget $raw_xfce -O /root/.config/xfce4/xfconf/xfce-perchannel-xml/xfce4-power-manager.xml
echo -e "\n $greenplus XFCE power management disabled for user: $finduser \n"
else
echo -e "\n $greenplus XFCE Detected - disabling xfce power management \n"
eval wget $raw_xfce -O /home/$finduser/.config/xfce4/xfconf/xfce-perchannel-xml/xfce4-power-manager.xml
echo -e "\n $greenplus XFCE power management disabled for user: $finduser \n"
fi
}
# disable_power_kde() {
# # need to work up a kde power management solution before implementing
# }
# 06.18.2021 - disable_power_checkde rev 1.2.9
disable_power_checkde() {
detect_xfce=$(ps -e | grep -c -E '^.* xfce4-session$')
detect_gnome=$(ps -e | grep -c -E '^.* gnome-session-*')
#detect_kde=$(ps -e | grep -c -E '^.* kded4$')
[ $detect_gnome -ne 0 ] && detected_env="GNOME"
[ $detect_xfce -ne 0 ] && detected_env="XFCE"
# need to work up a kde power management solution before implementing
# [ $detect_kde -ne 0 ] && detected_env="KDE"
echo -e "\n $greenplus Detected Environment: $detected_env"
[ $detected_env = "GNOME" ] && disable_power_gnome
[ $detected_env = "XFCE" ] && disable_power_xfce
[ $detected_env = "" ] && echo -e "\n $redexclaim Unable to determine desktop environment"
# [ $detected_env = "KDE" ] && disable_power_kde
}
# 02.02.21 - rev 1.1.8 - Turn off / Silence PCSPKR beep
silence_pcbeep () {
echo -e "blacklist pcspkr" > /etc/modprobe.d/nobeep.conf
echo -e "\n $greenplus Terminal Beep Silenced! /etc/modprobe.d/nobeep.conf \n"
}
fix_pipxlrd () {
eval pip install xlrd==1.2.0 --upgrade
eval pip3 install scapy==2.4.4 --upgrade
# eval pip3 install xlrd --upgrade
echo -e "\n $greenplus python module : xlrd installed \n"
}
# Thinking about this before implementation
# 07.02.21 - check_python check if python is symlinked to python2 if not, make it point to python2
# fix_python_version() {
# # check if python is python2
# # Meh.. rethink this...
# is_python2=$(ls -la /bin/python | grep -i -c "python2")
# # check if python is python3
# is_python3=$(ls -la /bin/python | grep -i -c "python3")
#
# if [ $is_python2 = 1 ]
# then
# echo -e "\n $greenplus python is python2 - skipping "
# else
# if [ $is_python3 = 1 ]
# then
# echo -e "\n $redminus python is python3 ... installing python-is-python2 \n\n"
# eval apt -y install python-is-python2
# echo -e "\n $greenplus python is now python2 "
# else
# echo -e "\n $redexclaim Unable to determine python value"
# fi
# fi
# }
python-pip-curl () {
# Adding in some checks
# python3_version="$(python3 --version 2>&1 | awk '{print $2}')"
# py3_major=$(echo "$python3_version" | cut -d'.' -f1)
# py3_minor=$(echo "$python3_version" | cut -d'.' -f2)
#
# python_version="$(python --version 2>&1 | awk '{print $2}')"
# py_major=$(echo "$python_version" | cut -d'.' -f1)
# py_minor=$(echo "$python_version" | cut -d'.' -f2)
#
# pip_is_for_python_version="$(pip --version 2>&1 | awk '{print $6}' | tr -d ")")" #needs to be modified
# pip_major=$(echo "$pip_is_for_python_version" | cut -d'.' -f1)
# pip_minor=$(echo "$pip_is_for_python_version" | cut -d'.' -f2)
#
# pip3_is_for_python_version="$(pip3 --version 2>&1 | awk '{print $6}' | tr -d ")" )"
# pip3_major=$(echo "$pip3_is_for_python_version" | cut -d'.' -f1)
# pip3_minor=$(echo "$pip3_is_for_python_version" | cut -d'.' -f2)
#
# echo " Python3 is : $python3_version $py3_major $py3_minor "
# echo " Python2 is : $python_version $py_major $py_minor "
# echo " Pip is for : $pip_is_for_python_version $pip_major $pip_minor"
# echo "Pip3 is for : $pip3_is_for_python_version $pip3_major $pip3_minor"
check_pip=$(whereis pip | grep -i -c "/usr/local/bin/pip2.7")
if [ $check_pip -ne 1 ]
then
echo -e "\n $greenplus installing pip"
# 01.26.2021 - get-pip.py throwing an error, commented out and pointed wget directly to the python2.7 get-pip.py
eval curl https://raw.githubusercontent.com/pypa/get-pip/3843bff3a0a61da5b63ea0b7d34794c5c51a2f11/2.7/get-pip.py -o /tmp/get-pip.py $silent
# make a python-is-python2 function out of this...
echo -e "\n $greenplus Symlinking /bin/python2.7 to /bin/python\n"
[[ -f /bin/python2.7 ]] && ln -sf /bin/python2.7 /bin/python
# ------- buildout this function at a later date
eval python /tmp/get-pip.py $silent
rm -f /tmp/get-pip.py
eval pip --no-python-version-warning install setuptools
# python2-pip installer is now removing /usr/bin/pip3 - new "feature" I guess... 09.01.2021
[[ ! -f /usr/bin/pip3 ]] && echo -e "\n $greenplus installing python3-pip"; apt -y reinstall python3-pip || echo -e "\n $greenplus python3-pip exists in /usr/bin/pip3"
echo -e "\n $greenplus python-pip installed"
else
echo -e "\n $greenminus python-pip already installed"
fi
}
# section= must be exact name of package in kali repo
# check= custom check for that particular item
# type= set in fix_section based on eval of $check and $force
# force= to override force / set force var
# fix_section $section $check $force
# 01.26.2021 - rev 1.1.5 - Current version of spike throws undefined symbol error, revert to old version
# 01.15.2023 - rev 1.6.0 - Updated to use $arch variable for amd64 or arm64
fix_spike () {
echo -e "\n $greenplus Fix SPIKE "
echo -e "\n $greenplus removing SPIKE..."
eval apt -y --allow-change-held-packages remove spike
# curl --progress-bar
eval wget https://old.kali.org/kali/pool/main/s/spike/spike_2.9-1kali6_$arch.deb -O /tmp/spike_2.9-1kali6_$arch.deb
echo -e "\n $greenplus installing spike 2.9 for $arch ... \n"
eval dpkg -i /tmp/spike_2.9-1kali6_$arch.deb
echo -e "\n $greenplus spike 2.9 installed \n"
rm -f /tmp/spike_2.9-1kali6_$arch.deb
echo -e "\n $greenplus setting apt hold on spike package"
eval apt-mark hold spike
echo -e "\n $greenplus apt hold placed on spike package"
}
fix_liblibc() {
# amd64 / x86_64
if [[ "$arch" == "amd64" ]]
then
if [[ ! -f /usr/lib/x86_64-linux-gnu/liblibc.a ]]
then
ln -sf /usr/lib/x86_64-linux-gnu/libc.a /usr/lib/x86_64-linux-gnu/liblibc.a
echo -e "\n $greenplus Fixing $arch liblibc.a symlink /usr/lib/x86_64-linux-gnu/liblibc.a "
fi
fi
# arm64
if [[ "$arch" == "arm64" ]]
then
if [[ ! -f /usr/lib/aarch64-linux-gnu/liblibc.a ]]
then
ln -sf /usr/lib/aarch64-linux-gnu/libc.a /usr/lib/aarch64-linux-gnu/liblibc.a
echo -e "\n $greenplus Fixing $arch liblibc.a symlink.."
fi
fi
}
fix_mitm6() {
[[ -d /opt/mitm6 ]] && rm -rf /opt/mitm6 || git clone https://github.com/dirkjanm/mitm6 /opt/mitm6
git clone https://github.com/dirkjanm/mitm6 /opt/mitm6
cd /opt/mitm6
pip install typing twisted
pip install -r requirements.txt
python setup.py install
echo -e "\n $greenplus Fixing liblibc.a symlink.."
echo -e "\n $greenplus MITM6 installed.. "
}
fix_gowitness () {
echo -e "\n $greenplus Installing gowitness prebuilt binary...\n"
rm -f /tmp/releases.gowitness > /dev/null
check_chrome
rm -f /usr/bin/gowitness > /dev/null
# 01.15.2023 rev 1.6.0 updated with $arch variable for amd64 or arm64 detected by pimpmykali
eval wget https://github.com/sensepost/gowitness/releases/download/2.4.1/gowitness-2.4.1-linux-$arch -O /usr/bin/gowitness
chmod +x /usr/bin/gowitness
rm -f /tmp/releases.gowitness > /dev/null
}
fix_root_connectionrefused () {
# fix root gedit connection refused
echo -e "\n $greenplus Adding root to xhost for $finduser display: xhost +SI:localuser:root \n"
# 07.02.21 - may need to consider using the sudo -i -u $finduser here
eval sudo -i -u $finduser xhost +SI:localuser:root
eval xhost +SI:localuser:root
echo -e "\n $greenplus root added to xhost"
}
fix_gedit () {
section="gedit"
check=$(whereis gedit | grep -i -c "gedit: /usr/bin/gedit")
fix_section $section $check $force
fix_root_connectionrefused
}
fix_set() {
# move these to their individual respecitive functions at a later date - 04.11.2021 rev 1.2.4
eval apt -y install libssl-dev set gcc-mingw-w64-x86-64-win32
}
fix_rockyou () {
cd /usr/share/wordlists
gzip -dqf /usr/share/wordlists/rockyou.txt.gz
echo -e "\n $greenplus gunzip /usr/share/wordlists/rockyou.txt.gz\n"
}
locate () {
section="locate"
check=$(whereis locate | grep -i -c "locate: /usr/bin/locate")
fix_section $section $check $force
}
fix_htop () {
section="htop"
check=$(whereis htop | grep -i -c "htop: /usr/bin/htop")
fix_section $section $check $force
}
python3_pip () {
# section="python3-pip"
# check=$(python3 -m pip --version | grep -i -c "/usr/lib/python3/dist-packages/pip")
# force=1
# fix_section $section $check $force
eval apt -y reinstall python3-pip
}
seclists () {
#section="seclists"
# Function changed 01.15.2023 rev 1.6.0 many users were thinking the script was "stuck" with no info being displayed
if [[ -d /usr/share/seclists ]];
then
echo -e "\n $greenplus /usr/share/seclists already exists -- skipping"
else
echo -e "\n $greenplus Download Seclists to /tmp/SecLists.zip"
eval wget https://github.com/danielmiessler/SecLists/archive/master.zip -O /tmp/SecList.zip
echo -e "\n $greenplus Extracing /tmp/Seclists.zip to /usr/share/seclists"
unzip -o /tmp/SecList.zip -d /usr/share/seclists
rm -f /tmp/SecList.zip
echo -e "\n $greenplus Seclists complete"
fi
}
fix_nmap () {
rm -f /usr/share/nmap/scripts/clamav-exec.nse
echo -e "\n $redminus /usr/share/nmap/scripts/clamav-exec.nse removed "
eval wget https://raw.githubusercontent.com/nmap/nmap/master/scripts/clamav-exec.nse -O /usr/share/nmap/scripts/clamav-exec.nse $silent
eval wget https://raw.githubusercontent.com/Dewalt-arch/pimpmykali/master/fixed-http-shellshock.nse -O /usr/share/nmap/scripts/http-shellshock.nse $silent
echo -e "\n $greenplus /usr/share/nmap/scripts/clamav-exec.nse replaced with working version "
}
fix_flameshot () {
section="flameshot"
check=$(whereis flameshot | grep -i -c "/usr/bin/flameshot")
fix_section $section $check $force
}
# 02.02.21 - rev 1.1.8 - install theharvester
fix_theharvester () {
section="theharvester"
check=$(whereis theharvester | grep -i -c "/usr/bin/theharvester")
fix_section $section $check $force
}
fix_golang () {
section="golang" #check this golang or golang-go?
check=$(whereis go | grep -i -c "/usr/bin/go")
fix_section $section $check $force
fix_go_path
}
fix_go_path() {
# added gonski fix - 01.21.22 rev 1.4.2
# --- This needs to be moved to a Global from a local as it is reused at line 1165 ---
# Why am I not using $finduser here?
check_for_displayzero=$(who | grep -c "(\:0)")
if [ $check_for_displayzero == 1 ]
then
findrealuser=$(who | grep "(\:0)" | awk '{print $1}')
echo -e "\n $greenplus getting user from display 0 (:0) : $findrealuser"
else
findrealuser=$(who | grep "tty[0-9]" | sort -n | head -n1 | awk '{print $1}')
echo -e "\n $greenplus display0 not found getting user from tty : $findrealuser"
fi
# above is the Gonski Fix, Gonski was getting 'kali kali' in $findrealuser the original "who | awk '{print $1}'" statement
# with a kali user on tty7 (:0) and then kali pts/1, as pimpmykali.sh is being run with sudo and was producing this fault
# this will resolve the issue either logged into x11 on display 0 or just in a terminal on a tty
# --- Move the above to a global from a local as it is reused on line 1165 ----
if [ $findrealuser == "root" ]
then
check_root_zshrc=$(cat /root/.zshrc | grep -c GOPATH)
[ -d /$findrealuser/go ] && echo -e "\n $greenminus go directories already exist in /$findrealuser" || echo -e "\n $greenplus creating directories /$findrealuser/go /$findrealuser/go/bin /$findrealuser/go/src"; mkdir -p /$findrealuser/go/{bin,src}
if [ $check_root_zshrc -ne 0 ]
then
echo -e "\n $redminus GOPATH Variables for $findrealuser already exist in /$findrealuser/.zshrc - Not changing"
else
echo -e "\n $greenplus Adding GOPATH Variables to /root/.zshrc"
eval echo -e 'export GOPATH=\$HOME/go' >> /root/.zshrc
eval echo -e 'export PATH=\$PATH:\$GOPATH/bin' >> /root/.zshrc
fi
check_root_bashrc=$(cat /root/.bashrc | grep -c GOPATH)
if [ $check_root_bashrc -ne 0 ]
then
echo -e "\n $redminus GOPATH Variables for $findrealuser already exist in /$findrealuser/.bashrc - Not changing"
else
echo -e "\n $greenplus Adding GOPATH Variables to /root/.bashrc"
eval echo -e 'export GOPATH=\$HOME/go' >> /root/.bashrc
eval echo -e 'export PATH=\$PATH:\$GOPATH/bin' >> /root/.bashrc
fi
else
check_user_zshrc=$(cat /home/$findrealuser/.zshrc | grep -c GOPATH)
[ -d /home/$findrealuser/go ] && echo -e "\n $greenminus go directories already exist in /home/$finduser" || echo -e "\n $greenplus creating directories /home/$findrealuser/go /home/$findrealuser/go/bin /home/$findrealuser/go/src"; mkdir -p /home/$findrealuser/go/{bin,src}; chown -R $findrealuser:$findrealuser /home/$findrealuser/go
if [ $check_user_zshrc -ne 0 ]
then
echo -e "\n $redminus GOPATH Variables for user $findrealuser already exist in /home/$findrealuser/.zshrc - Not Changing"
else
echo -e "\n $greenplus Adding GOPATH Variables to /home/$findrealuser/.zshrc"
eval echo -e 'export GOPATH=\$HOME/go' >> /home/$findrealuser/.zshrc
eval echo -e 'export PATH=\$PATH:\$GOPATH/bin' >> /home/$findrealuser/.zshrc
fi
check_user_bashrc=$(cat /home/$findrealuser/.bashrc | grep -c GOPATH)
if [ $check_user_bashrc -ne 0 ]
then
echo -e "\n $redminus GOPATH Variables for user $findrealuser already exist in /home/$findrealuser/.bashrc - Not Changing"
else
echo -e "\n $greenplus Adding GOPATH Variables to /home/$findrealuser/.bashrc"
eval echo -e 'export GOPATH=\$HOME/go' >> /home/$findrealuser/.bashrc
eval echo -e 'export PATH=\$PATH:\$GOPATH/bin' >> /home/$findrealuser/.bashrc
fi
fi
}
fix_smbconf () {
check_min=$(cat /etc/samba/smb.conf | grep -c -i "client min protocol")
check_max=$(cat /etc/samba/smb.conf | grep -c -i "client max protocol")
if [ $check_min -ne 0 ] || [ $check_max -ne 0 ]
then
echo -e "\n $green /etc/samba/smb.conf "
echo -e "\n $redminus client min protocol is already set not changing\n $redminus client max protocol is already set not changing"
else
sed 's/\[global\]/\[global\]\n client min protocol = CORE\n client max protocol = SMB3\n''/' -i /etc/samba/smb.conf
echo -e "\n $greenplus /etc/samba/smb.conf updated"
echo -e "\n $greenplus added : client min protocol = CORE\n $greenplus added : client max protocol = SMB3"
fi
}
fix_grub () {
check_grub=$(cat /etc/default/grub | grep -i -c "GRUB_CMDLINE_LINUX_DEFAULT=\"quiet\"" )
if [ $check_grub -ne 1 ]
then
echo -e "\n $redexclaim Error: /etc/default/grub is not the default config - not changing"
else
sed 's/GRUB_CMDLINE_LINUX_DEFAULT="quiet"/GRUB_CMDLINE_LINUX_DEFAULT="quiet mitigations=off"/' -i /etc/default/grub
update-grub
echo -e "\n $greenplus Added mitigations=off to GRUB_CMDLINE_LINUX_DEFAULT"
echo -e "\n $redexclaim Reboot for changes to take effect \n"
fi
}
fix_python_requests () {
#eval git clone https://github.com/psf/requests /opt/requests
#cd /opt/requests
eval pip install colorama termcolor service_identity requests==2.2.1
echo -e "\n $greenplus installed python2 module : colorama"
#eval pip install .
echo -e "\n $greenplus installed python2 module : requests"
}
fix_bad_apt_hash () {
mkdir -p /etc/gcrypt
echo "all" > /etc/gcrypt/hwf.deny
}
# Update this function with the new fork as atom was deprecated
# install_atom () {
# if [ -f /usr/bin/atom ]
# then
# echo -e "\n $greenminus atom already installed - skipping"
# else
# apt_update && apt_update_complete
# echo -e "\n $greenplus downloading atom"
# eval wget https://atom.io/download/deb -O /tmp/atom.deb $silent
# echo -e "\n $greenplus installing atom"
# eval dpkg -i /tmp/atom.deb $silent
# eval rm -f /tmp/atom.deb $silent
# eval apt -y --fix-broken install $silent
# fi
# }
install_sublime () {
echo -e "\n $greenplus installing sublime text editor"
# code fix provided by aashiksamuel
eval wget -qO - https://download.sublimetext.com/sublimehq-pub.gpg | gpg --no-default-keyring --keyring ./temp-keyring.gpg --import
eval gpg --no-default-keyring --keyring ./temp-keyring.gpg --export --output sublime-text.gpg
eval rm temp-keyring.gpg temp-keyring.gpg~
eval mkdir -p /usr/local/share/keyrings
eval mv ./sublime-text.gpg /usr/local/share/keyrings
eval apt-get install apt-transport-https
eval echo "deb [signed-by=/usr/local/share/keyrings/sublime-text.gpg] https://download.sublimetext.com/ apt/stable/" > /etc/apt/sources.list.d/sublime-text.list
apt_update && apt_update_complete
eval apt -y install sublime-text
}
# 06.01.21 - Function rewrite code-oss was added to Kali 2021.2 repo
install_vscode () {
if [[ -f /usr/bin/code ]]; then
echo -e "\n $greenminus vscode already installed - skipping"
else
echo -e "\n $greenplus installing vscode"
apt_update && apt_update_complete && apt -y install code-oss
echo -e "\n $greenplus vscode - installed "
fi
}
# 04.06.2021 fix_sources rev 1.2.2 / rev 1.3.2 updated to add wildcards
fix_sources () {
fix_bad_apt_hash
# relaxed grep
check_space=$(cat /etc/apt/sources.list | grep -c "# deb-src http://.*/kali kali-rolling.*")
check_nospace=$(cat /etc/apt/sources.list | grep -c "#deb-src http://.*/kali kali-rolling.*")
get_current_mirror=$(cat /etc/apt/sources.list | grep "deb-src http://.*/kali kali-rolling.*" | cut -d "/" -f3)
# original code - to be purged
#check_space=$(cat /etc/apt/sources.list | grep -c "# deb-src http://.*/kali kali-rolling main contrib non-free")
#check_nospace=$(cat /etc/apt/sources.list | grep -c "#deb-src http://.*/kali kali-rolling main contrib non-free")
#get_current_mirror=$(cat /etc/apt/sources.list | grep "deb-src http://.*/kali kali-rolling main contrib non-free" | cut -d "/" -f3)
if [[ $check_space = 0 && $check_nospace = 0 ]]; then
echo -e "\n $greenminus # deb-src or #deb-sec not found - skipping"
elif [ $check_space = 1 ]; then
echo -e "\n $greenplus # deb-src with space found in sources.list uncommenting and enabling deb-src"
# relaxed sed
sed 's/\# deb-src http\:\/\/.*\/kali kali-rolling.*/\deb-src http\:\/\/'$get_current_mirror'\/kali kali-rolling main contrib non\-free''/' -i /etc/apt/sources.list
# original code - to be purged
#sed 's/\# deb-src http\:\/\/.*\/kali kali-rolling main contrib non\-free/\deb-src http\:\/\/'$get_current_mirror'\/kali kali-rolling main contrib non\-free''/' -i /etc/apt/sources.list
echo -e "\n $greenplus new /etc/apt/sources.list written with deb-src enabled"
elif [ $check_nospace = 1 ]; then
echo -e "\n $greenplus #deb-src without space found in sources.list uncommenting and enabling deb-src"
# relaxed sed
sed 's/\#deb-src http\:\/\/.*\/kali kali-rolling.*/\deb-src http\:\/\/'$get_current_mirror'\/kali kali-rolling main contrib non\-free''/' -i /etc/apt/sources.list
# original code - to be purged
#sed 's/\#deb-src http\:\/\/.*\/kali kali-rolling main contrib non\-free/\deb-src http\:\/\/'$get_current_mirror'\/kali kali-rolling main contrib non\-free''/' -i /etc/apt/sources.list
echo -e "\n $greenplus new /etc/apt/sources.list written with deb-src enabled"
fi
}
run_update () {
fix_sources
echo -e "\n $greenplus starting: pimpmyupgrade \n"
apt_update && apt_update_complete
kernel_check=$(ls /lib/modules | sort -n | tail -n 1)
echo -e "\n $greenplus installing dkms build-essential linux-headers-$kernel_check \n"
eval apt -y install dkms build-essential linux-headers-amd64 $silent
}
make_rootgreatagain () {
echo -e "\n\n KALI-ROOT-LOGIN INSTALLATION: - PAGE 1 "$red"*** READ CAREFULLY! ***"$white" \n"
echo -e " On Kali 2019.x and prior the default user was root"
echo -e " On Kali 2020.1 and newer this was changed, the default user was changed to be "
echo -e " an" $yellow$bold"actual user"$norm$white" on the system and not "$red$bold"root"$norm$white", this user is : kali (by default) "
echo -e "\n Press Y - If you wish to re-enable the ability to login as root and be root all the time"
echo -e " If you choose Yes - a second screen will prompt you to copy all of /home/$finduser to /root"
echo -e " as there is nothing in the /root directory by default"
echo -e "\n Press N - The script will skip this section, and not re-enable the login as root function"
echo -e "\n "$bold$red"If you are confused or dont understand what"$norm$white
echo -e " "$bold$red"this part of the script is doing, press N"$norm$white
echo -e "\n Do you want to re-enable the ability to login as root in kali?"
read -n1 -p " Please type Y or N : " userinput
case $userinput in
y|Y) enable_rootlogin $force;;
n|N) echo -e "\n\n $redexclaim skipping root login setup" ;;
*) echo -e "\n invalid key try again Y or N"; make_rootgreatagain;;
esac
}
enable_rootlogin () {
section="kali-root-login"
check=$(whereis kali-root-login | grep -i -c "kali-root-login: /usr/share/kali-root-login")
fix_section $section $check $force
echo -e "\n\nEnabling Root Login Give root a password"
passwd root
if [ "$?" -ne 0 ]
then
echo -e "\n $redexclaim - Passwords did not match - restarting this function"
enable_rootlogin
else
echo -e "\n $greenplus - Password updated"
fi
echo -e "\n $greenplus root login enabled \n"
ask_homekali_to_root
}
# 01.02.2021 - rev 1.1.2 begin - new screens for copying from /home/kali to /root, no detection, all based on used input
ask_homekali_to_root () {
echo -e "\n\n KALI-ROOT-LOGIN INSTALLATION: - PAGE 2 "$red"*** READ CAREFULLY! ***"$white" \n"
echo -e " This section of the script is only executed if Yes was selected at the enable root login prompt\n"
echo -e " If you are planning on operating your kali install as root instead of the user kali, "
echo -e " by default there is nothing in /root, This script has the ability to copy everything"
echo -e " from /home/$finduser to /root for you. \n"
echo -e " $red Warning:$white This copy function $red will overwrite $white anything in /root with the entire contents of /home/kali"
echo -e " The copy statement that is going to be performed if you select Y is:\n "
echo -e " cp -Rvf /home/$finduser/* /home/$finduser/.* /root"
echo -e "\n Would you like to copy everything from /home/$finduser to /root ?"
echo -e " Press Y - to copy everything from /home/$finduser to /root"
echo -e " Press N - do not copy anything to /root and skip this function\n"
read -n1 -p " Please type Y or N : " userinput
case $userinput in
y|Y) ask_are_you_sure;;
n|N) echo -e "\n\n $redexclaim skipping copy of /home/$finduser to /root" ;;
*) echo -e "\n\n $redexclaim Invalid key try again, Y or N keys only $redexclaim"; ask_homekali_to_root;;
esac
}
# 01.03.2021 - rev 1.1.3 begin - added are you sure prompt
ask_are_you_sure () {
echo -e "\n\n Are you sure you want to copy all of /home/$finduser to /root ?"
read -n1 -p " Please type Y or N : " userinput
case $userinput in
y|Y) perform_copy_to_root;;
n|N) echo -e "\n\n $redexclaim skipping copy of /home/$finduser to /root - not copying ";;
*) echo -e "\n\n $redexclaim Invalid key try again, Y or N keys only $redexclaim"; ask_are_you_sure;;
esac
}
# 01.02.2021 - rev 1.1.2 - copy to /root warning screens and function
perform_copy_to_root () {
echo -e "\n\n $greenplus Copying everything from /home/$finduser to /root... Please wait..."
# add call to check_helpers here before doing the copy from /home/kali to /root
if [[ $finduser = "root" ]]
then
echo -e "Your already root!"
else
# [[ ! -d /root/Desktop ]] && cp -RVf /home/$findrealuser/kali/Desktop /root/Desktop
echo -e "\n\n cp -Rvf /home/$finduser/.* /home/$finduser/* \n\n"
eval cp -Rvf /home/$finduser/.* /home/$finduser/* /root >/dev/null 2>&1
eval chown -R root:root /root
echo -e "\n $greenplus Everything from /home/$finduser has been copied to /root"
fi
}
# check_helpers() {
# check /home/kali/.config/xfce4/helpers.rc for default settings of WebBrowser TerminalEmulator FileManager
# may need this in the copy to root function above , code is commented out and only a place holder currently
# if /root/.config/xfce4/helpers.rc AND /home/kali/.config/xfce4/helpers.rc does not exist create a new file for /root/.config/xfce4/helpers.rc
# if [ -f /home/kali/.config/xfce4/helpers.rc ]
# then
# check_browser=$(cat /home/kali/.config/xfce4/helpers.rc | grep -c "WebBrowser")
# if [ $check_browser = 1 ]
# then
# check_which_browser=$(cat /home/kali/.config/xfce4/helpers.rc | grep "WebBrowser" | cut -d "=" -f2)
# echo "WebBrowser is set and default browser is $check_which_browser"
# else
# echo "Browser is not set"
# fi
#
# check_terminal=$(cat /home/kali/.config/xfce4/helpers.rc | grep -c "TerminalEmulator")
# if [ $check_terminal = 1 ]
# then
# check_which_terminal=$(cat /home/kali/.config/xfce4/helpers.rc | grep "TerminalEmulator" | cut -d "=" -f2)
# echo "TerminalEmulator is set and default terminal is $check_which_terminal"
# else
# echo "Default TerminalEmulator is not set"
# fi
#
# check_filemanager=$(cat /home/kali/.config/xfce4/helpers.rc | grep -c "FileManager")
# if [ $check_filemanager = 1 ]
# then
# check_which_filemanager=$(cat /home/kali/.config/xfce4/helpers.rc | grep "FileManager" | cut -d "=" -f2)
# echo "FileManager is set and default file manager is $check_which_filemanager"
# else
# echo "Default FileManager is not set"
# fi
# else
# echo "/home/kali/.config/xfce4/helpers.rc does not exist - do something about it"
# fi
# }
fix_sead_warning () {
clear
# fugly - really need to clean this up, it works but its just a nightmare to look at
echo -e "
"$bold$redexclaim$red" WARNING "$redexclaim$bold$red" PIMPMYKALI IMPACKET REMOVAL FUNCTION "$redexclaim$bold$red" WARNING "$redexclaim$white$norm"
*** READ FULLY BEFORE PRESSING ANY KEY ***
"$red"DISCLAIMER:"$white" This is a last resort effort to remove impacket from the system
and install a clean working install of impacket-0.9.19 and should be only
used as such. This is for only if you screwed up your impacket as bad as
Bobloblaw (Blob) did!! (thank you blob! you are the wind beneath my impacket
removal scripts!)
This function of pimpmykali is reserved for the most severe cases of broken
impacket installs, multiple impacket installs, etc, and will attempt to
clean the system of impacket and any related files that may be preventing
a clean and working install of impacket-0.9.19
It is not possible to forsee every possible scenario but this makes a best
attempt of the most common dirs and files to clean your system to remove
anything impacket related only from the areas listed below.
This WILL RECURSIVLY DELETE ANY DIR NAMED impacket* from the following:
/opt /usr/bin /usr/local/lib /usr/lib /home/$finduser/.local/bin
/home/$finduser/.local/lib /root/.local/lib /root/.local/bin
AND ANY related .py and .pyc files from impacket in the following:
/usr/bin /local/local/bin /root/.local/bin /home/$finduser/.local/bin
After this function completes the following will be run automatically
sudo ./pimpmykali.sh --impacket
Answering only Y to the following prompt will preform the above actions,
pressing ANY OTHER KEY WILL EXIT
"
read -n1 -p " Press Y to execute or any other key to exit: " fixsead_userinput
case $fixsead_userinput in
y|Y) fix_sead_run ;;
*) exit ;;
esac
}
fix_sead_run () {
apt_update && apt_update_complete
python-pip-curl
python3_pip
eval pip uninstall impacket -y $silent
eval pip3 uninstall impacket -y $silent
SEAD=$(find /opt /usr/bin /usr/local/lib /usr/lib /home/$finduser/.local/bin /home/$finduser/.local/lib ~/.local/lib ~/.local/bin -name impacket* 2> /dev/null)
# Last Chance Launch Sequence ** WARNING SCREEN ** and 10 second time out
# may consider removing this.... 2nd warning screen
# clear
# echo -e " If you've made it this far you're having a really bad day with impacket... "
echo -e " Enjoy the last chance launch sequence!\n"
echo -e " Preparing to nuke Impacket... \n"
echo -e " $green[....]$white acquiring targets \n"
echo -e " $green[$red+$green..$red+$green]$white targets selected\n$SEAD \n"
echo -e " $green[-$red++$green-]$white targets locked \n"
echo -e " $green[++++]$white systems ready \n"
echo -e " $green[<$red@@$green>]$white taking aim \n"
echo -e " $green[$red####$green]$white requesting NukeImpacket launch codes \n"
echo -e " $green[$red$launch_codes_alpha-$launch_codes_beta-$launch_codes_charlie$green]$white launch code confirmed"
# echo -e " Are you sure you meant to run this script?\n"
# temp_cnt=${wait_time}
# while [[ ${temp_cnt} -gt 0 ]];
# do
# printf "\r You have %2d second(s) remaining to hit Ctrl+C to cancel this operation!" ${temp_cnt}
# sleep 1
# ((temp_cnt--))
# done