{"id":21755578,"url":"https://github.com/intevel/linux-open-ports","last_synced_at":"2026-02-18T14:01:21.679Z","repository":{"id":262139057,"uuid":"886329325","full_name":"Intevel/linux-open-ports","owner":"Intevel","description":"📡 Read out all open ports on a linux system ","archived":false,"fork":false,"pushed_at":"2024-12-19T00:08:37.000Z","size":6,"stargazers_count":2,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-10-07T17:51:24.413Z","etag":null,"topics":["go","golang","networking","networking-in-go","portscanner"],"latest_commit_sha":null,"homepage":"","language":"Go","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/Intevel.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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2024-11-10T18:37:16.000Z","updated_at":"2024-12-27T14:03:35.000Z","dependencies_parsed_at":"2025-10-07T17:33:50.678Z","dependency_job_id":"52c8542e-c617-4674-9aa0-1e290b57da80","html_url":"https://github.com/Intevel/linux-open-ports","commit_stats":null,"previous_names":["intevel/linux-open-ports"],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/Intevel/linux-open-ports","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Intevel%2Flinux-open-ports","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Intevel%2Flinux-open-ports/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Intevel%2Flinux-open-ports/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Intevel%2Flinux-open-ports/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Intevel","download_url":"https://codeload.github.com/Intevel/linux-open-ports/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Intevel%2Flinux-open-ports/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29581478,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-18T13:56:48.962Z","status":"ssl_error","status_checked_at":"2026-02-18T13:54:34.145Z","response_time":162,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["go","golang","networking","networking-in-go","portscanner"],"created_at":"2024-11-26T09:18:49.357Z","updated_at":"2026-02-18T14:01:21.663Z","avatar_url":"https://github.com/Intevel.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# linux-open-ports\n\n📡 Go package that retrieves information about open network ports on a Linux system. It identifies active ports and the processes associated with them by reading the system's network connection files in `/proc/net/`.\n\n## Features\n\n- Fetches open TCP and UDP ports.\n- Retrieves the PID associated with each open port.\n- Supports both IPv4 and IPv6 connections.\n- Efficiently handles connections by avoiding duplicates in the port list.\n\n## Installation\n\nTo use the `linuxopenports` package, you can add it to your Go project by importing it:\n\n```go\nimport \"github.com/intevel/linux-open-ports\"\n\n```\n\n## Usage\n\nThe `linuxopenports` package provides a single function, `GetOpenPorts()`, which returns a list of open ports and their associated processes. The function signature is as follows:\n\n```go\n\nfunc GetOpenPorts() ([]linuxopenports.Port, error)\n\n```\n\nThe `GetOpenPorts()` function returns a slice of `Port` structs, each containing the following fields:\n\n```go\n\ntype Port struct {\n    Protocol string // The protocol used by the port (TCP or UDP).\n    Port     uint16 // The port number.\n    PID      int    // The process ID associated with the port.\n    Program  string // The name of the program associated with the port.\n}\n\n```\n\nHere is an example of how to use the `GetOpenPorts()` function:\n\n```go\n\npackage main\n\nimport (\n    \"fmt\"\n    \"github.com/intevel/linux-open-ports\"\n)\n\nfunc main() {\n    openPorts, err := linuxopenports.GetOpenPorts()\n    if err != nil {\n        fmt.Println(\"Error:\", err)\n        return\n    }\n\n    for _, port := range openPorts {\n        fmt.Printf(\"Protocol: %s, Port: %d, PID: %d, Program: %s\\n\", port.Protocol, port.Port, port.PID, port.Program)\n    }\n}\n\n```\n\n## License\n\nPublished under MIT - Made with ❤️ by Conner Bachmann","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fintevel%2Flinux-open-ports","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fintevel%2Flinux-open-ports","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fintevel%2Flinux-open-ports/lists"}