bandit

[2024/bandit] bandit level2 -> level3 Write-up

성밍쟁 2024. 11. 9. 15:38
728x90
반응형

프롤로그

bandit 문제 풀이

저번 비밀번호는 263JGJPfgU6LtdEvgfWU1XP5yac29mFx

cat

 

문제

다음 단계로 가는 비밀번호는 홈 디렉터리 안에 spaces in this filename 라는 파일안에 저장되어 있다.

 

 

풀이과정

똑같이 "spaces in this filename" 를 cat으로 열면 될 것이다.

ssh bandit2@bandit.labs.overthewire.org -p 2220
263JGJPfgU6LtdEvgfWU1XP5yac29mFx

로 접속하고

ls -al

로 파일 이름을 확인하자.

저기 있는 spaces in this filename을 보기만 하면 되는 것이다.

이 문제의 의도는 저 공백이 있으면 cat 명령어의 각각의 인자로 파악될 것이라는 것. 어떻게 극복할 것인가 인데

원래 프로그래밍 언어에서도 하나로 묶을 때 "" 또는 '' 쓰는 것을 똑같이 이용해주면 된다.

cat "spaces in this filename"
cat ./"spaces in this filename"
cat "./spaces in this filename"

저거 다 된다.

그래서 정답이 나온다

 

 

정답

MNk8KNH3Usiio41PRUEoDFPqfxLPlSmx

 

출처

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

 

OverTheWire: Level Goal

We're hackers, and we are good-looking. We are the 1%. <!-- Please read and accept the Rules! --> Level Goal The password for the next level is stored in a file called spaces in this filename located in the home directory Commands you may need to solve thi

overthewire.org

 

 

728x90
반응형