Questo sito utilizza cookies solo per scopi di autenticazione sul sito e nient'altro. Nessuna informazione personale viene tracciata. Leggi l'informativa sui cookies.
Username: Password: oppure
Portscanner - Form1.vb

Form1.vb

Caricato da:
Scarica il programma completo

  1. Imports System
  2. Imports System.Drawing
  3. Imports System.Collections
  4. Imports System.ComponentModel
  5. Imports System.Windows.Forms
  6. Imports System.Net.Sockets
  7. Imports System.Net
  8. Imports System.Threading
  9.  
  10.  
  11. Namespace SaTaNaPoRTSCaNNeR
  12.    '/ <summary>
  13.    '/ Descrizione di riepilogo per Form1.
  14.    '/ </summary>
  15.    
  16.    Public Class Form1
  17.       Inherits System.Windows.Forms.Form
  18.       Private i As Integer
  19.       Private t As Thread
  20.       Private ipz As System.Windows.Forms.TextBox
  21.       Private da As System.Windows.Forms.TextBox
  22.       Private label1 As System.Windows.Forms.Label
  23.       Private label2 As System.Windows.Forms.Label
  24.       Private WithEvents button1 As System.Windows.Forms.Button
  25.       Private WithEvents button2 As System.Windows.Forms.Button
  26.       Private WithEvents button3 As System.Windows.Forms.Button
  27.       Private WithEvents button4 As System.Windows.Forms.Button
  28.       Private pictureBox1 As System.Windows.Forms.PictureBox
  29.       Private d As System.Windows.Forms.TextBox
  30.       Private label3 As System.Windows.Forms.Label
  31.       Private a As System.Windows.Forms.TextBox
  32.       Private label4 As System.Windows.Forms.Label
  33.       Private label5 As System.Windows.Forms.Label
  34.       Private barra As System.Windows.Forms.ProgressBar
  35.       Private richTextBox1 As System.Windows.Forms.RichTextBox
  36.       Private s As System.Windows.Forms.TextBox
  37.       Private label6 As System.Windows.Forms.Label
  38.       '/ <summary>
  39.       '/ Variabile di progettazione necessaria.
  40.       '/ </summary>
  41.       Private components As System.ComponentModel.Container = Nothing
  42.      
  43.      
  44.       Public Sub New()
  45.          '
  46.          ' Necessario per il supporto di Progettazione Windows Form
  47.          '
  48.          InitializeComponent()
  49.       End Sub 'New
  50.        
  51.       '
  52.       ' TODO: aggiungere il codice del costruttore dopo la chiamata a InitializeComponent
  53.       '
  54.      
  55.       '/ <summary>
  56.       '/ Pulire le risorse in uso.
  57.       '/ </summary>
  58.       Protected Overrides Sub Dispose(disposing As Boolean)
  59.          If disposing Then
  60.             If Not (components Is Nothing) Then
  61.                components.Dispose()
  62.             End If
  63.          End If
  64.          MyBase.Dispose(disposing)
  65.       End Sub 'Dispose
  66.      
  67.       #Region "Codice generato da Progettazione Windows Form"
  68.      
  69.       '/ <summary>
  70.       '/ Metodo necessario per il supporto della finestra di progettazione. Non modificare
  71.       '/ il contenuto del metodo con l'editor di codice.
  72.       '/ </summary>
  73.       Private Sub InitializeComponent()
  74.          Dim resources As New System.Resources.ResourceManager(GetType(Form1))
  75.          Me.ipz = New System.Windows.Forms.TextBox()
  76.          Me.da = New System.Windows.Forms.TextBox()
  77.          Me.label1 = New System.Windows.Forms.Label()
  78.          Me.label2 = New System.Windows.Forms.Label()
  79.          Me.button1 = New System.Windows.Forms.Button()
  80.          Me.button2 = New System.Windows.Forms.Button()
  81.          Me.button3 = New System.Windows.Forms.Button()
  82.          Me.button4 = New System.Windows.Forms.Button()
  83.          Me.pictureBox1 = New System.Windows.Forms.PictureBox()
  84.          Me.richTextBox1 = New System.Windows.Forms.RichTextBox()
  85.          Me.d = New System.Windows.Forms.TextBox()
  86.          Me.label3 = New System.Windows.Forms.Label()
  87.          Me.a = New System.Windows.Forms.TextBox()
  88.          Me.label4 = New System.Windows.Forms.Label()
  89.          Me.label5 = New System.Windows.Forms.Label()
  90.          Me.barra = New System.Windows.Forms.ProgressBar()
  91.          Me.s = New System.Windows.Forms.TextBox()
  92.          Me.label6 = New System.Windows.Forms.Label()
  93.          Me.SuspendLayout()
  94.          '
  95.          ' ipz
  96.          '
  97.          Me.ipz.Font = New System.Drawing.Font("Comic Sans MS", __unknown, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, System.Byte))
  98.          Me.ipz.ForeColor = System.Drawing.Color.Black '
  99.          'ToDo: Error processing original source shown below
  100.          '   this.ipz.Font = new System.Drawing.Font("Comic Sans MS", 27.75F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0)));
  101.          '   this.ipz.ForeColor = System.Drawing.Color.Black;
  102.          '--------------------------------------------------------------------^--- Numeric constant overflow
  103.          Me.ipz.Location = New System.Drawing.Point(128, 8)
  104.          Me.ipz.Multiline = True
  105.          Me.ipz.Name = "ipz"
  106.          Me.ipz.Size = New System.Drawing.Size(472, 48)
  107.          Me.ipz.TabIndex = 0
  108.          Me.ipz.Text = ""
  109.          '
  110.          ' da
  111.          '
  112.          Me.da.Font = New System.Drawing.Font("Comic Sans MS", __unknown, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, System.Byte))
  113.          Me.da.ForeColor = System.Drawing.Color.Black '
  114.          'ToDo: Error processing original source shown below
  115.          '   this.da.Font = new System.Drawing.Font("Comic Sans MS", 27.75F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0)));
  116.          '   this.da.ForeColor = System.Drawing.Color.Black;
  117.          '-------------------------------------------------------------------^--- Numeric constant overflow
  118.          Me.da.Location = New System.Drawing.Point(296, 72)
  119.          Me.da.Multiline = True
  120.          Me.da.Name = "da"
  121.          Me.da.Size = New System.Drawing.Size(120, 64)
  122.          Me.da.TabIndex = 1
  123.          Me.da.Text = "1"
  124.          '
  125.          ' label1
  126.          '
  127.          Me.label1.Font = New System.Drawing.Font("Comic Sans MS", 36F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, System.Byte))
  128.          Me.label1.ForeColor = System.Drawing.Color.Yellow
  129.          Me.label1.Location = New System.Drawing.Point(16, 0)
  130.          Me.label1.Name = "label1"
  131.          Me.label1.Size = New System.Drawing.Size(80, 56)
  132.          Me.label1.TabIndex = 2
  133.          Me.label1.Text = "IP"
  134.          '
  135.          ' label2
  136.          '
  137.          Me.label2.Font = New System.Drawing.Font("Comic Sans MS", __unknown, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, System.Byte))
  138.          Me.label2.ForeColor = System.Drawing.Color.Yellow '
  139.          'ToDo: Error processing original source shown below
  140.          '   this.label2.Font = new System.Drawing.Font("Comic Sans MS", 27.75F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0)));
  141.          '   this.label2.ForeColor = System.Drawing.Color.Yellow;
  142.          '-----------------------------------------------------------------------^--- Numeric constant overflow
  143.          Me.label2.Location = New System.Drawing.Point(8, 80)
  144.          Me.label2.Name = "label2"
  145.          Me.label2.Size = New System.Drawing.Size(176, 56)
  146.          Me.label2.TabIndex = 3
  147.          Me.label2.Text = "PoRTa"
  148.          '
  149.          ' button1
  150.          '
  151.          Me.button1.Font = New System.Drawing.Font("Comic Sans MS", __unknown, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, System.Byte))
  152.          Me.button1.ForeColor = System.Drawing.Color.Yellow '
  153.          'ToDo: Error processing original source shown below
  154.          '   this.button1.Font = new System.Drawing.Font("Comic Sans MS", 27.75F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0)));
  155.          '   this.button1.ForeColor = System.Drawing.Color.Yellow;
  156.          '------------------------------------------------------------------------^--- Numeric constant overflow
  157.          Me.button1.Location = New System.Drawing.Point(56, 424)
  158.          Me.button1.Name = "button1"
  159.          Me.button1.Size = New System.Drawing.Size(120, 48)
  160.          Me.button1.TabIndex = 4
  161.          Me.button1.Text = "VaI"
  162.          '
  163.          ' button2
  164.          '
  165.          Me.button2.Font = New System.Drawing.Font("Comic Sans MS", __unknown, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, System.Byte))
  166.          Me.button2.ForeColor = System.Drawing.Color.Yellow '
  167.          'ToDo: Error processing original source shown below
  168.          '   this.button2.Font = new System.Drawing.Font("Comic Sans MS", 27.75F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0)));
  169.          '   this.button2.ForeColor = System.Drawing.Color.Yellow;
  170.          '------------------------------------------------------------------------^--- Numeric constant overflow
  171.          Me.button2.Location = New System.Drawing.Point(264, 424)
  172.          Me.button2.Name = "button2"
  173.          Me.button2.Size = New System.Drawing.Size(120, 48)
  174.          Me.button2.TabIndex = 5
  175.          Me.button2.Text = "SToP"
  176.          '
  177.          ' button3
  178.          '
  179.          Me.button3.Font = New System.Drawing.Font("Comic Sans MS", __unknown, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, System.Byte))
  180.          Me.button3.ForeColor = System.Drawing.Color.Yellow '
  181.          'ToDo: Error processing original source shown below
  182.          '   this.button3.Font = new System.Drawing.Font("Comic Sans MS", 21.75F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0)));
  183.          '   this.button3.ForeColor = System.Drawing.Color.Yellow;
  184.          '------------------------------------------------------------------------^--- Numeric constant overflow
  185.          Me.button3.Location = New System.Drawing.Point(16, 488)
  186.          Me.button3.Name = "button3"
  187.          Me.button3.Size = New System.Drawing.Size(312, 48)
  188.          Me.button3.TabIndex = 6
  189.          Me.button3.Text = "CaNCeLLa SKeRMo"
  190.          '
  191.          ' button4
  192.          '
  193.          Me.button4.Font = New System.Drawing.Font("Comic Sans MS", __unknown, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, System.Byte))
  194.          Me.button4.ForeColor = System.Drawing.Color.Yellow '
  195.          'ToDo: Error processing original source shown below
  196.          '   this.button4.Font = new System.Drawing.Font("Comic Sans MS", 27.75F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0)));
  197.          '   this.button4.ForeColor = System.Drawing.Color.Yellow;
  198.          '------------------------------------------------------------------------^--- Numeric constant overflow
  199.          Me.button4.Location = New System.Drawing.Point(352, 488)
  200.          Me.button4.Name = "button4"
  201.          Me.button4.Size = New System.Drawing.Size(144, 48)
  202.          Me.button4.TabIndex = 7
  203.          Me.button4.Text = "ABouT"
  204.          '
  205.          ' pictureBox1
  206.          '
  207.          Me.pictureBox1.BackColor = System.Drawing.Color.Transparent
  208.          Me.pictureBox1.Image = CType(resources.GetObject("pictureBox1.Image"), System.Drawing.Image)
  209.          Me.pictureBox1.Location = New System.Drawing.Point(704, 8)
  210.          Me.pictureBox1.Name = "pictureBox1"
  211.          Me.pictureBox1.Size = New System.Drawing.Size(136, 176)
  212.          Me.pictureBox1.TabIndex = 8
  213.          Me.pictureBox1.TabStop = False
  214.          '
  215.          ' richTextBox1
  216.          '
  217.          Me.richTextBox1.Font = New System.Drawing.Font("Comic Sans MS", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, System.Byte))
  218.          Me.richTextBox1.ForeColor = System.Drawing.Color.Black
  219.          Me.richTextBox1.Location = New System.Drawing.Point(16, 208)
  220.          Me.richTextBox1.Name = "richTextBox1"
  221.          Me.richTextBox1.Size = New System.Drawing.Size(536, 200)
  222.          Me.richTextBox1.TabIndex = 9
  223.          Me.richTextBox1.Text = ""
  224.          '
  225.          ' d
  226.          '
  227.          Me.d.Font = New System.Drawing.Font("Comic Sans MS", __unknown, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, System.Byte))
  228.          Me.d.ForeColor = System.Drawing.Color.Black '
  229.          'ToDo: Error processing original source shown below
  230.          '   this.d.Font = new System.Drawing.Font("Comic Sans MS", 27.75F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0)));
  231.          '   this.d.ForeColor = System.Drawing.Color.Black;
  232.          '------------------------------------------------------------------^--- Numeric constant overflow
  233.          Me.d.Location = New System.Drawing.Point(208, 144)
  234.          Me.d.Multiline = True
  235.          Me.d.Name = "d"
  236.          Me.d.Size = New System.Drawing.Size(344, 56)
  237.          Me.d.TabIndex = 10
  238.          Me.d.Text = "5"
  239.          '
  240.          ' label3
  241.          '
  242.          Me.label3.Font = New System.Drawing.Font("Comic Sans MS", __unknown, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, System.Byte))
  243.          Me.label3.ForeColor = System.Drawing.Color.Yellow '
  244.          'ToDo: Error processing original source shown below
  245.          '   this.label3.Font = new System.Drawing.Font("Comic Sans MS", 27.75F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0)));
  246.          '   this.label3.ForeColor = System.Drawing.Color.Yellow;
  247.          '-----------------------------------------------------------------------^--- Numeric constant overflow
  248.          Me.label3.Location = New System.Drawing.Point(8, 144)
  249.          Me.label3.Name = "label3"
  250.          Me.label3.Size = New System.Drawing.Size(176, 56)
  251.          Me.label3.TabIndex = 11
  252.          Me.label3.Text = "DeLaY"
  253.          '
  254.          ' a
  255.          '
  256.          Me.a.Font = New System.Drawing.Font("Comic Sans MS", __unknown, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, System.Byte))
  257.          Me.a.ForeColor = System.Drawing.Color.Black '
  258.          'ToDo: Error processing original source shown below
  259.          '   this.a.Font = new System.Drawing.Font("Comic Sans MS", 27.75F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0)));
  260.          '   this.a.ForeColor = System.Drawing.Color.Black;
  261.          '------------------------------------------------------------------^--- Numeric constant overflow
  262.          '
  263.          'ToDo: Error processing original source shown below
  264.          '   //
  265.          '   this.ipz.Font = new System.Drawing.Font("Comic Sans MS", 27.75F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0)));
  266.          '-------------------------------------------------------------------^--- expression expected
  267.          '
  268.          'ToDo: Error processing original source shown below
  269.          '   //
  270.          '   this.da.Font = new System.Drawing.Font("Comic Sans MS", 27.75F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0)));
  271.          '------------------------------------------------------------------^--- expression expected
  272.          '
  273.          'ToDo: Error processing original source shown below
  274.          '   //
  275.          '   this.label2.Font = new System.Drawing.Font("Comic Sans MS", 27.75F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0)));
  276.          '----------------------------------------------------------------------^--- expression expected
  277.          '
  278.          'ToDo: Error processing original source shown below
  279.          '   //
  280.          '   this.button1.Font = new System.Drawing.Font("Comic Sans MS", 27.75F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0)));
  281.          '-----------------------------------------------------------------------^--- expression expected
  282.          '
  283.          'ToDo: Error processing original source shown below
  284.          '   //
  285.          '   this.button2.Font = new System.Drawing.Font("Comic Sans MS", 27.75F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0)));
  286.          '-----------------------------------------------------------------------^--- expression expected
  287.          '
  288.          'ToDo: Error processing original source shown below
  289.          '   //
  290.          '   this.button3.Font = new System.Drawing.Font("Comic Sans MS", 21.75F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0)));
  291.          '-----------------------------------------------------------------------^--- expression expected
  292.          '
  293.          'ToDo: Error processing original source shown below
  294.          '   //
  295.          '   this.button4.Font = new System.Drawing.Font("Comic Sans MS", 27.75F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0)));
  296.          '-----------------------------------------------------------------------^--- expression expected
  297.          '
  298.          'ToDo: Error processing original source shown below
  299.          '   //
  300.          '   this.d.Font = new System.Drawing.Font("Comic Sans MS", 27.75F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0)));
  301.          '-----------------------------------------------------------------^--- expression expected
  302.          '
  303.          'ToDo: Error processing original source shown below
  304.          '   //
  305.          '   this.label3.Font = new System.Drawing.Font("Comic Sans MS", 27.75F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0)));
  306.          '----------------------------------------------------------------------^--- expression expected
  307.          '
  308.          'ToDo: Error processing original source shown below
  309.          '   //
  310.          '   this.a.Font = new System.Drawing.Font("Comic Sans MS", 27.75F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0)));
  311.          '-----------------------------------------------------------------^--- expression expected
  312.          Me.a.Location = New System.Drawing.Point(512, 72)
  313.          Me.a.Multiline = True
  314.          Me.a.Name = "a"
  315.          Me.a.Size = New System.Drawing.Size(168, 64)
  316.          Me.a.TabIndex = 12
  317.          Me.a.Text = "65536"
  318.          '
  319.          ' label4
  320.          '
  321.          Me.label4.Font = New System.Drawing.Font("Comic Sans MS", 36F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, System.Byte))
  322.          Me.label4.ForeColor = System.Drawing.Color.Yellow
  323.          Me.label4.Location = New System.Drawing.Point(208, 72)
  324.          Me.label4.Name = "label4"
  325.          Me.label4.Size = New System.Drawing.Size(80, 64)
  326.          Me.label4.TabIndex = 13
  327.          Me.label4.Text = "Da"
  328.          '
  329.          ' label5
  330.          '
  331.          Me.label5.Font = New System.Drawing.Font("Comic Sans MS", 36F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, System.Byte))
  332.          Me.label5.ForeColor = System.Drawing.Color.Yellow
  333.          Me.label5.Location = New System.Drawing.Point(424, 72)
  334.          Me.label5.Name = "label5"
  335.          Me.label5.Size = New System.Drawing.Size(80, 64)
  336.          Me.label5.TabIndex = 14
  337.          Me.label5.Text = "A"
  338.          '
  339.          ' barra
  340.          '
  341.          Me.barra.Location = New System.Drawing.Point(16, 552)
  342.          Me.barra.Name = "barra"
  343.          Me.barra.Size = New System.Drawing.Size(536, 40)
  344.          Me.barra.TabIndex = 15
  345.          '
  346.          ' s
  347.          '
  348.          Me.s.Font = New System.Drawing.Font("Comic Sans MS", 24F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, System.Byte))
  349.          Me.s.ForeColor = System.Drawing.Color.Black
  350.          Me.s.Location = New System.Drawing.Point(568, 192)
  351.          Me.s.Multiline = True
  352.          Me.s.Name = "s"
  353.          Me.s.Size = New System.Drawing.Size(264, 216)
  354.          Me.s.TabIndex = 16
  355.          Me.s.Text = ""
  356.          '
  357.          ' label6
  358.          '
  359.          Me.label6.Font = New System.Drawing.Font("Comic Sans MS", 36F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, System.Byte))
  360.          Me.label6.ForeColor = System.Drawing.Color.Yellow
  361.          Me.label6.Location = New System.Drawing.Point(568, 456)
  362.          Me.label6.Name = "label6"
  363.          Me.label6.Size = New System.Drawing.Size(264, 80)
  364.          Me.label6.TabIndex = 17
  365.          Me.label6.Text = "*  H  *"
  366.          '
  367.          ' Form1
  368.          '
  369.          Me.AutoScaleBaseSize = New System.Drawing.Size(5, 13)
  370.          Me.BackColor = System.Drawing.Color.Blue
  371.          Me.ClientSize = New System.Drawing.Size(842, 608)
  372.          Me.Controls.Add(label6)
  373.          Me.Controls.Add(s)
  374.          Me.Controls.Add(barra)
  375.          Me.Controls.Add(label5)
  376.          Me.Controls.Add(label4)
  377.          Me.Controls.Add(a)
  378.          Me.Controls.Add(label3)
  379.          Me.Controls.Add(d)
  380.          Me.Controls.Add(richTextBox1)
  381.          Me.Controls.Add(pictureBox1)
  382.          Me.Controls.Add(button4)
  383.          Me.Controls.Add(button3)
  384.          Me.Controls.Add(button2)
  385.          Me.Controls.Add(button1)
  386.          Me.Controls.Add(label2)
  387.          Me.Controls.Add(label1)
  388.          Me.Controls.Add(da)
  389.          Me.Controls.Add(ipz)
  390.          Me.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedToolWindow
  391.          Me.Icon = CType(resources.GetObject("$this.Icon"), System.Drawing.Icon)
  392.          Me.Name = "Form1"
  393.          Me.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen
  394.          Me.Text = ".. PRÑ€R.     http://satanaoverride.altervista.org "
  395.          Me.ResumeLayout(False)
  396.       End Sub 'InitializeComponent
  397.       #End Region
  398.      
  399.      
  400.       '/ <summary>
  401.       '/ Il punto di ingresso principale dell'applicazione.
  402.       '/ </summary>
  403.       <STAThread()>  _
  404.       Shared Sub Main()
  405.          Application.Run(New Form1())
  406.       End Sub 'Main
  407.      
  408.      
  409.       Private Sub Form1_Load(sender As Object, e As System.EventArgs) Handles MyBase.Load
  410.       End Sub 'Form1_Load
  411.      
  412.      
  413.      
  414.       Private Sub button1_Click(sender As Object, e As System.EventArgs) Handles button1.Click
  415.          Dim ts As New ThreadStart(Me.ScannaPorte)
  416.          t = New Thread(ts)
  417.          t.Start()
  418.       End Sub 'button1_Click
  419.      
  420.       Public Sub ScannaPorte()
  421.          barra.Value = 0
  422.          Dim da1 As Integer = Convert.ToInt32(da.Text)
  423.          Dim a1 As Integer = Convert.ToInt32(a.Text)
  424.          barra.Maximum = a1 - da1
  425.          For i = da1 To a1
  426.             barra.Value += 1
  427.             s.Text = "Porta controllata: " + i + ""
  428.             Dim host As IPHostEntry = Dns.Resolve(ipz.Text)
  429.             Dim ip As IPAddress
  430.             For Each ip In  host.AddressList
  431.                Dim indirizzoeporta As New IPEndPoint(ip, i)
  432.                Dim socket As New Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp)
  433.                socket.BeginConnect(indirizzoeporta, New AsyncCallback(AddressOf ConnectCallback), socket)
  434.             Next ip
  435.          Next i 'int delay = Convert.ToInt32(d);
  436.          'Thread.Sleep(delay);
  437.          t.Abort()
  438.       End Sub 'ScannaPorte
  439.      
  440.       Public Sub ConnectCallback(ar As IAsyncResult)
  441.          Try
  442.             Dim client As Socket = CType(ar.AsyncState, Socket)
  443.             client.EndConnect(ar)
  444.             Dim s As Char() = ":".ToCharArray()
  445.             Dim p As String() = client.RemoteEndPoint.ToString().Split(s)
  446.             Dim porta As Integer = Convert.ToInt32(p(1))
  447.             Dim descr As String = Me.Porta(porta)
  448.             richTextBox1.Text += "Porta " + porta + " aperta (" + descr + ")" + ControlChars.Lf
  449.          Catch e As Exception
  450.          End Try
  451.       End Sub 'ConnectCallback
  452.        
  453.       Public Function Porta(porta As Integer) As String
  454.          Dim descrizioneporta As String = "Sconosciuta"
  455.          If porta = 1 Then
  456.             descrizioneporta = "Echo"
  457.          End If
  458.          If porta = 21 Then
  459.             descrizioneporta = "FTP"
  460.          End If
  461.          If porta = 23 Then
  462.             descrizioneporta = "Telnet"
  463.          End If
  464.          If porta = 25 Then
  465.             descrizioneporta = "Smtp"
  466.          End If
  467.          If porta = 79 Then
  468.             descrizioneporta = "Finger"
  469.          End If
  470.          If porta = 80 Then
  471.             descrizioneporta = "Http"
  472.          End If
  473.          If porta = 98 Then
  474.             descrizioneporta = "Linux Config"
  475.          End If
  476.          If porta = 110 Then
  477.             descrizioneporta = "POP3"
  478.          End If
  479.          If porta = 111 Then
  480.             descrizioneporta = "Sunrpc"
  481.          End If
  482.          If porta = 113 Then
  483.             descrizioneporta = "Trojan: Kazimas"
  484.          End If
  485.          If porta = 135 Then
  486.             descrizioneporta = "Dce Endpoint Resolution"
  487.          End If
  488.          If porta = 139 Then
  489.             descrizioneporta = "Netbios"
  490.          End If
  491.          If porta = 411 Then
  492.             descrizioneporta = "Dc server"
  493.          End If
  494.          If porta = 445 Then
  495.             descrizioneporta = "Microsoft Ds"
  496.          End If
  497.          If porta = 515 Then
  498.             descrizioneporta = "Printer"
  499.          End If
  500.          If porta = 1025 Then
  501.             descrizioneporta = "Network Black Jack"
  502.          End If
  503.          If porta = 1080 Then
  504.             descrizioneporta = "Socks"
  505.          End If
  506.          If porta = 1112 Then
  507.             descrizioneporta = "Msql"
  508.          End If
  509.          If porta = 1241 Then
  510.             descrizioneporta = "Messenger"
  511.          End If
  512.          
  513.          If porta = 4899 Then
  514.             descrizioneporta = "Radmin"
  515.          End If
  516.          If porta = 5900 Then
  517.             descrizioneporta = "Vnc"
  518.          End If
  519.          Return descrizioneporta
  520.       End Function 'Porta
  521.      
  522.      
  523.      
  524.       Private Sub button2_Click(sender As Object, e As System.EventArgs) Handles button2.Click
  525.          If t.IsAlive Then
  526.             t.Abort()
  527.          End If
  528.       End Sub 'button2_Click
  529.        
  530.      
  531.       Private Sub button3_Click(sender As Object, e As System.EventArgs) Handles button3.Click
  532.          ipz.Text = ""
  533.          da.Text = ""
  534.          a.Text = ""
  535.          d.Text = ""
  536.          richTextBox1.Text = ""
  537.          s.Text = ""
  538.       End Sub 'button3_Click
  539.        
  540.      
  541.       Private Sub button4_Click(sender As Object, e As System.EventArgs) Handles button4.Click
  542.          Dim f As New Form3()
  543.          f.ShowDialog()
  544.       End Sub 'button4_Click
  545.    End Class 'Form1
  546. End Namespace 'SaTaNaPoRTSCaNNeR