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

 

 


Tema destacado: (TUTORIAL) Aprende a emular Sentinel Dongle By Yapis


+  Foro de elhacker.net
|-+  Programación
| |-+  Programación General
| | |-+  .NET (C#, VB.NET, ASP) (Moderador: kub0x)
| | | |-+  Gestionar Sockets Ajenos ??
0 Usuarios y 1 Visitante están viendo este tema.
Páginas: [1] Ir Abajo Respuesta Imprimir
Autor Tema: Gestionar Sockets Ajenos ??  (Leído 2,332 veces)
TrashAmbishion


Desconectado Desconectado

Mensajes: 756


Ver Perfil
Gestionar Sockets Ajenos ??
« en: 19 Junio 2016, 23:19 pm »

Lo que quiero hacer es esto

http://www.vbforums.com/showthread.php?503818-RESOLVED-Block-IP

Estoy tratando de llevarlo a .NET si alguien puede ayudar se los agradecere.

Salu2


« Última modificación: 20 Junio 2016, 05:39 am por TrashAmbishion » En línea

TrashAmbishion


Desconectado Desconectado

Mensajes: 756


Ver Perfil
Re: Gestionar Sockets Ajenos ??
« Respuesta #1 en: 20 Junio 2016, 19:48 pm »

Lo que quiero hacer es esto

http://www.vbforums.com/showthread.php?503818-RESOLVED-Block-IP

Estoy tratando de llevarlo a .NET si alguien puede ayudar se los agradecere.

Salu2

Solucionado mas tarde subo como lo hice. Salu2


En línea

TrashAmbishion


Desconectado Desconectado

Mensajes: 756


Ver Perfil
Re: Gestionar Sockets Ajenos ??
« Respuesta #2 en: 21 Junio 2016, 07:36 am »

Código
  1. Dim pdwSize As Integer
  2.        Dim iRetVal As Integer
  3.        Dim i As Integer
  4.        Dim TcpTableRow As MIB_TCPROW
  5.        Dim pStructPointer As IntPtr = IntPtr.Zero
  6.        Dim iNumberOfStructures As Integer
  7.  
  8.        Form1.dgvtcp.Rows.Clear()
  9.  
  10.        iRetVal = GetTcpTable(pStructPointer, pdwSize, 0)
  11.  
  12.        pStructPointer = Marshal.AllocHGlobal(pdwSize)
  13.        iRetVal = GetTcpTable(pStructPointer, pdwSize, 0)
  14.        iNumberOfStructures = Math.Ceiling((pdwSize - 4) / Marshal.SizeOf(GetType(MIB_TCPROW)))
  15.  
  16. For i = 0 To iNumberOfStructures - 1
  17.            Dim pStructPointerTemp As IntPtr = New IntPtr(pStructPointer.ToInt32() + 4 + (i * Marshal.SizeOf(GetType(MIB_TCPROW))))
  18.  
  19.            TcpTableRow = New MIB_TCPROW()
  20.            With TcpTableRow
  21.                .dwLocalAddr = 0
  22.                .dwState = 0
  23.                .dwLocalPort = 0
  24.                .dwRemoteAddr = 0
  25.                .dwRemotePort = 0
  26.            End With
  27.            'Marshal.PtrToStructure(pStructPointerTemp, TcpTableRow)
  28.            TcpTableRow = CType(Marshal.PtrToStructure(pStructPointerTemp, GetType(MIB_TCPROW)), MIB_TCPROW)
  29.            ' Process each MIB_TCPROW here
  30.            With TcpTableRow
  31.  
  32.                'Aqui desconecto la ip que este conectado a mi
  33.  
  34.                    If GetIpFromLong(.dwRemoteAddr).ToString = "Aqui La Ip" Then
  35.                        .dwState = 12
  36.                        Try
  37.                            SetTcpEntry(TcpTableRow)
  38.                        Catch ex As Exception
  39.                            MessageBox.Show(ex.Message)
  40.                        End Try
  41.                        Exit For
  42.                    End If
  43.  
  44.           End With
  45. Next
  46. Marshal.FreeHGlobal(pStructPointer)
  47.  
  48.  
  49.  

Probado en Windows 8.1
En línea

Páginas: [1] Ir Arriba Respuesta Imprimir 

Ir a:  

Mensajes similares
Asunto Iniciado por Respuestas Vistas Último mensaje
Cambiar iconos de ficheros ajenos al proyecto
Programación Visual Basic
WarGhost 6 2,523 Último mensaje 28 Abril 2006, 18:36 pm
por WarGhost
lamer que se divierte con msn ajenos
Mensajería
coltking 2 4,288 Último mensaje 16 Diciembre 2010, 16:32 pm
por ~ Ghost_Networks ~
¿Alguna API para cambiar color de programas ajenos?
Hacking
ApOkAlizE 2 3,622 Último mensaje 20 Julio 2011, 02:06 am
por ApOkAlizE
Twitter podría hacer dinero con los usuarios ajenos
Noticias
wolfbcn 0 1,152 Último mensaje 11 Enero 2015, 02:27 am
por wolfbcn
La detección de mineros de criptomonedas en dispositivos ajenos creció un ...
Noticias
wolfbcn 0 979 Último mensaje 23 Marzo 2018, 01:14 am
por wolfbcn
WAP2 - Aviso Legal - Powered by SMF 1.1.21 | SMF © 2006-2008, Simple Machines