Jump to content
smagazor

RST-FindMe1

Recommended Posts

M-am gandit sa creez o serie de astfel de programe la care ideea de baza e sa va testati cunostintele de ASM si Reverse Engineering prin gasirea parolelor, creearea de generatoare de chei si nu numai.

Iata si primul program dintr-o serie cat mai lunga si cat mai educativa:

http://rapidshare.com/files/434746847/Rst-FindMe1.zip

Dupa ce reuseste cineva sa rezolve, ar fi indicat sa detalieze modul in care a facut acest lucru pentru ca toti sa se poata inspira si sa invete.

Cod sursa:


#include <stdio.h>
#include <stdlib.h>

int main ()
{
FILE *md5hash;
char namef[L_tmpnam],*datah;
datah = (char *)malloc(26);

printf("%s",tmpnam(namef)!=NULL?"Did it!\nEnter some data: ":"Error!\n");
md5hash = fopen(namef,"wt+");
fgets(datah,50,stdin);
fputs(datah,md5hash);
printf("\nProcessing data ...\n\n");
for (unsigned long int i=0;i<=999999999;i++);
fseek(md5hash,0L,SEEK_SET);
char p=fgetc(md5hash);
fseek(md5hash,3L,SEEK_SET);
char a=fgetc(md5hash);
fseek(md5hash,6L,SEEK_SET);
char s=fgetc(md5hash);
fseek(md5hash,9L,SEEK_SET);
char s2=fgetc(md5hash);
fseek(md5hash,12L,SEEK_SET);
char w=fgetc(md5hash);
fseek(md5hash,15L,SEEK_SET);
char o=fgetc(md5hash);
fseek(md5hash,18L,SEEK_SET);
char r=fgetc(md5hash);
fseek(md5hash,21L,SEEK_SET);
char d=fgetc(md5hash);
fseek(md5hash,24L,SEEK_SET);
fclose(md5hash);
remove(namef);

if (p==82 && a==83 && s==84 && s2==70 && w==105 && o==110 && r==100 && d==49)
printf("Congratulations, now what is the password I have checked for?");
else
printf("Could not compute the correct password. Try again!");
getchar();
return 0;
}

smagazor

Edited by smagazor
Link to comment
Share on other sites

L-am bagat in IDA pro, am urmarit pe grafic, am vazut unde era pus mesajul ca a fost inputul corect si am urmarit "nodurile" legate in cascada, unde era verificat fiecare caracter. sintaxa era ceva de genu:


cmp [ebp+3], 53h
jnz shortloc_4a00e4

Am cautat pe google tabelul ascii si am vazut ca pt 53h corespunde litera S. Am urmat firul si am aflat parola. :D

Link to comment
Share on other sites

Felicitari, ar fi indicat sa explicati mai in detaliu cum ati facut.

Usr6 sunt convins ca nu ai decompilat codul, atata timp cat e scris in C.

ms,

ba chiar asta am facut:)

C:/Documents and Settings/smagazor.RSTCENTER/Desktop/Rst-FindMe1.cpp

compilat cu dev-c++ 4.9.9.2

nu?:D

wcgu36.jpg

Link to comment
Share on other sites

" la compilare se face functie->adresa ... si programul a facut adresa->functie"

si asta ce inseamna?:)

uite un decompiler pt c Decompilation of Binary Programs - dcc

disassemble faci pt a obtine codul in asm, decompilatoarele se folosesc in general pt a obtine cat mai multe functii posibile din codul original, acuma sa nu ti imaginezi ca vei putea compila codul obtinut de decompiler asa cum ii el (in cazul autoit am reusit o data:D ).Daca cunosti programare, cu ajutorul unei surse obtinute prin decompilare ai putea sa-ti faci propria sursa

*multzam phantomas pt book

*Zamolxis Reverse Engineering Resources - Decompilers REC apare in poza postata

Link to comment
Share on other sites

Art of Assembly.pdf - 4.0 Mb

Si asta deasemenea cred ca va fi ajutatoare. Urmaresc acest thread pt ca mi se pare singurul care solicita materia cenusie, din tot ce este pe aici pe forum. Cum se spunea si mai sus, ar fi bine sa se posteze -daca tot s-a inceput asa ceva- si metode de identificare a unei functii, din codul asm rezultat. Anyway good job until now. :-BD

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



×
×
  • Create New...