1. Bandit5 목표
The password for the next level is stored in a file somewhere
under the inhere directory and has all of the following properties:
human-readable
1033 bytes in size
not executable
Commands you may need to solve this level
ls , cd , cat , file , du , find
2. Bandit5 구현
# 문제에 더미 파일들이 많기 때문에 해당 파일을 압축파일로 가져올 필요가 있다.
# Bandit의 경우 관리자가 주기적으로 비밀번호를 변경하고 있다.
# 하여 압축파일로 가져오는 방법만 설명하고 첨부한 링크를 통해 구현을 진행하면 된다.
# 비밀번호 4oQYVPkxZOOEOO5pTW81FB8j8lxXGUQw 입력 접속(비밀번호 변경 될 수 있음)
# ssh -oStrictHostKeyChecking=no bandit5@bandit.labs.overthewire.org -p 2220
# mkdir -p /tmp/bandit5_zip
# tar -cvf /tmp/bandit5_zip/bandit5.tar /home/bandit5/inhere
# exit
# scp -P 2220 bandit5@bandit.labs.overthewire.org:/tmp/bandit5_zip/bandit5.tar ./bandit5.tar
# 위 명령을 통해 다운로드 받은 파일을 첨부 하였다.
# 비밀번호 root 입력 접속
ssh -oStrictHostKeyChecking=no root@localhost -p 2220
chown -R root:root /home/bandit5/.[!.]*
mkdir /home/bandit5/inhere
# 첨부된 파일 다운로드
curl -L "https://blog.kakaocdn.net/dn/lCvyk/btsHWy0vaSm/V3RJQ0kEkvloQIAO3eiYk0/bandit5.tar?attach=1&knm=tfile.tar" -o /home/bandit5/inhere/bandit5.tar
tar xvf /home/bandit5/inhere/bandit5.tar -C /home/bandit5/inhere/ --strip-components=3
rm -rf /home/bandit5/inhere/bandit5.tar
chmod -R 750 /home/bandit5/inhere
chown -R root:bandit5 /home/bandit5/inhere
useradd bandit6 && echo -e "DXjZPULLxYr17uwoI01bNLQbtFemEgo7\nDXjZPULLxYr17uwoI01bNLQbtFemEgo7" | passwd bandit6
chmod 755 /home/bandit6
chown root:root /home/bandit6
3. Bandit5 문제풀의
# bandit5 로 설정한 패스워드를 입력하여 접속한다.
# koReBOKuIDDepwhWk7jZC0RTdopnAYKh
ssh bandit5@localhost -p 2220
find /home/bandit5/inhere -size 1033c
cat `find /home/bandit5/inhere -size 1033c` | tr -d ' '
'Wargame > Bandit' 카테고리의 다른 글
[ Docker ] Bandit Wargame 만들기 - 7번 문제 ( 9 / 33 ) (1) | 2024.06.11 |
---|---|
[ Docker ] Bandit Wargame 만들기 - 6번 문제 ( 8 / 33 ) (1) | 2024.06.11 |
[ Docker ] Bandit Wargame 만들기 - 4번 문제 ( 6 / 33 ) (0) | 2024.06.04 |
[ Docker ] Bandit Wargame 만들기 - 3번 문제 ( 5 / 33 ) (0) | 2024.06.04 |
[ Docker ] Bandit Wargame 만들기 - 2번 문제 ( 4 / 33 ) (1) | 2024.06.04 |