23 Kasım 2014 Pazar

Password Mangler - Linux Brute Force



#!/bin/sh 
#
#set -vx
verbose=FALSE

while getopts p:v r
do
   case $r in
      p) pwstring=$OPTARG;;
      v) verbose=TRUE;;
   esac
done

if [ -z "$pwstring" ]; then
   echo "Password to mangle: "
   read pwstring
fi

nospace=`echo $pwstring | sed -e 's/ /_/g'`

if [ $verbose = "TRUE" ]; then
   echo "converted spaces to underscores:"
   echo $nospace
   echo "Your mangled password is:"
fi

# use nawk because that allows random numbers

echo $nospace | nawk '{
                    srand()
                    a = $1 ; l = length(a)
                    j = "= + ! _ - @ . :"
                    k = split(j,s," ")
                    for (i=1; i <= l; i++)
                        {
# Isolate each character of the input one at a time
                          b=substr(a,i,1)
# Change the case of the input character (50/50 chance)
                          n=int(rand()*2)
                          if (n == 0)
                          {
                            c=tolower(b)
                          }
                          if (n == 1)
                          {
                            c=toupper(b)
                          }
# Change a to @ symbol (50/50 chance)
                          if ( b == "a" )
                          {
                               n=int(rand()*2)
                               if (n == 0)
                               {
                                 c="@"
                               }
                          }
# Change B to digit 8 (50/50 chance)
                          if ( b == "B" )
                          {
                               n=int(rand()*2)
                               if (n == 0)
                               {
                                 c="8"
                               }
                          }
# Change g to digit 9 (50/50 chance)
                          if ( b == "g" )
                          {
                               n=int(rand()*2)
                               if (n == 0)
                               {
                                 c="9"
                               }
                          }
# Change E to digit 3 (50/50 chance)
                          if ( b == "E" )
                          {
                               n=int(rand()*2)
                               if (n == 0)
                               {
                                 c="3"
                               }
                          }
# Change i or I to ! (50/50 chance)
                          if ( b == "i" || b == "I")
                          {
                               n=int(rand()*2)
                               if (n == 0)
                               {
                                 c="!"
                               }
                          }
# Change s or S to 5 (50/50 chance)
                          if ( b == "s" || b == "S")
                          {
                               n=int(rand()*2)
                               if (n == 0)
                               {
                                 c="5"
                               }
                          }
# Change o or O to 0 (zero , 50/50 chance)
                          if ( b == "o" || b == "O")
                          {
                               n=int(rand()*2)
                               if (n == 0)
                               {
                                 c="0"
                               }
                          }
# Change underscore to minus sign (50/50 chance)
                          if (b == "_")
                          {
                               n=int(rand()*2)
                               if (n == 0)
                               {
                                 c = "-"
                               }
                          }
# Change t to plus sign (50/50 chance)
                          if (b == "t")
                          {
                               n=int(rand()*2)
                               if (n == 0)
                               {
                                 c = "+"
                               }
                          }
# Change minus sign to random joiner (50/50 chance)
                          if (b == "-")
                          {
                               n=int(rand()*2)
                               if (n == 0)
                               {
                                 x=int(rand()*8)+1
                                 c=s[x]
                               }
                          }
# Print out the results
                        #printf "%s flip %s to %s \n" , b,n,c
                        printf "%s", c
                        }
                        print ""
                  }'


https://www.facebook.com/theethical
https://www.facebook.com/pages/Ethical-Cyber-Army-Agent/882502501778493?fref=ts
https://www.facebook.com/pages/Exploit-Vulnerability/672297779527405?fref=ts
https://www.facebook.com/pages/Shadow-Software/675773622535280?fref=ts
https://www.facebook.com/hackingtv?fref=ts

0 yorum:

Yorum Gönder