Difference between revisions of "CoE Cluster november 2011/MD5 attack singlethreaded"

From Teknologisk videncenter
Jump to: navigation, search
m (Eksempel på anvendelse)
m (bfcp.c source)
Line 42: Line 42:
 
}
 
}
 
</source>
 
</source>
 
+
=Preparing your script=
 +
#Make your own bin library: '''mkdir ~/bin'''
 +
#Make your own src library: '''mkdir ~/src'''
 +
#Copy and paste the bfcp c source code to ~/src/bfcp.c file
 +
#Compile bfcp '''gcc ~/src/bfcp.c -o ~/bin/bfcp'''
 +
#Make your scriptfile with wour preferred editor. fx. '''vi ~/bin/md5hack'''
 
[[Category:CoE]]
 
[[Category:CoE]]

Revision as of 11:00, 7 November 2011

Opgave

Vi ved en person anvender fire små bogstaver som password, og vi har fået fat i personens md5sum hash som er 420fc26fa13e665e32ca17ea781c645a

Hvad er personens password????

Password generator

Start programmet med bfpc aaaa og programmet vil skrive aaab start med aaab til aaac ....... zzzz

Eksempel på anvendelse

A="aaaa"
while A=`./bfcp $A`
do 
  echo -e "$A"
done

bfcp.c source

#include <string.h>
#include <stdio.h>
//bfcp - Brute Force Password Cracker

int main(int argc, char *argv[]) {
        int i,len;
        if (argc != 2) {
                fprintf(stderr,"Argument expected\n");
                return(1);
        }
        len =  (int) strlen(argv[1]);

        for (i=len-1; i >= 0 ; i--) {
                if (argv[1][i] != 'z') {
                        argv[1][i]++;
                        printf("%s\n",argv[1]);
                        return(0);
                } else {
                        argv[1][i]='a';
                }
        }
        //All passwords tryed
        return(1);
}

Preparing your script

  1. Make your own bin library: mkdir ~/bin
  2. Make your own src library: mkdir ~/src
  3. Copy and paste the bfcp c source code to ~/src/bfcp.c file
  4. Compile bfcp gcc ~/src/bfcp.c -o ~/bin/bfcp
  5. Make your scriptfile with wour preferred editor. fx. vi ~/bin/md5hack