{"id":21204937,"url":"https://github.com/saelo/cve-2014-0038","last_synced_at":"2025-07-10T08:31:50.446Z","repository":{"id":150758584,"uuid":"16454244","full_name":"saelo/cve-2014-0038","owner":"saelo","description":"Linux local root exploit for CVE-2014-0038","archived":false,"fork":false,"pushed_at":"2014-04-18T10:26:02.000Z","size":294,"stargazers_count":190,"open_issues_count":1,"forks_count":47,"subscribers_count":18,"default_branch":"master","last_synced_at":"2023-11-07T17:07:42.396Z","etag":null,"topics":["exploit","kernel","linux"],"latest_commit_sha":null,"homepage":"","language":"C","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/saelo.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}},"created_at":"2014-02-02T12:34:57.000Z","updated_at":"2023-09-28T10:23:57.000Z","dependencies_parsed_at":"2023-04-04T18:14:20.388Z","dependency_job_id":null,"html_url":"https://github.com/saelo/cve-2014-0038","commit_stats":null,"previous_names":[],"tags_count":0,"template":null,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/saelo%2Fcve-2014-0038","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/saelo%2Fcve-2014-0038/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/saelo%2Fcve-2014-0038/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/saelo%2Fcve-2014-0038/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/saelo","download_url":"https://codeload.github.com/saelo/cve-2014-0038/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":225629961,"owners_count":17499289,"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":["exploit","kernel","linux"],"created_at":"2024-11-20T20:42:05.786Z","updated_at":"2024-11-20T20:42:06.332Z","avatar_url":"https://github.com/saelo.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"Local root exploit for CVE-2014-0038\n====================================\n\nBug:\n----\nThe X86_X32 recvmmsg syscall does not properly sanitize the timeout pointer\npassed from userspace.\n\nExploit primitive:\n------------------\nPass a pointer to a kernel address as timeout for recvmmsg,\nif the original byte at that address is known it can be overwritten\nwith known data.\nIf the least significant byte is 0xff, waiting 255 seconds will turn it into a 0x00.\n\nRestrictions:\n-------------\nThe first long at the passed address (tv_sec) has to be positive\nand the second long (tv_nsec) has to be smaller than 1000000000.\n\nOverview:\n---------\nTarget the release function pointer of the ptmx_fops structure located in\nnon initialized (and thus writable) kernel memory. Zero out the three most\nsignificant bytes and thus turn it into a pointer to an address mappable in\nuser space.\nThe release pointer is used as it is followed by 16 0x00 bytes (so the tv_nsec\nis valid).\nOpen /dev/ptmx, close it and enjoy.\n\nNot very beautiful but should be fairly reliable if symbols can be resolved.\n\nTested on Ubuntu 13.10\n\nSee also http://blog.includesecurity.com/2014/03/exploit-CVE-2014-0038-x32-recvmmsg-kernel-vulnerablity.html\n\nRun:\n----\nRetrieve addresses from `/proc/kallsyms` and run the exploit:\n\n    ./build.sh \u0026\u0026 ./timeoutpwn\n\nIf you would like to build the binary for a remote server, try this:\n\n    ssh user@host 'cat /proc/kallsyms' \u003e syms.txt\n    CFLAGS=-static ./build.sh syms.txt\n    scp timeoutpwn user@host:\n    ...\n\nIf `ptmx_fops` cannot be found in kallsyms, try extracting it from the vmlinux\nas provided with the headers package (`linux-headers` on Arch Linux):\n\n    nm /lib/modules/$(uname -r)/build/vmlinux \u003e syms.txt\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsaelo%2Fcve-2014-0038","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsaelo%2Fcve-2014-0038","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsaelo%2Fcve-2014-0038/lists"}