# GrimWepa install script # # to INSTALL, type: # ./grimstall.sh install [location] # # [location] being the folder to create and install grimwepa to! # any folder will do, if no location is given, this install script defaults to /pentest/wireless/grimwepa/ # # # to UNINSTALL (remove entirely from your system), type: # ./grimstall.sh remove # # 'install' argument will do the following: # 1. creates folder /pentest/wireless/grimwepa/ (or any other given folder) # 2. copies .jar file to /pentest/wireless/grimwepa/ (or any other given folder) # 3. creates link to /pentest/wireless/grimwepa in /usr/bin/ as 'grimwepa' # *Step 4 only runs if user is installing to /pentest/wireless/grimwepa/* # 4. create /usr/share/applications/grimwepa.desktop , add text to it, update menus (for menu) # version is subject to change FILE="grimwepa_1.0.jar" if [ $2 ]; then DIR=$2 else DIR=/pentest/wireless/grimwepa/ fi if [ $1 ]; then # user asked to install GrimWepa if [ $1 = "install" ]; then # check if jar file is in this directory... if [ ! -f ${FILE} ]; then echo "[+] Attempting to download GrimWepa from the Google Code Homepage..." wget "http://grimwepa.googlecode.com/files/${FILE}" sleep 1 if [ ! -f ${FILE} ]; then # if the grimwepa jar isn't in the current directory... echo "[!] Error! unable to download GrimWepa," echo " you must run this script in the directory" echo " which has the file '${FILE}'" exit 0 fi fi echo "[!] You are about to remove all the files in the directory '${DIR}'" echo "[?] Do you wish to continue? (Type 'y' for yes, 'n' for no)" read ANSWER if [ "$ANSWER" = 'y' ]; then continue else exit 0 fi echo "[-] Removing old GrimWepa files..." # remove old files rm -rf ${DIR} echo "[+] Creating new GrimWepa directory" # create new folder mkdir ${DIR} echo "[+] Copying grimwepa files to directory..." # copy jar file to pentest cp ${FILE} ${DIR} echo "[+] Creating /usr/bin/ execution link..." # create /usr/bin/grimwepa file with execution line inside (so it can be called from anywhere) echo "java -jar ${DIR}${FILE} &" > /usr/bin/grimwepa echo "[+] Changing permissions of execution link..." # change permissions so it can be run chmod 755 /usr/bin/grimwepa echo "[-] Clearing GrimWepa's old desktop file..." # clear grimwepa.desktop file # rm -rf /usr/share/applications/grimwepa.desktop if [ ! $2 ]; then echo "[+] Creating new 'GrimWepa' desktop entry..." # create new desktop entry: echo "[Desktop Entry]" > /usr/share/applications/grimwepa.desktop echo "Comment=" >> /usr/share/applications/grimwepa.desktop echo "Exec=grimwepa" >> /usr/share/applications/grimwepa.desktop echo "GenericName=" >> /usr/share/applications/grimwepa.desktop echo "Icon=cache" >> /usr/share/applications/grimwepa.desktop echo "Name=GrimWepa" >> /usr/share/applications/grimwepa.desktop echo "Path=" >> /usr/share/applications/grimwepa.desktop echo "StartupNotify=true" >> /usr/share/applications/grimwepa.desktop echo "Terminal=0" >> /usr/share/applications/grimwepa.desktop echo "TerminalOptions=" >> /usr/share/applications/grimwepa.desktop echo "Type=Application" >> /usr/share/applications/grimwepa.desktop echo "X-KDE-SubstituteUID=false" >> /usr/share/applications/grimwepa.desktop echo "X-KDE-Username=" >> /usr/share/applications/grimwepa.desktop echo "Categories=BT-Radio-Network-Analysis-80211-Cracking" >> /usr/share/applications/grimwepa.desktop echo "[+] Updating menus..." # update menus with new .desktop information update-menus fi echo "[!] Installation complete!" if [ ! $2 ]; then echo "[!] GrimWepa is now in the menu under BT > Radio & Network Analysis > 80211 > Cracking" fi echo "[!] GrimWepa has been copied to ${DIR}" echo "[!] You can now delete ${FILE} from this directory" echo "[!] Save this grimstall.sh file if you wish to uninstall GrimWepa in the future." echo "[!] Type 'grimwepa' to run!" exit 0 elif [ $1 = "remove" ]; then # user asked to remove/uninstall GrimWepa echo "[!] You are about to remove all the files in the directory '${DIR}'" echo "[?] Do you wish to continue? (Type 'y' for yes, 'n' for no)" read -e ANSWER if [ ! $ANSWER == 'y' ]; then exit 0 fi echo "[!] Removing GrimWepa from your system..." echo "[-] Removing files from ${DIR} ..." rm -rf ${DIR}* echo "[-] Removing directory: ${DIR} ..." rm -rf ${DIR} echo "[-] Removing /usr/bin/ execution link..." rm -rf /usr/bin/grimwepa if [ ! $2 ]; then echo "[-] Remove GrimWepa from menu..." rm -rf /usr/share/applications/grimwepa.desktop echo "[-] Updating menu..." update-menus fi echo "[!] GrimWepa has been completely removed from your system" exit 0 fi fi echo "[?] GrimWepa installation shell script." echo "[?] Usage: ./grimstall.sh [install/remove] [location]" echo "" echo "[?] To install GrimWepa to your system, " echo " run this grimstall.sh file in the same " echo " directory as ${FILE} with this argument:" echo "./grimstall.sh install" echo "" echo "[?] GrimWepa defaults to install in /pentest/wireless/grimwepa/" echo " To install in a different directory, type:" echo "./grimstall.sh install /home/directory/whatever/" echo " !!!Don't forget the / at the end!!!" echo "" echo "[?] To remove GrimWepa from your system, " echo " run this grimstall.sh file with 'remove' as an argument:" echo "./grimstall.sh remove"