Bandit Level 6 → Level 7
Level Goal
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
Commands you may need to solve this level
ls, cd, cat, file, du, find, grep
find와 grep에 대해 알아보자...
find
리눅스 find 명령어
파일을 찾는 명령어 find 1. 기능 다양한 옵션을 통해 찾고자 하는 파일의 조건을 설정할 뒤 그 조건에 맞는 파일을 검색할 수 있다. 2. 사용법 find [찾을 디렉토리 경로] [찾기옵션] 3. 찾을 디렉토리 경로 / :..
geundi.tistory.com
참고
grep
https://geundi.tistory.com/113
참고
리눅스 grep 명령어
grep, egrep, fgrep 1. 기능 파일에서 특정한 패턴(문자열)을 찾는 명령어이다. 이는 해당 문자열이 들어있는 파일을 찾아 그 문자열이 들어가 있는 라인(행)을 화면에 출력한다. 아래에 언급하는 메타문자를 활용..
geundi.tistory.com
이번에도 가장먼저 ls를 입력했더니 이렇게 나온다... 흠...
find / 는 루트에서 전체를 검색한다고 한다. 위의 조건에 맞게 입력했다. -size 33c는 33byte 크기의 파일을 의미한다.
입력하니 해당 파일에 대한 접근허락이 거절되었다는 문구가 계속 뜨는데 딱 하나 안뜨는게 있다
/var/lib/dpkg/info/bandit7.password
cat /var/lib/dpkg/info/bandit7.password 입력
Bandit Level 7 → Level 8
Level Goal
The password for the next level is stored in the file data.txt next to the word millionth
Commands you may need to solve this level
grep, sort, uniq, strings, base64, tr, tar, gzip, bzip2, xxd
grep 명령어를 사용한다.
grep millionth data.txt는 data.txt 파일 안에 있는 millionth라는 문자열을 검색하라는 뜻이다.
Bandit Level 8 → Level 9
Level Goal
The password for the next level is stored in the file data.txt and is the only line of text that occurs only once
Commands you may need to solve this level
grep, sort, uniq, strings, base64, tr, tar, gzip, bzip2, xxd
grep: 문자열찾기
sort: 입력된 내용을 정렬, 내림차순, -r:오름차순
uniq: 중복된 내용이 있으면 하나만 남기고 삭제
tr: 지정한 문자를 변환하거나 삭제
tar: 파일묶기, 압축
data 파일 열어봄
sort data.txt 입력해서 깔끔하게 정렬해줌
힌트에 나온 uniq 명령어 사용
한 줄만 나온다!
UsvVyFSfZZWbi6wgC7dAFyFuR6jQQUhR
'보안공부 > OverTheWire' 카테고리의 다른 글
Bandit 16 ~ 23 (0) | 2020.09.12 |
---|---|
Bandit 9 ~ 15 (0) | 2020.05.12 |
Bandit Level 5 → Level 6 (2) | 2020.04.30 |
Bandit Level 4 → Level 5 (0) | 2020.04.30 |
Bandit Level 3 → Level 4 (0) | 2020.04.30 |