Emprisa Maldoc: Cyber Defenders Writeups


Details:


Instructions:

Use the password "cyberdefenders.org" to uncompress challenge files and inspect samples.


Case Overview:

As a SOC analyst, you were asked to inspect a suspected document a user received in his inbox. One of your colleagues told you that he could not find anything suspicious. However, throwing the document into the sandboxing solution triggered some alerts.

Your job is to investigate the document further and confirm whether it's malicious or not.


Tools:

  • Microsoft office IDE
  • rtfdump.py
  • Scdbg or Speakeasy
  • Debugger

Information

Category Name: Emprisa Maldoc

Files: c39-EmprisaMaldoc.zip 1.7 KB

1. What is the CVE ID of the exploited vulnerability?

Untuk mendapatkan informasi dari malware, teman-teman bisa hash dari file menggunakanVirusTotal:

md5sum c39-EmprisaMaldoc.rtf
#hash d82341600606afcf027646ea42f285ae

File tersebut ditandai oleh 40 vendor keamanan, sebagian besar mengaitkannya dengan CVE-2017-11882.


2. To reproduce the exploit in a lab environment and mimic a corporate machine running Microsoft office 2007, a specific patch should not be installed. Provide the patch number.

Microsoft memberikan instruksi terperinci untuk pengguna Microsoft Office 2007 tentang cara mengurangi kerentanan dengan pembaruan keamanan. Pembaruan yang harus diunduh disediakan di Metode 3:


3. What is the magic signature in the object data?

Gunakan tool rtfdump

rtfdump.py c39-EmprisaMaldoc.rtf


Data Objek, yang merupakan item 7, diberi nama Equation3, dan memiliki magic signature d0cf11e0.

4. What is the name of the spawned process when the document gets opened?

Kita bisa menganalisis file di Any.run untuk melihat proses mana yang muncul di Windows Environment:

Seperti yang bisa kita lihat, file tersebut dibuka dengan WINWORD.EXE. Kemudian, proses EQNEDT32.EXE dijalankan.


Proses ini membuat beberapa koneksi, termasuk ke halaman github:

Kemudian akan mengeluarkan sebuah file yang dapat dieksekusi, bernama test1.png. Kita dapat menyimpan file yang dapat dieksekusi untuk analisis lebih lanjut.



5. What is the full path of the downloaded payload?

Dengan menggunakan rtfobj, kita dapat menyimpan objek untuk memeriksa isinya:

rtfobj -s 0 c39-EmprisaMaldoc.rtf
strings c39-EmprisaMaldoc.rtf_object_000000FE.bin

Di sini, kita dapat melihat referensi huruf ke drive C. Karena shellcode memiliki akhiran yang berbeda-beda, disini kita dapat mengasumsikan jalur file dimulai dengan C:\o. Pada pertanyaan berikut, kita menyusun ulang shellcode dan mengeksekusi dengan scdbg:


6. Where is the URL used to fetch the payload?

Pada pertanyaan sebelumnya, kita telah menyimpan objek. Baris terakhir menunjukkan tautan ke halaman github, yang konsisten dengan laporan Any.run:

strings c39-EmprisaMaldoc.rtf_object_000000FE.bin

Baris terakhir berisi URL lengkap dari payload:


7. What is the flag inside the payload?

Untuk mendapatkan flag teman-teman dapat mengunduh muatan ke dalam vm, dan kita menggunakan curl dan menggunakan string untuk menemukan flag:


8. The document contains an obfuscated shellcode. What string was used to cut the shellcode in half?

Gunakan rtfdump

Dengan melihat ke dalam objek, kita dapat melihat bahwa shellcode terpecah pada 'Equation Native', karena ada blok kosong yang besar setelah string tersebut.


9. Fungsi apa yang digunakan untuk mengunduh file payload dari dalam shellcode?

Mengikuti pertanyaan sebelumnya, kita sekarang memiliki shellcode lengkap. Untuk melihat bagaimana dieksekusi, kita dapat menggunakan scbdg, dengan opsi 'Unlimited Steps' dan 'FindSc' ditandai. Melihat keluarannya, fungsi untuk mengunduh payload adalah URLDownloadToFileA:


10. What function was used to execute the downloaded payload file?

Setelah file diunduh ke jalur C:\o.exe, file tersebut dieksekusi dengan fungsi WinExec:


11. Which DLL gets loaded using the "LoadLibrayA" function?

Kode shell menggunakan fungsi LoadLibraryA untuk memuat DLL 'urlmon.dll':


12. What is the FONT name that gets loaded by the process to trigger the buffer overflow exploit?(3 words)

Jika kita melihat kembali struktur file rtf, kita dapat melihat ada tiga item di Level 3:

rtfdump.py c39-EmprisaMaldoc.rtf

Objek 6 pada dasarnya kosong, objek 7 berisi shellcode dan objek 8 berisi nama Font yang digunakan untuk buffer overflow. Isi yang serupa juga dapat ditemukan di objek 9.


13. What is the GitHub link of the tool that was likely used to make this exploit?

Googline untuk Times New Roman CVE-2017-1882 dan membawa ke halaman githuh GitHub - unamer/CVE-2017-11882 Isi kode python hampir sama dengan file rtf.

14. What is the memory address written by the exploit to execute the shellcode?

Melihat kode sumber, alamat memori yang direferensikan adalah 0x00402114:


Demikian walkthrough terkait tantangan emrpisa maldoc, semoga bisa menambah pengetahuan teman-teman, terimakasih. 

Postingan Komentar

Lebih baru Lebih lama