Can anyone help me to make a program intrusion prevention system with method anomaly base detection. I have the source code for a firewall. Can anyone give me program IDS to unify firewall to be a Wireless IPS this is source code for the firewall.
---------------------------------------------------------------------
Public Class Form1
Inherits System.Windows.Forms.Form
#Region " Windows Form Designer generated code "
Public Sub New()
MyBase.New()
'This call is required by the Windows Form Designer.
InitializeComponent()
'Add any initialization after the InitializeComponent() call
End Sub
'Form overrides dispose to clean up the component list.
Protected Overloads Overrides Sub Dispose(ByVal disposing As Boolean)
If disposing Then
If Not (components Is Nothing) Then
components.Dispose()
End If
End If
MyBase.Dispose(disposing)
End Sub
'Required by the Windows Form Designer
Private components As System.ComponentModel.IContainer
'NOTE: The following procedure is required by the Windows Form Designer
'It can be modified using the Windows Form Designer.
'Do not modify it using the code editor.
Friend WithEvents pname As System.Windows.Forms.ColumnHeader
Friend WithEvents pid As System.Windows.Forms.ColumnHeader
Friend WithEvents Priority As System.Windows.Forms.ColumnHeader
Friend WithEvents fname As System.Windows.Forms.ColumnHeader
Friend WithEvents TabControl1 As System.Windows.Forms.TabControl
Friend WithEvents ColumnHeader5 As System.Windows.Forms.ColumnHeader
Friend WithEvents ColumnHeader6 As System.Windows.Forms.ColumnHeader
Friend WithEvents ColumnHeader7 As System.Windows.Forms.ColumnHeader
Friend WithEvents ColumnHeader8 As System.Windows.Forms.ColumnHeader
Friend WithEvents TabPage1 As System.Windows.Forms.TabPage
Friend WithEvents ListView2 As System.Windows.Forms.ListView
Friend WithEvents ColumnHeader9 As System.Windows.Forms.ColumnHeader
Friend WithEvents ColumnHeader10 As System.Windows.Forms.ColumnHeader
Friend WithEvents ColumnHeader11 As System.Windows.Forms.ColumnHeader
Friend WithEvents ColumnHeader12 As System.Windows.Forms.ColumnHeader
Friend WithEvents TabPage2 As System.Windows.Forms.TabPage
Friend WithEvents ListView1 As System.Windows.Forms.ListView
Friend WithEvents Label1 As System.Windows.Forms.Label
Friend WithEvents ColumnHeader1 As System.Windows.Forms.ColumnHeader
Friend WithEvents ColumnHeader2 As System.Windows.Forms.ColumnHeader
Friend WithEvents ColumnHeader4 As System.Windows.Forms.ColumnHeader
Friend WithEvents Button1 As System.Windows.Forms.Button
Friend WithEvents ColumnHeader14 As System.Windows.Forms.ColumnHeader
Friend WithEvents ColumnHeader3 As System.Windows.Forms.ColumnHeader
Friend WithEvents ColumnHeader13 As System.Windows.Forms.ColumnHeader
Friend WithEvents TabPage3 As System.Windows.Forms.TabPage
Friend WithEvents ListBox1 As System.Windows.Forms.ListBox
Friend WithEvents Label2 As System.Windows.Forms.Label
Friend WithEvents GroupBox1 As System.Windows.Forms.GroupBox
Friend WithEvents TextBox1 As System.Windows.Forms.TextBox
Friend WithEvents Button3 As System.Windows.Forms.Button
Friend WithEvents Label3 As System.Windows.Forms.Label
Friend WithEvents Label4 As System.Windows.Forms.Label
Friend WithEvents Button6 As System.Windows.Forms.Button
Friend WithEvents Label5 As System.Windows.Forms.Label
Friend WithEvents Button7 As System.Windows.Forms.Button
Friend WithEvents Button8 As System.Windows.Forms.Button
Friend WithEvents Button5 As System.Windows.Forms.Button
Friend WithEvents TabPage4 As System.Windows.Forms.TabPage
Friend WithEvents PictureBox1 As System.Windows.Forms.PictureBox
Friend WithEvents PictureBox2 As System.Windows.Forms.PictureBox
Friend WithEvents Label7 As System.Windows.Forms.Label
Friend WithEvents PictureBox3 As System.Windows.Forms.PictureBox
Friend WithEvents PictureBox5 As System.Windows.Forms.PictureBox
Friend WithEvents Label9 As System.Windows.Forms.Label
Friend WithEvents Button2 As System.Windows.Forms.Button
Friend WithEvents Timer1 As System.Windows.Forms.Timer
Friend WithEvents Label8 As System.Windows.Forms.Label
Friend WithEvents Label10 As System.Windows.Forms.Label
Friend WithEvents PictureBox6 As System.Windows.Forms.PictureBox
Friend WithEvents LinkLabel1 As System.Windows.Forms.LinkLabel
<System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()
Me.components = New System.ComponentModel.Container
Dim resources As System.Resources.ResourceManager = New System.Resources.ResourceManager(GetType(Form1))
Me.pname = New System.Windows.Forms.ColumnHeader
Me.pid = New System.Windows.Forms.ColumnHeader
Me.Priority = New System.Windows.Forms.ColumnHeader
Me.fname = New System.Windows.Forms.ColumnHeader
Me.TabControl1 = New System.Windows.Forms.TabControl
Me.TabPage4 = New System.Windows.Forms.TabPage
Me.Button2 = New System.Windows.Forms.Button
Me.PictureBox5 = New System.Windows.Forms.PictureBox
Me.Label7 = New System.Windows.Forms.Label
Me.PictureBox2 = New System.Windows.Forms.PictureBox
Me.PictureBox1 = New System.Windows.Forms.PictureBox
Me.Label10 = New System.Windows.Forms.Label
Me.PictureBox6 = New System.Windows.Forms.PictureBox
Me.TabPage1 = New System.Windows.Forms.TabPage
Me.Label9 = New System.Windows.Forms.Label
Me.ListView2 = New System.Windows.Forms.ListView
Me.ColumnHeader9 = New System.Windows.Forms.ColumnHeader
Me.ColumnHeader10 = New System.Windows.Forms.ColumnHeader
Me.ColumnHeader11 = New System.Windows.Forms.ColumnHeader
Me.ColumnHeader12 = New System.Windows.Forms.ColumnHeader
Me.TabPage2 = New System.Windows.Forms.TabPage
Me.Button8 = New System.Windows.Forms.Button
Me.Button1 = New System.Windows.Forms.Button
Me.Label1 = New System.Windows.Forms.Label
Me.ListView1 = New System.Windows.Forms.ListView
Me.ColumnHeader1 = New System.Windows.Forms.ColumnHeader
Me.ColumnHeader2 = New System.Windows.Forms.ColumnHeader
Me.ColumnHeader4 = New System.Windows.Forms.ColumnHeader
Me.ColumnHeader14 = New System.Windows.Forms.ColumnHeader
Me.ColumnHeader3 = New System.Windows.Forms.ColumnHeader
Me.ColumnHeader13 = New System.Windows.Forms.ColumnHeader
Me.TabPage3 = New System.Windows.Forms.TabPage
Me.Label8 = New System.Windows.Forms.Label
Me.PictureBox3 = New System.Windows.Forms.PictureBox
Me.Button5 = New System.Windows.Forms.Button
Me.Button7 = New System.Windows.Forms.Button
Me.Label5 = New System.Windows.Forms.Label
Me.Button6 = New System.Windows.Forms.Button
Me.Label4 = New System.Windows.Forms.Label
Me.Label3 = New System.Windows.Forms.Label
Me.GroupBox1 = New System.Windows.Forms.GroupBox
Me.Button3 = New System.Windows.Forms.Button
Me.TextBox1 = New System.Windows.Forms.TextBox
Me.Label2 = New System.Windows.Forms.Label
Me.ListBox1 = New System.Windows.Forms.ListBox
Me.ColumnHeader5 = New System.Windows.Forms.ColumnHeader
Me.ColumnHeader6 = New System.Windows.Forms.ColumnHeader
Me.ColumnHeader7 = New System.Windows.Forms.ColumnHeader
Me.ColumnHeader8 = New System.Windows.Forms.ColumnHeader
Me.Timer1 = New System.Windows.Forms.Timer(Me.components)
Me.LinkLabel1 = New System.Windows.Forms.LinkLabel
Me.TabControl1.SuspendLayout()
Me.TabPage4.SuspendLayout()
Me.TabPage1.SuspendLayout()
Me.TabPage2.SuspendLayout()
Me.TabPage3.SuspendLayout()
Me.GroupBox1.SuspendLayout()
Me.SuspendLayout()
'
'pname
'
Me.pname.Text = "Process Name"
Me.pname.Width = 105
'
'pid
'
Me.pid.Text = "Process ID"
Me.pid.Width = 79
'
'Priority
'
Me.Priority.Text = "Priority"
Me.Priority.Width = 72
'
'fname
'
Me.fname.Text = "File Name"
Me.fname.Width = 195
'
'TabControl1
'
Me.TabControl1.Alignment = System.Windows.Forms.TabAlignment.Bottom
Me.TabControl1.Controls.Add(Me.TabPage4)
Me.TabControl1.Controls.Add(Me.TabPage2)
Me.TabControl1.Controls.Add(Me.TabPage1)
Me.TabControl1.Controls.Add(Me.TabPage3)
Me.TabControl1.Dock = System.Windows.Forms.DockStyle.Bottom
Me.TabControl1.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.TabControl1.Location = New System.Drawing.Point(0, 5)
Me.TabControl1.Name = "TabControl1"
Me.TabControl1.SelectedIndex = 0
Me.TabControl1.Size = New System.Drawing.Size(552, 424)
Me.TabControl1.TabIndex = 5
'
'TabPage4
'
Me.TabPage4.BackColor = System.Drawing.SystemColors.ControlLightLight
Me.TabPage4.Controls.Add(Me.LinkLabel1)
Me.TabPage4.Controls.Add(Me.Button2)
Me.TabPage4.Controls.Add(Me.PictureBox5)
Me.TabPage4.Controls.Add(Me.Label7)
Me.TabPage4.Controls.Add(Me.PictureBox2)
Me.TabPage4.Controls.Add(Me.PictureBox1)
Me.TabPage4.Controls.Add(Me.Label10)
Me.TabPage4.Controls.Add(Me.PictureBox6)
Me.TabPage4.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.TabPage4.Location = New System.Drawing.Point(4, 4)
Me.TabPage4.Name = "TabPage4"
Me.TabPage4.Size = New System.Drawing.Size(544, 398)
Me.TabPage4.TabIndex = 3
Me.TabPage4.Text = "Process Controller"
'
'Button2
'
Me.Button2.FlatStyle = System.Windows.Forms.FlatStyle.Popup
Me.Button2.Image = CType(resources.GetObject("Button2.Image"), System.Drawing.Image)
Me.Button2.ImageAlign = System.Drawing.ContentAlignment.TopCenter
Me.Button2.Location = New System.Drawing.Point(416, 272)
Me.Button2.Name = "Button2"
Me.Button2.Size = New System.Drawing.Size(96, 56)
Me.Button2.TabIndex = 7
Me.Button2.Text = "Help / Support"
Me.Button2.TextAlign = System.Drawing.ContentAlignment.BottomCenter
'
'PictureBox5
'
Me.PictureBox5.Image = CType(resources.GetObject("PictureBox5.Image"), System.Drawing.Image)
Me.PictureBox5.Location = New System.Drawing.Point(64, 104)
Me.PictureBox5.Name = "PictureBox5"
Me.PictureBox5.Size = New System.Drawing.Size(40, 40)
Me.PictureBox5.TabIndex = 5
Me.PictureBox5.TabStop = False
'
'Label7
'
Me.Label7.Font = New System.Drawing.Font("Times New Roman", 11.25!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.Label7.ForeColor = System.Drawing.Color.FromArgb(CType(0, Byte), CType(0, Byte), CType(192, Byte))
Me.Label7.Location = New System.Drawing.Point(152, 160)
Me.Label7.Name = "Label7"
Me.Label7.Size = New System.Drawing.Size(368, 56)
Me.Label7.TabIndex = 3
Me.Label7.Text = "Provides a complete data acquisition and control within your PC along with securi" & _
"ty and co-ordination"
'
'PictureBox2
'
Me.PictureBox2.Image = CType(resources.GetObject("PictureBox2.Image"), System.Drawing.Image)
Me.PictureBox2.Location = New System.Drawing.Point(64, 336)
Me.PictureBox2.Name = "PictureBox2"
Me.PictureBox2.Size = New System.Drawing.Size(480, 64)
Me.PictureBox2.TabIndex = 1
Me.PictureBox2.TabStop = False
'
'PictureBox1
'
Me.PictureBox1.Image = CType(resources.GetObject("PictureBox1.Image"), System.Drawing.Image)
Me.PictureBox1.Location = New System.Drawing.Point(0, 0)
Me.PictureBox1.Name = "PictureBox1"
Me.PictureBox1.Size = New System.Drawing.Size(472, 64)
Me.PictureBox1.TabIndex = 0
Me.PictureBox1.TabStop = False
'
'Label10
'
Me.Label10.Font = New System.Drawing.Font("Times New Roman", 11.25!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.Label10.ForeColor = System.Drawing.Color.FromArgb(CType(0, Byte), CType(0, Byte), CType(192, Byte))
Me.Label10.Location = New System.Drawing.Point(152, 168)
Me.Label10.Name = "Label10"
Me.Label10.Size = New System.Drawing.Size(368, 56)
Me.Label10.TabIndex = 3
Me.Label10.Text = "Provides a complete data acquisition and control within your PC along with securi" & _
"ty and co-ordination"
'
'PictureBox6
'
Me.PictureBox6.Image = CType(resources.GetObject("PictureBox6.Image"), System.Drawing.Image)
Me.PictureBox6.Location = New System.Drawing.Point(112, 88)
Me.PictureBox6.Name = "PictureBox6"
Me.PictureBox6.Size = New System.Drawing.Size(376, 56)
Me.PictureBox6.TabIndex = 4
Me.PictureBox6.TabStop = False
'
'TabPage1
'
Me.TabPage1.Controls.Add(Me.Label9)
Me.TabPage1.Controls.Add(Me.ListView2)
Me.TabPage1.Location = New System.Drawing.Point(4, 4)
Me.TabPage1.Name = "TabPage1"
Me.TabPage1.Size = New System.Drawing.Size(544, 398)
Me.TabPage1.TabIndex = 0
Me.TabPage1.Text = "Process List"
'
'Label9
'
Me.Label9.Font = New System.Drawing.Font("Times New Roman", 11.25!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.Label9.Location = New System.Drawing.Point(16, 8)
Me.Label9.Name = "Label9"
Me.Label9.Size = New System.Drawing.Size(208, 32)
Me.Label9.TabIndex = 6
Me.Label9.Text = "List of Running Processes :"
'
'ListView2
'
Me.ListView2.BackColor = System.Drawing.Color.White
Me.ListView2.Columns.AddRange(New System.Windows.Forms.ColumnHeader() {Me.ColumnHeader9, Me.ColumnHeader10, Me.ColumnHeader11, Me.ColumnHeader12})
Me.ListView2.Font = New System.Drawing.Font("Times New Roman", 9.75!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.ListView2.FullRowSelect = True
Me.ListView2.GridLines = True
Me.ListView2.Location = New System.Drawing.Point(8, 40)
Me.ListView2.Name = "ListView2"
Me.ListView2.Size = New System.Drawing.Size(536, 352)
Me.ListView2.TabIndex = 5
Me.ListView2.View = System.Windows.Forms.View.Details
'
'ColumnHeader9
'
Me.ColumnHeader9.Text = "Process Name"
Me.ColumnHeader9.Width = 105
'
'ColumnHeader10
'
Me.ColumnHeader10.Text = "Process ID"
Me.ColumnHeader10.Width = 79
'
'ColumnHeader11
'
Me.ColumnHeader11.Text = "Thread Count"
Me.ColumnHeader11.Width = 99
'
'ColumnHeader12
'
Me.ColumnHeader12.Text = "File Name"
Me.ColumnHeader12.Width = 285
'
'TabPage2
'
Me.TabPage2.Controls.Add(Me.Button8)
Me.TabPage2.Controls.Add(Me.Button1)
Me.TabPage2.Controls.Add(Me.Label1)
Me.TabPage2.Controls.Add(Me.ListView1)
Me.TabPage2.Location = New System.Drawing.Point(4, 4)
Me.TabPage2.Name = "TabPage2"
Me.TabPage2.Size = New System.Drawing.Size(544, 398)
Me.TabPage2.TabIndex = 1
Me.TabPage2.Text = "Remote Connections"
'
'Button8
'
Me.Button8.Location = New System.Drawing.Point(416, 344)
Me.Button8.Name = "Button8"
Me.Button8.Size = New System.Drawing.Size(112, 40)
Me.Button8.TabIndex = 4
Me.Button8.Text = "List Connections"
'
'Button1
'
Me.Button1.Location = New System.Drawing.Point(288, 344)
Me.Button1.Name = "Button1"
Me.Button1.Size = New System.Drawing.Size(112, 40)
Me.Button1.TabIndex = 2
Me.Button1.Text = "Get Process"
'
'Label1
'
Me.Label1.Font = New System.Drawing.Font("Times New Roman", 11.25!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.Label1.Location = New System.Drawing.Point(16, 16)
Me.Label1.Name = "Label1"
Me.Label1.Size = New System.Drawing.Size(256, 24)
Me.Label1.TabIndex = 1
Me.Label1.Text = "Processes with Remote Connections :"
'
'ListView1
'
Me.ListView1.Columns.AddRange(New System.Windows.Forms.ColumnHeader() {Me.ColumnHeader1, Me.ColumnHeader2, Me.ColumnHeader4, Me.ColumnHeader14, Me.ColumnHeader3, Me.ColumnHeader13})
Me.ListView1.Font = New System.Drawing.Font("Times New Roman", 9.0!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.ListView1.FullRowSelect = True
Me.ListView1.GridLines = True
Me.ListView1.Location = New System.Drawing.Point(8, 48)
Me.ListView1.Name = "ListView1"
Me.ListView1.Size = New System.Drawing.Size(520, 288)
Me.ListView1.TabIndex = 0
Me.ListView1.View = System.Windows.Forms.View.Details
'
'ColumnHeader1
'
Me.ColumnHeader1.Text = "Process ID"
Me.ColumnHeader1.Width = 74
'
'ColumnHeader2
'
Me.ColumnHeader2.Text = "Protocol"
Me.ColumnHeader2.TextAlign = System.Windows.Forms.HorizontalAlignment.Center
Me.ColumnHeader2.Width = 62
'
'ColumnHeader4
'
Me.ColumnHeader4.Text = "Local IP and Port"
Me.ColumnHeader4.TextAlign = System.Windows.Forms.HorizontalAlignment.Center
Me.ColumnHeader4.Width = 101
'
'ColumnHeader14
'
Me.ColumnHeader14.Text = "Remote IP and Port"
Me.ColumnHeader14.TextAlign = System.Windows.Forms.HorizontalAlignment.Center
Me.ColumnHeader14.Width = 113
'
'ColumnHeader3
'
Me.ColumnHeader3.Text = "Status"
Me.ColumnHeader3.TextAlign = System.Windows.Forms.HorizontalAlignment.Center
Me.ColumnHeader3.Width = 95
'
'ColumnHeader13
'
Me.ColumnHeader13.Text = "Program"
Me.ColumnHeader13.Width = 123
'
'TabPage3
'
Me.TabPage3.BackColor = System.Drawing.SystemColors.Control
Me.TabPage3.Controls.Add(Me.Label8)
Me.TabPage3.Controls.Add(Me.PictureBox3)
Me.TabPage3.Controls.Add(Me.Button5)
Me.TabPage3.Controls.Add(Me.Button7)
Me.TabPage3.Controls.Add(Me.Label5)
Me.TabPage3.Controls.Add(Me.Button6)
Me.TabPage3.Controls.Add(Me.Label4)
Me.TabPage3.Controls.Add(Me.Label3)
Me.TabPage3.Controls.Add(Me.GroupBox1)
Me.TabPage3.Controls.Add(Me.Label2)
Me.TabPage3.Controls.Add(Me.ListBox1)
Me.TabPage3.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.TabPage3.Location = New System.Drawing.Point(4, 4)
Me.TabPage3.Name = "TabPage3"
Me.TabPage3.Size = New System.Drawing.Size(544, 398)
Me.TabPage3.TabIndex = 2
Me.TabPage3.Text = "Firewall"
'
'Label8
'
Me.Label8.Font = New System.Drawing.Font("Arial", 26.25!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.Label8.ForeColor = System.Drawing.Color.FromArgb(CType(0, Byte), CType(0, Byte), CType(192, Byte))
Me.Label8.Location = New System.Drawing.Point(304, 48)
Me.Label8.Name = "Label8"
Me.Label8.Size = New System.Drawing.Size(208, 48)
Me.Label8.TabIndex = 12
Me.Label8.Text = "Fire Wall "
'
'PictureBox3
'
Me.PictureBox3.Image = CType(resources.GetObject("PictureBox3.Image"), System.Drawing.Image)
Me.PictureBox3.Location = New System.Drawing.Point(256, 48)
Me.PictureBox3.Name = "PictureBox3"
Me.PictureBox3.Size = New System.Drawing.Size(32, 40)
Me.PictureBox3.TabIndex = 11
Me.PictureBox3.TabStop = False
'
'Button5
'
Me.Button5.Font = New System.Drawing.Font("Times New Roman", 11.25!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.Button5.Location = New System.Drawing.Point(24, 344)
Me.Button5.Name = "Button5"
Me.Button5.Size = New System.Drawing.Size(184, 32)
Me.Button5.TabIndex = 10
Me.Button5.Text = "Remove from List"
'
'Button7
'
Me.Button7.Font = New System.Drawing.Font("Times New Roman", 11.25!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.Button7.Location = New System.Drawing.Point(392, 344)
Me.Button7.Name = "Button7"
Me.Button7.Size = New System.Drawing.Size(128, 32)
Me.Button7.TabIndex = 9
Me.Button7.Text = "Disable Firewall"
'
'Label5
'
Me.Label5.Font = New System.Drawing.Font("Times New Roman", 11.25!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.Label5.ForeColor = System.Drawing.Color.Green
Me.Label5.Location = New System.Drawing.Point(312, 144)
Me.Label5.Name = "Label5"
Me.Label5.Size = New System.Drawing.Size(160, 16)
Me.Label5.TabIndex = 8
Me.Label5.Text = "NOT MONITORING"
'
'Button6
'
Me.Button6.Font = New System.Drawing.Font("Times New Roman", 11.25!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.Button6.Location = New System.Drawing.Point(248, 344)
Me.Button6.Name = "Button6"
Me.Button6.Size = New System.Drawing.Size(136, 32)
Me.Button6.TabIndex = 7
Me.Button6.Text = "Enable Firewall"
'
'Label4
'
Me.Label4.Font = New System.Drawing.Font("Times New Roman", 12.0!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.Label4.ForeColor = System.Drawing.Color.OrangeRed
Me.Label4.Location = New System.Drawing.Point(456, 176)
Me.Label4.Name = "Label4"
Me.Label4.Size = New System.Drawing.Size(40, 24)
Me.Label4.TabIndex = 6
Me.Label4.Text = "000"
'
'Label3
'
Me.Label3.Font = New System.Drawing.Font("Times New Roman", 11.25!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.Label3.Location = New System.Drawing.Point(288, 176)
Me.Label3.Name = "Label3"
Me.Label3.Size = New System.Drawing.Size(160, 24)
Me.Label3.TabIndex = 5
Me.Label3.Text = "Blocked Processes :"
'
'GroupBox1
'
Me.GroupBox1.Controls.Add(Me.Button3)
Me.GroupBox1.Controls.Add(Me.TextBox1)
Me.GroupBox1.Font = New System.Drawing.Font("Times New Roman", 11.25!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.GroupBox1.Location = New System.Drawing.Point(256, 216)
Me.GroupBox1.Name = "GroupBox1"
Me.GroupBox1.Size = New System.Drawing.Size(272, 112)
Me.GroupBox1.TabIndex = 2
Me.GroupBox1.TabStop = False
Me.GroupBox1.Text = "Process Name to Block :"
'
'Button3
'
Me.Button3.Location = New System.Drawing.Point(72, 64)
Me.Button3.Name = "Button3"
Me.Button3.Size = New System.Drawing.Size(160, 32)
Me.Button3.TabIndex = 1
Me.Button3.Text = "Add to Block List"
'
'TextBox1
'
Me.TextBox1.Location = New System.Drawing.Point(16, 24)
Me.TextBox1.Name = "TextBox1"
Me.TextBox1.Size = New System.Drawing.Size(240, 25)
Me.TextBox1.TabIndex = 0
Me.TextBox1.Text = ""
'
'Label2
'
Me.Label2.Font = New System.Drawing.Font("Times New Roman", 11.25!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.Label2.Location = New System.Drawing.Point(8, 8)
Me.Label2.Name = "Label2"
Me.Label2.Size = New System.Drawing.Size(216, 24)
Me.Label2.TabIndex = 1
Me.Label2.Text = "Block List :"
'
'ListBox1
'
Me.ListBox1.Font = New System.Drawing.Font("Times New Roman", 9.0!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.ListBox1.ItemHeight = 15
Me.ListBox1.Location = New System.Drawing.Point(24, 64)
Me.ListBox1.Name = "ListBox1"
Me.ListBox1.Size = New System.Drawing.Size(184, 274)
Me.ListBox1.TabIndex = 0
'
'ColumnHeader5
'
Me.ColumnHeader5.Text = "Process Name"
Me.ColumnHeader5.Width = 105
'
'ColumnHeader6
'
Me.ColumnHeader6.Text = "Process ID"
Me.ColumnHeader6.Width = 79
'
'ColumnHeader7
'
Me.ColumnHeader7.Text = "Priority"
Me.ColumnHeader7.Width = 72
'
'ColumnHeader8
'
Me.ColumnHeader8.Text = "File Name"
Me.ColumnHeader8.Width = 285
'
'Timer1
'
'
'LinkLabel1
'
Me.LinkLabel1.Location = New System.Drawing.Point(32, 288)
Me.LinkLabel1.Name = "LinkLabel1"
Me.LinkLabel1.Size = New System.Drawing.Size(152, 24)
Me.LinkLabel1.TabIndex = 8
Me.LinkLabel1.TabStop = True
Me.LinkLabel1.Text = "VijeyAshok@yahoo.com"
'
'Form1
'
Me.AutoScaleBaseSize = New System.Drawing.Size(5, 13)
Me.ClientSize = New System.Drawing.Size(552, 429)
Me.Controls.Add(Me.TabControl1)
Me.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog
Me.Icon = CType(resources.GetObject("$this.Icon"), System.Drawing.Icon)
Me.MaximizeBox = False
Me.Name = "Form1"
Me.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen
Me.Text = "Complete Process guide with Firewall"
Me.TabControl1.ResumeLayout(False)
Me.TabPage4.ResumeLayout(False)
Me.TabPage1.ResumeLayout(False)
Me.TabPage2.ResumeLayout(False)
Me.TabPage3.ResumeLayout(False)
Me.GroupBox1.ResumeLayout(False)
Me.ResumeLayout(False)
End Sub
#End Region
Dim blockcount As Integer
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Call enumproc()
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
' Executes already created bat file for Netstat and creates Log File
' Netstat bat file content :netstat -n -o -a >net.log
' If this file is not present create a textfile
' paste the line below in the file without quotes
' "netstat -n -o -a >net.log"
' and save the file as "net.bat" ie .. by clicking "save as" so childish ?????? ha ha
' copy the bat file to the executable directory ie.. the \bin directory on the project folder
Dim r As Integer
r = Shell("net.bat", AppWinStyle.MinimizedFocus)
'Windows.Forms.Application.DoEvents()
End Sub
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
'To Kill the Specified Process
Dim ps As Process
Dim temp As String
On Error Resume Next
Process.GetProcessesByName(ListView1.FocusedItem.Text)
ps.CloseMainWindow()
ps.Kill()
End Sub
Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
ListBox1.Items.Add(TextBox1.Text)
TextBox1.Text = ""
End Sub
Private Sub Button6_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button6.Click
Timer1.Enabled = True
Button6.Enabled = False
Button7.Enabled = True
Label5.Text = " MONITORING "
End Sub
Private Sub Button7_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button7.Click
Timer1.Enabled = False
Button6.Enabled = True
Label5.Text = " NOT MONITORING "
End Sub
Private Sub Button8_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button8.Click
Call listrmproc()
End Sub
Private Sub Form1_Closing(ByVal sender As Object, ByVal e As System.ComponentModel.CancelEventArgs) Handles MyBase.Closing
Me.Dispose()
Me.Close()
End Sub
Private Sub Button5_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button5.Click
ListBox1.Items.Remove(ListBox1.SelectedItem)
ListBox1.Refresh()
End Sub
Private Function enumproc()
' Lists all Process with their Process ID, Name, Thread Count and MAin Module Name
Dim processes() As Process
Dim ps As Process
processes = process.GetProcesses()
For Each ps In processes
On Error Resume Next
Dim item1 As New ListViewItem(ps.ProcessName, 0)
item1.SubItems.Add(ps.Id)
item1.SubItems.Add(ps.Threads.Count.ToString)
item1.SubItems.Add(ps.MainModule.FileName)
ListView2.Items.AddRange(New ListViewItem() {item1})
Next
End Function
Private Function listrmproc()
' Trim the Created Log file and Write in O/P window
' Subjected to Approximation(Not Accurate Cutting of Data)
'
ListView1.Items.Clear()
Dim fnum As Integer
Dim data() As String
Dim swords As String
Dim temp1, temp2, temp3, temp4, temp5, temp6, temp7, temp8, temp9, temp10 As String
Dim temp11, temp12, temp13, temp14, temp15 As String
Dim t1, t2, t3, t4 As String
Dim i As Integer
Dim ps As Process
fnum = FreeFile()
FileOpen(fnum, "net.log", OpenMode.Input)
' Discard First Four Lines
t1 = LineInput(fnum)
t2 = LineInput(fnum)
t3 = LineInput(fnum)
t4 = LineInput(fnum)
' Netstat LogFile Format has Four Empty line at the Top
Do While (Not (EOF(fnum)))
swords = LineInput(fnum)
If swords <> "" Then
On Error Resume Next
' Nasty with this netstat log file
data = Split(Trim(swords))
temp1 = data(0)
' Change in Format will Create a big Fun
' i am discarding all UDP connections here dudes ,,,,,
If temp1 = "TCP" Then
temp2 = Trim(data(4))
temp4 = Microsoft.VisualBasic.Left(Microsoft.VisualBasic.Right(swords, 21), 15)
temp3 = Microsoft.VisualBasic.Left(Microsoft.VisualBasic.Right(swords, 46), 22)
temp5 = Microsoft.VisualBasic.Right(swords, 5)
Dim item As New ListViewItem(Trim(temp5), 0)
item.SubItems.Add(Trim(temp1))
item.SubItems.Add(Trim(temp2))
item.SubItems.Add(Trim(temp3))
item.SubItems.Add(Trim(temp4))
item.SubItems.Add(CStr(Process.GetProcessById(temp5).ProcessName))
ListView1.Items.AddRange(New ListViewItem() {item})
Else
Exit Do
End If
End If
Loop
' Bye to GF
FileClose(fnum)
End Function
Private Sub Timer1_Tick_1(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
' Enable Firewall Monitor
Dim i As Integer
Dim temp As String
Dim pname As String
Dim ps As Process
Dim processes() As Process
If ListBox1.Items.Count = 0 Then
Timer1.Enabled = False
MsgBox("Please Specify a Process to Block", MsgBoxStyle.Information)
Windows.Forms.Application.DoEvents()
Button6.Text = "Enable Firewall"
Label5.Text = " NOT MONITORING "
Button6.Enabled = True
Button7.Enabled = False
Exit Sub
Else
For i = 0 To ListBox1.Items.Count
On Error Resume Next
temp = CStr(ListBox1.Items.Item(i))
processes = ps.GetProcesses()
For Each ps In processes
pname = CStr(ps.ProcessName)
If pname = temp Then
Process.GetProcessesByName(temp)
ps.CloseMainWindow()
ps.Kill()
blockcount = Val(blockcount) + 1
End If
Next
Next
Label4.Text = CStr(blockcount)
End If
End Sub
Private Sub Button2_Click_1(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
Dim frm As New frmabout
frm.Show()
End Sub
End Class
------------------------------------------------------------