{"id":37164122,"url":"https://github.com/ihippik/pg-sniffer","last_synced_at":"2026-01-14T19:30:23.631Z","repository":{"id":130013629,"uuid":"577443121","full_name":"ihippik/pg-sniffer","owner":"ihippik","description":"Capture PostgreSQL SQL-queries","archived":false,"fork":false,"pushed_at":"2022-12-24T20:11:58.000Z","size":14,"stargazers_count":8,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-11-18T04:36:57.828Z","etag":null,"topics":["postgresql","sniffer-packet"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ihippik.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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":"2022-12-12T18:46:47.000Z","updated_at":"2024-07-08T07:50:39.000Z","dependencies_parsed_at":"2023-04-09T05:47:41.630Z","dependency_job_id":null,"html_url":"https://github.com/ihippik/pg-sniffer","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/ihippik/pg-sniffer","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ihippik%2Fpg-sniffer","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ihippik%2Fpg-sniffer/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ihippik%2Fpg-sniffer/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ihippik%2Fpg-sniffer/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ihippik","download_url":"https://codeload.github.com/ihippik/pg-sniffer/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ihippik%2Fpg-sniffer/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28432619,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-14T18:57:19.464Z","status":"ssl_error","status_checked_at":"2026-01-14T18:52:48.501Z","response_time":107,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6: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":["postgresql","sniffer-packet"],"created_at":"2026-01-14T19:30:20.719Z","updated_at":"2026-01-14T19:30:23.616Z","avatar_url":"https://github.com/ihippik.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# PG-sniffer\n\nCapture PostgreSQL SQL-queries.\n\nFor traffic capturing you needed administrative privileges (for example, `sudo`)\n\n### Commands\n* capture - start listening\n* list - network device list\n\n### Flags\n| flag      | description                  |\n|-----------|------------------------------|\n| port      | PostgreSQL port              |\n| device    | network device for capturing |\n| highlight | highlight SQL syntax         |\n\n\n## Preparation\nThe first thing to do is install the dependencies\n\n```bash\nsudo apt-get install libpcap-dev\n```\n\n## Principle of operation\n\n### Packet capturing\nThe movement of all data in networks is carried out in the form of packets, which are the unit of data for networks.\nThe term \"packet\" is first introduced at the network layer. The main protocols of this layer are `IP` (Internet Protocol).\nFurther transport layer protocols include `TCP` (Transmission Control Protocol), focused on creating a permanent connection,\nUDP (User Datagram Protocol) and the application layer contains many commonly used protocols such as HTTP, FTP, IMAP, SMTP and many others.\n\nPacket capture refers to the collection of data transmitted over a network.\nAnytime the NIC receives data, it checks the packet's destination MAC address against its own.\nAnd if the addresses match, an exception is thrown that is used to copy data from the network card buffer to the \"decision center\".\nWe look at the packet headers and pass this packet to the appropriate handler. When capturing packets, the driver also sends a copy to us. The usual capture library is `libpcap`.\nand that's why we install the dependencies we need.\nBy the way, this library is also used by `TCPDump` and `Wireshark`, known to all of us.\nWe can also filter traffic to only receive the packets we need (you can see the filter in the code).\nAll that remains for us to do is to select a network device and receive a copy of the packets from it and encode them according to the headers.\n\nPacket capture is typically used for network debugging or looking for performance or security anomalies\nIn our case, this is debugging an application working with a database.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fihippik%2Fpg-sniffer","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fihippik%2Fpg-sniffer","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fihippik%2Fpg-sniffer/lists"}