Skip to content

Invasor de rede  #456

@Esk-C

Description

@Esk-C

using System;
using System.Net;
using System.Net.Sockets;

class Program
{
static void Main()
{
string ipAddress = "192.168.1.1"; // Endereço IP da rede que você deseja escanear
int startPort = 1;
int endPort = 1024;

    Console.WriteLine($"Scanning {ipAddress} from port {startPort} to {endPort}");

    for (int port = startPort; port <= endPort; port++)
    {
        using (TcpClient tcpClient = new TcpClient())
        {
            try
            {
                tcpClient.Connect(ipAddress, port);
                Console.WriteLine($"Port {port} is open.");
            }
            catch (Exception)
            {
                // Porta fechada ou inacessível
            }
        }
    }

    Console.WriteLine("Scan complete.");
}

}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions