DESENCRIPTAR ARCHIVOS VBE

Para des­en­crip­tar (descod­i­ficar) archivos en VBScript encrip­ta­dos con srenc.exe, seguimos estos pasos:

- Abri­mos el bloc de notas:
— Copi­amos el sigu­iente texto:


'===============================================================================
'===============================================================================
' SCRIPT........: scriptDecode.vbs
' VERSION.......: 1.5
' DATE..........: 11/22/2003
' AUTHOR........: Joe Glessner
' DESCRIPTION...: Decodes scripts encoded with screnc.exe. Usable with
' Wscript by dragging an encoded script onto this one. If done
' this way, only the first 100 lines (or so) of the script
' will be displayed.
' If run using Cscript.exe the entire output will be
' displayed.
' This script can be used to output the decoded script to a
' file using Cscript.exe by calling it with the following
' syntax:
'
' cscript [Path]scriptDecoder.vbs [Path] >> output.txt
'
'===============================================================================
'===============================================================================
'**Start Encode**
'===============================================================================
'# START 
'===============================================================================
option explicit

'—————————————————————————
'# Declare variables
'—————————————————————————
Dim oArgs, NomFichier

'—————————————————————————
'# Check Arguments
'—————————————————————————
NomFichier=""
Set oArgs = WScript.Arguments
Select Case oArgs.Count
Case 0 'No Arg, pop­up a dia­log box to choose the file
NomFichier=BrowseForFolder("Choose an encod­ed file", &H4031, &H0011)
Case 1
If Instr(oArgs(0),"?")=0 Then '-? ou /? => aide
NomFichier=oArgs(0)
End If
Case Else
WScript.Echo "Too many parameters"
End Select
Set oArgs = Nothing

'—————————————————————————
'# Decode the file and out­put the results
'—————————————————————————
If Nom­Fichi­er<>"" Then
Dim fso
Set fso=WScript.CreateObject("Scripting.FileSystemObject")
If fso.FileExists(NomFichier) Then
Dim fic,contenu
Set fic = fso.OpenTextFile(NomFichier, 1)
Contenu=fic.readAll
fic.close
Set fic=Nothing

Con­st TagInit="#@~^" '#@~^awQAAA==
Con­st TagFin="==^#~@" '& chr(0)
Dim Debut­Code, FinCode
Do
FinCode=0
DebutCode=Instr(Contenu,TagInit)
If DebutCode>0 Then
If (Instr(DebutCode,Contenu,"==")-DebutCode)=10 Then
'If "==" fol­lows the tag
FinCode=Instr(DebutCode,Contenu,TagFin)
If FinCode>0 Then
Contenu=Left(Contenu,DebutCode‑1) & _
Decode(Mid(Contenu,DebutCode+12,FinCode-DebutCode-12–6)) & _
Mid(Contenu,FinCode+6)
End If
End If
End If
Loop Until FinCode=0
WScript.Echo Contenu
Else
WScript.Echo Nom­fichi­er & " not found"
End If
Set fso=Nothing
Else
WScript.Echo "Please give a filename"
WScript.Echo "Usage : " & wscript.fullname & " " & WScript.ScriptFullName & _
" "
End If

'===============================================================================
'# Functions
'===============================================================================
'—————————————————————————
'# Name.….….….…: Decode()
'# Use.….….….….: Decode(Chaine)
'# Pur­pose.….….….: Reverse the encod­ing done by screnc.exe.
'—————————————————————————
Func­tion Decode(Chaine)
Dim se,i,c,j,index,ChaineTemp
Dim tDecode(127)
Con­st Combinaison="1231232332321323132311233213233211323231311231321323112331123132"
Set se=WSCript.CreateObject("Scripting.Encoder")
For i=9 to 127
tDecode(i)="JLA"
Next
For i=9 to 127
ChaineTemp=Mid(se.EncodeScriptFile(".vbs",string(3,i),0,""),13,3)
For j=1 to 3
c=Asc(Mid(ChaineTemp,j,1))
tDecode©=Left(tDecode©,j‑1) & chr(i) & Mid(tDecode©,j+1)
Next
Next
'Next line we cor­rect a bug, oth­er­wise a ")" could be decod­ed to a ">"
tDecode(42)=Left(tDecode(42),1) & ")" & Right(tDecode(42),1)
Set se=Nothing
Chaine=Replace(Replace(Chaine,"@&",chr(10)),"@#",chr(13))
Chaine=Replace(Replace(Chaine,"@*",">"),"@!","<") Chaine=Replace(Chaine,"@$","@") index=-1 For i=1 to Len(Chaine) c=asc(Mid(Chaine,i,1)) If c31) and (c<128))>60) and (c<>62) and (c<>64) Then
Chaine=Left(Chaine,i‑1) & Mid(tDecode©,Mid(Combinaison, _
(index mod 64)+1,1),1) & Mid(Chaine,i+1)
End If
End If
Next
Decode=Chaine
End Function

'—————————————————————————
'# Name.….….….…: BrowseForFolder()
'# Use.….….….….: BrowseForFolder(ByVal pstr­Prompt, ByVal
'# pint­Browse­Type, ByVal pintLocation)
'# Pur­pose.….….….: Locate the encod­ed script using Shell.Application
'—————————————————————————
Func­tion BrowseForFolder(ByVal pstr­Prompt, ByVal pint­Browse­Type, ByVal pintLocation)
Dim Shel­lOb­ject, pstrTemp­Fold­er, x
Set ShellObject=WScript.CreateObject("Shell.Application")
On Error Resume Next
Set pstrTempFolder=ShellObject.BrowseForFolder(&H0,pstrPrompt,pintBrowseType,pintLocation)
BrowseForFolder=pstrTempFolder.ParentFolder.ParseName(pstrTempFolder.Title).Path
If Err.Number<>0 Then BrowseForFolder=""
Set pstrTempFolder=Nothing
Set ShellObject=Nothing
End Function

'===============================================================================
'# END
'===============================================================================

- Guardamos el archi­vo, por ejem­p­lo con este nom­bre: ScriptDecoder.vbs impor­tante que la exten­sión sea ".vbs"
— Para des­en­crip­tar, hare­mos lo siguiente:

  1. Ini­cio
  2. Eje­cu­tar (Win + R)
  3. Escribi­mos: CMD (Intro)
  4. Escribi­mos lo siguiente:

cscript //NoLogo C:ScriptDecoder.vbs "C:\archivo_encriptado.vbe" >"C:\archivo_desencriptado.vbs"

Donde:
C:ScriptDecoder.vbs –> Es el archi­vo que hemos crea­do con el Bloc de Notas.
C:\archivo_encriptado.vbe –> Es el archi­vo que quer­e­mos desencriptar.
C:\archivo_desencriptado.vbs –> Es el archi­vo que hemos gen­er­a­do desencriptado.

Deja una respuesta

Tu dirección de correo electrónico no será publicada. Los campos obligatorios están marcados con *

8 + 1 =