Old school – the text editor method

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

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.

Tip

Do not be fooled by the apparent simplicity of Nano (Nano's another text editor). Nano performs power-user functionality such as text justification, syntax highlighting, powerful text searching, and more.

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

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:

  • Case-sensitive searching
  • Text file conversion options—do you want to convert DOS or Mac text files?
  • Should the editor wrap your text?
  • Auto-indent options

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 –the power user's text editor of choice

VIM is an improved version of the vi editor that is available as charityware.

Tip

If you find that you want to use VIM, you are encouraged to make a donation to the ICCF. This information is displayed when starting the editor through the vim command.

VIM –the power user's text editor of choice

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.

VIM –the power user's text editor of choice

Some of the additional features of VIM are as follows:

  • Binary files can be reviewed and even edited by using the binary mode.
  • Can open files in read-only mode to avoid accidental file changes.
  • Basic on-the-fly file encryption using the -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:

VIM –the power user's text editor of choice

When saved and reopened without the proper encryption key, the information in the file is undecipherable:

# vim –x test.txt
VIM –the power user's text editor of choice

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.

Gedit – Gnome text editor

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:

Gedit – Gnome text editor

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:

Gedit – Gnome text editor

The gedit tool has many powerful options and also allows for syntax highlighting for when you are reviewing programming language files.

Tip

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.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset