In this walk through, we will be going through the Toolbox: Vim room from Tryhackme. We will learn about vim, a universal text editor that can be incredibly powerful when used properly. From basic text editing to editing of binary files, Vim can be an important arsenal in a security toolkit. So, let’s get started without any delay.

Table of Contents
Task 1 – Task 1
Question 1 – Install Vim
DoneQuestion 2 – Launch Vim
Done

Task 2 – Task 2
Question 1 – How do we enter “INSERT” mode?
iQuestion 2 – How do we start entering text into our new Vim document?
typingQuestion 3 – How do we return to command mode?
escQuestion 4 – How do we move the cursor left?
hQuestion 5 – How do we move the cursor right?
lQuestion 6 – How do we move the cursor up?
kQuestion 7 – How do we move the cursor down?
jQuestion 8 – How do we jump to the start of a word?
wQuestion 9 – How do we jump to the end of a word?
eQuestion 10 – How do we insert (before the cursor)
IQuestion 11 – How do we insert (at the beginning of the line?)
IQuestion 12 – How do we append (after the cursor)
AQuestion 13 – How do we append (at the end of the line)
aQuestion 14 – How do we make a new line under the current line?
o

Task 3 – Task 3
Question 1 – How do we write the file, but don’t exit?
:wQuestion 2 – How do we write the file, but don’t exit- as root?
:w !sudo tee %Question 3 – How do we write and quit?
:wqQuestion 4 – How do we quit?
:qQuestion 5 – How do we force quit?
:q!Question 6 – How do we save and quit, for all active tabs?
:wqa
Task 4 – Task 4
Question 1 – How do we copy a line?
YYQuestion 2 – how do we copy 2 lines?
2YYQuestion 3 – How do we copy to the end of the line?
y$Question 4 – How do we paste the clipboard contents after the cursor?
PQuestion 5 – How do we paste the clipboard contents before the cursor?
PQuestion 6 – How do we cut a line?
DDQuestion 7 – How do we cut two lines?
2DDQuestion 8 – How do we cut to the end of the line?
DQuestion 9 – How do we cut a character?
x
Task 5 – Task 5
Question 1 – How do we search forwards for a pattern (use “pattern” for your answer)
/patternQuestion 2 – How do we search backwards for a pattern (use “pattern” for your answer)
?patternQuestion 3 – How do we repeat this search in the same direction?
nQuestion 4 – How do we repeat this search in the opposite direction?
NQuestion 5 – How do we search for “old” and replace it with “new”
:%s/old/new/gQuestion 6 – How do we use “grep” to search for a pattern in multiple files?
:vimgrep
Also Read: Tryhackme – Tech_Supp0rt: 1
So that was “Toolbox: Vim” for you. We looked into the vim text editor in detail. We started off with a basic introduction, then looked into some modes vim offers. Next, we took a dive into writing, saving and editing in vim. Moving on, we looked into cut, copy and paste commands and at last had a peek on vimgrep and concluded the room. On that note, i would take your leave and will meet you in next one. Till then, “Happy hacking”.




