[카테고리:] Wargame

BOF 원정대 – Level 6 (darkelf)

문제 소스는 아래와 같다. /* The Lord of the BOF : The Fellowship of the BOF – darkelf – egghunter + buffer hunter + check length of argv[1] */ #include <stdio.h> #include <stdlib.h> extern char **environ; main(int argc, char *argv[]) { char buffer[40]; int i; if(argc < 2){ printf(argv error\n); exit(0); } // egghunter for(i=0; …

BOF 원정대 – Level 5 (wolfman)

문제소스는 아래와 같다. /* The Lord of the BOF : The Fellowship of the BOF – wolfman – egghunter + buffer hunter */ #include <stdio.h> #include <stdlib.h> extern char **environ; main(int argc, char *argv[]) { char buffer[40]; int i; 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] …

BOF 원정대 – Level 4 (orc)

문제 소스는 아래와 같다. /* The Lord of the BOF : The Fellowship of the BOF – orc – egghunter */ #include <stdio.h> #include <stdlib.h> extern char **environ; main(int argc, char *argv[]) { char buffer[40]; int i; 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') …

BOF 원정대 – Level 3 (goblin)

문제 소스는 아래와 같다. /* The Lord of the BOF : The Fellowship of the BOF – goblin – small buffer + stdin */ int main() { char buffer[16]; gets(buffer); printf(%s\n, buffer); } 이전 문제와 다른 점은 인자를 argv로 받는것이 아니라 gets() 함수를 이용해 받는다는 것이다. get() 함수를 이용해 인자를 받을때는 아래와 같이 풀이를 하면 …

BOF 원정대 – Level 2 (cobolt)

Level 2 문제 소스는 아래와 같다. /* The Lord of the BOF : The Fellowship of the BOF – cobolt – small buffer */ int main(int argc, char *argv[]) { char buffer[16]; if(argc < 2){ printf(argv error\n); exit(0); } strcpy(buffer, argv[1]); printf(%s\n, buffer); } 이번 문제는 전 문제와 달리 버퍼의 크기가 작다. 이런 경우 환경변수를 …

BOF 원정대 – Level 1 (gremlin)

첫번째 문제다. 소스는 아래와 같이 아주 단순한 BOF 다. /* The Lord of the BOF : The Fellowship of the BOF – gremlin – simple BOF */ int main(int argc, char *argv[]) { char buffer[256]; if(argc < 2){ printf("argv error\n"); exit(0); } strcpy(buffer, argv[1]); printf("%s\n", buffer); } 이번 문제의 풀이는 여러가지가 될 수 있다. 환경변수에 …

The Python Challenge – Level 26

http://www.pythonchallenge.com/pc/hex/decent.html 문제페이지 소스를 보면 아래와 같다. <html> <head> <title>be a man – apologize!</title> <link rel="stylesheet" type="text/css" href="../style.css"> </head> <body> <center> <br> <img src="decent.jpg"> <!– you've got his e-mail –> <br><br><font color="gold"/> Hurry up, I'm missing the boat </font> </body> </html> <!– Join us at the IRC: irc.freenode.net #pythonchallenge –> 우선 주석 내용을 살펴보면 메일을 받았다고 …

The Python Challenge – Level 25

http://www.pythonchallenge.com/pc/hex/lake.html 이번 레벨은 너무 어려웠다. 우선 문제 페이지의 소스를 보도록 하자. <html> <head> <title>imagine how they sound</title> <link rel="stylesheet" type="text/css" href="../style.css"> </head> <body> <center> <br> <br> <img src="lake1.jpg"> <!– can you see the waves? –> </body> </html> 주석을 보면 waves 가 보이냐고 한다. 이 부분에서 lake1.jpg 가 아닌 lake1.wav 파일이 있다는 것을 유추해내어야 한다 -_-; …

The Python Challenge – Level 24

http://www.pythonchallenge.com/pc/hex/ambiguity.html 접속을 하면 아래와 같인 미로 이미지가 나온다. 오른쪽 상단을 입구로 해서 왼쪽 하단의 출구로 나가는 미로찾기를 작성해야 하는 것으로 보인다. 미로찾기 알고리즘은 여러 알고리즘이 있으나 가장 간단한 좌수법(왼손으로 벽짚고 따라가기) 으로 작성하여 보았다. 좌수법의 알고리즘 원리는 아래와 같다. 1. 왼쪽이 비어있으면 왼쪽으로 먼저 간다. 2. 왼쪽이 막혀있고 위쪽이 비어있으면 위쪽으로 간다. 3. 왼쪽, 위쪽이 …

The Python Challenge – Level 23

http://www.pythonchallenge.com/pc/hex/bonus.html 문제 페이지 접속 후 해당 문제 소스를 보면 아래와 같다. <!– TODO: do you owe someone an apology? now it is a good time to tell him that you are sorry. Please show good manners although it has nothing to do with this level. –> <html> <head> <title>what is this module?</title> <link rel="stylesheet" type="text/css" …