[OverTheWire] bandit 10 -> 11

2025. 11. 22. 17:10·bandit

The password for the next level is stored in the file data.txt, which contains base64 encoded data

 

echo 명령어 옵션

  • n : 마지막에 따라오는 개행 문자(newline) 문자를 출력하지 않는다
  • e : 문자열에서 백슬래시와 이스케이프 문자를 (")로 묶어 인식하도록 한다
  • E : 문자열에서 백슬래시와 이스케이프문자를 비활성화 한다

*아 printf 명령어를 사용했으면 개행 생각을 안해도 되네요

더보기

bandit10@bandit:~$ ls
data.txt
bandit10@bandit:~$ cat data.txt
VGhlIHBhc3N3b3JkIGlzIGR0UjE3M2ZaS2IwUlJzREZTR3NnMlJXbnBOVmozcVJyCg==
bandit10@bandit:~$ echo -n 'VGhlIHBhc3N3b3JkIGlzIGR0UjE3M2ZaS2IwUlJzREZTR3NnMlJXbnBOVmozcVJyCg==' | base64 --decode
The password is dtR173fZKb0RRsDFSGsg2RWnpNVj3qRr
bandit10@bandit:~$ echo 'VGhlIHBhc3N3b3JkIGlzIGR0UjE3M2ZaS2IwUlJzREZTR3NnMlJXbnBOVmozcVJyCg==' | base64 --decode
The password is dtR173fZKb0RRsDFSGsg2RWnpNVj3qRr

---------------------------------------------------------------------printf---------------------------------------------------------------------------

bandit10@bandit:~$ printf 'VGhlIHBhc3N3b3JkIGlzIGR0UjE3M2ZaS2IwUlJzREZTR3NnMlJXbnBOVmozcVJyCg==' | base64 --decode
The password is dtR173fZKb0RRsDFSGsg2RWnpNVj3qRr

-n 옵션을 쓰고 안쓰고 차이가 궁금해서 해봤는데 디코더가 개행문자 \n 정도는 문제로 생각하지 않고 디코딩을 해줘서 그런 것으로 확인됐음 근데 나중에 데이터 출력물이 정확히 한 줄로 끝나야하는 상황이 온다면 -n 옵션이 필요한 것으로 보인답니다 ~

'bandit' 카테고리의 다른 글

[OverTheWire] bandit 12 -> 13  (0) 2025.11.22
[OverTheWire] bandit 11 -> 12  (0) 2025.11.22
[OverTheWire] bandit 9 -> 10  (0) 2025.11.22
[OverTheWire] bandit 8 -> 9  (0) 2025.11.22
[OverTheWire] bandit 7 -> 8  (0) 2025.11.22
'bandit' 카테고리의 다른 글
  • [OverTheWire] bandit 12 -> 13
  • [OverTheWire] bandit 11 -> 12
  • [OverTheWire] bandit 9 -> 10
  • [OverTheWire] bandit 8 -> 9
jokkams
jokkams
jokkams 님의 블로그 입니다.
  • jokkams
    jokkams 님의 블로그
    jokkams
  • 전체
    오늘
    어제
    • 분류 전체보기 (56)
      • 코드업 (8)
      • bandit (32)
      • 학교 (2)
      • 드림핵 (5)
  • 블로그 메뉴

    • 홈
    • 태그
    • 방명록
  • 링크

  • 공지사항

  • 인기 글

  • 태그

    코드업
    100제
  • 최근 댓글

  • 최근 글

  • hELLO· Designed By정상우.v4.10.5
jokkams
[OverTheWire] bandit 10 -> 11
상단으로

티스토리툴바