¸®´ª½º

 3916, 1/196 ȸ¿ø°¡ÀÔ  ·Î±×ÀΠ 
   ewqqw
   Brute force ¸¦ ÀÌ¿ëÇÑ °ø°Ý

http://www.hackerschool.org/HS_Boards/zboard.php?AllArticle=true&no=4454 [º¹»ç]


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

char password[8];

int generate_otp (void)
{
  int fd = open ("/dev/urandom", O_RDONLY);  
  int readed;

  readed = read (fd, (void *)password, 8);
  close (fd);

  return readed;
}

int main (int argc, char *argv[])
{
  char user_password[8];
  int readed = 0;

  if (generate_otp () != 8) {
    printf ("Something is wrong! Contact to administrator.\n");
    exit (0);        
  }
  
  printf ("Enter password (8 bytes) : \n");

  if (read (0, user_password, 8) != 8) {
    printf ("Please enter 8 bytes.\n");
    exit (0);
  }

  if (!strncmp (password, user_password, 8))
    system ("/bin/cat flag");
  else
    printf ("Wrong password !!!\n");

  return 0;
}

ÇÁ·Î±×·¥À» µû·Î ÀÛ¼ºÇؼ­ ½ÇÇà½ÃÄѾ߰ÚÁÒ?

  Hit : 4342     Date : 2017/03/30 08:48



    
ewqqw 8ÀÚ¸® ÀÔ´Ï´Ù... 2017/03/30  
pwnnnt pwnable.kr otp¶û ºñ½ÁÇϳ׿ä. 2017/03/31