-
Notifications
You must be signed in to change notification settings - Fork 333
/
pimpmykali.sh
executable file
·2854 lines (2585 loc) · 131 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.8.1a"
# 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'
spaces=' '
# 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"
# look at a method to find the current version of nessus should the version number change
nessusd_service_active=0
# 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 tracelabs osint vm, if found exit
findhostname=$(hostname)
findrelease=$(cat /etc/os-release | grep -i -c -m1 "2022.1")
if [[ "$finduser" == "osint" ]] && [[ "$findhostname" == "osint" ]] && [[ $findrelease -ge 1 ]]
then
echo -e "\n $redexclaim Tracelabs Osint VM Detected, exiting"
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
}
clean_vars() {
APP=""
EXIT_STATUS=""
FUNCTYPE=""
}
check_exit_status() {
case ${EXIT_STATUS} in
0) echo -e "\n${spaces}${greenplus} $APP $FUNCTYPE successs";;
1) echo -e "\n${spaces}${redexclaim} $APP $FUNCTYPE General Error Exit Status: ${EXIT_STATUS}" ;;
2) echo -e "\n${spaces}${redexclaim} $APP $FUNCTYPE Misuse of Shell commands, Exit Status: ${EXIT_STATUS}" ;;
126) echo -e "\n${spaces}${redexclaim} $APP $FUNCTYPE Command Invoked Cannot Execute, Exit Status ${EXIT_STATUS}";;
127) echo -e "\n${spaces}${redexclaim} $APP $FUNCTYPE Command Not Found, Exit Staus: ${EXIT_STATUS}";;
128) echo -e "\n${spaces}${redexclaim} $APP $FUNCTYPE Invalid Arguement to Exit, Exit Status: ${EXIT_STATUS}" ;;
255) echo -e "\n${spaces}${redexclaim} $APP $FUNCTYPE Exit status out of range, Exit Status: ${EXIT_STATUS}" ;;
*) echo -e "\n${spaces}${redexclaim} Exit Status $EXIT_STATUS for $APP $FUNCTYPE status: failed";;
esac
}
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_linwinpeas
fix_neo4j
fix_bloodhound
fix_proxychains
fix_sshuttle
fix_chisel
fix_cme # 08.03.2023 - added new CME6.x
fix_netexec
fix_ssh_widecompat
#fix_waybackurls # has issues not implemented yet
fix_dockercompose # 07.30.2024 - rev 1.7.9a6
fix_ghidra # 08.13.2024 - rev 1.8.1
}
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 # - restored after changes made in 1.6.9
# 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_dockercompose() {
# Menu option 7 Fix DockerCompose, also installs docker.io - Rev 1.7.9a6 07.30.2024
# exit_status tests :
# exit_status 127
# sudo rm /usr/local/bin/docker-compose
# sudo ./pimpmykali.sh menu option 7
#
# exit_status 0 - version check different versions
# sudo curl -L "https://github.com/docker/compose/releases/download/v2.28.1/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose && sudo chmod +x /usr/local/bin/docker-compose
# sudo ./pimpmykali.sh menu option 7
#
# exit_status 0 - version check same versions
# sudo ./pimpmyakli.sh menu option 7
#
# all other exit_status codes caught with * in case statement
#
DOCKERCOMPOSE_RELEASE_URL="https://github.com/docker/compose/releases/"
DOCKERCOMPOSE_RELEASE_HTML=$(curl -s "$DOCKERCOMPOSE_RELEASE_URL")
DOCKERCOMPOSE_LATEST_VERSION=$(echo "$DOCKERCOMPOSE_RELEASE_HTML" | grep -oP 'href="/docker/compose/releases/tag/v\K[0-9.]+(?=")' | head -n 1)
if [ -z "$DOCKERCOMPOSE_LATEST_VERSION" ]; then
echo -e "\n $redexclaim Error: Unable to find the latest Docker Compose version from Github"
exit 1
fi
DOCKERCOMPOSE_DOWNLOAD_URL="https://github.com/docker/compose/releases/download/v$DOCKERCOMPOSE_LATEST_VERSION/docker-compose-$(uname -s)-$(uname -m)"
if command -v docker-compose &> /dev/null;
then
SYSTEM_DOCKERCOMPOSE_VER=$(docker-compose --version | awk '{print $4}' | tr -d "v")
EXIT_STATUS="$?"
# exit status should result in 0
else
EXIT_STATUS="127"
# set exit status to 127 as docker-compose is not installed
fi
case $EXIT_STATUS in
0)
# exit code 0, docker compose is installed, compare versions and upgrade if newer is available
echo -e "\n\n $greenplus Local $(whereis docker-compose) found. Comparing versions..."
if [[ "$DOCKERCOMPOSE_LATEST_VERSION" > "$SYSTEM_DOCKERCOMPOSE_VER" ]]; then
echo -e "\n $greenminus Installed Docker Compose Ver = $SYSTEM_DOCKERCOMPOSE_VER"
echo -e " $greenminus Github Latest Docker Compose = $DOCKERCOMPOSE_LATEST_VERSION"
echo -e "\n $greenplus Installing latest DockerCompose \n"
apt_update
eval apt -y install build-essential python3-dev docker.io python3-setuptools \
python3-wheel python3-wheel-common cython3 python3-pip python3-pip-whl
echo -e "\n $greenplus Latest Docker Compose version: $DOCKERCOMPOSE_LATEST_VERSION"
echo -e "\n $greenplus Downloading Docker Compose: $DOCKERCOMPOSE_DOWNLOAD_URL to /usr/local/bin/docker-compose"
curl -L "$DOCKERCOMPOSE_DOWNLOAD_URL" -o /usr/local/bin/docker-compose
echo -e "\n $greenplus Making /usr/local/bin/docker-compose executable"
chmod +x /usr/local/bin/docker-compose
echo -e "\n $greenplus Docker Compose installed successfully $(docker-compose --version | awk {'print $4'})"
else
echo -e "\n $greenminus Installed Docker Compose Ver = $SYSTEM_DOCKERCOMPOSE_VER"
echo -e " $greenminus Github Latest Docker Compose = $DOCKERCOMPOSE_LATEST_VERSION"
echo -e "\n $greenplus Versions Match, exiting"
fi
;;
127)
# exit code 127 docker-compose is not found, install from
echo -e "\n\n $redexclaim Docker Compose command not found, installing..."
apt_update
apt_update_complete
eval apt -y install build-essential python3-dev docker.io python3-setuptools \
python3-wheel python3-wheel-common cython3 python3-pip python3-pip-whl
echo -e "\n $greenplus Latest Docker Compose version: $DOCKERCOMPOSE_LATEST_VERSION"
echo -e "\n $greenplus Downloading Docker Compose: $DOCKERCOMPOSE_DOWNLOAD_URL to /usr/local/bin/docker-compose\n"
curl -L "$DOCKERCOMPOSE_DOWNLOAD_URL" -o /usr/local/bin/docker-compose
echo -e "\n $greenplus Making /usr/local/bin/docker-compose executable"
chmod +x /usr/local/bin/docker-compose
echo -e "\n $greenplus Docker Compose installed successfully $(docker-compose --version | awk {'print $4'})"
;;
*)
# catch all other exit codes
echo -e "\n $redexclaim Unknown error code $EXIT_STATUS"
;;
esac
}
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
}
install_rustup() {
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs -sSf | sh -s -- -y
sudo -i -u $finduser curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs -sSf | sh -s -- -y
}
install_cargo() {
sudo apt -y install cargo libssl-dev
}
fix_waybackurls() {
echo -e "\n $greenplus Installing WaybackUrls \n"
[ -f $HOME/.cargo/env ] && source $HOME/.cargo/env
whichrust=$(which rustc)
whichcargo=$(which cargo)
echo -e "\n $greenplus Checking for rustc and cargo"
if [ "$whichrust" == "$HOME/.cargo/bin/rustc" ]
then
echo > /dev/null
else
echo -e "\n $redexclaim cannot find rustc, installing rustup"
export RUSTUP_INIT_SKIP_PATH_CHECK=yes
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs -sSf | sh -s -- -y
source $HOME/.cargo/env
echo "its in $HOME/.cargo/env"
fix_waybackurls
fi
[ -f $HOME/.cargo/env ] && source $HOME/.cargo/env
if [ "$whichcargo" == "$HOME/.cargo/bin/cargo" ]
then
rm -rf /opt/WaybackRust
git clone https://github.com/Neolex-Security/WaybackRust /opt/WaybackRust
cd /opt/WaybackRust
[ -f $HOME/.cargo/env ] && source $HOME/.cargo/env; cargo build --release
else
echo -e "\n $redexclaim cannot find cargo... installing cargo"
sudo apt -y install cargo libssl-dev
echo -e "\n $greenplus restarting fix_waybackurls function"
exit 0
fix_waybackurls
fi
if [[ -f /opt/WaybackRust/target/release/waybackrust ]]
then
echo -e "\n $greenplus symlinking waybackrust to /usr/bin/waybackurls"
ln -sf /opt/WaybackRust/target/release/waybackrust /usr/bin/waybackurls
echo -e "\n $greenplus Installation complete"
else
echo -e "\n $redexclaim cant find waybackrust"
fi
}
fix_neo4j() {
echo -e "\n $greenplus Installing Neo4j"
eval apt -y install neo4j
}
fix_bloodhound() {
echo -e "\n $greenplus Installing Bloodhound"
eval apt -y install bloodhound
}
fix_proxychains() {
echo -e "\n $greenplus Installing proxychains"
eval apt -y install proxychains
}
fix_sshuttle() {
echo -e "\n $greenplus Installing sshuttle"
eval apt -y install sshuttle
}
fix_chisel() {
echo -e "\n $greenplus Installing chisel"
eval apt -y install chisel
}
fix_ssh_widecompat() {
echo -e "\n $greenplus Setting SSH for wide compatibility"
eval cp -f /usr/share/kali-defaults/etc/ssh/ssh_config.d/kali-wide-compat.conf /etc/ssh/ssh_config.d/kali-wide-compat.conf
echo -e "\n $greenplus Restarting SSH service for wide compatibility"
eval systemctl restart ssh
}
fix_cme_symlinks() {
# needs to be a better way than doing this manually for each one
# create a few symlinks to make life easier
findrealuser=$(logname)
getshell=$(echo $SHELL | cut -d "/" -f4)
cmebin_path="$HOME/.local/share/pipx/venvs/crackmapexec/bin/"
localbin_path="$HOME/.local/bin/"
cme_symlink_array=( 'addcomputer.py' 'antdsparse' 'apython' 'ardpscan' 'asmbcertreq' 'asmbclient' 'asmbgetfile' 'asmbscanner' 'asmbshareenum'
'asn1tools' 'asysocksbrute' 'asysocksportscan' 'asysocksproxy' 'asysockssec' 'asysockstunnel' 'atexec.py' 'awinreg' 'bloodhound-python' 'dcomexec.py'
'dpapi.py' 'dploot' 'esentutl.py' 'exchanger.py' 'findDelegation.py' 'GetADUsers.py' 'getArch.py' 'Get-GPPPassword.py' 'getLAPSv2Password.py'
'GetNPUsers.py' 'getPac.py' 'getST.py' 'getTGT.py' 'GetUserSPNs.py' 'goldenPac.py' 'karmaSMB.py' 'keylistattack.py' 'kintercept.py' 'ldapdomaindump'
'ldd2bloodhound' 'ldd2pretty' 'lookupsid.py' 'lsassy' 'machine_role.py' 'masky' 'mimikatz.py' 'minidump' 'minikerberos-ccache2kirbi' 'minikerberos-ccacheedit'
'minikerberos-ccacheroast' 'minikerberos-cve202233647' 'minikerberos-cve202233679' 'minikerberos-getNTPKInit' 'minikerberos-getS4U2proxy'
'minikerberos-getS4U2self' 'minikerberos-getTGS' 'minikerberos-getTGT' 'minikerberos-kerb23hashdecrypt' 'minikerberos-kerberoast' 'minikerberos-kirbi2ccache'
'mqtt_check.py' 'msldap' 'mssqlclient.py' 'mssqlinstance.py' 'netaddr' 'netview.py' 'nmapAnswerMachine.py' 'normalizer' 'ntfs-read.py'
'ping6.py' 'ping.py' 'psexec.py' 'pypykatz' 'pywerview' 'raiseChild.py' 'rbcd.py' 'rdp_check.py' 'registry-read.py' 'reg.py'
'rpcdump.py' 'rpcmap.py' 'sambaPipe.py' 'samrdump.py' 'secretsdump.py' 'services.py' 'smbclient.py' 'smbexec.py' 'smbpasswd.py' 'smbrelayx.py'
'smbserver.py' 'sniffer.py' 'sniff.py' 'split.py' 'ticketConverter.py' 'ticketer.py' 'tstool.py' 'wmiexec.py' 'wmipersist.py' 'wmiquery.py')
for cme_symlink_array_file in ${cme_symlink_array[@]}; do
echo $cme_symlink_array_file > /tmp/cmesymlink.tmp
# sanity check
# runuser $findrealuser $getshell -c 'echo -e "\n $HOME/.local/share/pipx/venvs/crackmapexec/bin/$(cat /tmp/cmesymlink.tmp) $HOME/.local/bin/$(cat /tmp/cmesymlink.tmp)"'
echo -e "\n $greenplus Creating symlink for user $findrealuser to ~/.local/bin/$cme_symlink_array_file "
runuser $findrealuser $getshell -c 'symlink_file=$(cat /tmp/cmesymlink.tmp); ln -sf $HOME/.local/share/pipx/venvs/crackmapexec/bin/$symlink_file $HOME/.local/bin/$symlink_file'
done
# cleanup
rm -f /tmp/cmesymlink.tmp
}
fix_nxc_symlinks() {
findrealuser=$(logname)
getshell=$(echo $SHELL | cut -d "/" -f4)
nxcbin_path="$HOME/.local/share/pipx/venvs/netexec/bin/"
localbin_path="$HOME/.local/bin/"
nxc_symlink_array=( 'netexec' 'NetExec' 'nxc' 'nxcdb' )
for nxc_symlink_array_file in ${cme_symlink_array[@]}; do
echo $cme_symlink_array_file > /tmp/nxcsymlink.tmp
# sanity check
# runuser $findrealuser $getshell -c 'echo -e "\n $HOME/.local/share/pipx/venvs/crackmapexec/bin/$(cat /tmp/cmesymlink.tmp) $HOME/.local/bin/$(cat /tmp/cmesymlink.tmp)"'
echo -e "\n $greenplus Creating symlink for user $findrealuser to ~/.local/bin/$nxc_symlink_array_file "
runuser $findrealuser $getshell -c 'symlink_file=$(cat /tmp/nxcsymlink.tmp); ln -sf $HOME/.local/share/pipx/venvs/netexec/bin/$symlink_file $HOME/.local/bin/$symlink_file'
done
# cleanup
rm -f /tmp/nxcsymlink.tmp
}
fix_netexec() {
findrealuser=$(logname)
echo -e "\n $greenplus Installing Netexec (nxc)"
# root installation
if [[ $findrealuser == "root" ]];
then
echo -e "\n Starting $findrealuser user installation"
eval apt -y install pipx python3-venv python3-poetry
pipx install git+https://github.com/Pennyw0rth/NetExec --force
getshell=$(echo $SHELL | cut -d "/" -f4)
check_for_local_bin_path=$(cat "$HOME/.$getshell"rc | grep -i "PATH=" | grep -i "\$HOME\/\.local\/bin" -c)
if [[ $check_for_local_bin_path -eq 0 ]];
then
echo "export PATH=\$HOME/.local/bin:\$PATH" >> $HOME/.$getshell"rc"
else
echo "\n $redexclaim Path already exists for user $findrealuser "
fi
fix_nxc_symlinks
fi
# user installation
if [[ $findrealuser != "root" ]];
then
echo -e "\n Starting $findrealuser user installation\n"
eval apt -y install pipx python3-venv python3-poetry
sudo -i -u $findrealuser sh -c 'pipx install git+https://github.com/Pennyw0rth/NetExec --force'
getshell=$(echo $SHELL | cut -d "/" -f4)
subshell=$(runuser $findrealuser $getshell -c 'echo $SHELL | cut -d "/" -f4')
checkforlocalbinpath=$(cat /home/$findrealuser/.$subshell"rc" | grep -i PATH= | grep -i "\$HOME\/\.local\/bin:\$PATH" -c)
if [[ $checkforlocalbinpath -eq 0 ]]
then
runuser $findrealuser $getshell -c 'subshell=$(echo $SHELL | cut -d "/" -f4); echo "export PATH=\$HOME/.local/bin:\$PATH" >> $HOME/.$subshell"rc"'
runuser $findrealuser $getshell -c 'subshell=$(echo $SHELL | cut -d "/" -f4); source $HOME/.$subshell"rc"'
else
echo -e "\n $redexclaim Path already exists "
fi
fix_nxc_symlinks
fi
}
fix_cme() {
findrealuser=$(logname)
echo -e "\n $greenplus Installing cme (crackmapexec)"
echo -e "\n $greenplus Checking for existing crackmapexec installation..."
checkforcme=$(apt list crackmapexec | grep -i -c "installed")
if [[ $checkforcme -ge 1 ]];
then
echo -e "\n $greenplus Existing installation found! - Removing"
sudo apt -y remove crackmapexec
fi
# root installation
if [[ $findrealuser == "root" ]];
then
echo -e "\n Starting $findrealuser user installation"
# pipx installer changed as of revision 1.7.4h
eval apt -y install pipx python3-venv
# python3 -m pip install pipx --user
# git clone https://github.com/mpgn/CrackMapExec /opt/CrackMapExec
git clone https://github.com/Porchetta-Industries/CrackMapExec /opt/CrackMapExec
cd /opt/CrackMapExec
pipx install . --force
getshell=$(echo $SHELL | cut -d "/" -f4)
check_for_local_bin_path=$(cat "$HOME/.$getshell"rc | grep -i "PATH=" | grep -i "\$HOME\/\.local\/bin" -c)
if [[ $check_for_local_bin_path -eq 0 ]];
then
echo "export PATH=\$HOME/.local/bin:\$PATH" >> $HOME/.$getshell"rc"
else
echo "\n $redexclaim Path already exists for user $findrealuser "
fi
fix_cme_symlinks
fi
# user installation
if [[ $findrealuser != "root" ]];
then
echo -e "\n Starting $findrealuser user installation\n"
# pipx installer changed as of revision 1.7.4h
# sudo -i -u $findrealuser sh -c 'python3 -m pip install pipx --user'
eval apt -y install pipx python3-venv
[ -d /opt/CrackMapExec ] && rm -rf /opt/CrackMapExec
git clone https://github.com/Porchetta-Industries/CrackMapExec /opt/CrackMapExec
sudo -i -u $findrealuser sh -c 'cd /opt/CrackMapExec; pipx install . --force'
getshell=$(echo $SHELL | cut -d "/" -f4)
subshell=$(runuser $findrealuser $getshell -c 'echo $SHELL | cut -d "/" -f4')
checkforlocalbinpath=$(cat /home/$findrealuser/.$subshell"rc" | grep -i PATH= | grep -i "\$HOME\/\.local\/bin:\$PATH" -c)
if [[ $checkforlocalbinpath -eq 0 ]]
then
runuser $findrealuser $getshell -c 'subshell=$(echo $SHELL | cut -d "/" -f4); echo "export PATH=\$HOME/.local/bin:\$PATH" >> $HOME/.$subshell"rc"'
runuser $findrealuser $getshell -c 'subshell=$(echo $SHELL | cut -d "/" -f4); source $HOME/.$subshell"rc"'
else
echo -e "\n $redexclaim Path already exists "
fi
fix_cme_symlinks
fi
}
fix_linwinpeas() {
# get all the peas!!!
# Thanks lbalmaceda for the code submission! May 6, 2024 rev 1.7.9a4 carlospolop -> peass-ng updated url
current_build=$(curl -s https://github.com/peass-ng/PEASS-ng/releases | grep -i "refs/heads/master" -m 1 | awk '{ print $5 }' | cut -d "<" -f1)
releases_url="https://github.com/peass-ng/PEASS-ng/releases/download/$current_build"
dest_linpeas="/opt/linpeas"
dest_winpeas="/opt/winpeas"
# linpeas to /opt/linpeas
echo -e "\n $greenplus Downloading all the linpeas from build $current_build"
[ ! -d $dest_linpeas ] && mkdir $dest_linpeas || echo > /dev/null
linpeas_arr=('linpeas.sh' 'linpeas_darwin_amd64' 'linpeas_darwin_arm64' 'linpeas_fat.sh' 'linpeas_linux_386' 'linpeas_linux_amd64' 'linpeas_linux_arm')
for linpeas_file in ${linpeas_arr[@]}; do
echo -e " $greenplus Downloading $linpeas_file to $dest_linpeas/$linpeas_file"
wget -q $releases_url/$linpeas_file -O $dest_linpeas/$linpeas_file
chmod +x $dest_linpeas/$linpeas_file
done
# winpeas to /opt/winpeas
echo -e "\n $greenplus Downloading all the winpeas from build $current_build"
[ ! -d $dest_winpeas ] && mkdir $dest_winpeas || echo > /dev/null
winpeas_arr=('winPEAS.bat' 'winPEASany.exe' 'winPEASany_ofs.exe' 'winPEASx64_ofs.exe' 'winPEASx86.exe' 'winPEASx86_ofs.exe')
for winpeas_file in ${winpeas_arr[@]}; do
echo -e " $greenplus Downloading $winpeas_file to $dest_winpeas/$winpeas_file"
# revision 1.7.4 static wget of the April 2023 release of Winpeas
# due to github issue https://github.com/carlospolop/PEASS-ng/issues/359
# wget -q https://github.com/peass-ng/PEASS-ng/releases/tag/20230419-b6aac9cb/$winpeas_file -O $dest_winpeas/$winpeas_file
# original code to be re-enabled once the winpeas group releases a fixed self-contained version
# updated in 1.7.9a4 to always get latest release
wget -q $releases_url/$winpeas_file -O $dest_winpeas/$winpeas_file
chmod +x $dest_winpeas/$winpeas_file
done
}
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 reinstall 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
echo -e "\n $greenplus Gowitness dependancy fix: Installing - google-chrome for $arch \n"
eval apt -y install libu2f-udev
eval dpkg -i /tmp/google-chrome-stable_current_amd64.deb
rm -f /tmp/google-chrome-stable_current_amd64.deb
# --- old code to be removed ---
# --- added as of revision 1.6.9a - changed installation source to kali repo
# --- disabled as a 1.7.1 google-chrome-stable no longer in the repo!!
# eval apt -y install google-chrome-stable
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
pip3 install typing twisted --break-system-packages
pip3 install -r requirements.txt --break-system-packages
python3 setup.py install
fix_liblibc
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() {