Reverse Engineering 101 ( Using Ida To Break Password Protections )

The Camtasia Studio video content presented here requires a more recent version of the Adobe Flash Player. If you are you using a browser with JavaScript disabled please enable it now. Otherwise, please update your version of the free Flash Player by downloading here.

Posted By: SecurityTube_Bot
Posted On: Mon 21 Feb 2011
Views: 43001
Share this video:
Share it on Facebook Share it on Twitter Share it on Reddit Share it on Digg Share it on Stumbleupon
Support SecurityTube:


Description: This video is the second in the Reverse Engineering 101 series. I would encourage you to view the first video on finding hidden passwords in binaries using a hex editor. In this video we will use the IDA Pro tool to dissect a binary file and see how to crack a basic password protection.Please download an evaluation copy of IDA here.  Also, please download binary of the program to be disassembled in this reverse engineering exercise from here.









We will use the code from the previous video in this example. Lets look at the program:

------------Code Starts ------------------

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
 
#define password "FindMeIfYouCan"

int main(int argc, char *argv[])
{
  char pass[100];
 
 
  printf("Please enter your password\n\n");
  scanf("%s", pass);
  if ( strcmp(pass, password) == 0 )
  {
       printf("Congrats!! Correct Pass\n\n");
  }
  else
  {
      printf("Wrong Pass\n\n");
  }
      
  system("PAUSE");    
  return 0;
}

-------------------------------- Code Ends ---------------------

 The user entered password is stored in the variable "pass", while the program password is held in "password". The entire protection mechanism in the above program depends on the "srtcmp" function(). If the passwords match, strcmp() returns a "0". The the "If" statement does a comparison to check if "0" was returned. If True, then the user is allowed access, else the user is denied access.

well how do we reverse engineer this program?  well what if somehow we could have "0" placed in the output of the strcmp() operation, so that the If statement yields a "True"? In order to understand how we can accomplish this we need to dive into the assembly language equivalent of the code above. You can watch how its done in the video below. If you are noob to Assembly and would me to create an "Assembly Language Primer to begin Reverse Engineering", please raise a request using the "Feedback" button to the left of the page.

 

Tags: programming ,


Comments (5)

DW2054 on Sun 29 May 2011

Very interesting, I will look to see if you have come up with an assembler primer video set, if not please do.

ashish on Mon 04 Jul 2011

I also will look to see if you have come up with an assembler primer video set, if not please do.

LON3R on Mon 04 Jul 2011

Hi ,
me too.
Please do assembler video.

in0cula on Sat 23 Jul 2011

I watched the assembly megaprimer, i really like to watch a reverse engeneering series, love this

mastermindhacker on Sat 28 Jan 2012

I also watched assembly videos and liked them and this reverse engineering series is also interesting.
Thank you very much for these videos.

Login to post a comment