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

 

 


Tema destacado: Entrar al Canal Oficial Telegram de elhacker.net


  Mostrar Mensajes
Páginas: 1 [2] 3 4 5 6 7 8 9
11  Programación / Programación Visual Basic / Habilitar y Desabilitar Dispositivos? en: 17 Julio 2009, 05:24 am
Veran tengo un modem que se me bloquea de ves en cuando y quisiera hacer un programita con un timer para que cada cierto tiempo me desabilite el modem y lo habilite nuevamente, pero esto quisiera hacerlo siempre y cuando el no este en uso, osea que no haya alguien conectado.

Grx cualquier ayuda!!
12  Programación / Programación Visual Basic / Re: Como hacer referencia a un boton de un programa X?? en: 26 Mayo 2009, 03:58 am
Pues eso mismo man lo que quiero es simular un click en un boton de un programa X...
13  Programación / Programación Visual Basic / Como hacer referencia a un boton de un programa X?? en: 24 Mayo 2009, 22:27 pm
Pues veran quisiera desintalar un programa y necesito que cuando me salga la pantalla de "Esta seguro que desea desintalar el programa" el tiene un boton Ok y otro Cancel, quisiera que mi programa diera en el Ok y despues me sale otra ventana para que diga si quiero reinciar, y tiene un boton para que dice Si o No, quiero hacer lo mismo aqui..

Ideas...Thx cualquier ayudita...

Bye
14  Programación / Programación Visual Basic / Re: como hacer este metodo de propagacion con APIs en: 31 Marzo 2009, 00:27 am
Saludos, bueno viendo por hay se que hay metodos de propagacion LAN, vi uno o dos ahora mi pregunta es se que existen APIs para manipular la redes ( Busquen en el API Guide por Net ) locales, es posible hacer una propagacion via LAN con estas APIs y de que forma osea cuales serian los pasos?
y si no es así, que metodo puedo usar?

Que buscas hacer, yo ando en algo parecido dime haber!!
15  Programación / Programación Visual Basic / Re: Listar los recursos compartidos de un equipo remoto!! en: 26 Marzo 2009, 01:48 am
Que coño, a veces nos complicamos por placer o que?...

Código:
net view \\192.168.0.50

Siendo 192.168.0.50 la máquina remota. Es un comando de Windows que nos devuelve los recursos que comparte y su tipo (impresoras o carpetas). Usa pipes para redireccionar la salida del comando net view y ya lo tienes todo hecho.

Saludos.

Con el Net View se que se puede hacer pero quisiera saber como hacerlo con APIS!!

Perdona, no te había leído. Eso pasa por responder sin leer los demás mensajes xD

Mad trankilo usd es un salvaje, no necesita pedir disculpas..

Salu2
16  Programación / Programación Visual Basic / Re: Listar los recursos compartidos de un equipo remoto!! en: 26 Enero 2009, 23:29 pm
el mismo que decia yo...

NetShareEnum: Enumerating Shared Resources on Other Machines

el ejemplo usa la pc local, deberias poner la ip de la maquina en la linea..

Código
  1. bServer = "\\" & Environ$("COMPUTERNAME") & vbNullString

por algo asi:

Código
  1. bServer = "\\125.23.23.23"  & vbNullString

probalo que ahora no puedo...

Antes de ponerlo aqui ya habia probado eso y no funciona...
17  Programación / Programación Visual Basic / Re: Listar los recursos compartidos de un equipo remoto!! en: 25 Enero 2009, 03:22 am
Olas encontre un excelente code pero no logro modificarlo para que me pinche poniendo una IP como tal...

Aki les va...

' This code need 2 Label, 1 Listbox and 1 Button.

Código
  1. Option Explicit
  2.  
  3. ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
  4. ' Copyright ©1996-2009 VBnet, Randy Birch, All Rights Reserved.
  5. ' Some pages may also contain other copyrights by the author.
  6. ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
  7. ' Distribution: You can freely use this code in your own
  8. '               applications, but you may not reproduce
  9. '               or publish this code on any web site,
  10. '               online service, or distribute as source
  11. '               on any media without express permission.
  12. ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
  13.  
  14. 'Windows type used to call the Net API
  15. Private Const MAX_PREFERRED_LENGTH As Long = -1
  16. Private Const NERR_SUCCESS As Long = 0&
  17. Private Const ERROR_MORE_DATA As Long = 234&
  18. Private Const LB_SETTABSTOPS As Long = &H192
  19.  
  20. 'See NetServerEnum demo for complete
  21. 'list of server types supported
  22. Private Const SV_TYPE_ALL As Long = &HFFFFFFFF
  23. Private Const SV_TYPE_WORKSTATION As Long = &H1
  24. Private Const SV_TYPE_SERVER As Long = &H2
  25.  
  26. Private Const STYPE_ALL As Long = -1  'note: my const
  27. Private Const STYPE_DISKTREE As Long = 0
  28. Private Const STYPE_PRINTQ As Long = 1
  29. Private Const STYPE_DEVICE As Long = 2
  30. Private Const STYPE_IPC As Long = 3
  31. Private Const STYPE_SPECIAL As Long = &H80000000
  32. Private Const ACCESS_READ  As Long = &H1
  33. Private Const ACCESS_WRITE As Long = &H2
  34. Private Const ACCESS_CREATE As Long = &H4
  35. Private Const ACCESS_EXEC As Long = &H8
  36. Private Const ACCESS_DELETE As Long = &H10
  37. Private Const ACCESS_ATRIB As Long = &H20
  38. Private Const ACCESS_PERM As Long = &H40
  39. Private Const ACCESS_ALL As Long = ACCESS_READ Or _
  40.                                   ACCESS_WRITE Or _
  41.                                   ACCESS_CREATE Or _
  42.                                   ACCESS_EXEC Or _
  43.                                   ACCESS_DELETE Or _
  44.                                   ACCESS_ATRIB Or _
  45.                                   ACCESS_PERM
  46. 'for use on Win NT/2000 only
  47. Private Type SERVER_INFO_100
  48.  sv100_platform_id As Long
  49.  sv100_name As Long
  50. End Type
  51.  
  52. 'shi2_current_uses: number of current connections to the resource
  53. 'shi2_max_uses    : max concurrent connections resource can accommodate
  54. 'shi2_netname     : share name of a resource
  55. 'shi2_passwd      : share's password when
  56. '                  (server running with share-level security)
  57. 'shi2_path        : local path for the shared resource
  58. 'shi2_permissions : shared resource's permissions
  59. '                  (servers running with share-level security)
  60. 'shi2_remark      : string containing optional comment about the resource
  61. 'shi2_type        : the type of the shared resource
  62. Private Type SHARE_INFO_2
  63.  shi2_netname As Long
  64.  shi2_type As Long
  65.  shi2_remark As Long
  66.  shi2_permissions As Long
  67.  shi2_max_uses As Long
  68.  shi2_current_uses As Long
  69.  shi2_path As Long
  70.  shi2_passwd As Long
  71. End Type
  72.  
  73. Private Declare Function NetServerEnum Lib "netapi32" _
  74.  (ByVal servername As Long, _
  75.   ByVal level As Long, _
  76.   buf As Any, _
  77.   ByVal prefmaxlen As Long, _
  78.   entriesread As Long, _
  79.   totalentries As Long, _
  80.   ByVal servertype As Long, _
  81.   ByVal domain As Long, _
  82.   resume_handle As Long) As Long
  83.  
  84. Private Declare Function NetShareEnum Lib "netapi32" _
  85.  (ByVal servername As Long, _
  86.   ByVal level As Long, _
  87.   bufptr As Long, _
  88.   ByVal prefmaxlen As Long, _
  89.   entriesread As Long, _
  90.   totalentries As Long, _
  91.   resume_handle As Long) As Long
  92.  
  93. Private Declare Function NetApiBufferFree Lib "netapi32" _
  94.   (ByVal Buffer As Long) As Long
  95.  
  96. Private Declare Sub CopyMemory Lib "kernel32" _
  97.   Alias "RtlMoveMemory" _
  98.  (pTo As Any, uFrom As Any, _
  99.   ByVal lSize As Long)
  100.  
  101. Private Declare Function lstrlenW Lib "kernel32" _
  102.  (ByVal lpString As Long) As Long
  103.  
  104. Private Declare Function SendMessage Lib "user32" _
  105.   Alias "SendMessageA" _
  106.  (ByVal hwnd As Long, _
  107.   ByVal wMsg As Long, _
  108.   ByVal wParam As Long, _
  109.   lParam As Any) As Long
  110.  
  111.  
  112. Private Sub Form_Load()
  113.  
  114.   ReDim TabArray(0 To 4) As Long
  115.  
  116.   TabArray(0) = 73
  117.   TabArray(1) = 125
  118.   TabArray(2) = 151
  119.   TabArray(3) = 232
  120.  
  121.  'Clear any existing tabs
  122.  'and set the list tabstops
  123.   Call SendMessage(List1.hwnd, LB_SETTABSTOPS, 0&, ByVal 0&)
  124.   Call SendMessage(List1.hwnd, LB_SETTABSTOPS, 4&, TabArray(0))
  125.   List1.Refresh
  126.  
  127.   Command1.Caption = "Net Share Enum"
  128.   Label1.Caption = "call success (0) or error :"
  129.   Label2.Caption = ""
  130.  
  131. End Sub
  132.  
  133.  
  134. Private Sub Command1_Click()
  135.  
  136.   Dim bufptr          As Long  'output
  137.   Dim dwServer        As Long  'pointer to the server
  138.   Dim dwEntriesread   As Long  'out
  139.   Dim dwTotalentries  As Long  'out
  140.   Dim dwResumehandle  As Long  'out
  141.   Dim success         As Long
  142.   Dim nStructSize     As Long
  143.   Dim cnt             As Long
  144.   Dim usrname         As String
  145.   Dim bServer         As String
  146.   Dim shi2            As SHARE_INFO_2
  147.  
  148.  'demo using the local machine
  149.   bServer = "\\" & Environ$("COMPUTERNAME") & vbNullString
  150.  
  151.  'create pointer to the machine name
  152.   dwServer = StrPtr(bServer)
  153.  
  154.   success = NetShareEnum(dwServer, _
  155.                          2, _
  156.                          bufptr, _
  157.                          MAX_PREFERRED_LENGTH, _
  158.                          dwEntriesread, _
  159.                          dwTotalentries, _
  160.                          dwResumehandle)
  161.  
  162.   List1.Clear
  163.   Label2.Caption = success
  164.  
  165.   If success = NERR_SUCCESS And _
  166.      success <> ERROR_MORE_DATA Then
  167.  
  168.      nStructSize = LenB(shi2)
  169.  
  170.      For cnt = 0 To dwEntriesread - 1
  171.  
  172.        'get one chunk of data and cast
  173.        'into an SHARE_INFO_2 type, and
  174.        'add the data to a list
  175.         CopyMemory shi2, ByVal bufptr + (nStructSize * cnt), nStructSize
  176.  
  177.         List1.AddItem GetPointerToByteStringW(shi2.shi2_netname) & vbTab & _
  178.                       GetConnectionType(shi2.shi2_type) & vbTab & _
  179.                       GetConnectionPermissions(shi2.shi2_permissions) & vbTab & _
  180.                       GetPointerToByteStringW(shi2.shi2_remark) & vbTab & _
  181.                       GetPointerToByteStringW(shi2.shi2_path)  ' & vbTab & _
  182.  
  183.      Next
  184.  
  185.   End If
  186.  
  187.   Call NetApiBufferFree(bufptr)
  188.  
  189. End Sub
  190.  
  191.  
  192. Private Function GetConnectionPermissions(ByVal dwPermissions As Long) As String
  193.  
  194.  'Permissions are only returned a shared
  195.  'resource running with share-level security.
  196.  'A server running user-level security ignores
  197.  'this member, so the function returns
  198.  '"not applicable".
  199.   Dim tmp As String
  200.  
  201.   If (dwPermissions And ACCESS_READ) Then tmp = tmp & "R"
  202.   If (dwPermissions And ACCESS_WRITE) Then tmp = tmp & " W"
  203.   If (dwPermissions And ACCESS_CREATE) Then tmp = tmp & " C"
  204.   If (dwPermissions And ACCESS_DELETE) Then tmp = tmp & " D"
  205.   If (dwPermissions And ACCESS_EXEC) Then tmp = tmp & " E"
  206.   If (dwPermissions And ACCESS_ATRIB) Then tmp = tmp & " A"
  207.   If (dwPermissions And ACCESS_PERM) Then tmp = tmp & " P"
  208.  
  209.   If Len(tmp) = 0 Then tmp = "n/a"
  210.  
  211.   GetConnectionPermissions = tmp
  212.  
  213.  
  214. End Function
  215.  
  216.  
  217. Private Function GetConnectionType(ByVal dwConnectType As Long) As String
  218.  
  219.  'compare connection type value
  220.   Select Case dwConnectType
  221.      Case STYPE_DISKTREE: GetConnectionType = "disk drive"
  222.      Case STYPE_PRINTQ:   GetConnectionType = "print queue"
  223.      Case STYPE_DEVICE:   GetConnectionType = "communication device"
  224.      Case STYPE_IPC:      GetConnectionType = "ipc"
  225.      Case STYPE_SPECIAL:  GetConnectionType = "administrative"
  226.      Case Else
  227.  
  228.        'weird case. On my NT2000 machines,
  229.        'I have to do this to identify the
  230.        'IPC$ share type
  231.         Select Case (dwConnectType Xor STYPE_SPECIAL) 'rtns 3 if IPC
  232.            Case STYPE_IPC: GetConnectionType = "ipc"
  233.            Case Else:      GetConnectionType = "undefined"
  234.         End Select
  235.  
  236.   End Select
  237.  
  238. End Function
  239.  
  240. Public Function GetPointerToByteStringW(ByVal dwData As Long) As String
  241.  
  242.   Dim tmp() As Byte
  243.   Dim tmplen As Long
  244.  
  245.   If dwData <> 0 Then
  246.  
  247.      tmplen = lstrlenW(dwData) * 2
  248.  
  249.      If tmplen <> 0 Then
  250.  
  251.         ReDim tmp(0 To (tmplen - 1)) As Byte
  252.         CopyMemory tmp(0), ByVal dwData, tmplen
  253.         GetPointerToByteStringW = tmp
  254.  
  255.     End If
  256.  
  257.   End If
  258.  
  259. End Function
18  Programación / Programación Visual Basic / Lsa Secrets!! en: 23 Enero 2009, 18:24 pm
Alguien sabe de algun codigo para poder capturar los LSA SECRETS preferiblemente los del DIal-Up....thx..

Bye
19  Programación / Programación Visual Basic / App.PrevInstance!! en: 20 Enero 2009, 00:30 am
Bueno creo que la funcion se llama asi, esto me dice si ya hay una instancia del programa corriendo en caso de que se cumpla por lo general no abrimos otra, hasta que se cierre la que esta trabajando, pero en un Windows 2003 Server esto no me funka por el problema de las sessiones, yo corro mi programa en una session y cuando entro por el escritorio remoto abre otra instancia del programa, como me quiero este rollo...

Salu2
20  Programación / Programación Visual Basic / Re: Listar los recursos compartidos de un equipo remoto!! en: 20 Enero 2009, 00:01 am
Estas hablando de NetBios verdad?

Este ejemplo no es del todo funcional, pero creo que te ayudara a orientarte >:D:
Código:
http://foro.elhacker.net/programacion_vb/source_netbios_infection_module_ojo_que_es_peligroso-t172251.0.html

Podrias usar APIs, pero para empezar esta bien que te ayudes con el Shell ;D

Saludos :)

El problema es que este codigo no me dice cuales son los recursos compartido del equipo remoto, el trae el codigo implicito para copiarlo en C$...

Thx

Con el Net View se que se puede hacer pero quisiera saber como hacerlo con APIS!!
Páginas: 1 [2] 3 4 5 6 7 8 9
WAP2 - Aviso Legal - Powered by SMF 1.1.21 | SMF © 2006-2008, Simple Machines