Goal Reached Thanks to every supporter — we hit 100%!

Goal: 1000 CNY · Raised: 1000 CNY

100.0%

CVE-2019-12735 PoC — Vim 操作系统命令注入漏洞

Source
Associated Vulnerability
Title:Vim 操作系统命令注入漏洞 (CVE-2019-12735)
Description:Vim是一款基于UNIX平台的编辑器。Neovim是Vim的重构版。 Vim 8.1.1365之前版本和Neovim 0.3.6之前版本中的getchar.c文件存在操作系统命令注入漏洞。该漏洞源于外部输入数据构造操作系统可执行命令过程中,网络系统或产品未正确过滤其中的特殊字符、命令等。攻击者可利用该漏洞执行非法操作系统命令。
Readme
# CVE-2019-12735-VIM-NEOVIM  
  

### USAGE:  
  
前提需要开启modeline功能   
普通用户的modeline功能默认开启,而root用户是默认关闭的。  
使用echo &modeline 查询开启情况 1为开启 0为关闭   
若没有则可以在~/.vimrc(没有该文件自行创建即可)中加入set modeline即可   

自行写入需要考虑 转义字符x1b是非显示字符   
想要修改第二段利用代码,简单的方法是下载源文件,修改执行命令的部分,也可以使用二进制编辑器自行写入或修改。   

**poc.txt:**   

`vim poc.txt`   

**shell.txt:**   


`nc -lvp 9999`   
  

`vim shell.txt`   

**then you can getshell**     

### 安全建议   

1.更新vim >= 8.1.1365 neovim > v0.3.6   
2.在vimrc中加入set nomodeline,禁用modeline   
3.不要轻易打开来路不明的文件   
File Snapshot

[4.0K] /data/pocs/0ecb15915afdaa04acd695af3e985b2d0963a706 ├── [ 75] poc.txt ├── [ 846] README.md └── [ 144] shell.txt 0 directories, 3 files
Shenlong Bot has cached this for you
Remarks
    1. It is advised to access via the original source first.
    2. If the original source is unavailable, please email f.jinxu#gmail.com for a local snapshot (replace # with @).
    3. Shenlong has snapshotted the POC code for you. To support long-term maintenance, please consider donating. Thank you for your support.