1. Meow
Task 1. What does the acronym VM stand for?
answer : Virtual Machine
Task 2.
What tool do we use to interact with the operating system in order to issue commands via the command line, such as the one to start our VPN connection? It's also known as a console or shell.
answer : terminal
Task 3. What service do we use to form our VPN connection into HTB labs?
answer : openvpn
Task 4. What is the abbreviated name for a 'tunnel interface' in the output of your VPN boot-up sequence output?
이것은 말그대로 VPN을 사용했을때 사용되는 아웃풋 인터페이스 이름의 약자가 뭐냐는건데,
이것은 다음과 같이 확인할수 있습니다.
네트워크 인터페이스는 ifconfig으로 확인할수있는데, 여기서 보면, 3번째 인터페이스가 처음보는 인터페이스 입니다.
이 문제의 정답이 'tunnel interface' 의 약자이므로 정답은 tun0인데, tun 뒤에붙은 번호는 같은 인터페이스의 순서를 매기는 번호이므로 진짜 답은 tun 입니다.
answer : tun0
Task 5. What tool do we use to test our connection to the target with an ICMP echo request?
ICMP 요청을 보내서 타겟과의 연결이 이루어지는지 확인하는 툴은 pinga 입니다.
윈도우와 리눅스 등에 기본적으로 설치되어있는 네트워크 툴입니다.
다음과 같이 ip주소나 도메인을 입력해서 해당 웹서버와 연결이 되고있는지 체크해줍니다.
answer : ping
Task 6. What is the name of the most common tool for finding open ports on a target?
answer : nmap
Task 7. What service do we identify on port 23/tcp during our scans?
주어진 VM의 23번 포트를 스캔해보면
텔넷 서비스가 돌아가고 있다고 나옵니다.
그러므로 정답은 telnet 입니다.
answer : telnet
Task 8. What username is able to log into the target over telnet with a blank password?
텔넷에서 비밀번호 없이 로그인할수 있는 유저이름은 root 입니다.
다음과 같이 텔넷으로 접속한뒤 username을 root로 하면 다음과 같이 비밀번호 없이 로그인 됩니다.
answer : root
submit flag
이 서버에서 플래그를 찾아보면
디렉토리에 바로 파일이 있습니다.
이 파일의 내용을 확인해보면
다음과 같이 플래그를 얻었습니다.
2. Fawn
Task 1. What does the 3-letter acronym FTP stand for?
answer : File Transfer Protocol
Task 2. Which port does the FTP service listen on usually?
answer : 21
Task 3. What acronym is used for the secure version of FTP?
answer : sftp
Task 4. What is the command we can use to send an ICMP echo request to test our connection to the target?
answer : ping
Task 5. From your scans, what version is FTP running on the target?
포트의 서버/버전 정보를 스캔할때는 다음과 같은 명령어를 사용합니다.
answer : vsftpd 3.0.3
Task 6. From your scans, what OS type is running on the target?
아까전에 스캔했던 내용을 확인해보면, 다음과 같이 Unix라는 운영체제를 사용한다는것을 알수 있습니다.
answer : Unix
Task 7. What is the command we need to run in order to display the 'ftp' client help menu?
칼리리눅스에는 기본적으로 ftp프로그램이 설치되어있습니다.
answer : ftp -h
Task 8. What is username that is used over FTP when you want to log in without having an account?
answer : anonymous
Task 9. What is the response code we get for the FTP message 'Login successful'?
지금까지 얻었던 정보로 이 ftp서버에 접속을 성공해보면 다음과 같이 로그인성공 응답코드가 230이라는것을
알수 있습니다.
answer : 230
Task 10. There are a couple of commands we can use to list the files and directories available on the FTP server. One is dir. What is the other that is a common way to list files on a Linux system.
answer : ls
Task 11. What is the command used to download the file we found on the FTP server?
answer : get
submit flag.
서버에 로그인 한뒤 디렉토리를 확인해보면 플래그파일이 보입니다.
이 플래그 파일을 확인하는 방법은 저의 컴퓨터로 직접 가져오는것입니다.
먼저 내 컴퓨터 아무곳에다가 임의의 파일을 하나 만든뒤
다음과 같이 get 명령어를 이용해서 플래그파일의 내용을 로컬파일로 가져오면
이렇게 플래그를 얻을수 있습니다.
3. Dancing
Task 1. What does 3-letter acronym SMB stand for?
answer : server message block
Task 2. What port does SMB use to operate at?
answer : 445
Task 3. What is the service name for port 445 that came up in our Nmap scan?
nmap으로 스캔해보면 다음과 같이 microsoft-ds 라는 서비스가 동작하고 있다는것을 알수 있습니다.
answer : microsoft-ds
Task 4. What is the 'flag' or 'switch' we can use with the SMB tool to 'list' the contents of the share?
answer : -L
Task 5. How many shares are there on Dancing?
이런식으로 비밀번호 없이도 공유이름들이 얼마나 있는지 확인해볼수 있습니다.
answer : 4
Task 6. What is the name of the share we are able to access in the end with a blank password?
이것은 방금 알아낸 이름들을 하나씩 대입해보다보면 알수 있습니다.
비밀번호 없이 접속되는 계정은 IPC$ 와 WorkShares 두개이지만, 실질적으로 하위 디렉토리가 있는 계정은
WorkShares이기 때문에 정답은 WorkShares 입니다.
answer : WorkShares
Task 7. What is the command we can use within the SMB shell to download the files we find?
answer : get
submit flag
amy.j 라는 디렉토리에 어떤 텍스트파일이 있어서 한번 내용을 가져와 봤는데
그냥 단순한 worknote여서 다시 찾아보면
두번째 디렉토리로 들어가보니 다음과 같이 플래그 파일이 있으므로 내용을 가져와서 확인해보면
이렇게 플래그를 얻을수 있습니다.
4. Redeemer
Task 1. Which TCP port is open on the machine?
일단 최대한 많은 TCP 포트를 스캔해보면 다음과 같이 나옵니다.
그냥 옵션을 줘서 스캔했을때는 별다른 결과가 안나오는것을 봤을때, 일반적으로 사용되는 포트를 사용하는것은 아닌것같으므로, 조건에 맞는 범위만큼 포트를 스캔해서 찾아봐야 합니다.
answer : 6379
Task 2. Which service is running on the port that is open on the machine?
방금 찾은 포트를 사용해서 대상 머신의 서비스를 스캔해보면 다음과 같이 나옵니다.
answer : Redis
Task 3. What type of database is Redis? Choose from the following options:
(i) In-memory Database, (ii) Traditional Database
Redis는 nosql 데이터베이스 서비스로 일반적인 형태인 DB가 아닌
메모리에 DB정보를 저장해서 사용하는 형태의 데이터베이스 서비스입니다.
answer : In-memory Database
Task 4. Which command-line utility is used to interact with the Redis server?
Enter the program name tou would enter into the terminal without any arguments.
answer : redis-cli
Task 5. Which flag is used with the Redis command-line utility to specify the hostname?
answer : -h
Task 6. Once connected to a Redis server, which command is used to obtain the information and statistics about the Redis server?
answer : info
Task 7. What is the version of the Redis server being used on the target machine?
아까전에 스캔했을때 얻었던 정보에 포함되어있습니다.
answer : 5.0.7
Task 8. Which command is used to select the desired database in Redis?
answer : select
Task 9. How many keys are present inside the database with index 0?
우선 여기있는 블로그를 참고해서 redis-cli를 설치해준뒤
Linux에 Redis CLI 설치 및 사용법 (tistory.com)
주어진 머신에 접속 해줍니다.
info Keyspace 라는 명령어로 키값의 정보를 얻어서 알아내거나
" keys * " 라는 명령어를 입력하면 현재 키값들을 확인할수 있지만
"절대로!!" 실제 서비스에서는 사용해선 절대 안됩니다. 왜냐하면 부하를 많이 주기때문에 잘못하면 서버가 다운될수도 있기 때문입니다.
다음과 같이 4개라는것을 알수있습니다.
answer : 4
Task 10. Which command is used to obtain all the keys in a database?
방금 썼던 명령어가 답입니다.
answer : keys *
submit flag.
아까전에 키값들을 조회했을때 얻었던 키들중 하나인 "flag"의 값을 출력해보면
다음과 같이 플래그를 얻어낼수 있습니다.
나머지 남아있는 VIP 버전에서 해볼수 있기 때문에 나중에 VIP버전을 산다면 추가적으로 해볼것입니다.
Redis 기본명령어 참고자료
Redis 데이터 입력, 수정, 삭제, 조회 :: Data Science Lab (sungwookkang.com)
'워게임 > hack the box' 카테고리의 다른 글
[hack the box] Tier 1 : Starting Point (0) | 2022.11.13 |
---|---|
[hack the box] 시작하기 전에 셋팅... (0) | 2022.11.08 |