둘둘리둘둘리둘둘리둘둘리둘둘리둘

[Hacker school FTZ] Level15 -> Level16 본문

War game/해커 스쿨 FTZ

[Hacker school FTZ] Level15 -> Level16

dool2ly 2015. 8. 20. 19:22

#include <stdio.h>


main()

{ int crap;

  int *check;

  char buf[20];

  fgets(buf,45,stdin);

  if (*check==0xdeadbeef)

   {

     setreuid(3096,3096);

     system("/bin/sh");

   }

}


Level14에서 한번 꼬았다.. check가 가진값이 아니라 check가 가리키는곳의 값이 0xdeadbeef인지 검사후 맞으면 쉘을 띄워준다.


풀이는 level14(http://dool2ly.tistory.com/21)와 다를게 없지만, check에 0xdeadbeef를 넣어줄게 아니라 0xdeadbeef를 가진 주소를 넣어줘야 한다.


0xdeadbeef는 이미 main함수에 하드코딩 돼있으니 그 값을 가져다 쓰면 되겠다.


페이로드 : [ dummy(40) | 0xdeadbeef주소 ]


--풀이--


Comments