Una ronda de bash ( I )

Hoy... scripts varios en bash.

Empezando por lo más simple, un cracker de MD5, simplemente lee el diccionario y va comparando las lineas con el hash objetivo [md5crack.sh]

=============================================================================== ./md5crack.sh ===============================================================================

[Unknown INPUT type]

!/usr/bin/env bash

Escrito por kenkeiras

function showuse {     echo "$0 "     exit 1 }

if [ "$1" = "" ] then     showuse fi

if [ "$2" = "" ] then     showuse fi

i=0 for word in $(cat $1);do     test=echo -en "$word" |md5sum|cut -c1-32     if [ "$test" = "$2" ]         then             echo "-> $word"             i=$(($i + 1))         fi done echo "$i resultados" ===============================================================================

Siguiendo con pruebas_de_/dev/tcp, buscar las contraseñas por defecto usando la_web_del_cirt [get_pass_cirt.sh]:

=============================================================================== ./get_pass_cirt.sh =============================================================================== [Unknown INPUT type] ===============================================================================

!/usr/bin/env bash

Escrito por kenkeiras

if [ "$1" = "" ]; then     echo "No has especificado un criterio de búsqueda"     exit 1 else     key=$1 fi

Se pide la web

exec 3<>/dev/tcp/cirt.net/80 echo -en "GET /passwords?criteria=$key\ HTTP/1.1\r\n" >&3 echo -en "HOST: cirt.net\r\n" >&3 echo -en "Connection: close\r\n\r\n" >&3 res=$(cat <&3) # Se leen los datos exec 3>&- # Se cierra la conexion

n=0 for i in $res     do         if [ $n -eq 1 ] # Se comprueba si ya muestra el usuario/contraseña             then                 echo $i|cut -d> -f2|cut -d\< -f1                 n=0         else if [ $n -ne 0 ] # Sino puede que venga pronto             then                 n=$(($n - 1))             fi         fi         out=$(echo $i|grep -e User -e >Pass)         if [ $? -eq 0 ] # Si es la parte del usuario/contraseña             then                 out=$(echo $out|cut -d> -f3|cut -d\& -f1|cut -d\< -f1)                 if [ ! $out = "" ]                     then                         echo $out|grep Pass >> /dev/null                         if [ $? -eq 0 ]                             then                                 n=2                             else                                 n=3                             fi                         echo -n "$out:"                     fi             else                 echo $i|grep -e "" >> /dev/null # Si se acabo el user/ pass                 if [ $? -eq 0 ]                     then                         echo "----------------------------"                     fi             fi     done ===============================================================================

O usando la web de phenoelit [get_pass_phenoelit-us.sh] este tarda un rato, tiene que parsear 256 Kb's: =============================================================================== ./get_pass_phenoelit-us.sh  =============================================================================== [Unknown INPUT type] ===============================================================================

!/usr/bin/env bash

Escrito por kenkeiras

if [ "$1" = "" ]; then     echo "No has especificado un criterio de búsqueda"     exit 1 else     key=$1 fi

Se pide la web

exec 3<>/dev/tcp/www.phenoelit-us.org/80 echo -en "GET /dpl/dpl.html HTTP/1.1\r\n" >&3 echo -en "HOST: www.phenoelit-us.org\r\n" >&3 echo -en "Connection: close\r\n\r\n" >&3 res=$(cat <&3) # Se leen los datosexec 3>&- # Se cierra la conexion res=$(echo $res|sed -e "s/\n//g" |sed -e "s/ /$/g" |sed -e "s/[<]/\n/g")

t=0 d=0 for i in $res     do           echo $i|grep "/tr" >> /dev/null         if [ $? -eq 0 ]             then                 if [ $t -ne 0 ]                     then                         echo "------------------"                     fi                 d=1                 t=0             else                 echo $i|grep "" >> /dev/null                 if [ $? -eq 0 ]                     then                         d=0                     fi                 if [ $d -ne 0 ]                     then                         d=$(($d + 1))                         if [ $d = 3 ]                             then                                 out=$(echo $i|cut -d> -f2|grep -i "$key")                                 if [ $? -eq 0 ]                                     then                                         echo $out|sed -e "s/$/ /g"                                         t=1                                     fi                             fi                         if [ $t -ne 0 ]                             then                                 if [ $d = 11 ]                                     then                                         echo -n "User: "                                         echo $i|cut -d> -f2|sed -e "s/$/ /g"                                     else                                     if [ $d = 13 ]                                         then                                             echo -n "Password: "                                             echo $i|cut -d> -f2|sed -e "s/ $º/ /g"                                         fi                                     fi                             fi                     fi             fi     done ===============================================================================

Hasta ahora, la segunda parte por la tarde

ps:_Todo_bajo_la_WTFPL,_claro

untagged

Hablando en esotérico » « Una ronda de bash ( y II )