Calcular tamaíño de Diccionario con Crunch

Publicado por D3M0N, 04 de Diciembre de 2011, 12:54:31 AM

Tema anterior - Siguiente tema

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

D3M0N

Encontre este script navegando por internet, y he decidido compartirlo con vosotros.

Este script funciona de la siguiente manera (x^y) * (y+1) = tamaíño en bites donde:

x = es el numero de caracteres que vamos a usar
y = es el numero de lineas que tendra nuestra wordlist

tambien podemos calcularlo sin el script usando este comando en nuestra terminal:

echo "(16^8)*(8+1)" | bc


y sin mas demora les pego el script que espero que les sea de utilidad.

Código: php
#!/bin/bash
#crunch wordlist size checker v0.2
#by TAPE September 2010
#
#Colours
#=======
green=$(tput setaf 2 && tput bold)
red=$(tput setaf 1 && tput bold)
stand=$(tput sgr 0)
#
clear
#
echo
echo $green"WILL YOU HAVE ENOUGH SPACE FOR YOUR CRUNCH WORDLIST ?!"
echo "======================================================"
echo "Calculation: (x^y)*(y+1) = size in bytes"
echo "x= number of characters"
echo "y= length of the word"
echo
echo $stand"Choose the number of characters that will be used making the wordlist"
echo "====================================================================="
echo "Example ;"
echo $red"10 $stand = Numeric only"
echo $red"16 $stand = Hexadecimal"
echo $red"26 $stand = Alpha only"
echo $red"33 $stand = Special characters including space"
echo $red"36 $stand = Alpha + Numeric"
echo $red"52 $stand = Lowercase+Uppercase alpha"
echo $red"62 $stand = Lower+Uppercase alpha + Numeric"
echo $red"95 $stand = Lower+Uppercase alpha +Numeric+SpecialCharacters including space"
echo
echo -ne "Enter number of characters to be used:$red \c"
read X
echo -ne $stand"Enter length of words/passphrases: $red\c"
read Y
clear
(tput sgr 0)
echo
echo $stand"Number of characters with which wordlist will be created: $red$X"
echo $stand"Length of the words/passphrases in wordlist: $red$Y"
echo $stand"-------------------------------------------------------------"
#
# Calculations based on binary sizes ;
# For comma seperated values for groups of 3 digits pipe the below calculation out through sed ;
# sed -r ':L;s=\b([0-9]+)([0-9]{3})\b=\1,\2=g;t L'
B=$( echo "scale=3;($X^$Y)*($Y+1)" | bc )
KB=$( echo "scale=3;($X^$Y)*($Y+1) / 1024" | bc )
MB=$( echo "scale=3;(($X^$Y)*($Y+1)/1024)/1024" | bc )
GB=$( echo "scale=3;((($X^$Y)*($Y+1)/1024)/1024)/1024" | bc )
TB=$( echo "scale=3;(((($X^$Y)*($Y+1)/1024)/1024)/1024)/1024" | bc )
PB=$( echo "scale=3;((((($X^$Y)*($Y+1)/1024)/1024)/1024)/1024)/1024" | bc )
#
# Calculation for number of results ;
# For comma seperated values for groups of 3 digits pipe the below calculation out through sed ;
# sed -r ':L;s=\b([0-9]+)([0-9]{3})\b=\1,\2=g;t L'
NMBR=$( echo "($X^$Y)" | bc )
echo
#
# Outcome of calculations ;
echo $stand"Number of words/passphrases in wordlist: $green$NMBR"
(tput sgr 0)
echo
echo $stand"Estimated wordlist size ; "
echo $green"B  $stand(Bytes)     = $green$B"
echo $green"KB $stand(Kilobytes) = $green$KB"
echo $green"MB $stand(Megabytes) = $green$MB"
echo $green"GB $stand(Gigabytes) = $green$GB"
echo $green"TB $stand(Terabytes) = $green$TB"
echo $green"PB $stand(Petabytes) = $green$PB"
(tput sgr 0)
echo
exit
#
#Last edit 27-09-2010