|
Mostrar Mensajes
|
Páginas: [1] 2 3
|
1
|
Seguridad Informática / Análisis y Diseño de Malware / Re: Avira 1 - Yo 0
|
en: 24 Septiembre 2011, 02:55 am
|
Gracias Karcrack ,,seguire probando entonces me es raro ya q si la declaro en el codigo si anda cuando la borro y cargo el .tlb al ejecutarlo se queda como cargando pero al final no hace nda ,,pero buen seguire probando ..
Realemnte te estoy volviendo loco con preguntas pero tengo una mas jaja ,,al cargar tu modulo en mi stub me queda en el codigo final una importacion de la libreria MSVBVM60.DLL la cual es :"Zombie_AddRef" ,ahora mi pregunta es como puedo cambiar el nombre desde el codigo ya q no puedo sacar esa firma con ningun metodo probe moviendo de lugar la importacion y nda me sigue detectando el avast ahora el lugar nuevo en donde la movi ,,tmb probe hacer con el olly un mov byte ptr para limpiar lo cual me lo deja indetectado pero tmb no me lo deja funcional
|
|
|
3
|
Seguridad Informática / Análisis y Diseño de Malware / Re: Avira 1 - Yo 0
|
en: 19 Septiembre 2011, 05:20 am
|
Siento si te estoy volviendo loco con la preguntas pero no te comprendi bien q pongo Private Declare Sub CopyBytes Lib "MSVBVM60" Alias "__vbaCopyBytes" (ByVal Sz As Long, Dest As Any, Source As Any) en un .tlb hasta ahi no hay problema pero ahora q hago tengo por ejemplo esto : Call CopyMemory(tIMAGE_DOS_HEADER, bvBuff(0), SIZE_DOS_HEADER)
Call CopyMemory(tIMAGE_NT_HEADERS, bvBuff(tIMAGE_DOS_HEADER.e_lfanew), SIZE_NT_HEADERS)
CopyMemory tIMAGE_SECTION_HEADER, bvBuff(tIMAGE_DOS_HEADER.e_lfanew + SIZE_NT_HEADERS + SIZE_IMAGE_SECTION_HEADER * i), Len(tIMAGE_SECTION_HEADER)
Lo q hago es transformar esos codigos para usarlos con CopyBytes ,pero al ejecutarlo no hace nda pero tmp me tira ningun error uso por ejemplo: CopyBytes Len(tIMAGE_SECTION_HEADER), tIMAGE_SECTION_HEADER, bvBuff(tIMAGE_DOS_HEADER.e_lfanew + SIZE_NT_HEADERS + SIZE_IMAGE_SECTION_HEADER * i) EDITO: si pongo como api en el source: Private Declare Sub CopyBytes Lib "MSVBVM60.DLL" Alias "__vbaCopyBytes" (ByVal Size As Long, Dest As Any, Source As Any)
funciona perfecto,,pero si lo uso con .tlb hace q carga algo pero al final no hace nda ,,alguien sabe por q?
|
|
|
4
|
Seguridad Informática / Análisis y Diseño de Malware / Re: Avira 1 - Yo 0
|
en: 18 Septiembre 2011, 20:59 pm
|
Gracias Karcrack ,estoy rehaciendo todo mi stub y cargando nuevas ideas q tenia desde antes como doble encryptacion , cargar los datos en una nueva sección y mezclar el archivo a encryptar con codigo limpio ,ahora quiero darle una alternativa a Private Declare Sub CopyMemory Lib "kernel32" Alias "RtlMoveMemory" (pDst As Any, pSrc As Any, ByVal dlen As Long) Con un .tlb no se puede cargar no? La otra opcion es reemplzarla lei tu post ( http://foro.elhacker.net/programacion_visual_basic/vb6asm_alternativa_copymemoryrtlmovememorycopybytes-t300862.0.html) pero no me funciona ,o nose bien como llamarlo ,,si me podes dar una mano se agradece,,saludos
|
|
|
5
|
Seguridad Informática / Análisis y Diseño de Malware / Re: Intento de agregar sección a ejecutable
|
en: 18 Septiembre 2011, 18:54 pm
|
Yo tengo este codigo el cual no lo he podido revisar aun pero si lo probe y es funcional ,,ve este codigo capaz puedes sacar en donde te equivocaste : Option Explicit
Const IMAGE_DOS_SIGNATURE As Integer = &H5A4D Const IMAGE_NT_SIGNATURE As Long = &H4550
Private Type IMAGE_DOS_HEADER e_magic As Integer e_cblp As Integer e_cp As Integer e_crlc As Integer e_cparhdr As Integer e_minalloc As Integer e_maxalloc As Integer e_ss As Integer e_sp As Integer e_csum As Integer e_ip As Integer e_cs As Integer e_lfarlc As Integer e_onvo As Integer e_res(0 To 3) As Integer e_oemid As Integer e_oeminfo As Integer e_res2(0 To 9) As Integer e_lfanew As Long End Type
Private Type IMAGE_FILE_HEADER Machine As Integer NumberOfSections As Integer TimeDataStamp As Long PointerToSymbolTable As Long NumberOfSymbols As Long SizeOfOptionalHeader As Integer Characteristics As Integer End Type
Private Type IMAGE_DATA_DIRECTORY VirtualAddress As Long isize As Long End Type
Private Type IMAGE_OPTIONAL_HEADER32 Magic As Integer MajorLinkerVersion As Byte MinorLinkerVersion As Byte SizeOfCode As Long SizeOfInitalizedData As Long SizeOfUninitalizedData As Long AddressOfEntryPoint As Long BaseOfCode As Long BaseOfData As Long ImageBase As Long SectionAlignment As Long FileAlignment As Long MajorOperatingSystemVer As Integer MinorOperatingSystemVer As Integer MajorImageVersion As Integer MinorImageVersion As Integer MajorSubsystemVersion As Integer MinorSubsystemVersion As Integer Reserved1 As Long SizeOfImage As Long SizeOfHeaders As Long CheckSum As Long Subsystem As Integer DllCharacteristics As Integer SizeOfStackReserve As Long SizeOfStackCommit As Long SizeOfHeapReserve As Long SizeOfHeapCommit As Long LoaerFlags As Long NumberOfRvaAndSizes As Long DataDirectory(1 To 16) As IMAGE_DATA_DIRECTORY End Type
Private Type IMAGE_SECTION_HEADER Name As String * 8 VirtualSize As Long VirtualAddress As Long SizeOfRawData As Long PointerToRawData As Long PointerToRelocations As Long PointerToLinenumbers As Long NumberOfRelocations As Integer NumberOfLinenumbers As Integer Characteristics As Long End Type
Private Type IMAGE_NT_HEADERS Signature As Long FileHeader As IMAGE_FILE_HEADER OptionalHeader As IMAGE_OPTIONAL_HEADER32 End Type
Private Function Align(ByVal dwValue As Long, ByVal dwAlign As Long) As Long
If dwAlign <> 0 Then If dwValue Mod dwAlign <> 0 Then Align = (dwValue + dwAlign) - (dwValue Mod dwAlign) Exit Function End If End If
Align = dwValue End Function
Private Function LastSectionRaw(Sections() As IMAGE_SECTION_HEADER) As Long Dim i As Integer Dim ret As Long
For i = LBound(Sections) To UBound(Sections)
If Sections(i).SizeOfRawData + Sections(i).PointerToRawData > ret Then ret = Sections(i).SizeOfRawData + Sections(i).PointerToRawData End If
Next i
LastSectionRaw = ret End Function
Private Function LastSectionVirtual(Sections() As IMAGE_SECTION_HEADER) As Long Dim i As Integer Dim ret As Long
For i = LBound(Sections) To UBound(Sections)
If Sections(i).VirtualSize + Sections(i).VirtualAddress > ret Then ret = Sections(i).VirtualSize + Sections(i).VirtualAddress End If
Next i
LastSectionVirtual = ret End Function
Public Function AddSection(ByVal szFile As String, ByVal NewSectionName As String, _ ByVal NewSectionSize As Long, ByVal NewSectionCharacteristics As Long, _ ByRef dwNewSectionRVA As Long, ByVal FailIfExists As Boolean) As Long Dim hFile As Long, hMap As Long, lpMap As Long, x As Long Dim i As Integer, k As Integer, FF As Integer
Dim DOSHeader As IMAGE_DOS_HEADER Dim NTHeader As IMAGE_NT_HEADERS Dim SectionHeader() As IMAGE_SECTION_HEADER
If Len(NewSectionName) < 1 Then Exit Function If Len(NewSectionName) > 8 Then NewSectionName = Left$(NewSectionName, 8) Else NewSectionName = NewSectionName & String(8 - Len(NewSectionName), Chr$(0)) End If
FF = FreeFile Open szFile For Binary As #FF
Get #FF, , DOSHeader If DOSHeader.e_magic = IMAGE_DOS_SIGNATURE Then
Get #FF, 1 + DOSHeader.e_lfanew, NTHeader
If NTHeader.Signature = IMAGE_NT_SIGNATURE Then
ReDim SectionHeader(0 To NTHeader.FileHeader.NumberOfSections - 1) As IMAGE_SECTION_HEADER
k = NTHeader.FileHeader.NumberOfSections - 1 x = DOSHeader.e_lfanew + 24 + NTHeader.FileHeader.SizeOfOptionalHeader
For i = LBound(SectionHeader) To UBound(SectionHeader) Get #FF, 1 + x, SectionHeader(i)
If SectionHeader(i).Name = NewSectionName And FailIfExists = True Then Exit Function
x = x + Len(SectionHeader(i)) Next i
If NTHeader.OptionalHeader.SizeOfHeaders >= x + Len(SectionHeader(0)) Then
NTHeader.FileHeader.NumberOfSections = NTHeader.FileHeader.NumberOfSections + 1 ReDim Preserve SectionHeader(0 To NTHeader.FileHeader.NumberOfSections - 1) As IMAGE_SECTION_HEADER
With SectionHeader(NTHeader.FileHeader.NumberOfSections - 1) .Name = NewSectionName
.Characteristics = NewSectionCharacteristics
.PointerToRawData = Align(LastSectionRaw(SectionHeader), NTHeader.OptionalHeader.FileAlignment) .SizeOfRawData = Align(NewSectionSize, NTHeader.OptionalHeader.FileAlignment)
.VirtualAddress = Align(LastSectionVirtual(SectionHeader), NTHeader.OptionalHeader.SectionAlignment) .VirtualSize = NewSectionSize End With
'write new section NTHeader.OptionalHeader.DataDirectory(12).VirtualAddress = 0 NTHeader.OptionalHeader.DataDirectory(12).isize = 0
NTHeader.OptionalHeader.SizeOfImage = NTHeader.OptionalHeader.SizeOfImage + SectionHeader(k + 1).VirtualSize
Put #FF, 1 + DOSHeader.e_lfanew, NTHeader Put #FF, 1 + x, SectionHeader(k + 1)
Put #FF, SectionHeader(k + 1).PointerToRawData + SectionHeader(k + 1).SizeOfRawData, Chr$(0) AddSection = SectionHeader(k + 1).PointerToRawData End If End If End If
Close #FF
End Function
Function AddFile2File(File2BeAdded As String, File2Add2 As String, SectionName As String) Dim dwSettingsRVA As Long, dwSettingsRaw As Long Dim Settings As String Settings = (ReadFile(File2BeAdded)) dwSettingsRaw = AddSection(File2Add2, SectionName, Len(Settings), &HC0000040, dwSettingsRVA, True) Open File2Add2 For Binary Access Write As #1 Put #1, dwSettingsRaw + 1, Settings Close #1 End Function Para llamarlo usa Call AddFile2File(Text1.Text, App.Path & "\salida.exe", ".comoquieras") Suerte...
|
|
|
6
|
Seguridad Informática / Análisis y Diseño de Malware / Re: Avira 1 - Yo 0
|
en: 17 Septiembre 2011, 04:39 am
|
Gracias Karcrack realmente viendo los codigos q creas me doy cuenta q me esta ayudando uno de los grandes en este tema en español aunque tmb vi tu nombre en varios foros en ingles ,pero buen el link del TLB esta caido igual el codigo funciona sin el TLB ya q no sustituiste las apis ,,si me puedes pasar el .tlb se agradeceria !
|
|
|
7
|
Seguridad Informática / Análisis y Diseño de Malware / Re: Firmas en la cabecera un gran reto!
|
en: 17 Septiembre 2011, 04:18 am
|
Gracias realmente agradezco q el avira me lo detecte ya q estoy aprendiendo bastante ,,gracias de nuevo por seguir contestando con este problema ,,del lordpe tomo el sizeofheaders el cual esta en 00001000 tomo el hex workshop y pongo ese valor en hex todo lo q esta depues lo pongo en 00 lo guardo y aun asi es detectado por lo q sigue estando en la cabecera la firma o eso parace,al hacer esto me tira el avira TR/Crypt.XPACK.Gen mientras q el original me sale TR/Crypt.XPACK.Gen3
|
|
|
8
|
Seguridad Informática / Análisis y Diseño de Malware / Re: Avira 1 - Yo 0
|
en: 16 Septiembre 2011, 03:28 am
|
Sin duda alguna cuando lo tenga fud ,,tu nombre estara entre los mas agradecidos al subirlo al foro,,intente sacar las apis con TLB las cuales solo logre sacar una sola me quedan estas q probe de mil formas y no obtuve buen resultado Private Declare Sub CopyMemory Lib "kernel32" Alias "RtlMoveMemory" (pDst As Any, pSrc As Any, ByVal dlen As Long) Private Declare Function DllFunction Lib "MSVBVM60" Alias "DllFunctionCall" (ByRef typeAPI As tAPICall) As Long Private Declare Sub CopyMemory Lib "kernel32" Alias "RtlMoveMemory" (pDst As Any, pSrc As Any, ByVal dlen As Long)
CopyMemory esta dos veces por q la uso en distintos modulos Edito:carge tu modulo y lo probe funciona excelente pero es mas detectado q el q tenia antes
|
|
|
9
|
Seguridad Informática / Análisis y Diseño de Malware / Re: Firmas en la cabecera un gran reto!
|
en: 16 Septiembre 2011, 03:16 am
|
Gracias por el apoyo gente !!!!,,realmente soy bastante nuevo en este foro pero veo q se ayudan mucho ,,espero subir mi crypt cuando sea fud 100% en este gran foro!! 2Fac3r : estoy 100% seguro q la firma se encuentra en la cabecera ya q al modificar ese offset me lo deja indetectable (tmb debo decir q antes habia firmas en el cuerpo las cuales las movi con el olly y ya no son detectadas) ,tmb tengo el codigo fuente ya q lo hice yo va en parte lei me base en muchos codigos de la red para hacerlo,,el cual uso las apis de forma dinamica ,,obvio siempre alguna hay q declarar o por lo menos asi lo hice yo. Karcrack subo una imgahen del hex donde marco los offset los cuales al modificar me lo deja indetecable pero tmb lo rompe The Swash eres un grande!! hace tiempo lei y intente entender tu codigo de como realiner las secciones en C te felicito por eso ,,logre hacerlo en vb6 usando tu codigo y otros mas q encontre por la red ,pero el tuyo fue el primero q lei,,asi q al crear el encryptado realineo de forma automtica y agrego todos los datos a la ultima sección,el bound import no esta en 0 ya q lei varios tutoriales de como pasar el hermoso avira los cuales no me dieron resultado. imagen en rojo los detectados,los valores de los offset son los orginales Uploaded with ImageShack.us,,saludos
|
|
|
10
|
Seguridad Informática / Análisis y Diseño de Malware / Firmas en la cabecera un gran reto!
|
en: 14 Septiembre 2011, 21:58 pm
|
Bien como dice el titulo estoy intentando sacar una firma q se encuentra en la cabecera y para mi sorpresa (era de esperar) me deja inservible el stub probe con el offset locator y sus 256 combinacion y nda me lo deja indetecable pero a la vez inservible ,,tengo bien posicionado el offset detectado es el 68 ,,ahora mi pregunta es si hay otra forma de limpiar esa firma sin cambiar el valor del offset con un hex ,,desde gracias por leer.saludos
|
|
|
|
|
|
|