PEN-103
Linux is just the name of the kernel, a piece of software that handles interactions between the hardware and end-user applications.
Linux distribution, on the other hand, refers to a complete operating system (OS) built on top of the Linux kernel
Xfce is Kali Linux’s Default Desktop Environment
A rolling distribution has many benefits but it also comes with multiple challenges, both for those of us who are building the distribution and for the users who have to cope with a never-ending flow of updates and sometimes backwards-incompatible changes.
Relationship with Debian
The Kali Linux distribution is based on Debian Testing.
Managing the Difference with Debian
The Kali Package Tracker helps us to keep track of our divergence with Debian.
Purpose and Use Cases
Linux can also be deployed in the cloud to quickly build a farm of password-cracking machines and on mobile phones and tablets to allow for truly portable penetration testing.
Summary
Unlike most mainstream operating systems, Kali Linux is a rolling distribution, which means that you will receive updates every single day.
The Kali Linux distribution is based on Debian Testing.
Verifying Integrity and Authenticity
Now you should generate the checksum of your downloaded image and ensure that it matches what you recorded from the Kali website:
$ sha256sum kali-linux-2020.3-live-amd64.iso
1a0b2ea83f48861dd3f3babd5a2892a14b30a7234c8c9b5013a6507d1401874f kali-linux-2020.3-live-amd64.iso
Relying on PGP’s Web of Trust
For cases like this, we also provide a GnuPG key that we use to sign the checksums of the images we provide. The key’s identifiers and its fingerprints are shown here:
pub rsa4096 2012-03-05 [SC] [expires: 2023-01-16]
44C6 513A 8E4F B3D3 0875 F758 ED44 4FF0 7D8D 0BF6
uid Kali Linux Repository <devel@kali.org>
sub rsa4096 2012-03-05 [E] [expires: 2023-01-16]
This model has its own limitations so you can opt to download Kali’s public key over HTTPS (or from a keyserver) and just decide that you trust it because its fingerprint matches what we announced in multiple places, including just above in this course:
$ wget -q -O - https://archive.kali.org/archive-key.asc | gpg --import
[ or ]
$ gpg --keyserver hkps://keys.openpgp.org --recv-key 44C6513A8E4FB3D30875F758ED444FF07D8D0BF6
gpg: key ED444FF07D8D0BF6: public key "Kali Linux Repository <devel@kali.org>" imported
gpg: Total number processed: 1
gpg: imported: 1
[...]
$ gpg --fingerprint 44C6513A8E4FB3D30875F758ED444FF07D8D0BF6
[...]
44C6 513A 8E4F B3D3 0875 F758 ED44 4FF0 7D8D 0BF6
[...]
Note that you can use the following command line to verify that the downloaded file has the same checksum that is listed in SHA256SUMS
, provided that the downloaded ISO file is in the same directory:
$ grep kali-linux-2020.3-live-amd64.iso SHA256SUMS | sha256sum -c
kali-linux-2020.3-live-amd64.iso: OK
If you don’t get OK
in response, then the file you have downloaded is different from the one released by the Kali team. It cannot be trusted and should not be used.
Disable Secure Boot
While the Kali Linux images can be booted in UEFI mode, they do not support secure boot. You should disable that feature in your machine’s Setup.
What Is Linux and What Is It Doing?
The term “Linux” is often used to refer to the entire operating system, but in reality, Linux is the operating system kernel, which is started by the boot loader, which is itself started by the BIOS/UEFI.
The kernel provides a common base to all other programs on the system and typically runs in ring zero, also known as kernel space.
Relationship between APT and dpkg
A Debian package is a compressed archive of a software application. A binary package (a .deb
file) contains files that can be directly used (such as programs or documentation), while a source package contains the source code for the software and the instructions required for building a binary package.
APT is a set of tools that help manage Debian packages, or applications on your Debian system.
The magic of APT lies in the fact that it is a complete package management system that will not only install or remove a package, but will consider the requirements and dependencies of the packaged application (and even their requirements and dependencies) and attempt to satisfy them automatically.
APT retrieves its packages from a repository, a package storage system or simply, “package source”. The /etc/apt/sources.list
file lists the different repositories (or sources) that publish Debian packages.
Initializing APT
APT is a vast project and tool set, whose original plans included a graphical interface. From a client perspective, it is centered around the command-line tool apt-get
as well as apt
, which was later developed to overcome design flaws of apt-get
.
Installing Packages with APT
You can add a package to the system with a simple apt install package
. APT will automatically install the necessary dependencies:
You can also use apt-get install package
, or aptitude install package
. For simple package installation, they do essentially the same thing. As you will see later, the differences are more meaningful for upgrades or when dependencies resolution do not have any perfect solution.
Upgrading Kali Linux
We recommend regular upgrades, because they will install the latest security updates. To upgrade, use apt update
followed by either apt upgrade
, apt-get upgrade
, or aptitude safe-upgrade
. These commands look for installed packages that can be upgraded without removing any packages. In other words, the goal is to ensure the least intrusive upgrade possible. The apt-get
command line tool is slightly more demanding than aptitude
or apt
because it will refuse to install packages that were not installed beforehand.
The apt
tool will generally select the most recent version number.
For more important upgrades, such as major version upgrades, use apt full-upgrade
. With this instruction, apt
will complete the upgrade even if it has to remove some obsolete packages or install new dependencies. This is also the command that you should use for regular upgrades of your Kali Rolling system. It is so simple that it hardly needs explanation: APT’s reputation is based on this great functionality