0
0

【TryHackMe】Gotta Catch'em All!:Walkthrough

Posted at

概要

TryHackMe「Gotta Catch'em All!」のWalkthroughです。

Task1

Q1.Find the Grass-Type Pokemon

Hint.Colors are beautiful!

ポートスキャンを実行します。

$ nmap -Pn -sC -sV -A -T4 -p- -oN nmap_result 10.10.130.206
PORT   STATE SERVICE VERSION
22/tcp open  ssh     OpenSSH 7.2p2 Ubuntu 4ubuntu2.8 (Ubuntu Linux; protocol 2.0)
| ssh-hostkey: 
|   2048 58:14:75:69:1e:a9:59:5f:b2:3a:69:1c:6c:78:5c:27 (RSA)
|   256 23:f5:fb:e7:57:c2:a5:3e:c2:26:29:0e:74:db:37:c2 (ECDSA)
|_  256 f1:9b:b5:8a:b9:29:aa:b6:aa:a2:52:4a:6e:65:95:c5 (ED25519)
80/tcp open  http    Apache httpd 2.4.18 ((Ubuntu))
|_http-title: Can You Find Them All?
|_http-server-header: Apache/2.4.18 (Ubuntu)

ポートの稼働状況が分かりました。

ポート サービス バージョン
22 ssh OpenSSH 7.2p2
80 http Apache httpd 2.4.18

WebサービスのコメントアウトからSSH接続に使用できそうな情報を入手しました。

SSH comment.jpg

Username: pokemon,Password: hack_the_pokemonでSSH接続に成功しました。

$ ssh pokemon@10.10.143.207
pokemon@root:~$

/home/pokemon/Desktop/P0kEmOn.zipを発見しました。

$ ls Desktop/
P0kEmOn.zip

解凍するとgrass-type.txtを取り出せました。

$ unzip Desktop/P0kEmOn.zip 
Archive:  Desktop/P0kEmOn.zip
   creating: P0kEmOn/
  inflating: P0kEmOn/grass-type.txt

中身は16進数でした。

P0kEmOn/grass-type.txt
50 6f 4b 65 4d 6f 4e 7b 42 75 6c 62 61 73 61 75 72 7d

デコードしてフラグを入手できます。

grass.jpg

A.PoKeMoN{Bulbasaur}

Q2.Find the Water-Type Pokemon

Hint.Maybe the website has an answer?

/var/www/html/water-type.txtを発見しました。

$ ls -l /var/www/html/
total 16
-rw-r--r-- 1 root    root 11217 Jun 24  2020 index.html
-rw-r--r-- 1 pokemon root    24 Jun 22  2020 water-type.txt

中身には暗号化された文字列があります。

/var/www/html/water-type.txt
Ecgudfxq_EcGmP{Ecgudfxq}

ROT13でデコードしてフラグを入手できます。

q2 answer.jpg

A.Squirtle_SqUaD{Squirtle}

Q3.Find the Fire-Type Pokemon

これまでの法則からファイル名はfire-type.txtであると予測できます。
ファイルを検索します。

$ find / -name *fire-type* 2>/dev/null
/etc/why_am_i_here?/fire-type.txt

/etc/why_am_i_here?/fire-type.txtがヒットしました。
中身はbase64でエンコードされています。

/etc/why_am_i_here?/fire-type.txt
UDBrM20wbntDaGFybWFuZGVyfQ==

デコードしてフラグを入手できます。

$ echo -n "UDBrM20wbntDaGFybWFuZGVyfQ==" | base64 -d
P0k3m0n{Charmander}

A.P0k3m0n{Charmander}

Q4.Who is Root's Favorite Pokemon?

ashアカウントに入る必要がありそうです。

$ ls -l ../
total 12
drwx------  6 root    root    4096 Jun 24  2020 ash
drwxr-xr-x 20 pokemon pokemon 4096 Jul 21 22:12 pokemon
-rwx------  1 ash     root       8 Jun 22  2020 roots-pokemon.txt

/home/pokemon/Videos/Gotta/Catch/Them/ALL\!/Could_this_be_what_Im_looking_for\?.cplusplusを発見しました。

/home/pokemon/Videos/Gotta/Catch/Them/ALL!/Could_this_be_what_Im_looking_for?.cplusplus
# include <iostream>

int main() {
        std::cout << "ash : pikapika"
        return 0;
}

ファイルの中身からashアカウントの認証情報を得られました。
ashにログインします。

$ su ash
Password: 
To run a command as administrator (user "root"), use "sudo <command>".
See "man sudo_root" for details.

bash: /home/ash/.bashrc: Permission denied
ash@root:/home/pokemon$

/home/roots-pokemon.txtからフラグを入手できます。

/home/roots-pokemon.txt
Pikachu!

A.Pikachu!

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0