Skeleton
[LOB] Level11: skeleton → golem
golem /* The Lord of the BOF : The Fellowship of the BOF - golem - stack destroyer */ #include #include extern char **environ; main(int argc, char *argv[]) { char buffer[40]; int i; if(argc < 2){ printf("argv error\n"); exit(0); } if(argv[1][47] != '\xbf') { printf("stack is still your friend.\n"); exit(0); } strcpy(buffer, argv[1]); printf("%s\n", buffer); // stack destroyer! memset(buffer, 0, ..
[BOF, LOB] Level10: vampire → skeleton
skeleton /* The Lord of the BOF : The Fellowship of the BOF - skeleton - argv hunter */ #include #include extern char **environ; main(int argc, char *argv[]) { char buffer[40]; int i, saved_argc; if(argc < 2){ printf("argv error\n"); exit(0); } // egghunter for(i=0; environ[i]; i++) memset(environ[i], 0, strlen(environ[i])); if(argv[1][47] != '\xbf') { printf("stack is still your friend.\n"); ex..
[LOS]Level10 skeleton 문제풀이
쿼리문에 id값은 'guest'값이 들어가있고, 'and 1=0' 값이 붙어있다. 9번째줄을 보면 id값이 'admin'이여야 풀린다. 'and 1=0'값은 무조건 거짓이다. id값에 'admin'을 넣고 pw값 뒷부분을 주석처리한다. (pw=%27%20||%20id=%27admin%27%23)