Kali Linux Penetration Testing Bible. Gus Khawaja

Чтение книги онлайн.

Читать онлайн книгу Kali Linux Penetration Testing Bible - Gus Khawaja страница 11

Kali Linux Penetration Testing Bible - Gus Khawaja

Скачать книгу

to Contact the Author

      We appreciate your input and questions about this book! Email the author at [email protected] , or message him on Twitter at @GusKhawaja .

      Kali Linux can be summarized in two simple words: terminal window. If you master your terminal window skills, then you will be one of those elite ethical hackers. In this chapter, you will learn all the essentials of the terminal window so you can start using Kali Linux like a boss.

      If you already know how to manage the terminal window, please use this chapter as a reference, or maybe go over it quickly in case there is something new that you haven't learned before. The main goal of this chapter is not only to show you the commands of Kali Linux but to help you deeply understand it through practical examples.

      Kali Linux is a Debian‐based operating system developed by Offensive Security, so if you're used to Ubuntu, for example, the commands in the terminal window will look the same since Debian and Kali share an equal distribution.

      Here's what this chapter covers:

       Kali Linux file system

       Terminal window basics

       Managing users and groups

       Manipulating files and folders

       Handling remote connections

       Kali Linux system management

       Dealing with networking in Kali Linux

      To get a visual representation of the Kali Linux file system directories, open the terminal window and execute the ls command to list the contents of the root system directory. Take note that by default you will be in the user home directory. To change it, you must execute the cd / command:

      kali@kali:~$ cd / kali@kali:/$ ls bin boot dev etc home initrd.img initrd.img.old lib lib32 lib64 libx32 lost+found media mnt opt proc root run sbin srv sys tmp usr var vmlinuz vmlinuz.old

       /bin (binaries): This directory holds Linux binaries like the ls command that we executed earlier.

       /sbin (system binaries): This directory contains system binary files that serve as administrative commands (e.g., fdisk ).

       / boot : This directory contains the Linux bootloader files.

       / dev (devices): This directory contains the device configuration files (e.g., /dev/null ).

       / sys : This is similar to /dev , which contains configurations about devices and drivers.

       / etc (etcetera): This directory contains all the administration system files (e.g., /etc/passwd shows all the system users in Kali).

       / lib (libraries): This directory contains the shared libraries for the binaries inside /bin and /sbin .

       / proc (processes): This directory holds the processes and kernel information files.

       / lost+found : As the name says, this directory contains the files that have been recovered.

       / mnt (mount): This directory contains the mounted directories (e.g., a remote file share).

       / media : This directory holds the removable media mounted directories (e.g., DVD).

       / opt (option): This directory is used for add‐on software package installation. Also, it is used when installing software by users (e.g., hacking tools that you download from GitHub).

       / tmp (temporary): This is a temporary folder used temporarily; the contents are wiped after each reboot. The tmp folder is a good place to download your tools for privilege escalation once you get a limited shell.

       / usr (user): This directory contains many subdirectories. In fact, /usr/share is a folder that you need to memorize because most of the tools that you use in Kali Linux (e.g., Nmap, Metasploit, etc.) are stored there, and it contains the wordlists dictionary files ( /usr/share/wordlists/ ).

       / home : This is the home for Kali Linux users (e.g., /home/john/ ).

       / root : This is the root user home directory.

       / srv (serve): This folder holds some data related to system server functionalities (e.g., data for FTP servers).

       / var (variable): This folder holds variable data for databases, logs, and websites. For example, /var/www/html/ contains the files for the Apache web server.

       / run (runtime): This directory contains runtime system data (e.g., currently logged‐in users).

      Terminal Window Basic Commands

      There are lots of common commands that we use as penetration testers on a daily basis. Many of these commands will be listed in the upcoming sections or later in this book. In this section, you will see all the general standard tools that I personally use frequently. You will also learn the basic commands that are identified for general use.

      First, to open the terminal window from the desktop, you can use the Ctrl+Alt+T key combination instead of opening the application from its icon using the mouse cursor.

      kali@kali:~$ cat -h cat: invalid option -- 'h' Try 'cat --help' for more information. kali@kali:~$ cat --help Usage: cat [OPTION]… [FILE]… Concatenate FILE(s) to standard output. With no FILE, or when FILE is -, read standard input. -A, --show-all equivalent to -vET -b, --number-nonblank number nonempty output lines, overrides -n -e equivalent to -vE -E, --show-ends display $ at end of

Скачать книгу