콘텐츠로 건너뛰기

Easy_ELF

File

ubuntu@29c7cfc91700:~/CTF/reversing.kr$ file Easy_ELF
Easy_ELF: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), dynamically linked, interpreter /lib/ld-linux.so.2, for GNU/Linux 2.6.15, BuildID[sha1]=8edb9e400a3882319cd4582f89dd2373b7e1745c, stripped

32비트 리눅스용 실행파일 하나.

Decompile

main

int __cdecl main()
{
  write(1, "Reversing.Kr Easy ELF\n\n", 0x17u);
  sub_8048434();  //__isoc99_scanf(&unk_8048650, &byte_804A020);
  if ( sub_8048451() )
    sub_80484F7();  //write(1, "Correct!\n", 9u);
  else
    write(1, "Wrong\n", 6u);
  return 0;
}

sub_8048451() 함수에서 true를 반환시켜야 된다.

sub_8048451

_BOOL4 sub_8048451()
{
  if ( byte_804A021 != '1' )
    return 0;
  byte_804A020 ^= 0x34u;
  byte_804A022 ^= 0x32u;
  byte_804A023 ^= 0x88u;
  if ( byte_804A024 != 'X' )
    return 0;
  if ( byte_804A025 )
    return 0;
  if ( byte_804A022 != 124 )
    return 0;
  if ( byte_804A020 == 120 )
    return byte_804A023 == 0xDDu;
  return 0;
}

일부 문자는 XOR 연산하고 각각의 문자를 확인한다.

Solution

자세한 설명은 생략한다..

ubuntu@29c7cfc91700:~/CTF/reversing.kr$ ./Easy_ELF 
Reversing.Kr Easy ELF

L1NUX
Correct!
태그:

답글 남기기