|
61
|
Seguridad Informática / Análisis y Diseño de Malware / [TLB][VB6] Indetectar DllFunctionCall y CopyBytes
|
en: 24 Marzo 2010, 00:43 am
|
Bueno, me han comentado que DllFunctionCall y __vbaCopyBytes es detectado por el paranoico de Avira... asi que aqui esta el TLB que debe hacer indetectable la llamada a estas APIs http://www.box.net/shared/58sikxl3nu Para gastarlo? Pues eliminar la declaracion de las APIs del codigo en VB y agregar el TLB a la lista de referencias: Proyecto->Referencias...Saludos
|
|
|
62
|
Programación / Programación Visual Basic / [m][SRC][Semaforos!] Alternativa a CreateMutex
|
en: 16 Marzo 2010, 15:58 pm
|
Ya puse una alternativa hace un tiempo: http://foro.elhacker.net/programacion_vb/srcmaltmutexbas_alternativa_a_createmutex-t243771.0.html Pues aqui va otra trabajando con Semaforos Option Explicit 'KERNEL32 Private Declare Function CreateSemaphoreW Lib "kernel32.dll" (ByVal lpSemaphoreAttributes As Long, ByVal lInitialCount As Long, ByVal lMaximumCount As Long, ByVal lpName As Long) As Long Private Const ERROR_ALREADY_EXISTS As Long = 183& Public Function bWasIOpened(ByVal lpName As String) As Boolean bWasIOpened = (CreateSemaphoreW(0&, 0&, 1&, StrPtr(lpName)) > 0) And (Err.LastDllError = ERROR_ALREADY_EXISTS) End Function
Minimalista, como a mi me gusta Bueno, para que no sepa para que sirve esto lo explico, es bastante facil. Sirve para que no hayan dos instancias de nuestra aplicacion ejecutandose simultaneamente... Una mejor explicacion de nuestro amigo MadAntrax sirve para controlar que nuestra aplicación no sea ejecutada 2 veces en un mismo equipo. Algunos pensareis que eso ya se puede hacer con If App.PrevInstance = True Then End
pero eso no es cierto... si nuestra aplicación se copia en System32 como: programa1.exe y programa2.exe... el usuario podrá ejecutar el programa1.exe y el programa2.exe simultáneamente! Eso puede suponer un problema en el caso de estar programando un troyano o un keylogger (donde lo importante es solo tener una instancia de nuestro malware a la vez). Ejemplo de uso del code: Private Sub Form_Load() If bWasIOpened("Cualquier_Cosa") = True Then End End Sub
Nota:Probar solo compilado. Saludos
|
|
|
63
|
Programación / Programación Visual Basic / [FIX] Error sacar BaseAddress Kernel32 W7 {cInvoke,cRunPe...}
|
en: 3 Marzo 2010, 17:46 pm
|
Bueno, supongo que algunos se habran dado cuenta que en W7 algunos CallAPI no funcionan... Eso es porque el W7 pone primero NTDLL antes que KERNEL32 en los modules cargados (Peb->InInitOrder[0]->BaseAddress != &KERNEL32 )... Es por eso que he programado (Basandome en otros) este shellcode que saca el BaseAddress de K32 en cualquier W$ NT aqui tenies el codigo: http://karcrack.pastebin.com/TWmj5G5c Y bueno, para solucionar el problema en los codigos que utilizan un pequeño shellcode para sacar el BaseAddres basta con reemplazar la constante THUNK_KERNELBASE por estos OPCODES: 8B4C2408565531C0648B70308B760C8B761C8B6E088B7E208B3638471875F3803F6B7407803F4B7402EBE789295D5EC3 Saludos Originalmente posteado (En Ingles):http://www.advancevb.com.ar/?p=499
|
|
|
64
|
Programación / Programación Visual Basic / [SNIPPET]Alternativa App.TaskVisible
|
en: 12 Febrero 2010, 23:35 pm
|
'USER32 Private Declare Function ShowWindow Lib "USER32" (ByVal hwnd As Long, ByVal nCmdShow As Long) As Long Private Declare Function FindWindowA Lib "USER32" (ByVal lpClassName As String, ByVal lpWindowName As String) As Long Private Const SW_HIDE As Long = 0 Private Const SW_NORMAL As Long = 1 Private Const CLASSNAME As String = "ThunderRT6Main" Public Sub AppTaskVisible(ByVal bVisible As Boolean) Dim lHwnd As Long lHwnd = FindWindowA(CLASSNAME, App.Title) If lHwnd Then Call ShowWindow(lHwnd, IIf((bVisible = True), SW_NORMAL, SW_HIDE)) End If End Sub
Bueno, la gente se queja de que App.TaskVisible es detectada... asi que aqui esta, el sustituto Lo he probado en W$ XP SP3, a ver si alguien puede probarlo en otro W$ Olvidaba decir que hay que probarlo compilado! Saludos
|
|
|
65
|
Programación / Programación Visual Basic / [NTDLL] Enumerar dispositivos (p.e Unidades Extraibles...) - ProcessDeviceMap
|
en: 11 Febrero 2010, 16:18 pm
|
Option Explicit '--------------------------------------------------------------------------------------- ' Module : mNativeEnumDrives ' Author : Karcrack ' Date : 11/02/2010 ' Purpose : Enumerate Drives, allow filtering by device type '--------------------------------------------------------------------------------------- 'NTDLL Private Declare Function NtQueryInformationProcess Lib "NTDLL" (ByVal hProcess As Long, ByVal ProcessInformationClass As Long, ProcessInformation As Any, ByVal ProcessInformationLength As Long, ReturnLength As Long) As Long Private Type PROCESS_DEVICEMAP_INFORMATION DriveMap As Long DriveType(1 To 32) As Byte End Type Public Enum DeviceType DRIVE_NOFILTER = -1 DRIVE_UNKNOWN DRIVE_NO_ROOT_DIR DRIVE_REMOVABLE DRIVE_FIXED DRIVE_REMOTE DRIVE_CDROM DRIVE_RAMDISK End Enum Private Const ProcessDeviceMap = 23 Public Function NtGetDrives(Optional ByVal lFilterType As DeviceType = DRIVE_NOFILTER) As Collection Dim tPDC As PROCESS_DEVICEMAP_INFORMATION Dim i As Long Set NtGetDrives = New Collection If NtQueryInformationProcess(-1, ProcessDeviceMap, tPDC, Len(tPDC), ByVal 0&) = 0 Then For i = 0 To 25 If tPDC.DriveMap And 2 ^ i Then If (lFilterType = -1) Or (tPDC.DriveType(i + 1) = lFilterType) Then NtGetDrives.Add Chr$(65 + i) & ":\" End If End If Next i End If End Function
Simplemente es una modificación de este código: http://www.advancevb.com.ar/?p=335Ejemplo de uso:Private Sub Form_Load() Dim vItem As Variant For Each vItem In NtGetDrives(DRIVE_REMOVABLE) MsgBox vItem Next vItem End Sub
Mostrará las unidades extraibles! Hay que tener en cuenta que no todos los PenDrives USB son detectados como unidades extraibles, para mas precision mirar este codigo que saca el BusType: http://www.advancevb.com.ar/?p=345Cualquier duda preguntar! Saludos!
|
|
|
66
|
Programación / Programación Visual Basic / [NTDLL] Sacar puntero API - LdrLoadDll() + LdrGetProcedureAddress()
|
en: 10 Febrero 2010, 18:06 pm
|
Option Explicit 'NTDLL Private Declare Function LdrLoadDll Lib "NTDLL" (ByVal pWPathToFile As Long, ByVal Flags As Long, ByRef pwModuleFileName As UNICODE_STRING, ByRef ModuleHandle As Long) As Long Private Declare Function LdrGetProcedureAddress Lib "NTDLL" (ByVal ModuleHandle As Long, ByRef paFunctionName As Long, ByVal Ordinal As Integer, ByRef FunctionAddress As Long) As Long Private Declare Sub RtlInitUnicodeString Lib "NTDLL" (DestinationString As Any, ByVal SourceString As Long) Private Type UNICODE_STRING uLength As Integer uMaximumLength As Integer pBuffer As Long End Type Public Function NtLoadLibrary(ByVal sName As String) As Long Dim US As UNICODE_STRING Call RtlInitUnicodeString(US, StrPtr(sName)) Call LdrLoadDll(ByVal 0&, ByVal 0&, US, NtLoadLibrary) End Function Public Function NtGetProcAddr(ByVal lModuleHandle As Long, ByVal sProc As String) As Long Dim i As Long Dim ANSI() As Byte ReDim ANSI(0 To Len(sProc)) For i = 1 To Len(sProc) ANSI(i - 1) = Asc(Mid$(sProc, i, 1)) Next i Call LdrGetProcedureAddress(lModuleHandle, VarPtr(ANSI(0)), ByVal 0&, NtGetProcAddr) End Function
Es el equivalente nativo de LoadLibrary+GetProcAddress Ejemplo: Option Explicit 'KERNEL32 Private Declare Function LoadLibrary Lib "KERNEL32" Alias "LoadLibraryA" (ByVal lpLibFileName As String) As Long Private Declare Function GetProcAddress Lib "KERNEL32" (ByVal hModule As Long, ByVal lpProcName As String) As Long Private Sub Form_Load() MsgBox Hex$(NtGetProcAddr(NtLoadLibrary("KERNEL32"), "ExitProcess")) & vbCrLf & Hex$(GetProcAddress(LoadLibrary("KERNEL32"), "ExitProcess")) End Sub
Cualquier duda... preguntar! Saludos
|
|
|
67
|
Programación / Programación Visual Basic / [ASM+VB6][ANTI] IsVirtualPC - Saber si estamos en un VPC!
|
en: 10 Febrero 2010, 18:04 pm
|
Option Explicit '--------------------------------------------------------------------------------------- ' Module : mAntiVirtualPC ' Author : Karcrack ' Now$ : 06/09/2009 17:35 ' Used for? : Known if being Virtualized inside M$ Virtual PC ' Thanks : Kiash > He tested on Virtual PC ' Original C source: ' BOOL IsVirtualPC(void){ ' __try{ ' __asm{ ' mov eax, 1 ' _emit 0x0F ' _emit 0x3F ' _emit 0x07 ' _emit 0x0B ' _emit 0xC7 ' _emit 0x45 ' _emit 0xFC ' _emit 0xFF ' _emit 0xFF ' _emit 0xFF ' _emit 0xFF ' } ' }__except(1){ ' return FALSE; ' } ' return TRUE; ' } '--------------------------------------------------------------------------------------- 'KERNEL32 Private Declare Function SetUnhandledExceptionFilter Lib "KERNEL32" (ByVal lpTopLevelExceptionFilter As Long) As Long 'USER32 Private Declare Function CallWindowProc Lib "USER32" Alias "CallWindowProcA" (ByVal lpPrevWndFunc As Long, ByVal hwnd As Long, ByVal msg As Long, ByVal wParam As Long, ByVal lParam As Long) As Long 'MSVBVM60 Private Declare Sub PutMem8 Lib "MSVBVM60" (inDst As Any, ByVal inSrc As Currency) Private Const THUNK_ANTI1 As Currency = -104917872100.9905@ 'db 0x0F, 0x3F,0x07,0x0B,0xC7,0x45,0xFC,0xFF Private Const THUNK_ANTI2 As Currency = -802975918416356.9665@ 'db 0xFF,0xFF,0xFF + RET + NOP + NOP + NOP + NOP Private m_bFlag As Boolean Public Function IsVirtualPC() As Boolean On Error Resume Next Dim bvASM(&HF) As Byte Dim lOldSEH As Long m_bFlag = True lOldSEH = SetUnhandledExceptionFilter(AddressOf ExceptionHandler) Call PutMem8(ByVal VarPtr(bvASM(0)), THUNK_ANTI1) Call PutMem8(ByVal VarPtr(bvASM(0)) + 8, THUNK_ANTI2) Call CallWindowProc(VarPtr(bvASM(0)), 0&, 0&, 0&, 0&) Call SetUnhandledExceptionFilter(lOldSEH) IsVirtualPC = m_bFlag End Function Public Function ExceptionHandler(ByRef uException As Long) As Long m_bFlag = False: ExceptionHandler = -1 ' VB Will process our error :P Call Mid$(vbNullString, 0) End Function
Como siempre, cualquier duda... preguntar! Este es un codigo que detecta si estamos siendo ejecutados en un M$ Virtual PC, simplemente pase el codigo de C a VB Saludos
|
|
|
68
|
Programación / Programación Visual Basic / [ASM+VB6] Deteccion Virtual Machine - Interrupt Descriptor Table
|
en: 10 Febrero 2010, 18:00 pm
|
Option Explicit '--------------------------------------------------------------------------------------- ' Module : mVirtualized ' Author : Karcrack ' Date : 09/09/09 ' Used for? : Detect Virtualized Machines... like VMWare/V.PC/QEmu... ' Tested On : ' - Virtual PC 2007, 1.0 (Tested by: KIASH!) ' - VMWare ,6.5.3.185404 (Tested by: SkyWeb!) ' ' Reference : ' :http://www.cs.nps.navy.mil/people/faculty/irvine/publications/2000/VMM-usenix00-0611.pdf ' :http://invisiblethings.org/papers/redpill.html ' :http://www.ntsecurity.nu/onmymind/2007/2007-02-27.html ' :http://blog.assarbad.net/wp-content/uploads/2006/11/redpill_getting_colorless.pdf '--------------------------------------------------------------------------------------- 'USER32 Private Declare Function CallThunk8 Lib "USER32" Alias "CallWindowProcW" (ByRef cThunk As Currency, Optional ByVal Param1 As Long, Optional ByVal Param2 As Long, Optional ByVal Param3 As Long, Optional ByVal Param4 As Long) As Long Public Function ImVirtualized() As Boolean Dim tIDT(2 + 4) As Byte ' mov ecx, [esp+4]\ ' sidt [ecx] |->; -439297879751758.3221@ ' retn / Call CallThunk8(-439297879751758.3221@, ByVal VarPtr(tIDT(0))) ImVirtualized = (tIDT(5) > &HD0) End Function
Es muy recomendable leer los links citados en los comentarios para mas info sobre el tema Cualquier duda... preguntar! Saludos
|
|
|
69
|
Programación / Programación Visual Basic / [ASM+VB6] Alternativa GetCurrentProcessId() - [FS:0x20]
|
en: 10 Febrero 2010, 17:55 pm
|
'USER32 Private Declare Function CallThunk8 Lib "USER32" Alias "CallWindowProcW" (ByRef cThunk As Currency, Optional ByVal Param1 As Long = 0, Optional ByVal Param2 As Long = 0, Optional ByVal Param3 As Long = 0, Optional ByVal Param4 As Long = 0) As Long '--------------------------------------------------------------------------------------- ' Procedure : FS_GetCurrentProcessId ' Author : Karcrack ' Date : 23/09/2009 ' Purpose : GetCurrentProcessId@Kernel32 alternative. Reads info from TIB '--------------------------------------------------------------------------------------- ' Public Function FS_GetCurrentProcessId() As Long ' mov eax, [FS:0x20] FS_GetCurrentProcessId = CallThunk8(-801556291178721.2444@) End Function
Pensaba que lo habia posteado aqui, pero no lo he encontrado, asi que aqui teneis! Lo que hace este codigo es leer el TIB para sacar nuestro PID Cualquier duda... preguntais! Saludos
|
|
|
70
|
Media / Juegos y Consolas / [TORNEO-XBOX360] Call of Duty: Modern Warfare 2
|
en: 1 Diciembre 2009, 23:07 pm
|
Aquí tenéis un torneo de Call of Duty: Modern Warfare 2 CON PREMIOSLos premios serán lo más seguro, unas camisetas de Modern Warfare 2 con el GT del jugador impreso (esta por ver toda esta parte). El torneo será, probablemente, por equipos (dependemos de la gente que se apunte). Por ahora, que la gente se registre y apunte su Gamertag y ya se irá actualizando esto. Cuanta más gente, antes empezamos y lo hacemos por equipos!
|
|
|
|
|
|
|