Advertisement
Guest User

PIXIEWPS AUTO INSTALLATION

a guest
May 4th, 2015
2,989
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 6.40 KB | None | 0 0
  1. #!/bin/bash
  2. #HACKSHOW NETWORK CRACK WIFI COURSE
  3. #Fantome195
  4. instalador_version=0.5
  5. # Colores
  6. CIERRE=${CIERRE:-""}
  7. ROJO=${ROJO:-""}
  8. VERDE=${VERDE:-""}
  9. AMARILLO=${AMARILLO:-""}
  10. CYAN=${CYAN:-""}
  11.  
  12. clear
  13.  
  14. Internet(){
  15. # COMPROBAR ACCESO A INTERNET POR GEMINIS DEMON
  16. if [ ! "$(ping google.com -c1 2>/dev/null)" ]; then
  17.       echo "PARA PODER INSTALAR ESTA APLICACION ES NECESARIO DISPONER DE CONEXION A INTERNET"
  18.       echo ""
  19.       sleep 1
  20.       exit 0
  21. fi
  22. }
  23.  
  24. # Si el sistema no tiene reaver_pixie se baja ,parchea compila e instala
  25. dependencia_reaver_pixie(){
  26. echo "DESCARGANDO REAVER"
  27. svn checkout http://reaver-wps.googlecode.com/svn/trunk/ reaver-wps-read-only
  28. echo ""
  29. echo "APLICANDO PARCHE REAVER"
  30. cd reaver-wps-read-only/
  31. patch -Np1 -i ../Parche_Reaver_5.1MOD.patch
  32. echo ""
  33. echo "COMPILANDO REAVER"
  34. cd src
  35. ./configure || exit 1
  36. make || exit 1
  37. cp -rf reaver /usr/bin/reaver_pixie
  38. cd ..
  39. cd ..
  40. rm -rf reaver-wps-read-only/
  41. }
  42.  
  43. if ! hash reaver_pixie &>/dev/null ; then
  44. echo "$ROJO"
  45. echo "Dependencia reaver_pixie NO se cumple ... solucionando."
  46. echo "$CIERRE"
  47. Internet
  48. dependencia_reaver_pixie
  49. copiar_reaver_pixie=si
  50. else
  51. echo "$VERDE"
  52. echo "Dependencia reaver_pixie se cumple ... continuamos."
  53. echo "$CIERRE"
  54. copiar_reaver_pixie=no
  55. sleep 1
  56. fi
  57.  
  58. # Si el sistema no tiene pixiewps se baja, compila e instala
  59. dependencia_pixiewps(){
  60. echo ""
  61. echo "DESCARGANDO PIXIEWPS 1.0"
  62. wget https://github.com/wiire/pixiewps/archive/master.zip
  63. echo ""
  64. echo "DESCOMPRIMIENDO PIXIEWPS"
  65. unzip master.zip
  66. echo ""
  67. echo "INSTALANDO PIXIEWPS"
  68. cd pixiewps-master
  69. cd src
  70. make || exit 1
  71. cp -rf pixiewps /usr/bin/pixiewps
  72. cd ..
  73. cd ..
  74. rm  master.zip
  75. rm -rf pixiewps-master
  76. }
  77.  
  78. if ! hash pixiewps &>/dev/null ; then
  79. echo "$ROJO"
  80. echo "Dependencia pixiewps NO se cumple ... solucionando."
  81. echo "$CIERRE"
  82. Internet
  83. dependencia_pixiewps
  84. copiar_pixiewps=si
  85. else
  86. echo "$VERDE"
  87. echo "Dependencia pixiewps se cumple ... continuamos."
  88. echo "$CIERRE"
  89. copiar_pixiewps=no
  90. sleep 1
  91. fi
  92.  
  93. ######################################################################################
  94. #### HASTA AQUI DESCARGA E INSTALACION DE DEPENDENCIAS, AHORA EL PROPIO PIXIESCRIPT ##
  95. ######################################################################################
  96.  
  97. # Cd a la ruta del script
  98. # Con esto dara igual si se abrio la terminal en la misma carpeta o en otra ruta
  99. cd $(echo $0 | sed "s/$(basename $0)//g")
  100.  
  101. # Buscamos los iconos y los movemos
  102. buscar_iconos=`find . -name "*.png"`
  103. for x in $buscar_iconos; do
  104. cp -rf $x /tmp
  105. done
  106. if [ -f /tmp/icono.png ]; then
  107. mv -f /tmp/icono.png /usr/share/pixmaps/PixieScript.png
  108. fi
  109. if [ -f /tmp/keys.png ]; then
  110. mv -f /tmp/keys.png /usr/share/pixmaps/PixieKeys.png
  111. fi
  112.  
  113. # Miramos si estamos en wifislax
  114. if [ -f /etc/wifislax-version ]; then
  115. wifislax="true"
  116. else
  117. wifislax="false"
  118. fi
  119.  
  120. # Miramos version del script
  121. buscar_PixieScript=`find . -name 'PixieScript.sh'`
  122. script_version=`head -3 $buscar_PixieScript | tail -1 | awk -F"\"" {'print $2'}`
  123.  
  124. # Permisos a ejecutables
  125. ruta=`pwd`
  126. chmod 777 $ruta/*/* &>/dev/null
  127.  
  128. #### Instalamos en sistema ####
  129. # Si la ruta existe , hay una version vieja ,por lo que sera eliminada
  130. # Se regenerara la ruta para instalacion limpia
  131. ruta_install=/opt/PixieScript
  132. if [ -d $ruta_install ]; then
  133. rm -rf $ruta_install
  134. mkdir -p $ruta_install
  135. else
  136. mkdir -p $ruta_install
  137. fi
  138.  
  139. # Copiamos todo a la ruta de sistema
  140. cp -rf $ruta/* $ruta_install
  141.  
  142. # Generamos el fichero desktop
  143. # Si estamos en wifislax , la ruta variara
  144. if [ $wifislax = true ]; then
  145. ruta_desktop=/usr/share/applications/wifislax/Wpa_wps
  146. #### Generamos el acceso directo a la carpeta Keys
  147. ln -f -s $ruta_install/PIXIESCRIPT_KEYS /opt/Wireless-Keys/PixieScript    
  148. else
  149. ruta_desktop=/usr/share/applications
  150. ln -f -s $ruta_install/PIXIESCRIPT_KEYS $HOME/Desktop/PixieScript_Keys
  151. fi
  152.  
  153. # Definimos categoria en la que aparecera el lanzador del menu
  154. if [ $wifislax = true ]; then
  155. Categories="Wpa wps;"
  156. else
  157. Categories="Network;"
  158. fi
  159.  
  160. # Ahora el fichero
  161. echo "[Desktop Entry]
  162. Categories=$Categories
  163. Comment=by 5.1
  164. Exec=sh -c "$ruta_install/PixieScript.sh';${SHELL:-bash}'"
  165. Icon=PixieScript
  166. Name=PixieScript
  167. Path=$ruta_install
  168. StartupNotify=false
  169. Terminal=true
  170. Type=Application
  171. Version=1.0" > $ruta_desktop/PixieScript.desktop
  172.  
  173. echo ""
  174. echo "Instalador version ${AMARILLO}$instalador_version${CIERRE}"
  175. echo ""
  176. echo "Permisos concedidos y acceso creado en el menu en la categoria ${VERDE}$Categories${CIERRE}"
  177. echo ""
  178. if [ $wifislax = true ]; then
  179. echo "Detectado sistema ${VERDE}wifislax${CIERRE}... ${AMARILO}¿quieres crear un modulo xzm para usarlo en modo live?${CIERRE}"
  180. echo ""
  181. echo "Pulsa ${ROJO}ENTER${CIERRE} para crear xzm o ${ROJO}CIERRA${CIERRE} el script si no necesitas el modulo xzm"
  182. read
  183. mkdir -p /tmp/PixieScript${ruta_install}
  184. mkdir -p /tmp/PixieScript/usr/share/{pixmaps,applications/wifislax/Wpa_wps}
  185. cp -rf $ruta/* /tmp/PixieScript${ruta_install}
  186. cp -rf $ruta_desktop/PixieScript.desktop /tmp/PixieScript/$ruta_desktop
  187. cp -rf /usr/share/pixmaps/PixieScript.png /tmp/PixieScript/usr/share/pixmaps
  188. ####################################
  189. ## Aqui generamos la carpeta keys ##
  190. ####################################
  191. mkdir -p /tmp/PixieScript/opt/Wireless-Keys/
  192. ln -f -s $ruta_install/PIXIESCRIPT_KEYS /tmp/PixieScript/opt/Wireless-Keys/PixieScript
  193. cp -rf /usr/share/pixmaps/PixieKeys.png /tmp/PixieScript/usr/share/pixmaps
  194. ########################################################
  195. ## Variable que copiara los binarios que no tengamos  ##
  196. ########################################################
  197. if [ $copiar_pixiewps = si ]; then
  198. mkdir -p /tmp/PixieScript/usr/bin
  199. cp -rf /usr/bin/pixiewps /tmp/PixieScript/usr/bin/pixiewps
  200. fi
  201. if [ $copiar_reaver_pixie = si ]; then
  202. mkdir -p /tmp/PixieScript/usr/bin
  203. cp -rf /usr/bin/reaver_pixie /tmp/PixieScript/usr/bin/reaver_pixie
  204. fi
  205. ##########################################################################################################
  206. # Por si acaso volvemos a dar permisos
  207. chmod 777 /tmp/PixieScript/*/* &>/dev/null
  208. # Estripamos
  209. stripdir /tmp/PixieScript &>/dev/null
  210. # Creamos xzm
  211. dir2xzm /tmp/PixieScript /tmp/PixieScript-$script_version-i486-1sw.xzm
  212. # Limpieza
  213. rm -rf /tmp/PixieScript
  214. # Movemos el xzm a escritorio
  215. mv -f /tmp/PixieScript-$script_version-i486-1sw.xzm $HOME/Desktop/
  216. fi
  217. echo ""
  218. echo "${CYAN}Instalacion completada${CIERRE}"
  219. echo "${AMARILLO}Bye Bye${CIERRE}"
  220. exit 0
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement