본문 바로가기

Level 12 → Level 13 Level Goal The password for the next level is stored in the file data.txt, which is a hexdump of a file that has been repeatedly compressed. For this level it may be useful to create a directory under /tmp in which you can work using mkdir. For example: mkdir /tmp/myname123. Then copy the datafile using cp, and rename it using mv (read the manpages!) 비밀번호는 반복하여 압축한 파일을 hexdump로 변환한 data.txt에 저장되..
Level 11 → Level 12 Level Goal The password for the next level is stored in the file data.txt, where all lowercase (a-z) and uppercase (A-Z) letters have been rotated by 13 positions 비밀번호는 모든 소문자와 대문자에 ROT13이 적용된 data.txt 파일에 저장되어 있다 +) 참고 ROT13이란 알파벳에서 13번째 뒤에 문자로 대체하는 문자 대치 암호를 뜻한다 ROT13에 대한 설명(en) ROT13에 대한 설명(kr) Code bandit11@bandit:~$ ls data.txt bandit11@bandit:~$ man tr bandit11@bandit:~$ cat data.txt | tr ..
Level 10 → Level 11 Base64 정리 Level Goal The password for the next level is stored in the file data.txt, which contains base64 encoded data 비밀번호는 base64로 인코딩된 데이터가 포함된 data.txt 파일에 저장되어 있다 Base64 Base64이란 64개의 문자로 이진파일을 아스키 문자열로 대치하는 인코딩 방식을 뜻한다 Base64에 대한 설명(en) Base64에 대한 설명(kr) Code bandit10@bandit:~$ cat data.txt VGhlIHBhc3N3b3JkIGlzIElGdWt3S0dzRlc4TU9xM0lSRnFyeEUxaHhUTkViVVBSCg== bandit10@bandit:~$ man base64 ..
2941 2941
5622 5622 5622번 문제 #include int main(void) { int abc[26] = { 3, 3, 3, 4, 4, 4, 5, 5, 5, 6, 6, 6, 7, 7, 7, 8, 8, 8, 8, 9, 9, 9, 10, 10, 10, 10 }; // 인덱스 : 알파벳, 값 : 걸리는 시간 int c, s = 0; // c : 입력 받을 문자 s : 합계를 받을 변수 while ((c = getchar()) != '\n') // 문자 하나를 입력 받기 s += abc[c - 65]; // 받은 문자에 해당하는 시간을 합계에 추가함 printf("%d", s); } 결과 입력 받는 문자에 따라 받는 결과로 나오는 숫자가 달라지는 문자이다. 전에 1157번 문제처럼 문자를 숫자 형식으로 받으면 그 값을 ..
Level 9 → Level 10 Level Goal The password for the next level is stored in the file data.txt in one of the few human-readable strings, beginning with several ‘=’ characters. 비밀번호는 몇 개의 '='문자로 시작하는 몇 개의 human-readable 문자열로 data.txt 파일에 저장되어 있다 Code bandit9@bandit:~$ grep '=' data.txt Binary file data.txt matchesbandit9@bandit:~$ file data.txt # file의 타입 확인 data.txt: data # 텍스트 파일의 경우 ASCII text로 출력된다 bandit9@bandit..
Level 8 → Level 9 Level Goal The password for the next level is stored in the file data.txt and is the only line of text that occurs only once 비밀번호는 data.txt 파일에 저장되어 있으며 한 번만 입력된 유일한 텍스트 줄이다 Code bandit8@bandit:~$ cat data.txt | sort -r | uniq -u #비밀번호 즉 한 문장을 제외하면 전부 중복된 문장이란 의미이므로 중복되는 줄을 제거하기로 하였다. 구글링 결과 uniq 명령어를 발견하여 실행하였다. u옵션은 중복된 줄을 제외하고 출력하는 옵션이다
Level 7 → Level 8 Level Goal The password for the next level is stored in the file data.txt next to the word millionth 비밀번호는 data.txt 파일의 millionth 단어 옆에 저장되어 있다 Code bandit7@bandit:~$ cat data.txt #데이터 bandit7@bandit:~$ grep millionth data.txt #비밀번호 처음에는 data.txt 파일을 출력했는데 결과가 너무 많았다. 파일 속에서 단어가 포함된 줄을 출력하기로 하고 grep 명령어를 이용하여 출력하였다