r00t-3xp10it

[netool toolkit] universal downloader/installer

Jul 23rd, 2015
4,160
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 15.45 KB | None | 0 0
  1. #!/bin/sh
  2. ###
  3. #
  4. # -=[netool toolkit downloader/installer]=-
  5. # Author: r00t-3xp10it -> peterubuntu10[at]sourceforge[dot]net
  6. # Project -> https://sourceforge.net/projects/netoolsh/
  7. # ------------------------------------------------------------
  8. # This script will download the correct toolkit for your OS
  9. # using my GIT (dev-only repository), or using my STABLE repo,
  10. # and will install it under: Kali, Ubuntu, Debian, Parrot, BackBox,
  11. # Lubuntu, Xubuntu, Kubuntu "more distros will be added in the future".
  12. # ------------------------------------------------------------
  13. # Save file as: downloader.sh
  14. # Set privs   : chmod +x downloader.sh
  15. # run script  : ./downloader.sh
  16. #
  17. ###
  18.  
  19.  
  20. # ----------------------------------------
  21. # Variable declarations
  22. ########################################################################################
  23. H0m3=`echo ~`                              # local user Home path                      #
  24. OS=`awk '{print $1}' /etc/issue`           # grab Operative System distro              #
  25. rpath="$H0m3/opensource"                   # toolkit correct directory (default)       #
  26. wEr3=`pwd`                                 # current path of downloader.sh             #
  27. ########################################################################################
  28.  
  29.  
  30. # ----------------------------------------
  31. # Colorise shell Script output leters
  32. # ----------------------------------------
  33. Colors() {
  34. Escape="\033";
  35. white="${Escape}[0m";
  36. RedF="${Escape}[31m";
  37. GreenF="${Escape}[32m";
  38. YellowF="${Escape}[33m";
  39. BlueF="${Escape}[34m";
  40. CyanF="${Escape}[36m";
  41. Reset="${Escape}[0m";
  42. }
  43.  
  44.  
  45.  
  46.  
  47.  
  48. # ----------------------------------
  49. # bash trap ctrl-c and call ctrl_c()
  50. # ----------------------------------
  51. trap ctrl_c INT
  52. ctrl_c() {
  53. Colors;
  54.    echo ${RedF}[x]${YellowF} You have pressed ${RedF}[CTRL+C] ${Reset};
  55.    echo ${RedF}[x]${YellowF} Please Wait, cleanning ... ${Reset};
  56.    sleep 2
  57.    cd /tmp && rm *.sh > /dev/null 2>&1
  58.    rm *.txt > /dev/null 2>&1
  59. exit
  60. }
  61.  
  62.  
  63.  
  64. # collecting some info about repository's available
  65. cd /tmp && wget -qq https://dl.dropboxusercontent.com/u/21426454/netool-kali/update2.txt
  66. G1T=`cat /tmp/update2.txt | egrep -m 1 "V3rs10n:" | cut -d ':' -f2` > /dev/null 2>&1
  67. ST4BL3=`cat /tmp/update2.txt | egrep -m 1 "ST4bL3:" | cut -d ':' -f2` > /dev/null 2>&1
  68. cd $H0m3
  69.  
  70.  
  71.  
  72. Colors;
  73. # ----------------------------
  74. # installer banner display
  75. # ----------------------------
  76. cat << !
  77.  
  78.      ┌┐┌┌─┐┌┬┐  ┌┬┐┌─┐┌─┐┬  ┌─┐
  79.      │││├┤  │    │ │ ││ ││  └─┐
  80.      ┘└┘└─┘ ┴    ┴ └─┘└─┘┴─┘└─┘ (universal)
  81.  +---------------------------------------------+
  82.  |    Downloader/Installer by: r00t-3xp10it    |
  83.  +---------------------------------------------+
  84.  |  Script to quickly 'download' and 'install' |
  85.  |  the correct version of toolkit in your OS. |
  86.  |                     ---                     |
  87.  |  this script will allow you to download the |
  88.  |   toolkit from STABLE repository (bug free) |
  89.  |   or from GIT repository (not-stable-beta). |
  90.  +---------------------------------------------+
  91. !
  92. Colors;
  93. echo ${white} '|'_STABLE REPO:${GreenF}$ST4BL3   ${white}GIT REPO:${GreenF}$G1T${Reset};
  94. echo "" && echo ""
  95. echo ${RedF}_${Reset};
  96. echo ${BlueF}['>'][ PRESS${GreenF} ENTER ${BlueF}TO DOWNLOAD TOOLKIT ]${Reset};
  97. echo ${BlueF}['>'][ PRESS${YellowF} CTRL+C ${BlueF}TO ABORT TASKS ]${Reset};
  98. read op
  99. echo ${BlueF}[+][ distro download ${YellowF}'->'${GreenF} $OS ${BlueF}]${Reset};
  100. sleep 1
  101. echo ${BlueF}[+][ clonning into ${YellowF}'->'${GreenF} $rpath ${BlueF}]${Reset};
  102. sleep 1
  103.  
  104.  
  105.   # check if opensource folder exists
  106.   if [ -d $rpath ]; then
  107.     echo ${RedF}[x][ abort clonninig repository, folder allready exists ]${Reset};
  108.     zenity --info --title="ABORT CLONNING REPOSITORY" --text "the toolkit was [ NOT ] downloaded.\nfolder allready exists.\n\nIf you wish to update, then delete opensource folder and run this script again." --width 400 > /dev/null 2>&1
  109.     exit
  110.   else
  111.     echo "good" > /dev/null 2>&1
  112. fi
  113.  
  114.  
  115.  
  116.  
  117.  
  118. # -----------------------------------------
  119. # check if compatible OS distro (node name)
  120. # -----------------------------------------
  121. if [ "$OS" "=" "Kali" ]; then
  122. m0D=$(zenity --list --title "CHOSE REPOSITORY" --text "Download toolkit from:" --radiolist --column "Pick" --column "Option" TRUE "STABLE REPOSITORY (bug free $ST4BL3)" FALSE "GIT REPOSITORY (under develop $G1T)" --width 330 --height 180) > /dev/null 2>&1
  123.  
  124.       if [ "$m0D" = "STABLE REPOSITORY (bug free $ST4BL3)" ]; then
  125.         cd $H0m3 && wget https://sourceforge.net/projects/netoolsh/files/opensource%5Bkali%5D.tar.gz
  126.         tar -xf opensource[kali].tar.gz
  127.         echo ${BlueF}[+][${GreenF} download completed, running installer ${BlueF}]${Reset};
  128.         echo ""
  129.         cd opensource && chmod +x INSTALL.sh && ./INSTALL.sh
  130.         rm $wEr3/downloader.sh > /dev/null 2>&1
  131.         rm /tmp/update2.txt > /dev/null 2>&1
  132.         exit
  133.  
  134.       elif [ "$m0D" = "GIT REPOSITORY (under develop $G1T)" ]; then
  135.         cd $H0m3 && git clone git://git.code.sf.net/p/netoolsh/opensource-kali opensource
  136.         echo ${BlueF}[+][${GreenF} clonning completed, running installer ${BlueF}]${Reset};
  137.         echo ""
  138.         cd opensource && chmod +x INSTALL.sh && ./INSTALL.sh
  139.         rm $wEr3/downloader.sh > /dev/null 2>&1
  140.         rm /tmp/update2.txt > /dev/null 2>&1
  141.         exit
  142.  
  143.    else
  144.      echo ${RedF}[x][ABORTED][${YellowF} QUIT ${RedF}] ${Reset};
  145.      rm $wEr3/downloader.sh > /dev/null 2>&1
  146.      rm /tmp/update2.txt > /dev/null 2>&1
  147.      sleep 2
  148.      exit
  149. fi
  150.  
  151.  
  152.  
  153.  
  154.  
  155.   elif [ "$OS" "=" "Ubuntu" ]; then
  156.     m0D=$(zenity --list --title "CHOSE REPOSITORY" --text "Download toolkit from:" --radiolist --column "Pick" --column "Option" TRUE "STABLE REPOSITORY (bug free $ST4BL3)" FALSE "GIT REPOSITORY (under develop $G1T)" --width 330 --height 180) > /dev/null 2>&1
  157.  
  158.       if [ "$m0D" = "STABLE REPOSITORY (bug free $ST4BL3)" ]; then
  159.         cd $H0m3 && wget https://sourceforge.net/projects/netoolsh/files/opensource.tar.gz
  160.         tar -xf opensource.tar.gz
  161.         echo ${BlueF}[+][${GreenF} download completed, running installer ${BlueF}]${Reset}
  162.         echo ""
  163.         cd opensource && chmod +x INSTALL.sh && ./INSTALL.sh
  164.         rm $wEr3/downloader.sh > /dev/null 2>&1
  165.         rm /tmp/update2.txt > /dev/null 2>&1
  166.         exit
  167.  
  168.       elif [ "$m0D" = "GIT REPOSITORY (under develop $G1T)" ]; then
  169.         cd $H0m3 && git clone git://git.code.sf.net/p/netoolsh/opensource opensource
  170.         echo ${BlueF}[+][${GreenF} clonning completed, running installer ${BlueF}]${Reset};
  171.         echo ""
  172.         cd opensource && chmod +x INSTALL.sh && ./INSTALL.sh
  173.         rm $wEr3/downloader.sh > /dev/null 2>&1
  174.         rm /tmp/update2.txt > /dev/null 2>&1
  175.         exit
  176.  
  177.    else
  178.      echo ${RedF}[x][ABORTED][${YellowF} QUIT ${RedF}] ${Reset};
  179.      rm $wEr3/downloader.sh > /dev/null 2>&1
  180.      rm /tmp/update2.txt > /dev/null 2>&1
  181.      sleep 2
  182.      exit
  183. fi
  184.  
  185.  
  186.  
  187.  
  188.   elif [ "$OS" "=" "BackBox" ]; then
  189.   m0D=$(zenity --list --title "CHOSE REPOSITORY" --text "Download toolkit from:" --radiolist --column "Pick" --column "Option" TRUE "STABLE REPOSITORY (bug free $ST4BL3)" FALSE "GIT REPOSITORY (under develop $G1T)" --width 330 --height 180) > /dev/null 2>&1
  190.  
  191.       if [ "$m0D" = "STABLE REPOSITORY (bug free $ST4BL3)" ]; then
  192.         cd $H0m3 && wget https://sourceforge.net/projects/netoolsh/files/opensource.tar.gz
  193.         tar -xf opensource.tar.gz
  194.         zenity --info --title="REMARK" --text "netool toolkit it was build to work on Ubuntu or Kali,\nThis downloader will replace the original 'installer' by\none universal installer to be hable to run it on BackBox\nRemenber to edit 'toolkit_config' file to input the correct paths to toolkit dependencies." --width 460 > /dev/null 2>&1
  195.         # Special thanks to 'milton@barra' for checking dependencies paths on backbox distro
  196.         echo ${BlueF}[+][${GreenF} all files downloaded, running installer ${BlueF}]${Reset};
  197.         echo ""
  198.         cd opensource && chmod +x INSTALL.sh && ./INSTALL.sh
  199.         rm $wEr3/downloader.sh > /dev/null 2>&1
  200.         rm /tmp/update2.txt > /dev/null 2>&1
  201.         exit
  202.  
  203.       elif [ "$m0D" = "GIT REPOSITORY (under develop $G1T)" ]; then
  204.         cd $H0m3 && git clone git://git.code.sf.net/p/netoolsh/opensource opensource
  205.         zenity --info --title="REMARK" --text "netool toolkit it was build to work on Ubuntu or Kali,\nThis downloader will replace the original 'installer' by\none universal installer to be hable to run it on BackBox\nRemenber to edit 'toolkit_config' file to input the correct paths to toolkit dependencies." --width 460 > /dev/null 2>&1
  206.         # Special thanks to 'milton@barra' for checking dependencies paths on backbox distro
  207.         echo ${BlueF}[+][${GreenF} all files downloaded, running installer ${BlueF}]${Reset};
  208.         echo ""
  209.         cd opensource && chmod +x INSTALL.sh && ./INSTALL.sh
  210.         rm $wEr3/downloader.sh > /dev/null 2>&1
  211.         rm /tmp/update2.txt > /dev/null 2>&1
  212.         exit
  213.  
  214.       else
  215.       echo ${RedF}[x][ABORTED][${YellowF} QUIT ${RedF}] ${Reset};
  216.       rm $wEr3/downloader.sh > /dev/null 2>&1
  217.       rm /tmp/update2.txt > /dev/null 2>&1
  218.       sleep 2
  219.       exit
  220.       fi
  221.  
  222.  
  223.  
  224.  
  225.  
  226.   elif [ "$OS" "=" "Debian" ] || [ "$OS" "=" "Parrot" ]; then
  227.   m0D=$(zenity --list --title "CHOSE REPOSITORY" --text "Download toolkit from:" --radiolist --column "Pick" --column "Option" TRUE "STABLE REPOSITORY (bug free $ST4BL3)" FALSE "GIT REPOSITORY (under develop $G1T)" --width 330 --height 180) > /dev/null 2>&1
  228.  
  229.       if [ "$m0D" = "STABLE REPOSITORY (bug free $ST4BL3)" ]; then
  230.         cd $H0m3 && wget https://sourceforge.net/projects/netoolsh/files/opensource%5Bkali%5D.tar.gz
  231.         tar -xf opensource[kali].tar.gz
  232.         # Special thanks to '????' for checking dependencies paths on debian/parrot distros
  233.         cd /tmp && wget https://dl.dropboxusercontent.com/u/21426454/netool-kali/INSTALL.sh
  234.         zenity --info --title="REMARK" --text "netool toolkit it was build to work on Ubuntu or Kali,\nThis downloader will replace the original 'installer' by\none universal installer to be hable to run it on $OS\nRemenber to edit 'toolkit_config' file to input the correct paths to toolkit dependencies." --width 460 > /dev/null 2>&1
  235.         echo ${BlueF}[+][${GreenF} all files downloaded, running installer ${BlueF}]${Reset};
  236.         echo ""
  237.         sed "s|node='Parrot'|node='$OS'|g" INSTALL.sh > copy.int
  238.         mv -f /tmp/copy.int $rpath/INSTALL.sh > /dev/null 2<&1
  239.         cd $rpath && chmod +x INSTALL.sh && ./INSTALL.sh
  240.         rm $wEr3/downloader.sh > /dev/null 2>&1
  241.         rm /tmp/INSTALL.sh > /dev/null 2<&1
  242.         rm /tmp/update2.txt > /dev/null 2>&1
  243.         exit
  244.  
  245.       elif [ "$m0D" = "GIT REPOSITORY (under develop $G1T)" ]; then
  246.         cd $H0m3 && git clone git://git.code.sf.net/p/netoolsh/opensource-kali opensource
  247.         # Special thanks to '????' for checking dependencies paths on debian/parrot distros
  248.         cd /tmp && wget https://dl.dropboxusercontent.com/u/21426454/netool-kali/INSTALL.sh
  249.         zenity --info --title="REMARK" --text "netool toolkit it was build to work on Ubuntu or Kali,\nThis downloader will replace the original 'installer' by\none universal installer to be hable to run it on $OS\nRemenber to edit 'toolkit_config' file to input the correct paths to toolkit dependencies." --width 460 > /dev/null 2>&1
  250.         echo ${BlueF}[+][${GreenF} all files downloaded, running installer ${BlueF}]${Reset};
  251.         echo ""
  252.         sed "s|node='Parrot'|node='$OS'|g" INSTALL.sh > copy.int
  253.         mv -f /tmp/copy.int $rpath/INSTALL.sh > /dev/null 2<&1
  254.         cd $rpath && chmod +x INSTALL.sh && ./INSTALL.sh
  255.         rm $wEr3/downloader.sh > /dev/null 2>&1
  256.         rm /tmp/INSTALL.sh > /dev/null 2<&1
  257.         rm /tmp/update2.txt > /dev/null 2>&1
  258.         exit
  259.  
  260.    else
  261.      echo ${RedF}[x][ABORTED][${YellowF} QUIT ${RedF}] ${Reset};
  262.      rm $wEr3/downloader.sh > /dev/null 2>&1
  263.      rm /tmp/update2.txt > /dev/null 2>&1
  264.      sleep 2
  265.      exit
  266. fi
  267.  
  268.  
  269.  
  270.   elif [ "$OS" "=" "Lubuntu" ] || [ "$OS" "=" "Xubuntu" ] || [ "$OS" "=" "Kubuntu" ]; then
  271.   m0D=$(zenity --list --title "CHOSE REPOSITORY" --text "Download toolkit from:" --radiolist --column "Pick" --column "Option" TRUE "STABLE REPOSITORY (bug free $ST4BL3)" FALSE "GIT REPOSITORY (under develop $G1T)" --width 330 --height 180) > /dev/null 2>&1
  272.  
  273.       if [ "$m0D" = "STABLE REPOSITORY (bug free $ST4BL3)" ]; then
  274.         cd $H0m3 && wget https://sourceforge.net/projects/netoolsh/files/opensource.tar.gz
  275.         tar -xf opensource.tar.gz
  276.         cd /tmp && wget https://dl.dropboxusercontent.com/u/21426454/netool-kali/INSTALL.sh
  277.         zenity --info --title="REMARK" --text "netool toolkit it was build to work on Ubuntu or Kali,\nThis downloader will replace the original 'installer' by\none universal installer to be hable to run it on $OS\nRemenber to edit 'toolkit_config' file to input the correct paths to toolkit dependencies." --width 460 > /dev/null 2>&1
  278.         echo ${BlueF}[+][${GreenF} all files downloaded, running installer ${BlueF}]${Reset};
  279.         echo ""
  280.         sed "s|node='Parrot'|node='$OS'|g" INSTALL.sh > copy.int
  281.         mv -f /tmp/copy.int $rpath/INSTALL.sh > /dev/null 2<&1
  282.         cd $rpath && chmod +x INSTALL.sh && ./INSTALL.sh
  283.         rm $wEr3/downloader.sh > /dev/null 2>&1
  284.         rm /tmp/INSTALL.sh > /dev/null 2<&1
  285.         rm /tmp/update2.txt > /dev/null 2>&1
  286.         exit
  287.  
  288.       elif [ "$m0D" = "GIT REPOSITORY (under develop $G1T)" ]; then
  289.         cd $H0m3 && git clone git://git.code.sf.net/p/netoolsh/opensource opensource
  290.         cd /tmp && wget https://dl.dropboxusercontent.com/u/21426454/netool-kali/INSTALL.sh
  291.         zenity --info --title="REMARK" --text "netool toolkit it was build to work on Ubuntu or Kali,\nThis downloader will replace the original 'installer' by\none universal installer to be hable to run it on $OS\nRemenber to edit 'toolkit_config' file to input the correct paths to toolkit dependencies." --width 460 > /dev/null 2>&1
  292.         echo ${BlueF}[+][${GreenF} all files downloaded, running installer ${BlueF}]${Reset};
  293.         echo ""
  294.         sed "s|node='Parrot'|node='$OS'|g" INSTALL.sh > copy.int
  295.         mv -f /tmp/copy.int $rpath/INSTALL.sh > /dev/null 2<&1
  296.         cd $rpath && chmod +x INSTALL.sh && ./INSTALL.sh
  297.         rm $wEr3/downloader.sh > /dev/null 2>&1
  298.         rm /tmp/INSTALL.sh > /dev/null 2<&1
  299.         rm /tmp/update2.txt > /dev/null 2>&1
  300.         exit
  301.  
  302.    else
  303.      echo ${RedF}[x][ABORTED][${YellowF} QUIT ${RedF}] ${Reset};
  304.      rm $wEr3/downloader.sh > /dev/null 2>&1
  305.      rm /tmp/update2.txt > /dev/null 2>&1
  306.      sleep 2
  307.      exit
  308. fi
  309.  
  310.  
  311. else
  312.  
  313.  
  314. Colors;
  315. # --------------------------------------------------------------------
  316. # fail comparing toolkit version to current installed Operative System
  317. # --------------------------------------------------------------------
  318. echo ${RedF}[x]${BlueF}[Supported OS][${RedF} FAIL ${BlueF}]${Reset};
  319. echo ${RedF}[x]${BlueF}[Supported OS ${YellowF} '->'${BlueF} Kali, Ubuntu, BackBox, Lubuntu, Xubuntu, Kubuntu, Debian, Parrot ${BlueF}]${Reset};
  320. sleep 2
  321.  
  322. QuE=$(zenity ---question --title="T00LKIT DOWNLOADER/INSTALLER" --text "report issue to my project webpage?" --width 350) > /dev/null 2>&1
  323. if [ "$?" -eq "0" ]; then
  324.  xdg-open "https://sourceforge.net/p/netoolsh/discussion/general/thread/928a3086/?limit=25#0214/cc81" > /dev/null 2>&1
  325.  rm /tmp/update2.txt > /dev/null 2>&1
  326. else
  327.  rm /tmp/update2.txt > /dev/null 2>&1
  328. fi
  329.  
  330. exit
  331. fi
Advertisement
Add Comment
Please, Sign In to add comment