티스토리 뷰
id : bandit10
password : G7w8LIi6J3kTb8A7j9LgrywtEUlyyp6s
(2023.03 기준)
base64 방식으로 인코딩된 패스워드가 data.txt 파일에 들어있다고 합니다.
살펴봅시다.
특정 패턴의 암호문 처럼 보이는데
문자열의 마지막이 == 으로 끝나는 것을 봐선 base64 인코딩이 맞네요
리눅스 환경에서 인코딩 문제를 해결해봅시다.
더보기




원하는 문자열을 입력한 후 <enter>, ctrl + d 로 종료한다




리눅스에서도 문자열 인코딩을 위한 base64 명령어 자체를 지원합니다.
--help 를 붙여 사용법을 살펴보니 간단하게 [해당명령어] [파일명] 정도면 될 것 같네요
base64 data.txt 로 인코딩된 텍스트가 들어있는 data.txt 를 한번 더 인코딩 해봅시다.

알 수 없는 문자열이 더 길어졌습니다.
이건 문제를 해결한게 아니라, base64 문자를 한번 더 base64 방식으로 인코딩 한 겁니다.
문제를 풀기위해서는 디코딩을 해야겠죠?
위의 사용법을 참고해서 -d 옵션을 붙여봅시다.

11 단계로의 패스워드를 획득했습니다.
tip) 파일이 아니라 사용자 입력 문자열을 base64 인코딩 하고 싶다면 아래와 같은 방식으로 이용해야 합니다.
1. base64 기본 명령어로 이용하기(base64 또는 base64 - 로 사용 가능)


2. echo 와 | (pipe) 연계해서 활용하기

디코딩도 같은 방식으로 하면 됩니다.

728x90
반응형
'수업 노트 > bandit' 카테고리의 다른 글
[lesson12] bandit level 12 → 13 (0) | 2021.09.05 |
---|---|
[lesson11] bandit level 11 → 12 (1) | 2021.08.28 |
[lesson9] bandit level 9 → 10 (0) | 2021.08.28 |
[lesson8] bandit level 8 → 9 (1) | 2021.08.22 |
[lesson7] bandit level 7 → 8 (0) | 2021.08.22 |
공지사항
최근에 올라온 글
최근에 달린 댓글
- Total
- Today
- Yesterday
TAG
- 32bit
- Linux
- 리터럴
- over the wire
- 웹보안
- ssh
- tr
- Encode
- X32
- 리눅스
- 풀이
- Strings
- tar
- 웹보안공부
- gz
- Natas
- nc
- 압축파일
- bz2
- Bandit
- find
- HTTPS
- natas7
- OpenSSL
- java
- OverTheWire
- solution
- SSL
- BASE64
- grep
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | ||||||
2 | 3 | 4 | 5 | 6 | 7 | 8 |
9 | 10 | 11 | 12 | 13 | 14 | 15 |
16 | 17 | 18 | 19 | 20 | 21 | 22 |
23 | 24 | 25 | 26 | 27 | 28 |
글 보관함