-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Closed
Description
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
Labels
No labels