Popular Linux text editors include vim, which takes a bit of getting used to, and Nano, which provides a convenient method of editing and collecting simple file data.
Nano has been used throughout this book for various text editing needs. It is quick and simple to learn, which makes it perfect for taking quick notes or rapidly editing documents.
To launch Nano from Kali, type, nano
followed by the name of the file that will need to be edited or created. Nano will create the file in your current working directory.
# nano test.txt
Nano is very customizable through command-line options or by editing the configuration file at /etc/nanorc
. Some of the options available to be set by using nanorc
include the following, and more:
If you decide to take advantage of Nano during your testing process, be sure to take a look at the settings and find a configuration that works best for your workflow and preference.
More information about Nano can be found online at http://tuxradar.com/content/text-editing-nano-made-easy.
VIM is an improved version of the vi editor that is available as charityware.
There are a few basic commands that anyone using VIM should be familiar with. To assist those who are completely new to VIM, the tool provides a tutorial that can be reached via typing vimtutor
at the command line.
Some of the additional features of VIM are as follows:
-X
switch. If using a recent version of VIM (7.3+), the encryption can be set to use Blowfish as the encryption type. To encrypt a file named test.txt
, start a file using:# vim -x test.txt
You will be prompted to enter an encryption key. This key will be needed to decrypt the file in the future:
Enter Encryption Key: ThisIsATest Enter Same Key again: ThisIsATest
Enter some text into the file:
When saved and reopened without the proper encryption key, the information in the file is undecipherable:
# vim –x test.txt
Encrypting the data collected during testing is both beneficial and encouraged; however, it is important to note that the type of symmetric encryption used by VIM is not ideal for sharing files. A separate solution focuses on asymmetrical encryption methods that may be more appropriate in such cases.
Within many versions of Linux as well as in Kali, the Gnome desktop has the gedit editor bundled by default. This editor can provide another method of taking the data we collected and provides a record of the testing outcome. In the terminal window of Kali or pretty much any other Gnome environment, enter gedit
. This will result in the tool starting up; an example of this is shown in the following screenshot:
Once you have opened gedit, you can see that there are few differences between it and any other editor. In fact, you have many of the same hotkeys that are available in most of the popular document-based software programs. You can also open additional documents and maintain tabs; this is accomplished by selecting the + button to the right of the menu. An example of this is shown in the following screenshot:
The gedit tool has many powerful options and also allows for syntax highlighting for when you are reviewing programming language files.
To find out more, and explore this powerful tool in greater depth, check out the wiki page located here: https://wiki.gnome.org/Apps/Gedit. Not only will you learn a lot about the tool, you can also learn how to create snippets, which will stop you from having to type recurring text multiple times.