{"id":24367783,"url":"https://github.com/raw-phil/litm","last_synced_at":"2026-02-21T15:31:36.004Z","repository":{"id":273066179,"uuid":"869126286","full_name":"raw-phil/litm","owner":"raw-phil","description":"litm (Logger In The Middle) is a simple CLI tool that captures and logs HTTP/1.1 traffic of a web server using eBPF.","archived":false,"fork":false,"pushed_at":"2025-02-01T13:44:44.000Z","size":99,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-06-24T01:10:06.027Z","etag":null,"topics":["c","ebpf","go","linux"],"latest_commit_sha":null,"homepage":"","language":"Go","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/raw-phil.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}},"created_at":"2024-10-07T19:01:26.000Z","updated_at":"2025-02-14T13:34:39.000Z","dependencies_parsed_at":"2025-04-10T16:05:53.685Z","dependency_job_id":"9a908f51-4c34-45d9-8557-bd3b32df4f44","html_url":"https://github.com/raw-phil/litm","commit_stats":null,"previous_names":["raw-phil/litm"],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/raw-phil/litm","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/raw-phil%2Flitm","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/raw-phil%2Flitm/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/raw-phil%2Flitm/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/raw-phil%2Flitm/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/raw-phil","download_url":"https://codeload.github.com/raw-phil/litm/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/raw-phil%2Flitm/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29684478,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-21T14:31:22.911Z","status":"ssl_error","status_checked_at":"2026-02-21T14:31:22.570Z","response_time":107,"last_error":"SSL_read: 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":["c","ebpf","go","linux"],"created_at":"2025-01-19T02:55:00.228Z","updated_at":"2026-02-21T15:31:35.990Z","avatar_url":"https://github.com/raw-phil.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# litm\n\n\u003e [!WARNING]   \n\u003e This is a free-time project created to learn eBPF. Use it at your own risk.\n\nlitm (Logger In The Middle) is a simple CLI tool that captures and logs HTTP/1.1 traffic of a web server using eBPF. Built with Go and [ebpf-go](https://github.com/cilium/ebpf), it listens to network-related syscalls, processes HTTP traffic in user space, and generates logs in Common Log Format (CLF).\n\n[![Go Reference](https://pkg.go.dev/badge/golang.org/x/example.svg)](https://pkg.go.dev/golang.org/x/example)\n\n## Table of Contents\n\n- [Features](#features)\n- [Installation](#installation)\n- [Build](#build)\n- [Usage](#usage)\n- [How It Works](#how-it-works)\n\n## Features\n\n- Monitors HTTP/1.1 traffic of a web-server using eBPF\n- Parses TCP data using Go’s `net/http` package\n- Logs HTTP traffic in [CLF](https://en.wikipedia.org/wiki/Common_Log_Format) format\n\n## Installation\n\n### Prerequisites\n\n- Go (1.18+ recommended)\n- Linux 5.x+ with eBPF support\n\n### Install\n\n```sh\ngo install github.com/raw-phil/litm@latest\n```\n\n## Build\n### Build Go part\n- Clone repository\n```sh\ngit clone https://github.com/raw-phil/litm \u0026\u0026 cd litm\n```\n- Build\n```sh\ngo build -o litm .\n```\n\n### Build eBPF part\nDo it if you want to modify the content of eBPF programs (litm.bpf.c):\n\n- Clone repository\n```sh\ngit clone https://github.com/raw-phil/litm \u0026\u0026 cd litm\n```\n- Generate vmlinux.h\n```sh\nbpftool btf dump file /sys/kernel/btf/vmlinux format c \u003e internal/bpf/vmlinux.h\n```\n- Build\n```sh\ngo generate ./internal/bpf\n```\n\n## Usage\n\n### Help\n```sh\nlitm --help\n```\n```\n  -F\tRemove info logs to produce output that is suitable for processing by another program\n  -ip string\n    \tIp (IPv4 or IPv6) where the server is listening\n  -p uint\n    \tPort where the server is listening\n```\n### Run\n\n\u003e [!NOTE] \n\u003e litm uses eBPF, so it must be run by the root user or with the `CAP_BPF` capability set.\n\n```sh\nlitm -p 3000 -ip 127.0.0.1\n```\nThis command start logging on STDOUT, http traffic processed by web-server on 127.0.0.1:3000\n\n## How It Works\n\n1. litm attaches to the most common syscalls that web servers use to read and write to a TCP connection.\n2. The eBPF program collects HTTP data and transfers it to user space via a ring buffer.\n3. The Go program reconstructs HTTP requests and responses using `net/http`.\n4. The parsed data is logged in Common Log Format (CLF).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fraw-phil%2Flitm","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fraw-phil%2Flitm","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fraw-phil%2Flitm/lists"}