{"id":15035620,"url":"https://github.com/liragbr/portscanner","last_synced_at":"2026-02-04T15:03:18.502Z","repository":{"id":244185014,"uuid":"814512731","full_name":"Liragbr/PortScanner","owner":"Liragbr","description":"PortScanner is a C# tool for identifying open ports on target systems, crucial for network security. It offers fast, multi-threaded scanning and detailed reports, perfect for network administrators and cybersecurity professionals.","archived":false,"fork":false,"pushed_at":"2024-06-13T07:20:53.000Z","size":6,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-06-26T02:03:01.294Z","etag":null,"topics":["csharp","csharp-code","cybersecurity","hacker","hackertools","multithreading","networkanalysis","networksecurity","networktools","openports","penetrationtesting","portscanner","portscanning","security","systemsecurity","tcpclient","tools"],"latest_commit_sha":null,"homepage":"","language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Liragbr.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-06-13T06:57:11.000Z","updated_at":"2024-09-30T04:29:26.000Z","dependencies_parsed_at":"2024-06-13T10:11:18.067Z","dependency_job_id":null,"html_url":"https://github.com/Liragbr/PortScanner","commit_stats":null,"previous_names":["liragbr/portscanner"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/Liragbr/PortScanner","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Liragbr%2FPortScanner","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Liragbr%2FPortScanner/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Liragbr%2FPortScanner/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Liragbr%2FPortScanner/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Liragbr","download_url":"https://codeload.github.com/Liragbr/PortScanner/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Liragbr%2FPortScanner/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":261984644,"owners_count":23240302,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["csharp","csharp-code","cybersecurity","hacker","hackertools","multithreading","networkanalysis","networksecurity","networktools","openports","penetrationtesting","portscanner","portscanning","security","systemsecurity","tcpclient","tools"],"created_at":"2024-09-24T20:29:03.757Z","updated_at":"2026-02-04T15:03:18.420Z","avatar_url":"https://github.com/Liragbr.png","language":"C#","readme":"# 🥷🏻 Port Scanner\r\n### Warning\r\nI made this project in order to improve my programming logic and better understand some cybersecurity and c# issues, the code was not tested in production that is, it may contain flaws, always have explicit permission before scanning ports on systems that are not yours. Door scanners can be misinterpreted as intrusion attempts\r\n### Introduction \r\nthis project is a port scanning tool developed in C#. Port scanning is a crucial technique used in network security to identify open ports and services available on a target system. This tool helps in identifying potential vulnerabilities by scanning for open ports and understanding the services running on them.\r\n\r\nPort scanning works by sending packets to specified ports on a target system and analyzing the responses. It is widely used by network administrators for security assessments and by attackers for reconnaissance. The key features of this PortScanner include:\r\n\r\n- Multi-threaded Scanning: Enhances performance by scanning multiple ports simultaneously.\r\n- Customizable Scanning Options: Allows users to specify the range of ports and the IP addresses to scan.\r\n- Detailed Reporting: Provides comprehensive reports on the open ports and services detected.\r\nThis repository is designed to be a valuable resource for cybersecurity professionals, network administrators, and developers interested in network security.\r\n\r\n## Usage\r\n- Run the executable or start debugging from your development environment.\r\n- Specify the target IP address and the range of ports you want to scan.\r\n- Start the scan and view the results in the output window.\r\n\r\n## Code Overview\r\n### CommandExecutor.cs\r\nThe CommandExecutor class is responsible for executing system commands to gather network information.\r\n\r\n```csharp\r\npublic class CommandExecutor\r\n{\r\n    public static string ExecuteCommand(string command)\r\n    {\r\n        // Initializes a new process to execute the command\r\n        ProcessStartInfo procStartInfo = new ProcessStartInfo(\"cmd\", \"/c \" + command)\r\n        {\r\n            RedirectStandardOutput = true,\r\n            UseShellExecute = false,\r\n            CreateNoWindow = true\r\n        };\r\n\r\n        // Starts the process\r\n        Process proc = new Process\r\n        {\r\n            StartInfo = procStartInfo\r\n        };\r\n        proc.Start();\r\n\r\n        // Reads the output of the command\r\n        return proc.StandardOutput.ReadToEnd();\r\n    }\r\n}\r\nThis function uses ProcessStartInfo to set up the command execution environment and Process to run the command and capture its output.\r\n````\r\n\u003cbr\u003e\r\n\r\n### PortScanner.cs\r\nThe PortScanner class handles the scanning logic.\r\n\r\n```csharp\r\npublic class PortScanner\r\n{\r\n    private string targetIP;\r\n    private int startPort;\r\n    private int endPort;\r\n\r\n    public PortScanner(string ip, int start, int end)\r\n    {\r\n        targetIP = ip;\r\n        startPort = start;\r\n        endPort = end;\r\n    }\r\n\r\n    public void Scan()\r\n    {\r\n        Parallel.For(startPort, endPort + 1, port =\u003e\r\n        {\r\n            // Attempts to connect to the port\r\n            using (TcpClient tcpClient = new TcpClient())\r\n            {\r\n                try\r\n                {\r\n                    tcpClient.Connect(targetIP, port);\r\n                    Console.WriteLine($\"Port {port} is open.\");\r\n                }\r\n                catch (Exception)\r\n                {\r\n                    Console.WriteLine($\"Port {port} is closed.\");\r\n                }\r\n            }\r\n        });\r\n    }\r\n}\r\n```\r\nThis class sets up the scanning parameters and uses `Parallel.For` to scan ports concurrently, enhancing the scan speed significantly.\r\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fliragbr%2Fportscanner","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fliragbr%2Fportscanner","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fliragbr%2Fportscanner/lists"}