{"id":17209393,"url":"https://github.com/de-vri-es/fdinject","last_synced_at":"2025-03-25T11:42:14.395Z","repository":{"id":21774619,"uuid":"25096915","full_name":"de-vri-es/fdinject","owner":"de-vri-es","description":"Write data to any file descriptor in any processs.","archived":false,"fork":false,"pushed_at":"2014-10-11T22:35:16.000Z","size":152,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-01-30T10:41:51.839Z","etag":null,"topics":["debug","file-descriptor","inject","strace"],"latest_commit_sha":null,"homepage":null,"language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/de-vri-es.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":"2014-10-11T22:00:11.000Z","updated_at":"2020-12-21T08:54:37.000Z","dependencies_parsed_at":"2022-08-19T16:50:50.874Z","dependency_job_id":null,"html_url":"https://github.com/de-vri-es/fdinject","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/de-vri-es%2Ffdinject","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/de-vri-es%2Ffdinject/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/de-vri-es%2Ffdinject/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/de-vri-es%2Ffdinject/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/de-vri-es","download_url":"https://codeload.github.com/de-vri-es/fdinject/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245458057,"owners_count":20618693,"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":["debug","file-descriptor","inject","strace"],"created_at":"2024-10-15T02:51:29.765Z","updated_at":"2025-03-25T11:42:14.368Z","avatar_url":"https://github.com/de-vri-es.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Introduction\nfdinject is a tool for writing data to any file descriptor of any process.\nIt uses ptrace to attach to the target process and then makes the that process invoke the required system calls.\nThe tool requires root rights and currently only works on Linux x86_64.\nSupport for Linux on x86_32 and ARM are planned for the future.\n\nOne use case is to write data to open TCP connection from any process without the difficulty of injecting packets.\n\n# Usage\n```\nfdinject pid fd\n```\nThis will make fdinject read data from stdin and write it to file descriptor `fd` of the process with PID `pid`.\n\n# Details\nfdinject performs the following actions after attaching to the target process:\n\n1. Make the other process call mmap to get a fresh block of memory to hold the injected data.\n2. Copy the data to the newly allocated memory.\n3. Call write(fd, ...) in the target process untill all data has been written or an error occurs.\n4. Unmap the allocated memory in the other process again.\n\nThese steps are all implemented by invoking system calls directly to avoid the need to resolve symbol names in the target executable.\n\nInput is buffered until standard input closes.\nIt is then copied to the target process in one go and written to the file descriptor.\nThis should probably be changed to write standard input in multiple blocks for large input.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fde-vri-es%2Ffdinject","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fde-vri-es%2Ffdinject","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fde-vri-es%2Ffdinject/lists"}