{"id":30763535,"url":"https://github.com/m0rd3caii/lib2shell-privesc","last_synced_at":"2026-02-12T12:34:00.491Z","repository":{"id":308161696,"uuid":"1031842401","full_name":"m0rd3caii/lib2shell-privesc","owner":"m0rd3caii","description":"Privilege escalation via SUID ssh-keygen abusing the -D flag to load a malicious shared object and spawn a shell with elevated privileges.","archived":false,"fork":false,"pushed_at":"2025-08-04T12:18:57.000Z","size":4,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-09-04T16:21:40.815Z","etag":null,"topics":["ssh-keygen-suid","suid-binaries","suidsploit"],"latest_commit_sha":null,"homepage":"","language":null,"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/m0rd3caii.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,"zenodo":null}},"created_at":"2025-08-04T12:14:49.000Z","updated_at":"2025-08-04T12:19:45.000Z","dependencies_parsed_at":"2025-08-04T16:56:44.587Z","dependency_job_id":null,"html_url":"https://github.com/m0rd3caii/lib2shell-privesc","commit_stats":null,"previous_names":["m0rd3caii/lib2shell-privesc"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/m0rd3caii/lib2shell-privesc","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/m0rd3caii%2Flib2shell-privesc","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/m0rd3caii%2Flib2shell-privesc/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/m0rd3caii%2Flib2shell-privesc/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/m0rd3caii%2Flib2shell-privesc/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/m0rd3caii","download_url":"https://codeload.github.com/m0rd3caii/lib2shell-privesc/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/m0rd3caii%2Flib2shell-privesc/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29366358,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-12T08:51:36.827Z","status":"ssl_error","status_checked_at":"2026-02-12T08:51:26.849Z","response_time":55,"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":["ssh-keygen-suid","suid-binaries","suidsploit"],"created_at":"2025-09-04T16:10:36.624Z","updated_at":"2026-02-12T12:34:00.487Z","avatar_url":"https://github.com/m0rd3caii.png","language":null,"funding_links":[],"categories":[],"sub_categories":[],"readme":"# lib2shell-privesc\nPrivilege escalation via SUID ssh-keygen abusing the -D flag to load a malicious shared object and spawn a shell with elevated privileges.\n\n\n# lib2shell-privesc\n\nThis project demonstrates a simple privilege escalation technique by abusing a SUID `ssh-keygen` binary and the `-D` option, which loads a shared library as a PKCS#11 provider. By crafting a malicious shared object, we can spawn a shell with elevated privileges.\n\n## Requirements\n\n- A system where `ssh-keygen` is SUID (with effective UID 0 or a higher-privileged user).\n- GCC or compatible C compiler.\n\n## 🛠️ Compilation\n\nCompile the shared object with:\n\n```bash\ngcc -fPIC -shared -o lib.so lib.c\n```\n\nMake sure the output file is named lib.so (or match whatever you want to load with -D).\n\n## 🚀 Usage\nRun the vulnerable ssh-keygen binary with:\n\n```bash\n./ssh-keygen -D ./lib.so\n```\nThis will load the shared library, triggering the constructor function and spawning a root shell (if the effective UID of ssh-keygen is root).\n\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fm0rd3caii%2Flib2shell-privesc","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fm0rd3caii%2Flib2shell-privesc","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fm0rd3caii%2Flib2shell-privesc/lists"}