CoE Cluster november 2011/MD5 attack singlethreaded

From Teknologisk videncenter
< CoE Cluster november 2011
Revision as of 13:41, 7 November 2011 by Heth (talk | contribs) (Preparing your script)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

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

Links