The document describes a program that monitors network traffic and detects potential denial of service (DoS) or distributed denial of service (DDoS) attacks by comparing send/receive bandwidth to a threshold.
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0 ratings0% found this document useful (0 votes)
11 views2 pages
新文字文件
The document describes a program that monitors network traffic and detects potential denial of service (DoS) or distributed denial of service (DDoS) attacks by comparing send/receive bandwidth to a threshold.
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 2
Public Class Form1
Dim Count As String
Private Sub Timer1_Tick(sender As Object, e As EventArgs) Handles Timer1.Tick Dim networkInterfaces As New System.Diagnostics.PerformanceCounterCategory("Network Interface") Dim nics As String() = networkInterfaces.GetInstanceNames() Dim bytesSent(nics.Length - 1) As System.Diagnostics.PerformanceCounter Dim bytesReceived(nics.Length - 1) As System.Diagnostics.PerformanceCounter Dim i As Integer For i = 0 To nics.Length - 1 bytesSent(i) = New System.Diagnostics.PerformanceCounter("Network Interface", "Bytes Sent/sec", nics(i), True) bytesReceived(i) = New System.Diagnostics.PerformanceCounter("Network Interface", "Bytes received/sec", nics(i), True) Next ListBox1.Items.Add("Received : " + bytesReceived(0).NextValue.ToString) ListBox2.Items.Add("Send ByteG" + bytesSent(0).RawValue.ToString) Dim DDOS As Long = bytesSent(0).RawValue.ToString * 8 If ComboBox1.Text = "KB" And DDOS < Count Then ListBox3.Items.Add("You are DOS / DDOS attacked : No") ListBox3.ForeColor = Color.Black ElseIf ComboBox1.Text = "KB" And DDOS > Count Then If TextBox1.Text = "" Then ListBox3.Items.Add("You are DOS / DDOS attacked : Yes") ListBox3.ForeColor = Color.Red Else ListBox3.Items.Add("You are DOS / DDOS attacked : Yes") ListBox3.ForeColor = Color.Red System.Diagnostics.Process.Start(TextBox1.Text) End If ElseIf ComboBox1.Text = "MB" And DDOS < Count Then ListBox3.Items.Add("You are DOS / DDOS attacked : No") ListBox3.ForeColor = Color.Black ElseIf ComboBox1.Text = "MB" And DDOS > Count Then If TextBox1.Text = "" Then ListBox3.Items.Add("You are DOS / DDOS attacked : Yes") ListBox3.ForeColor = Color.Red Else ListBox3.Items.Add("You are DOS / DDOS attacked : Yes") ListBox3.ForeColor = Color.Red System.Diagnostics.Process.Start(TextBox1.Text) End If Else ListBox3.Items.Add("You are DOS / DDOS attacked : No") ListBox3.ForeColor = Color.Black End If End Sub
Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
MessageBox.Show("This tool is not 100% work......and , hope you enjoy it!", "ISSAC") Timer1.Start() End Sub
Private Sub Button1_Click(sender As Object, e As EventArgs)
ListBox1.Items.Clear() End Sub
Private Sub Button2_Click(sender As Object, e As EventArgs)
ListBox2.Items.Clear() End Sub
Private Sub Button4_Click(sender As Object, e As EventArgs) Handles
Button4.Click If ComboBox1.Text = "KB" Then Count = NumericUpDown1.Value * 8 * 1024 ElseIf ComboBox1.Text = "MB" Then Count = NumericUpDown1.Value * 8 * 1024 * 1024 End If End Sub
Private Sub Button3_Click(sender As Object, e As EventArgs)
ListBox3.Items.Clear() End Sub
Private Sub Button5_Click(sender As Object, e As EventArgs) Handles
Button5.Click MessageBox.Show("When you are DOS / DDOS attacked , will open this file", "ISSAC") If (OpenFileDialog1.ShowDialog() = Windows.Forms.DialogResult.OK) Then TextBox1.Text = OpenFileDialog1.FileName End If End Sub End Class