# bandit
bandit Level 30->34
Level 30 -> 31 log도 확인해보고 branch도 확인해봤더니 알아낸 정보가 없었다. 그래서 tag 명령어를 통해 확인하니 secret이라는 commit을 확인할 수 있었다. 또한, show-ref 명령어를 통해 모든 정보를 확인할 수도 있었다. Level 31 -> 32 이전 문제들과는 다르게 새로운 파일이 하나 생겼다. email과 name을 설정한 것을 알려주는 파일이었는데, 어디다 쓰는지는 아직은 모르겠으나 필요하니까 넣어준 파일인 듯 싶다. <

[OverTheWire Bandit]Level 7 → Level 8 write up
문제 정보 없다. 문제 The password for the next level is stored in the file data.txt next to the word millionth 분석 >Level 8의 password는 data.txt 파일 단어 millionth 옆에 저장되어 있다. ls 명령어를 사용하면 data.txt가 있다. 그 파일을 확인하면 8만줄의 글이 출력되는 것을 확인할 수 있다. 
bandit Level 20 - 30
Level 20 -> 21 내가 특정한 네트워크에 연결을 맺고, 해당 네트워크에 이전 password를 입력하면, 상대 네트워크에서 새로운 password를 준다는 문제이다. 먼저 이전 문제와 같이 suconnect 파일을 읽어보려고 했더니, ./suconnect + portnumber을 이용하여야 한다는 문구가 출력되었다. 이를 위해 새로운 환경을 하나 더 만들어주고, 서로가 소통하게끔 설정하였다. 먼저, 새로운 환경에서는 nc -l 명령어를 통해 가상의 포트를 열어주고, 포트번호는 555
Bandit 6 -> 10
Level 6 -> 7 > owned by user bandit7 owned by group bandit6 33 bytes in size 이러한 조건을 가지고 있다고 하니, 바로 find로 찾으면 될 거 같네요. 뭐가 많이 뜨니깐, 에러들 리디렉션 시켜버립시다. Level 7 -> 8 data.txt 안에 있는 데이터 중, millionth 옆에 비밀번호가 있다고 하네요. 대충 cat 결과를 grep로 넘기면 되겠네요. Level 8 -> 9 data.txt중에서 단 한번만 나오는게 정답이라고 하네요. 커맨드 역할을 알아봅시다. >sort : stdin을 정렬해서 stdout으로 보내줌 uniq : 중복되는 단어는 없애서, 한 번만 표시해줌, -u옵션을 쓰면 단 한개인 것들만 표시해준다. 그러면, 이렇게 하면 되겠네요!! Level 9 -> 10 해당 파일에서 읽을 수 있는 부분에 있다고 하네요. = 몇 개 이

[OverTheWire Bandit]Level 6 → Level 7 write up
문제 정보 없다. 문제 The password for the next level is stored somewhere on the server and has all of the following properties: owned by user bandit7 owned by group bandit6 33 bytes in size 분석 >Level 7의 password는 서버 어딘가에 있다. user는 bandit7이, group은 bandit6이 소유하고 있고, 파일 크기는 33byte이다. 주어진 정보를 이용해서 password를 찾기 위해 find명령어를 사용할 것이다. 파일 크기는 -size옵션을, user 소유는 -user옵션을, group 소유는 -group옵션을 사용한
Bandit 0 -> 6
인터넷을 끄적이다가 bandit라는거를 발견했다. 뭔가 linux를 처음 공부하는 사람들을 위한 리눅스와 친숙해지는?? 그런 프로그램인 듯 하다. Level 0 Level 0 -> 1 Level 1 -> 2 파일 이름이 -으로 설정되어 있다. cat -커맨드로는 옵션이랑 섞여가지구 확인이 안되겠지,,,, 이런 함정이라니 생각보다 재밌는거 같다. Level 2 -> 3 다음은 파일 명에 공백이 있는경우이다. 공백을 \를 이용해 표현하거나, 따옴표를 이용해 하는 방법 2가지가 있을 거 같다. Level 3 -> 4 파일명이 .로 시작하는 경우. 리눅스에서는 이러한 파일들이 ls 명령어로는 보이지 않는다. ls -alh로 파일명 확인 후, cat 찍어버리면 된다. Level 4 -> 5 폴더 안에 사람이 읽을 수 있는 파일에 정답이 있다고 한다. cat으로 찍어보는것도 방법이지만, 대충 file 찍으면 보일 거 같아서

[OverTheWire Bandit]Level 5 → Level 6 write up
문제 정보 없다. 문제 The password for the next level is stored in a file somewhere under the inhere directory and has all of the following properties: human-readable 1033 bytes in size not executable 분석 >Level 6의 password는 inhere directory 안 어딘가에 있다. password가 들어간 파일 사람이 읽기가 가능하고, 1033byte이며, 실행이 불가능하다. ls을 사용하면 inhere 디렉토리가 나온다. 
[OverTheWire Bandit]Level 4 → Level 5 write up
문제 정보 없다. 문제 The password for the next level is stored in the only human-readable file in the inhere directory. Tip: if your terminal is messed up, try the “reset” command. 분석 >Level 5의 password는 inhere diretory에 사람이 보는 게 가능하도록 되어 있는 파일에 있다. ls을 하면 inhere라는 디렉토리를 볼 수 있다. 해당 디렉토리에 들어가서 다시

[OverTheWire Bandit]Level 3 → Level 4 write up
문제 정보 없다. 문제 The password for the next level is stored in a hidden file in the inhere directory. 분석 >Level 4의 password는 inhere directory에 숨김 파일로 되어 있다. ls를 사용하면 inhere라는 디렉토리를 확인할 수 있다. 해당 디렉토리에 들어갈려면 cd명령어를 알아야 한다. cd는 Change Directory의 줄임말로 현재 작업 중인 디렉토리에서 다른 디렉토리로 이동할 때 사용하는

[OverTheWire Bandit]Level 2 → Level 3 write up
문제 정보 없다. 문제 The password for the next level is stored in a file called spaces in this filename located in the home directory 분석 >Level 3의 password는 home directory에 spaces in this filename에 저장되어 있다. ls을 사용하면 spaces in this filename이라는 파일을 볼 수 있다. 이번에는 파일 내용을 보기 위해 `cat spaces in this fil
[OverTheWire Bandit]Level 1 → Level 2 write up
문제 정보 없다. 문제 The password for the next level is stored in a file called - located in the home directory 분석 >Level 2의 password는 home directory에 -에 저장되어 있다. 일단 ls을 사용하면 -파일이 있는 것을 볼 수 있다. 이번에는 -파일 내용을 보기 위해 cat -를 사용한다. 하지만 -가 옵션을 나타날 때 사용하는 문자여서 -파일 내용을 볼 수가 없다. 그리고 - 뒤에 옵션이 안

[OverTheWire Bandit]Level 0 → Level 1 write up
문제 정보 없다. 문제 The password for the next level is stored in a file called readme located in the home directory. Use this password to log into bandit1 using SSH. Whenever you find a password for a level, use SSH (on port 2220) to log into that level and continue the game. 분석 >Level 1의 password는 home directory에 readme에 저장되어 있다. 목표 readme에 있는 password를 이용해서 bandit1로 접속한다. 일단 문제를 푸는 데 필요

[OverTheWire Bandit]Level 0 write up
문제 정보 없다. 문제 The goal of this level is for you to log into the game using SSH. The host to which you need to connect is bandit.labs.overthewire.org, on port 2220. The username is bandit0 and the password is bandit0. Once logged in, go to the Level 1 page to find out how to beat Level 1. 분석 >호스트는 bandit.labs.overthewire.org이고, 포트는 2220이다. username은 bandit0이고 password도 bandit0이다. 목

Bandit Wargame Level 1 ~ 10 (풀이중)
오랜만에 리눅스 복습할 겸, Bandit 워게임을 풀어보자! Bandit OverThewire 커뮤니티에서 제공하는 워게임 종류 중 하나로서, 입문자가 리눅스를 배우는데 큰 도움을 주는 워게임이다. 호스트 PC에서 가상머신을 구동할 필요없이 커뮤니티에서 서버를 제공하기 때문에 SSH로 접속하면 바로 시작할 수 있다. https://overthewire.org/wargames/bandit/ 접속방법 SSH 사용법을 모른다면 man 명령어를 사용해 확인하거나 아래 페이지에 접속해보자. https://www.wikihow.com/Use-SSH 아래 그림처럼 [ssh 접속 계정@접속 주소 -p 포트 번호] 를 입력하면 패스워드를 입력하라고 요구한다. 패스워드를 입력 후 로그인에 성공하면 문제를 풀 수 있다. 
Bandit level 14→15
환경 : Linux Ubuntu 22.04 문제 >The password for the next level can be retrieved by submitting the password of the current level to port 30000 on localhost. 풀이 localhost의 port 30000에 접속한 후 bandit14의 비밀번호를 제출하면 bandit15의 비밀번호를 얻을 수 있다. 이 문제는 두 가지 방법(명령어)으로 풀이가 가능하다. 1. nc nc localhost 30000 2. telnet telnet localhost 30000 <img src='https://velog.velcdn.com/images/

Bandit level 13→14
환경 : Linux Ubuntu 22.04 문제 >The password for the next level is stored in /etc/bandit_pass/bandit14 and can only be read by user bandit14. For this level, you don’t get the next password, but you get a private SSH key that can be used to log into the next level. Note: localhost is a hostname that refers to the machine you are working on 풀이 앞의 문제들처럼 비밀번호를 알아낸 후 로그인하는 것이 아닌 private SSH key를 통해 bandit14에 접속 후 비밀번호를 알아내는 방식인 것 같다. <img src='https://velog.velcdn.com/images/r2tr1ever/post/ee

Bandit level 12→13
환경 : Linux Ubuntu 22.04 문제 >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가 여러 번 compressed된 파일에 비밀번호가 있는 것 같다. 여러 번의 decompress 과정을 통해 비밀번호를 찾을 수 있을 것이다. <img src="https://velog.vel

Bandit level 11→12
환경 : Linux Ubuntu 22.04 문제 >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 풀이 카이사르 암호에 대한 설명인 것 같다. data.txt 파일을 읽어보자. 모든 알파벳을 13자리만큼 회전했으므로 tr 명령어를 실행해서 바꿔줄 수 있다. <img

Bandit level 10→11
환경 : Linux Ubuntu 22.04 문제 >The password for the next level is stored in the file data.txt, which contains base64 encoded data 풀이 문제에서 비밀번호는 base64 형식으로 encoding되어있다고 했기 때문에 파일을 읽어준 후 decoding하는 과정이 필요하다. [base64 설명] 데이터를 Base64로 변환하는 것을 encoding, 그 반대를 decoding한다고 표현한다. 64진법을 사용하기 때문에 6bit로 하나의 문자를 표현한다.(2^6 = 64) 6bit를 4개씩 모아 변환하며, 비는 공간(padding)은 =로 채운다. 따라서 Base64로 encoding 했을 때 데이터의 크기는 33% 증가한다. ASCII text→16진수→2진수→0으로 padding→10진수→Base64(Base64 table) Base64에 대해 간

Bandit level 9→10
환경 : Linux Ubuntu 22.04 문제 >The password for the next level is stored in the file data.txt in one of the few human-readable strings, preceded by several ‘=’ characters. 풀이 data.txt 파일을 읽어보자. non-human readable file이다. 여기서 ASCII code인 것들만 읽어와야할 것 같다. strings 명령어를 이용하면 실행파일의 ASCI