해킹&보안

[반딧 워게임 : OverTheWire] Level 27 -> 28 (리눅스/해킹/보안 공부)

yamaeking 2025. 3. 21. 21:11

자 오늘은 Level 27 -> 28을 해보도록 하겠다. 

(Login ID :  bandit27/  Password : upsNCc7vzaRDx6oZC6GiR6ERwe1MowGB

 

1. 문제 내용

https://overthewire.org/wargames/bandit/bandit28.html

 

OverTheWire: Level Goal

We're hackers, and we are good-looking. We are the 1%. <!-- Please read and accept the Rules! --> Level Goal There is a git repository at ssh://bandit27-git@localhost/home/bandit27-git/repo via the port 2220. The password for the user bandit27-git is the s

overthewire.org

 

> ~~한 git 저장소가 있다. 이 깃저장소(bandit27-git) 비번은 반딧27 비번과 똑같음. repository 복사해서 비번 찾으셈ㄱㄱ

2. 문제 풀이

 ->  bandit27 에 ssh 로그인 한 뒤, git clone 을 하여야 한다. 

git clone ssh://bandit27-git@localhost/home/bandit27-git/repo

 

 근데 반딧에서는 아무데나 write 권한을 주지 않기 때문에 저렇게 하면 아래와 같이 에러 메시지가 뜬다.

 

그러니 tmp directory 에 작업해야 하는데, 아래의 프로세스로 해보자.

 

mkdir /tmp/gitTask   //여기서 gitTask말고 다른걸 해야 할 거임. 이미 여러 디렉토리들이 있음
cd /tmp/gitTask  // 디렉토리로 이동
git clone ssh://bandit27-git@localhost:2220/home/bandit27-git/repo   //복사

 

저렇게 하고 yes 를 하고, 비밀번호를 입력하라고 하면 bandit27 비밀번호를 넣어주자.  ( upsNCc7vzaRDx6oZC6GiR6ERwe1MowGB )

 

그럼 뭘 클론해왔나 ls -al 를 해보면 아래와 같이 repo 디렉토리가 있다. 

 

cd repo 로 이동하면, README 파일이 있는데, 이걸 cat README 하면 다음 레벨 비밀번호가 나온다.

 

 > 끝!

 

3. 요약

☞ git clone 에 대한 기초적인 명령어를 알 수 있는 레벨.