Kali Linux Penetration Testing Bible. Gus Khawaja

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

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

Kali Linux Penetration Testing Bible - Gus Khawaja

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

do we find a package name? Let's say you want to install something that is not already installed on Kali. Then you can search the repository packages using the following command:

      $apt-cache search keyword

      Finally, if you want to install a package and you're not sure if the name exists in the repository, then you can use the apt‐cache show command:

      $apt-cache show [software name] root@kali:/# apt-cache show filezilla Package: filezilla Version: 3.49.1-1 Installed-Size: 6997 Maintainer: Adrien Cunin <[email protected]> Architecture: amd64 […]

      Process Management

      root@kali:/# apt install htop -y Reading package lists… Done Building dependency tree Reading state information… Done

      Once it's installed, you can run the htop command:

      $htop

Snapshot of HTOP.

      Another way to get the list of currently running processes is by using the ps command:

      To kill a process, you will need to identify its PID first; then you can use the kill command to get the job done:

      $kill [PID]

      If the system doesn't allow you to kill it, then you must force it to close using the ‐9 switch:

      $kill -9 [PID]

      In this section, you will get the chance to understand the basics of networking in Kali Linux. Later in the book we will come back to more advanced topics regarding networking, so make sure to understand and grasp the contents in this section.

Snapshot of Kali Networking Commands.

      Network Interface

      You must be a pro in networking to survive in the penetration testing career. It's one of the pillars of the job if you're going to execute network infrastructure penetration tests.

      PC hosts have internal IP addresses to connect with the network, and they have a public IP address to communicate with the outside world. The latter is the mission of your home router, and you don't manage it locally on your localhost. On the other hand, you must maintain the internal network IP addresses, which are either static (you define it) or automatically assigned by a DHCP server (which is generally your home router).

      IPv4 Private Address Ranges

      Internal IP addresses (aka private IP addresses) for IPv4 have multiple ranges: classes A, B, and C.

       Class A: 10.0.0.0 to 10.255.255.255 or 10.0.0.0/8 (up to 16,777,214 hosts)

       Class B: 172.16.0.0 to 172.31.255.255 or 172.16.0.0/12 (up to 1,048,574 hosts)

       Class C: 192.168.0.0 to 192.168.255.255 or 192.168.0.0/24 (up to 254 hosts)

      Let's take a quick look at our Kali host IP address. To get the information about our network interface, execute the popular ifconfig command (take note that there has been a shift to use the ip addr command lately instead of ifconfig ).

Snapshot of Kali Network Interfaces.

      There are two important facts to understand about our Ethernet adapter eth0 . First, inet 10.0.0.246 represents the Kali host IP address that was assigned automatically by the DHCP server. The second part is the netmask, which means that we're using a /24 subnet; in other words, we only need 254 hosts to be assigned on this IP range.

      The second interface is lo , which represents a local loopback; you will never touch this since the network infrastructure will need it to operate correctly.

      There are two common other interfaces that you will encounter; the first one is the wireless interface if you're connected wirelessly instead of the wire. The second is the VPN interface, if you're connected to a remote VPN server.

      Static IP Addressing

       Static IP address (it's going to be 10.0.0.20 in my case; in your case, it has to match your private IP address range)

       Subnetmask or CIDR (/24 means 255.255.255.0)

       Router/gateway IP address (my router IP address is 10.0.0.1; yours could be different)

Snapshot of Static IP Configs.

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