Post

Mr. Phisher

“Çok tuhaf görünen bir ek içeren şüpheli bir e-posta aldım. Sürekli olarak “makroları etkinleştirmemi” istiyor. Onlar ne?”

Mr.Phisher


AttackBox açıldığında ilgili dosyaları görebiliyoruz.

Daha rahat çalışmak için dosyaları makineme indireceğim.

AttackBox’da terminali açıp python3 -m http.server 8080 komutuyla web servisini çalıştırıyorum.

http://10.10.222.24:8080’e gidip dosyaları indiriyorum.

Belgeyi incelemek için oletools tool’unu kullanacağım.

İndirmek için komut: pip install oletools

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
┌──(root㉿kali)-[~/Desktop]
└─# olevba MrPhisher.docm 
olevba 0.60.1 on Python 3.11.8 - http://decalage.info/python/oletools
===============================================================================
FILE: MrPhisher.docm
Type: OpenXML
WARNING  For now, VBA stomping cannot be detected for files in memory
-------------------------------------------------------------------------------
VBA MACRO ThisDocument.cls 
in file: word/vbaProject.bin - OLE stream: 'VBA/ThisDocument'
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
(empty macro)
-------------------------------------------------------------------------------
VBA MACRO NewMacros.bas 
in file: word/vbaProject.bin - OLE stream: 'VBA/NewMacros'
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
Sub Format()
Dim a()
Dim b As String
a = Array(102, 109, 99, 100, 127, 100, 53, 62, 105, 57, 61, 106, 62, 62, 55, 110, 113, 114, 118, 39, 36, 118, 47, 35, 32, 125, 34, 46, 46, 124, 43, 124, 25, 71, 26, 71, 21, 88)
For i = 0 To UBound(a)
b = b & Chr(a(i) Xor i)
Next
End Sub
+----------+--------------------+---------------------------------------------+
|Type      |Keyword             |Description                                  |
+----------+--------------------+---------------------------------------------+
|Suspicious|Chr                 |May attempt to obfuscate specific strings    |
|          |                    |(use option --deobf to deobfuscate)          |
|Suspicious|Xor                 |May attempt to obfuscate specific strings    |
|          |                    |(use option --deobf to deobfuscate)          |
+----------+--------------------+---------------------------------------------+
1
2
3
4
5
6
7
8
Sub Format()
Dim a()
Dim b As String
a = Array(102, 109, 99, 100, 127, 100, 53, 62, 105, 57, 61, 106, 62, 62, 55, 110, 113, 114, 118, 39, 36, 118, 47, 35, 32, 125, 34, 46, 46, 124, 43, 124, 25, 71, 26, 71, 21, 88)
For i = 0 To UBound(a)
b = b & Chr(a(i) Xor i)
Next
End Sub

Hiç Visual Basics ile çalışmadım ama diğer programlama dilleri bilgim sayesinde kodda neler olduğunu tahmin edebiliyorum. Ondalık değerleri olan bir ‘a’ dizimiz var. Dizi üzerinde yinelenen bir for döngüsü var, burada dizideki ondalık sayı yineleyiciyle XOR’lanır ve bir dizeye eklenir. Bayrak olabilecek bir dizenin kodlamasına benziyor.

Kodu çözülmüş metni görmek için gereken adımları tam olarak uygulayan bir python script’i yazdım.

1
2
3
4
5
a = ""
b = [102, 109, 99, 100, 127, 100, 53, 62, 105, 57, 61, 106, 62, 62, 55, 110, 113, 114, 118, 39, 36, 118, 47, 35, 32, 125, 34, 46, 46, 124, 43, 124, 25, 71, 26, 71, 21, 88]
for i in range(len(b)):
     b += chr(b[i] ^ i)
print(a)

This post is licensed under CC BY 4.0 by the author.