diff --git a/README.md b/README.md index de9cac1..44a30fa 100644 --- a/README.md +++ b/README.md @@ -3,8 +3,8 @@ # Fixes for new imported Kali Linux virtual machines - could be used on a bare metal machines, but thats on you -# Github index updated added +x permission: -- Script should now be executable upon clone (perms: 755 rwxr-xr-x added to github) +# Github index updated added +x permission: +- Script should now be executable upon clone (perms: 755 rwxr-xr-x added to github) - you should not need to chmod +x pimpmykali.sh upon git clone anymore # Installation script: @@ -13,21 +13,25 @@ - cd pimpmykali - sudo ./pimpmykali.sh -# Revision 0.5d - bugfix Thank you to @AES ! for finding the bug, nmap wget script was pulling the wrong page +# Revision 0.5e - Nuke Impacket added to menu enter character ! to run nuke imapcket + - some issues with people understanding how to use --borked on the command line + so a menu item was added to ease use of the nuke impacket function. + +# Revision 0.5d - bugfix Thank you to @AES ! for finding the bug, nmap wget script was pulling the wrong page - correct page has been added new version git pushd - - unfortunatly versions 0.5c thru 0.4 are affected if you have an old version + - unfortunatly versions 0.5c thru 0.4 are affected if you have an old version or havent ran pimpmykali.sh please git clone a fresh copy and re-run the nmap from the menu Menu Option 8 - Fix clamav-exec.nse - - corrected http-shellshock.nse nmap script added - Thank you Alek & Blob! - -# Revision 0.5c - fix_upgrade removed from fix_missing - - fix_upgrade removed from fix_missing and is no longer 'forced' as a part of fix_missing + - corrected http-shellshock.nse nmap script added - Thank you Alek & Blob! + +# Revision 0.5c - fix_upgrade removed from fix_missing + - fix_upgrade removed from fix_missing and is no longer 'forced' as a part of fix_missing - fix_upgrade will now only be called as a part of fix_all (menu 0) or fix_upgrade (menu 9) - or command line switches --upgrade -upgrade or upgrade + or command line switches --upgrade -upgrade or upgrade - general code cleanup, some additional comments added # Revision 0.5b - Blindpentesters Essential Collection added - - added Blindpentesters 'The Essentials' tools and utils collection + - added Blindpentesters 'The Essentials' tools and utils collection - menu option 'B' for blindpentesters tools collection, installs, runs the_essentials.sh and exits # Revision 0.5a - cosmetic fixes @@ -40,16 +44,16 @@ - virt_what determines if vm is under virtualbox or vmware - check_vm checks for virtualbox or vmware and installs proper drivers for each - run_update runs fix_sources, runs apt upgrade calls virt_what, calls check_vm - + # Revision 0.4b : minor updates - reworked fix_section works much better now - - added slient 'mode' variable, uncomment silent= line to turn output on and off from apt etc + - added slient 'mode' variable, uncomment silent= line to turn output on and off from apt etc - misc cleanup in the script # Revision 0.4a : 2nd warning screen added for --borked impacket removal system - If you cant have a little fun with your own scripts your doing something wrong.... - last chance warning screen ( mostly novelty ), random launch code generation on each run of --borked - - list of target selection, targets locked, etc + - list of target selection, targets locked, etc - seriously if you made it to --borked 2nd warning your having a bad day with impacket.. enjoy the giggle - 10 second wait timer added to last chance launch screen before operations are preformed - if no ctrl+c is entered to cancel the operation, fix_sead is run, followed by fix_impacket @@ -62,75 +66,75 @@ - added --borked notice to menu system, help system - added warning screen for --borked, only input of Y will proceed anything else exits - fix_sead_warning, fix_sead_run, fix_impacket_array, fix_impacket all executed in order with --borked - - fix_sead_run removes any and all directories named impacket* in the following locations (you have been warned): + - fix_sead_run removes any and all directories named impacket* in the following locations (you have been warned): /opt /usr/bin /usr/local/lib /usr/lib /home/$finduser/.local/bin /home/$finduser/.local/lib ~/.local/lib ~/.local/bin - - fix_sead_run, also removes via fix_impacket_array any .py or .pyc related to impacket in the following: - /usr/bin/$impacket_file /usr/local/bin/$impacket_file - (root)~/.local/bin/$impacket_file + - fix_sead_run, also removes via fix_impacket_array any .py or .pyc related to impacket in the following: + /usr/bin/$impacket_file /usr/local/bin/$impacket_file + (root)~/.local/bin/$impacket_file (user)/home/$finduser/.local/bin/$impacket_file # Revision 0.3d - added flameshot to fix_missing as a part of the default installed tools - emergency fix to --force, everything should be functioning now -# Revision 0.3c: +# Revision 0.3c: - per request kali-root-login enabling prompt has been reworked and reworded to be less confusing and - to give the user a better explaniation of what the script is doing at that stage + to give the user a better explaniation of what the script is doing at that stage - added to note that if you dont understand what this part of the script is doing hit N - added colors for syntax highlighting in the onscreen messages of the script in places - added fix_nmap function for fixing /usr/share/nmap/scripts/clamav-exec.nse (commented out at this time clamav-exec.nse was an issue at one time but unknown if it is still relevent) - --force command line argument was being called without setting $force in fix_all $force - fixed -# Revision 0.3b: - - bug fix ( Thanks ShadeauxBoss! for finding it ) impacket installation was missing cd /opt/impacket-0.9.19 +# Revision 0.3b: + - bug fix ( Thanks ShadeauxBoss! for finding it ) impacket installation was missing cd /opt/impacket-0.9.19 - feature request added : Gedit installation menu option 7, is included in fix_missing, all and force - remove clear from exit screen -# Revision 0.3a: +# Revision 0.3a: - the extraction of the impacket-0.9.19.tar.gz was leaving /opt/impacket-0.9.19 with 700 perms and an ownership of 503:root, this has been changed to ownership root:root and all files inside /opt/impacket-0.9.19 have had their permissions set to 755 after extraction of impacket-0.9.19.tar.gz - Ascii art added to the menu - -# Revision 0.3: + +# Revision 0.3: - added checks for already installed installations, added --force command ( --force will run all fixes/reinstalls ) - fix_impacket function : added both .py and .pyc files to impacket removal array - added on screen notification of files being removed by the array - fix_missing function : has been reworked new vars check section force type - added fix_section function : fix_section is the workhorse for fix_missing -- reworked python-pip installation to its own function python-pip-curl and installs python-pip via curl +- reworked python-pip installation to its own function python-pip-curl and installs python-pip via curl -# Revision 0.2: +# Revision 0.2: - Added colorized notifications, help system, command line arguements, case based menu system - valid command line arguements are: help, all, go, grub, impacket, missing, menu, smb, grub, root - anything other than --all or -all or all , will only run that function and then exit. - command line arguements can be used with -- or - or just the word itself to try can catch for all possible cases - -- example command line var: --help or -help or help will catch help and works for all valid command line arguements - anything other the command line arugement catch exits and displays help -# Fixes : -- python-pip now removed from kali repos, installation via curl +- example command line var: --help or -help or help will catch help and works for all valid command line arguements + anything other the command line arugement catch exits and displays help + +# Fixes : +- python-pip now removed from kali repos, installation via curl - python3-pip not installed - seclists not installed -- golang not installed +- golang not installed - kali-root-login not installed and reneables root login - reworked and added prompt - impacket-0.9.19 - removes any prior installation of impacket (gracefully and forcefully) - - installs impacket-0.9.19 - - installs python-pip via curl + - installs impacket-0.9.19 + - installs python-pip via curl - installs python wheel - /etc/samba/smb.conf - adds the 2 lines below [global] for min max protocol - client min protocol = CORE - client max protocol = SMB3 - grub added detection of default /etc/default/grub - - added mitigations=off + - added mitigations=off # TODO -- .bashrc alias and functions ( currently commented out and is not a part of the running script ) - - adds command ex function to extract from any archive with 1 command ex - - vpnip - displays tun0 ip address in the terminal via vpnip alias +- .bashrc alias and functions ( currently commented out and is not a part of the running script ) + - adds command ex function to extract from any archive with 1 command ex + - vpnip - displays tun0 ip address in the terminal via vpnip alias - added /sbin to user path, can now ifconfig without sudo diff --git a/pimpmykali.sh b/pimpmykali.sh index ef527f1..00aaa77 100755 --- a/pimpmykali.sh +++ b/pimpmykali.sh @@ -98,7 +98,7 @@ # # revision var - revision="0.5d" + revision="0.5e" # unicorn puke: red=$'\e[1;31m' @@ -387,8 +387,8 @@ fix_sead_run () { python3_pip # gracefully attempt to remove impacket via pip and pip3 - eval pip uninstall impacket -y $silent - eval pip3 uninstall impacket -y $silent + eval pip uninstall impacket -y $silent + eval pip3 uninstall impacket -y $silent # used to get the username running this script as sudo to check /home/$finduser/.local/lib and /home/$finduser/.local/bin finduser=$(logname) @@ -444,14 +444,14 @@ fix_impacket_array () { 'smbrelayx.pyc' 'smbserver.pyc' 'sniffer.pyc' 'sniff.pyc' 'split.pyc' 'ticketConverter.pyc' 'ticketer.pyc' 'wmiexec.pyc' 'wmipersist.pyc' 'wmiquery.pyc' ) - for impacket_file in ${arr[@]}; do + for impacket_file in ${arr[@]}; do rm -f /usr/bin/$impacket_file /usr/local/bin/$impacket_file ~/.local/bin/$impacket_file /home/$finduser/.local/bin/$impacket_file # removed status of whats being removed from screen, too much screen garbage # echo -e "\n $greenplus $impacket_file removed" done } -fix_impacket () { +fix_impacket () { step 3 finduser=$(logname) # 2020.3 - package: impacket no longer exists in repo will throw error eval apt -y remove impacket $silent ## do not remove : python3-impacket impacket-scripts @@ -506,6 +506,18 @@ bpt () { } pimpmywifi_main () { + + # - RTL8188AU FIX LIBC6 BREAKS LIBGCC-9-DEV + # -----begin fix----- + # apt -y update + # apt -y remove realtek-88xxau-dkms && apt -y purge realtek-88xxau-dkms + # apt -y install gcc-9-base # libc6 breaks libgcc-9-dev fix + # apt -y install linux-headers-amd64 + # apt -y install realtek-88xxau-dkms + # apt -y upgrade + # reboot + # iwconfig + # -----end fix------ # detect wifi chipset # install proper dkms driver based upon detection # or just give a menu for a selection of drivers? @@ -522,10 +534,8 @@ pimpmywifi_main () { else echo DIFFERENT fi - } - virt_what() { # DISPLAY POWER MANAGEMENT -- ISSUE # if the vm's display goes 'dark' or 'power saving mode' for whatever reason virt-what is not @@ -533,7 +543,7 @@ virt_what() { # maybe implement something here to read the power management settings and drop inplace some that # are not set to dim / turn off display... echo -e "\n $greenplus installing virt-what \n" - apt -y update $silent && apt -y install virt-what $silent + eval apt -y update $silent && apt -y install virt-what $silent } vbox_fix_shared_folder_permission_denied () { @@ -572,7 +582,7 @@ check_vm () { then echo -e "\n $greenplus *** VIRTUALBOX DETECTED *** \n" echo -e "\n $greenplus installing virtualbox-dkms virtualbox-guest-x11" - apt -y reinstall virtualbox-dkms virtualbox-guest-x11 + eval apt -y reinstall virtualbox-dkms virtualbox-guest-x11 $silent # Additional Fixes for virtualbox since were already here and detected virtualbox #----------------------- additional virtualbox fixes vbox_fix_shared_folder_permission_denied @@ -582,7 +592,7 @@ check_vm () { then echo -e "\n $greenplus *** VMWARE DETECTED *** \n" echo -e "\n $greenplus installing open-vm-tools-desktop fuse" - apt -y reinstall open-vm-tools-desktop fuse + eval apt -y reinstall open-vm-tools-desktop fuse $silent # Additional Fixes for Vmware since were already here and detected vmware #----------------------- additional vmware fixes # fixes go here @@ -602,18 +612,25 @@ fix_sources () { run_update () { fix_sources echo -e "\n $greenplus starting pimpmyupgrade \n" - apt -y update $silent && sudo apt -y upgrade $silent + eval apt -y update $silent && apt -y upgrade $silent kernel_check=$(ls /lib/modules | sort -n | tail -n 1) echo -e "\n $greenplus installing linux-headers-$kernel_check \n" # Works well, tested multiple systems but keep an eye out for issues - apt -y install linux-headers-amd64 $silent # generic meta package for correct linux-headers + eval apt -y install linux-headers-amd64 $silent # generic meta package for correct linux-headers #apt -y install linux-headers-$kernel_check #apt install -y linux-headers-5.8.0-kali2-amd64 } # ascii art -asciiart=$(base64 -d <<< "H4sIAAAAAAAAA31QQQrCQAy89xVz9NR8QHoQH+BVCATBvQmCCEXI480kXdteTJfdzGQy2S3wi9EM/2MnSDm3oUoMuJlX3hmsMMSjA4uAtUTsSQ9NUkkKVgKKBXp1lEC0auURW3owsQlTZtf4QtGZgjXYKT4inPtI23oEK7wXlyPnd8arKdKE0EPdUnhIf0v+iE2o7BgVFVyec3u1OxFw+uRxbvPt8R6+MOpGq5cBAAA=" | gunzip ) +#asciiart=$(base64 -d <<< "H4sIAAAAAAAAA31QQQrCQAy89xVz9NR8QHoQH+BVCATBvQmCCEXI480kXdteTJfdzGQy2S3wi9EM/2MnSDm3oUoMuJlX3hmsMMSjA4uAtUTsSQ9NUkkKVgKKBXp1lEC0auURW3owsQlTZtf4QtGZgjXYKT4inPtI23oEK7wXlyPnd8arKdKE0EPdUnhIf0v+iE2o7BgVFVyec3u1OxFw+uRxbvPt8R6+MOpGq5cBAAA=" | gunzip ) +asciiart=$(base64 -d <<< "H4sIAAAAAAAAA31QQQrCQAy89xVz9NR8QHoQH+BVCATBvQmC +CEXI480kXdteTJfdzGQy2S3wi9EM/2MnSDm3oUoMuJlX3hmsMMSjA4uAtUTsSQ9NUkkKVgKKBX +p1lEC0auURW3owsQlTZtf4QtGZgjXYKT4inPtI23oEK7wXlyPnd8arKdKE0EPdUnhIf0v+iE2o +7BgVFVyec3u1OxFw+uRxbvPt8R6+MOpGq5cBAAA=" | gunzip ) + + + pimpmykali_menu () { clear @@ -630,8 +647,9 @@ pimpmykali_menu () { echo -e " 8 - Fix nmap scripts (clamav-exec.nse and http-shellshock.nse)" # fix_nmap echo -e " 9 - Pimpmyupgrade (apt upgrade with vbox/vmware detection)" # fix_upgrade echo -e " (sources.list, linux-headers, vm-video)" - echo -e " B - BlindPentesters 'The Essentials' tools & utilies collection\n" # bpt function - the essentials - echo -e " 0 - Fix ALL (runs only 1 thru 9) \n" # fix_all + echo -e " ! - Nuke Impacket (Type ! character for this menu item)\n" # fix_sead_warning + echo -e " B - BlindPentesters 'The Essentials' tools & utilies collection\n" # bpt function - the essentials + echo -e " 0 - Fix ALL (runs only 1 thru 9) \n" # fix_all echo -e " Now with Pimpmyupgrade\n - when prompted Yes or No select Yes to auto restart services \n" echo -e " use the --borked command line switch as a last resort to" echo -e " remove/reinstall impacket only!! \n" @@ -648,6 +666,7 @@ pimpmykali_menu () { 8) fix_nmap ;; 9) fix_upgrade ;; 0) fix_all ;; + !) forced=1; fix_sead_warning;; b|B) bpt ;; # x|X) exit_screen ;; x|X) echo -e "\n\n Exiting pimpmykali.sh - Happy Hacking! \n" ;; @@ -656,7 +675,7 @@ pimpmykali_menu () { } pimpmykali_help () { - # do not edit this echo statement, spacing has been fixed and is correct for display terminal + # do not edit this echo statement, spacing has been fixed and is correct for display in the terminal echo -e "\n valid command line arguements are : \n \n --all run all operations \n"\ "--smb only run smb.conf fix \n --go only fix/install golang"\ "\n --impacket only fix/install impacket \n --grub only add mitigations=off"\ @@ -685,14 +704,14 @@ check_arg () { --help) pimpmykali_help ;; -help) pimpmykali_help ;; help) pimpmykali_help ;; --flameshot) fix_flameshot ;; -flameshot) fix_flameshot ;; flameshot) fix_flameshot ;; --force) force=1; fix_all $force ;; -force) force=1; fix_all $force ;; force) force=1; fix_all $force ;; - --borked) force=1; fix_sead_warning;; -borked) fix_sead_warning; exit ;; borked) fix_sead_warning; exit ;; + --borked) force=1; fix_sead_warning;; -borked) fix_sead_warning; ;; borked) fix_sead_warning; ;; --nmap) fix_nmap ;; -nmap) fix_nmap ;; nmap) fix_nmap ;; --bpt) bpt ;; -bpt) bpt ;; bpt) bpt;; --upgrade) fix_upgrade ;; *) pimpmykali_help ; exit 0 ;; esac fi - } + } exit_screen () { echo -e "$asciiart"