{"id":21616717,"url":"https://github.com/al1ex/cve-2017-16995","last_synced_at":"2025-09-02T11:09:40.789Z","repository":{"id":108706724,"uuid":"131100341","full_name":"Al1ex/CVE-2017-16995","owner":"Al1ex","description":"CVE-2017-16995（Ubuntu本地提权漏洞）","archived":false,"fork":false,"pushed_at":"2021-09-08T03:53:24.000Z","size":6,"stargazers_count":12,"open_issues_count":0,"forks_count":10,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-04-11T07:47:23.278Z","etag":null,"topics":[],"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/Al1ex.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":"2018-04-26T04:33:50.000Z","updated_at":"2024-08-12T19:38:03.000Z","dependencies_parsed_at":"2023-06-01T04:31:01.786Z","dependency_job_id":null,"html_url":"https://github.com/Al1ex/CVE-2017-16995","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/Al1ex/CVE-2017-16995","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Al1ex%2FCVE-2017-16995","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Al1ex%2FCVE-2017-16995/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Al1ex%2FCVE-2017-16995/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Al1ex%2FCVE-2017-16995/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Al1ex","download_url":"https://codeload.github.com/Al1ex/CVE-2017-16995/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Al1ex%2FCVE-2017-16995/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":273272670,"owners_count":25076010,"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","status":"online","status_checked_at":"2025-09-02T02:00:09.530Z","response_time":77,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":[],"created_at":"2024-11-24T22:15:11.127Z","updated_at":"2025-09-02T11:09:40.782Z","avatar_url":"https://github.com/Al1ex.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"# 漏洞描述\nUbuntu是一个以桌面应用为主的开源GNU/Linux操作系统，基于Debian GNU/Linux 。近期有白帽子爆出 ubuntu 的最新版本（Ubuntu 16.04）存在本地提权漏洞，漏洞编号为CVE-2017-16995。该漏洞存在于调用eBPF bpf(2)的Linux内核系统中，当用户提供恶意BPF程序使eBPF验证器模块产生计算错误，导致任意内存读写问题， 低权限用户可使用此漏洞获得管理权限。\n该漏洞在老版本中已经得到修复，然而最新版本中仍然可被利用，官方暂未发布相关补丁，漏洞处于0day状态。\n\n# 影响版本\nLinux Kernel Version 4.14-4.4\n仅影响Ubuntu/Debian发行版本\n\n# 漏洞等级\n 高危\n# 演示\n~~~\nbearcat@ubuntu:/opt$ lsb_release -a\n\u003cbr\u003eNo LSB modules are available.\n\u003cbr\u003eDistributor ID: Ubuntu\n\u003cbr\u003eDescription:    Ubuntu 16.04.4 LTS\n\u003cbr\u003eRelease:        16.04\n\u003cbr\u003eCodename:       xenial\n\u003cbr\u003ebearcat@ubuntu:/opt$ uname -a\n\u003cbr\u003eLinux ubuntu 4.4.0-116-generic #140-Ubuntu SMP Mon Feb 12 21:23:04 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux\n\u003cbr\u003ebearcat@ubuntu:/opt$ id\n\u003cbr\u003euid=1000(bearcat) gid=1000(bearcat) \u003cbr\u003egroups=1000(bearcat),4(adm),24(cdrom),27(sudo),30(dip),46(plugdev),110(lxd),115(lpadmin),116(sambashare)\n\u003cbr\u003ebearcat@ubuntu:/opt$ ls\n\u003cbr\u003eexploit.c\n\u003cbr\u003ebearcat@ubuntu:/opt$ gcc exploit.c -o exploit\n\u003cbr\u003ebearcat@ubuntu:/opt$ ./exploit\n\u003cbr\u003etask_struct = ffff88003a0db800\n\u003cbr\u003euidptr = ffff8800374b76c4\n\u003cbr\u003espawning root shell\n\u003cbr\u003eroot@ubuntu:/opt# id\n\u003cbr\u003euid=0(root) gid=0(root) groups=0(root),4(adm),24(cdrom),27(sudo),30(dip),46(plugdev),110(lxd),115(lpadmin),116(sambashare),1000(bearcat)\n\u003cbr\u003eroot@ubuntu:/opt#\n~~~\n\n# 漏洞修复\n#### 方法一：\n目前暂未有明确的补丁升级方案提出，但是建议用户通过修改内核参数限制普通用户使用bpf(2)系统调用来缓解：\n设置参数“kernel.unprivileged_bpf_disabled = 1”通过限制对bpf(2)调用了访问来防止这种特权升级\u003cbr\u003e\n `root@Ubuntu# echo 1 \u003e /proc/sys/kernel/unprivileged_bpf_disabled`\u003cbr\u003e\n #### 方法二：\n 升级Linux Kernel 版本，需要重启服务器之后生效：\n这一步在环境搭建过程中已经描述过了具体的操作，用户只需要修改内核版本即可！\u003cbr\u003e\n #### 方法三：\n 代码补丁 https://github.com/torvalds/linux/commit/95a762e2c8c942780948091f8f2a4f32fce1ac6f\n \n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fal1ex%2Fcve-2017-16995","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fal1ex%2Fcve-2017-16995","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fal1ex%2Fcve-2017-16995/lists"}