LoginSignup
0
1

More than 5 years have passed since last update.

TWO PCAPS I PROVIDED FOR UA-CTF IN NOVEMBER 2018

Last updated at Posted at 2019-04-21

Студентські змагання з кібербезпеки Ua-Ctf (ウクライナ語) の教材だそうな

  • Студенческие соревнования по кибербезопасности Ua-Ctf (google 先生によるロシア語)
  • 学生の Ua-Ctf というサイバーセキュリティ分野の競技(ロシア語だったら読めるんで訳してみた)

Ua-Ctf ってなに?

  • 原文ウクライナ語なので google 先生に聞いてみた

CTF - (Capture the Flag) is a competition among hackers (white hats). Participants compete with each other in speed and ability to find information security vulnerabilities and their exploitation. The purpose of the competition is to improve the skills of specialists in the field of cybersecurity, to provide students with the opportunity of practical application of knowledge and skills, promoting cybersecurity and forming a community of specialists. The CTF format is generally accepted in the world and is regularly held in developed countries at the local, national and global level.
CTF - (Capture the Flag)は、ハッカー(ホワイトハット)同士の競争です。参加者は、情報セキュリティの脆弱性とその悪用を見つけるためのスピードと能力において互いに競合します。競争の目的は、サイバーセキュリティの分野における専門家のスキルを向上させること、知識とスキルの実用化、サイバーセキュリティの推進、および専門家のコミュニティの形成の機会を学生に提供することです。 CTFフォーマットは世界で一般的に受け入れられており、地方、国および世界レベルで先進国で定期的に開催されています。

A feature of the UA-CTF program is that the task is designed in such a way that they mimic the well-known cyber incidents of Ukraine. Participants are expected to have 25 tasks and 20 hours, during which they will be asked to try to protect the cyberspace of Ukraine by solving problems from all regions of our Motherland. For each vulnerability found and successfully exploited, the participant receives points. At the end of the competition, the winner is the one who managed to find and exploit more vulnerabilities.
UA-CTFプログラムの特徴は、タスクがウクライナの有名なサイバーインシデントを模倣するように設計されていることです。参加者は25のタスクと20時間を持つことが期待され、その間に彼らは私たちの祖国のすべての地域からの問題を解決することによってウクライナのサイバースペースを保護しようとするように求められます。発見され、悪用された脆弱性ごとに、参加者はポイントを受け取ります。競争の終わりに、勝者はより多くの脆弱性を見つけて悪用することに成功したものです。

では TWO PCAPS I PROVIDED FOR UA-CTF IN NOVEMBER 2018 をみてみます

FIRST PCAP: 2018-CTF-from-malware-traffic-analysis.net-1-of-2.pcap.zip

zip 解凍のパスワードは infected です。答えもありますがこれも zip 解凍パスワードは infected です。
タスクが設定されていますのでこれを Wireshark でみていきます。

  • What is the MAC address of the Windows client at 192.168.2.147?
  • What is the host name for the Windows client at 192.168.2.147?
  • Based on the Kerberos traffic, what is the Windows user account name used on 192.168.2.147?
  • What is the URL that returned a Windows executable file?
  • When did the URL happen? (date and time in UTC)
  • How many bytes is the Windows executable file returned from that URL?
  • What is the SHA256 file hash of the Windows executable file returned from that URL?
  • After receiving the Windows executable file, what IP address did the infected Windows host try to establish a TCP connection with?

What is the MAC address of the Windows client at 192.168.2.147?

Wireshark を適当に操作すればでてきます。

What is the host name for the Windows client at 192.168.2.147?

NetBios Registation パケットを拾います。同様に参加ドメインが DNIPROMOTROS であることがわかります。
What is the host name for the Windows client at 192_168_2_147.png

ip.addr==192.168.2.147 && nbns.flags==0x2910

Based on the Kerberos traffic, what is the Windows user account name used on 192.168.2.147?

kerberos の AS へのリクエストパケット(AS-REQ)と AS からのへの返答パケット(AS-REP)をみると、SNameString として DNIPROMOTROS を指定しているのが No. 547,555 のパケットであり、No. 555 の返答として No. 557 があるようです。 No. 557 には CNameString として、jermija.lyakh とあり、これが答えのようです。
このあたりに解説されてます: Kerberos Wireshark Captures: A Windows Login Example

  • kerberos ってなんじゃらほいなのであれば、ケルベロス認証 あたりを参照してください。

Based on the Kerberos traffic.png

(kerberos.as_req_element || kerberos.as_rep_element ) && ip.addr==192.168.2.147

ちなみに上記は SNameString と、CNameString のカラムを増やしていますが、編集 → 設定→ Appearance Columns で次のように設定します:

Based on the Kerberos traffic2.png

What is the URL that returned a Windows executable file?

What is the URL that returned a Windows executable file.png

書式バーにてアプリケーションレイヤ http を指定してさらに、「パケットバイト列」「文字列」として .exe を探します。キャプチャでは探す文字列が「正規表現」と選択されていますが、. は正規表現ではなんでも一文字にあたり完全一致の「文字列」とは少し意味が違いますが「正規表現」でも結果的にはうまくいきます。同じ意味にしたければ \.exe となります。

検索結果をスクロールすると Full request URI: が現れるのでそれが答えです。

When did the URL happen? (date and time in UTC)

表示 → 時刻形式 → UTC日時 で UTC に変更してください。

How many bytes is the Windows executable file returned from that URL?

No. 718 を右クリック → 追跡 → HTTP ストリーム で http ヘッダを見てください。

GET /hojuks/vez.exe HTTP/1.1
Accept: */*
Accept-Encoding: gzip, deflate
User-Agent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.1; WOW64; Trident/7.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0; .NET4.0C; .NET4.0E)
Host: micropcsystem.com
Connection: Keep-Alive

HTTP/1.1 200 OK
Date: Tue, 13 Nov 2018 02:02:13 GMT
Server: Apache
Last-Modified: Mon, 12 Nov 2018 09:21:30 GMT
Accept-Ranges: bytes
Content-Length: 699392
Content-Type: application/x-msdownload

What is the SHA256 file hash of the Windows executable file returned from that URL?

取り出した瞬間に WindowsDefender が消してしまいます、なので、Windows10 では不可です。他、リアルタイムスキャンウィルス対策ソフトが入っている環境ではうまくいかないでしょう。

というわけで Ubuntu 18.04 でやっちゃいます。パッケージ名は wireshark-gtk です。wireshark-gtk を実行し、2018-CTF-from-malware-traffic-analysis.net-1-of-2.pcap を開いて、File → Export Objects → HTTP で次の画面が出るので:

What is the SHA256 file hash of the Windows executable file.png

vez.exe を選択し、名前を付けて保存 をクリックして適当なディレクトリに展開します。 ハッシュ値はコマンドラインから出します:

$ sha256sum vez.exe
43092b2993c9d9cfab01aa340bc378cad547ae0938c6803cb580271139798765  vez.exe

After receiving the Windows executable file, what IP address did the infected Windows host try to establish a TCP connection with?

ローカル IP 以外の通信をとらえてみます。
After receiving the Windows executable file.png

ip.dst!=192.168.0.0/16 && ip.src==192.168.2.147

198.54.126.123 から怪しい exe ファイルを受け取った後、93.87.38.24 に通信が発生していることがわかります。さらに、93.87.38.24 を通信先として絞り込みます。

After receiving the Windows executable file2.png

ip.addr==93.87.38.24

合計 2 回 192.168.2.147 から 93.87.38.24 へSYN を送っているものの RST が返ってきているのでつながらずに終了しているのが見えます(TCP Retransmission は回数には含めない)。

SECOND PCAP: 2018-CTF-from-malware-traffic-analysis.net-2-of-2.pcap.zip

zip 解凍のパスワードは infected です。答えもありますがこれも zip 解凍パスワードは infected です。
タスクが設定されていますのでこれを Wireshark でみていきます。

  • What is the MAC address of the Windows client at 172.17.1.129?
  • What is the host name for the Windows client at 172.17.1.129?
  • Based on the Kerberos traffic, what is the Windows user account name used on 172.17.1.129?
  • What URL in the pcap returned a Microsoft Word document?
  • When did the URL happen? (date and time in UTC)
  • How many bytes is the Word document returned from that URL?
  • What is the SHA256 of the Word document returned from that URL?
  • What URL in the pcap returned a Windows executable file?
  • How many bytes is the Windows executable file returned from that URL?
  • What is the SHA256 of the Windows executable file returned from that URL?
  • What type of infection occurred in this pcap?
  • In addition to HTTP post-infection traffic, what other type of post-infection traffic is generated by the infected Windows host?

What is the MAC address of the Windows client at 172.17.1.129?

Wireshark を適当に操作すればでてきます。

What is the host name for the Windows client at 172.17.1.129?

NetBios で自分のコンピューター名を宣言しているパケットをとらえます。

What is the host name for the Windows client.png

ip.addr==172.17.1.129 && nbns

Based on the Kerberos traffic, what is the Windows user account name used on 172.17.1.129?

Based on the Kerberos traffic.png

(kerberos.as_req_element || kerberos.as_rep_element ) && ip.addr==172.17.1.129

kerberos の AS へのリクエストパケット(AS-REQ)と AS からのへの返答パケット(AS-REP)をみると、SNameString として KYIVARTWORKS を指定しているのが No. 534,542 であり、No. 542 の返答として No. 544 があるようである。No. 544 には CNameString として、innochka.nalyvaiko とあり、これが答え。

ちなみに上記は SNameString と、CNameString のカラムを増やしていますが、編集 → 設定→ Appearance Columns で次のように設定します:
Based on the Kerberos traffic2.png

What URL in the pcap returned a Microsoft Word document?

書式バーにてアプリケーションレイヤ http を指定してさらに、「パケットバイト列」「文字列」として Content-Type: application/msword を探します。

What URL in the pcap returned a Microsoft Word document.png

ip.addr==172.17.1.129 && http

No. 700 パケットを右クリック→追跡 → HTTP ストリーム で http ヘッダを見ます:

GET /QpX8It/BIZ/Firmenkunden/ HTTP/1.1
Accept: text/html, application/xhtml+xml, */*
Accept-Language: en-US
User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; Trident/7.0; rv:11.0) like Gecko
Accept-Encoding: gzip, deflate
Host: ifcingenieria.cl
DNT: 1
Connection: Keep-Alive

HTTP/1.1 200 OK
Date: Mon, 12 Nov 2018 21:01:49 GMT
Server: Apache
X-Powered-By: PHP/5.5.36
Expires: Tue, 01 Jan 1970 00:00:00 GMT
Cache-Control: no-store, no-cache, must-revalidate, max-age=0, post-check=0, pre-check=0
Pragma: no-cache
Content-Disposition: attachment; filename="2018_11Details_zur_Transaktion.doc"
Content-Transfer-Encoding: binary
Last-Modified: Mon, 12 Nov 2018 21:01:49 GMT
Keep-Alive: timeout=5, max=100
Connection: Keep-Alive
Transfer-Encoding: chunked
Content-Type: application/msword

/QpX8It/BIZ/Firmenkunden/ を叩いてダウンロードしているのがわかるので、その文字列で再検索かけて、ヒットする No. 700 パケット内の Full Request URI が答えです。最も、Content-Type: application/msword で探した時点で下までスクロールさせればでてきますが...

What URL in the pcap returned a Microsoft Word document2.png

When did the URL happen? (date and time in UTC)

表示 → 時刻形式 → UTC日時 で UTC に変更してください。

700 2018-11-12 21:01:49.337937  172.17.1.129    138.0.120.12    HTTP    337 64240   GET /QpX8It/BIZ/Firmenkunden/ HTTP/1.1

How many bytes is the Word document returned from that URL?

No. 700 の GET リクエストの応答である No. 800 をみます。検索条件は上記と同じ(ip.addr==172.17.1.129 && http && 文字列 /QpX8It/BIZ/Firmenkunden/)です。問題の doc は添付ファイル形式で戻ってきているので、添付ファイルの情報をみます。

How many bytes is the Word document returned from that URL.png

What is the SHA256 of the Word document returned from that URL?

取り出した瞬間に WindowsDefender が消してしまいます、なので、Windows10 では不可です。他、リアルタイムスキャンウィルス対策ソフトが入っている環境ではうまくいかないでしょう。

というわけで Ubuntu 18.04 でやっちゃいます。パッケージ名は wireshark-gtk です。wireshark-gtk を実行し、2018-CTF-from-malware-traffic-analysis.net-2-of-2.pcap を開いて、File → Export Objects → HTTP で次の画面が出るので:

What is the SHA256 of the Word document.png

Firmenkunden を選択し、名前を付けて保存 をクリックして適当なディレクトリに展開します。 ハッシュは値コマンドラインから出します:

$ sha256sum Firmenkunden
09ebe4229a74cdb1212671e6391742cc6bee387bf14da02974b07857b27f9223  Firmenkunden

What URL in the pcap returned a Windows executable file?

.exe をパケット中から探してもいいんですけど、ここでは別の方法で探します。ファイル → オブジェクトをエクスポート → HTTP でダウンロードしたファイルの一覧を出し、コンテントタイプが application/octet-stream が怪しいのがわかります。No. 1442 と 1459 については、相手が crl.microsoft.com なので信用されるサイトであるとみなし除外すると、No. 1289 timlinger.com だけが残ります。これしかないので、クリックして No. 1289 を WireShark で出します。

What URL in the pcap returned a Windows executable file2.png
No. 1289 に対する GET メソッドは No. 825 であることがわかるので、No. 825 をスクロールして Full Request URI を得ます。
What URL in the pcap returned a Windows executable file.png

How many bytes is the Windows executable file returned from that URL?

No. 1289 をスクロールして得ます。 8000 バイトごとに分けて送られてきているので合計値となります。

How many bytes is the Windows executable file returned from that URL2.png

What is the SHA256 of the Windows executable file returned from that URL?

取り出した瞬間に WindowsDefender が消してしまいます、なので、Windows10 では不可です。他、リアルタイムスキャンウィルス対策ソフトが入っている環境ではうまくいかないでしょう。

というわけで Ubuntu 18.04 でやっちゃいます。パッケージ名は wireshark-gtk です。wireshark-gtk を実行し、2018-CTF-from-malware-traffic-analysis.net-2-of-2.pcap を開いて、File → Export Objects → HTTP で次の画面が出るので:

What is the SHA256 of the Windows executable file.png

application/octet-stream の nmw を選択し、名前を付けて保存 をクリックして適当なディレクトリに展開します。 ハッシュは値コマンドラインから出します:

$ sha256sum nmw
69e731afb5f27668b3a77e19a15e62cce84e623404077a8563fcf61450d8b741  nmw

What type of infection occurred in this pcap?

全問でハッシュ値がとれる環境であればいいのですが、そうでなければ答えから SHA256 69e731afb5f27668b3a77e19a15e62cce84e623404077a8563fcf61450d8b741 を使います。それで ハッシュ値を Virustotal で検索します。ファイルそのものはあげず、必ずハッシュ値で検索します。なぜならば、Virustotal の有料版は、本人以外でも様々なアップロードされたファイルそのものを見ることができるからです。

Virustotal で Microsoft の項目を見ると、Trojan:Win32/Emotet.AC!bit とあるので Trojan:Win32/Emotet.AC!bit でさらにぐぐります。Win32/Emotet.AW の日本語解説をみつけることができました。

doc ファイルをダウンロードしたあとに No. 1490 にみられるように http://24.206.17.102:8080/ に対して滅茶苦茶怪しい通信が始まりますが、IP アドレスでぐぐると、Daily Emotet IoCs and Notes for 11/12/18emotetIoC (Indicator of Compromise) として登録されていることがわかります。emotet でぐぐるとこいつが一体なにをするのか更にいろいろでてきます。

こういう google をはじめ公開されている検索機関で調べることを OSINT (Open Source Intelligence) といいます。六宮さん使えそうな OSINT リンク をまとめられています。

In addition to HTTP post-infection traffic, what other type of post-infection traffic is generated by the infected Windows host?

送信先ポートを見たいので、編集 → 設定→ Appearance Columns で DstPort を加えます。多分、図とは違い一番後ろに加わるはずですが順番は並べ替えるのできにしなくていいです。

In addition to HTTP post-infection traffic.png

内向きのアドレス、tcp 以外の通信、http, https の通信は除くフィルタを作ります(8080, 7080, 50000 ポートは右クリック → 追跡 → tcp ストリームを見ると http であることがわかる)。付け加えたカラム DstPort が一番右に表示されているので、Protocol の後ろに Drag & Drop で並べ替えます。

In addition to HTTP post-infection traffic2.png

ip.src==172.17.1.129 && not ip.dst ==172.17.1.2 && tcp && not tcp.dstport in {80 7080 88 8080 443 50000}

残るのは 25, 587, 465, 990, 8443 ポートの通信となりますが 990, 8443 は相手先が存在しないみたい(通信失敗)で何をしているのかわからないので、これらを除くと残りは 25, 587, 465 ポートとなります、 つまりメールをどこかに送信 しているということです。Dstport をダブルクリックして並べ替えると一目瞭然です。

結局 8443 と 990 ポートは何をしているのかわからないが、送信先 IP で OSINT を検索すると答えが返ってくることがあります。8443 ポートの通信先 IP である 89.145.200.162 については見つけることができました (無料ですが ID 登録が必要です)。

0
1
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
1