{"id":20292467,"url":"https://github.com/mauricelambert/portsscanner","last_synced_at":"2026-06-11T07:30:59.038Z","repository":{"id":62577962,"uuid":"328010272","full_name":"mauricelambert/PortsScanner","owner":"mauricelambert","description":"This package implement a tool to scan ports on one host with python3 (Scapy is required for somes scans).","archived":false,"fork":false,"pushed_at":"2021-01-08T20:56:35.000Z","size":27,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-15T19:11:07.449Z","etag":null,"topics":["package","port-scanner","port-scanning","pypi","python3","scapy"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mauricelambert.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-01-08T20:54:57.000Z","updated_at":"2021-01-08T21:05:33.000Z","dependencies_parsed_at":"2022-11-03T19:38:25.643Z","dependency_job_id":null,"html_url":"https://github.com/mauricelambert/PortsScanner","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mauricelambert%2FPortsScanner","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mauricelambert%2FPortsScanner/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mauricelambert%2FPortsScanner/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mauricelambert%2FPortsScanner/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mauricelambert","download_url":"https://codeload.github.com/mauricelambert/PortsScanner/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241787485,"owners_count":20020101,"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":["package","port-scanner","port-scanning","pypi","python3","scapy"],"created_at":"2024-11-14T15:17:24.110Z","updated_at":"2026-06-11T07:30:58.992Z","avatar_url":"https://github.com/mauricelambert.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# PortsScanner\r\n\r\n## Description\r\nThis package implement a tool to scan ports on one host with python3 (Scapy is required for somes scans).\r\n\r\n## Requirements\r\nThis package require : \r\n - python3\r\n - python3 Standard Library\r\n - Scapy for advanced scans\r\n\r\n## Installation\r\n```bash\r\npip install PortsScanner \r\n```\r\n\r\n## Examples\r\n\r\n### Command lines\r\n\r\n```bash\r\n## Simple scan\r\n\r\nPortsScanner 127.0.0.1 # default scan (asynchronous TCP connect), Scapy isn't required\r\nPortsScanner -w 50 -q 100 127.0.0.1 # default scan with 50 async workers and 100 seconds for timeout total\r\nPortsScanner -i 0.5 -T connect localhost # TCP connect scan (not asynchronous) with interval (0.5 seconds) between differents connections\r\nPortsScanner -p 53,80,8080,443-445 -t 1 -r 2 -T S --timer -R localhost # SYN scan (Scapy is required) on ports : 53,80,8080,443,444,445 with a timeout (1 second) and two successive scan (to verify result), with timer and result in real time.\r\n\r\n## Advanced scan\r\n\r\nPortsScanner -p 1900 -T U -t 1 localhost # UDP scan on SSDP port (1900) with timeout (1 second)\r\nPortsScanner -p 80,445 -T F -i 1 -t 3 localhost # FIN scan on http and microsoft_ds with interval (1 second) and timeout (3 seconds)\r\nPortsScanner -p 80,445 -T X -R -i 1 -t 3 localhost # Xmas tree scan on http and microsoft_ds with interval (1 second), a timeout (3 seconds) and view result in realtime\r\nPortsScanner -p 80,445 -T N -R -i 1 -t 3 localhost # NULL scan on http and microsoft_ds with interval (1 second), a timeout (3 seconds) and view result in realtime\r\nPortsScanner -p 80,445 -T A -R -i 1 -t 3 localhost # ACK scan on http and microsoft_ds with interval (1 second), a timeout (3 seconds) and view result in realtime\r\n\r\n## Custom scan\r\n\r\nPortsScanner -f S -F SA -i 1 -t 1 -r 3 --timer -R -m 34 192.168.0.254 # A custom SYN scan with flag \"S\" and responses flags \"SA\", a interval (1 second), a timeout (1 second), retry (3 successive scans), timer in report, real time result and print in report port with more than 34 pourcent success (good responses / number of retry * 100)\r\nPortsScanner -f F -F RA -i 1 -t 1 -r 3 -u --timer -I -u -m 34 192.168.0.254 # A custom FIN scan with flag \"F\" and responses flags \"RA\" with interval (1 second), timeout (1 second), retry (3 successive scans), timer in report, with inversed and unaswerred result (is a opened port when you don't have response) and print in report port with more than 34 pourcent success (good responses / number of retry * 100)\r\n```\r\n\r\n### Python3\r\n\r\n1. Simple usage\r\n```python\r\nfrom PortsScanner import PortsScanner\r\nscanner = PortsScanner(\"localhost\")\r\nscanner.launcher()\r\n```\r\n\r\n```python\r\nfrom PortsScanner import PortsScanner\r\nscanner = PortsScanner(\"localhost\", ports=[8080, 80, 443, 8080], timeout_total=5, workers=4)\r\nscanner.launcher()\r\n```\r\n\r\n```python\r\nfrom PortsScanner import PortsScanner\r\nscanner = PortsScanner(\"192.168.0.254\", ports=[80,445,443], timeout=3, inter=0.5, retry=1, type_=\"S\", timer=True, view_real_time=True)\r\nscanner.launcher()\r\nscanner.report()\r\n```\r\n\r\n2. Advanced usage\r\n\r\n```python\r\nfrom PortsScanner import PortsScanner\r\n\r\nclass CustomPortsScanner (PortsScanner):\r\n    def handle_find_port (self, port):\r\n        print(f\"{port} - {self.TCP_SERVICES[port]} is opened\")\r\n\r\nscanner = CustomPortsScanner(\"localhost\", ports = [80,443], timeout=2, inter=1, retry=2, flags=\"F\", timer=True, flags_response=\"RA\", view_real_time=True, invers=True, unanswers=True, probability_min=51)\r\nscanner.launcher()\r\nscanner.report()\r\n```\r\n\r\n## Link\r\n[Github Page](https://github.com/mauricelambert/PortsScanner)\r\n\r\n## Licence\r\nLicensed under the [GPL, version 3](https://www.gnu.org/licenses/).","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmauricelambert%2Fportsscanner","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmauricelambert%2Fportsscanner","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmauricelambert%2Fportsscanner/lists"}