- HackWare.ru
- Этичный хакинг и тестирование на проникновение, информационная безопасность
- Как добавить репозитории Kali Linux в другой дистрибутив
- Что даст репозиторий Kali Linux?
- Что происходит при добавлении репозиториев других дистрибутивов Linux
- В какие дистрибутивы можно добавить репозитории Kali Linux
- Инструкция по добавлению репозиториев Kali Linux (на примере Linux Mint)
- Полное превращение системы в Kali Linux
- Ethical hacking and penetration testing
- InfoSec, IT, Kali Linux, BlackArch
- How to add Kali Linux repositories to another Linux distribution
- What will the Kali Linux repository give?
- What happens when adding repositories of other Linux distributions
- What distributions can Kali Linux repositories be added to
- Manual for adding Kali Linux repositories (using Linux Mint as an example)
- Complete system conversion to Kali Linux
- Adding repositories kali linux
- Default Network Repository Value
- Switching Branches/Regular Repositories
- Sources.list Format
- Default Offline Install Values
- Non-Kali Repositories
- Mirrors
- Source Repositories
HackWare.ru
Этичный хакинг и тестирование на проникновение, информационная безопасность
Как добавить репозитории Kali Linux в другой дистрибутив
Начну с самого главного — с серьёзного предупреждения: эта операция вполне может убить ваш дистрибутив и сделать его непригодным для использования! Это вполне реальная возможность всё поломать из-за несовместимости пакетов!
Что даст репозиторий Kali Linux?
После всех этих страшных предупреждений, возникает вопрос, зачем так рисковать? Если вы добавите репозиторий другого дистрибутива, то вы сможете установить его пакеты. Например, если в Linux Mint добавить репозитории Kali Linux, то можно установить программы Kali Linux в Linux Mint.
Что происходит при добавлении репозиториев других дистрибутивов Linux
При добавлении любых новых репозиториев, после обновления кэша пакетов, пакеты из новых репозиториев становятся доступны для установки, а также для обновления существующих в системе пакетов.
Репозитории могут содержать одинаковые пакеты, но разных версий. При выполнении обновлений, более новые пакеты заменят пакеты предыдущих версий в системе. Поскольку исходные пакеты дистрибутива могут не сочетаться с пакетами другого дистрибутива, то система может перестать нормально работать после обновления. Причём если первое обновление прошло нормально, это не означает, что в результате какого-нибудь последующее что-нибудь не случиться.
Можно значительно снизить опасность от репозиториев Kali Linux, но при этом пользоваться преимуществами этого дистрибутива — с помощью установления репозиторию Kali Linux более низкого приоритета — об этом будет рассказано ниже.
В какие дистрибутивы можно добавить репозитории Kali Linux
Для этого подходят только дистрибутивы на основе Debian, то есть сама Debian, а также Linux Mint, Ubuntu и пр.
Инструкция по добавлению репозиториев Kali Linux (на примере Linux Mint)
Мы не только правильно добавим репозитории, но и настроим низкий приоритет репозиториев Kali Linux, благодаря этому:
- при автоматическом обновлении пакеты Kali Linux не будут заменять пакеты основного дистрибутива, даже если у Kali Linux более новые версии
- можно будет устанавливать любые программы Kali Linux
- при выходе новых версий программ Kali Linux, они будут автоматически обновляться вместе с остальными пакетами в системе
То есть мы получаем преимущества Kali Linux, но не рискуем испортить свой дистрибутив (хотя всякое может случиться).
Начните с полного обновления вашей системы:
Затем перезагрузитесь — то есть мы получили полностью обновлённую систему, в которой команда
должна выводить следующее:
Выполним проверку — попробуем установить программу WPScan в Linux Mint:
Этот пакет отсутствует, поэтому ожидаемая неудача:
Добавляем репозитории Kali Linux:
Чтобы убедиться, что новые репозитории добавлены, вновь попытаемся обновить кэш приложений:
Операция должна завершиться ошибкой:
Если система на английском языке, то будет примерно так:
Это нормально — так и должно быть.
Для последующей операции нам понадобиться пакет gnupg, установим его:
Теперь, чтобы система смогла верифицировать пакеты Kali Linux, нужно добавить публичный ключ данного дистрибутива. Скачиваем его и добавляем следующими командами:
Теперь вновь обновляешь кэш (но ни в коем случае не обновляем систему — иначе всё сломается и она у вас больше не загрузиться):
Как можно убедиться, нам предлагается обновить более полутора тысяч пакетов — НЕ делаем этого.
Теперь нам нужно установить правильный приоритет для пакетов из репозиториев Kali Linux: у них будет более низкий приоритет чем у остальных, в результате пакеты Kali Linux (например, ядра) не будут устанавливаться автоматически, но вручную вы сможете установить любые пакеты, которые вам нужны.
Или попросту создайте файл /etc/apt/preferences.d/kali.pref со следующем содержимым:
Вновь обновляем кэш пакетов:
Как можно увидеть, теперь репозиторий Kali Linux не оказывает влияние на систему при её обновлении:
Но зато если мы попытаемся установить WPScan, который ранее мы не смогли найти в репозиториях, то теперь всё пройдёт успешно. Хотя есть нюансы — программа apt не справится с этой задачей:
Проблема будет в том, что у пакета wpscan есть зависимости, эти зависимости присутствуют в репозиториях Kali Linux, но что-то не даёт программе apt справится с их установкой.
Поэтому для установки пакетов Kali Linux мы будем использовать aptitude в команде вида:
Например для установки wpscan:
В этом и заключается эффект репозиториев Kali Linux (возможность установить её программы) при минимальных рисках поломать дистрибутив Linux, в который вы добавляете новые репозитории.
Тем не менее риски остаются: при установке пакетов, в зависимостях которых могут присутствовать важные компоненты системы, такие как ядро. Поэтому не рекомендуется устанавливать драйверы и модули ядра из репозитория Kali Linux (из основных репозиториев вашего дистрибутива вы можете устанавливать что угодно, в том числе и видеодрайверы и новые ядра). С подавляющем большинством другим программ проблем быть не должно.
Полное превращение системы в Kali Linux
Если вам нужна Kali Linux, то просто скачайте Live-дистрибутив и установите себе.
Но бывают ситуации, когда невозможно «просто скачать и установить» — например, при развёртывании Kali Linux на VPS хостинге. Мне пришлось решать эту задачу при развёртывании системы на DigitalOcean. Об этом примере я расскажу в следующей статье, посвящённой моему опыту работы с DigitalOcean.
Источник
Ethical hacking and penetration testing
InfoSec, IT, Kali Linux, BlackArch
How to add Kali Linux repositories to another Linux distribution
I’ll start with the most important thing, with a serious warning: this operation may kill your distribution and make it unusable! This is a very real opportunity to break everything due to incompatibility of packages!
What will the Kali Linux repository give?
After all these terrible warnings, the question arises, why take this risk? If you add the repository of another distribution, you can install its packages. For example, if you add Kali Linux repositories to Linux Mint, you can install Kali Linux programs on Linux Mint.
What happens when adding repositories of other Linux distributions
When adding any new repositories, after updating the package cache, packages from new repositories become available for installation, as well as for updating existing packages in the system.
Repositories may contain the same packages, but different versions. When performing updates, newer packages will replace packages of previous versions in the system. Since the source packages of the distribution kit may not be compatible with the packages of another distribution kit, the system may stop working normally after the upgrade. Moreover, if the first upgrade went fine, this does not mean that as a result of any subsequent upgrade something bad will not happen.
You can significantly reduce the danger from Kali Linux repositories, but at the same time take advantage of this Linux distribution. We will achieve this by setting a lower priority for Kali Linux repository; this will be described below.
What distributions can Kali Linux repositories be added to
Only distributions based on Debian are suitable for this, that is, Debian itself, as well as Linux Mint, Ubuntu, etc.
Manual for adding Kali Linux repositories (using Linux Mint as an example)
We will not only correctly add repositories, but also configure the low priority of Kali Linux repositories, thanks to this:
- with automatic updates, Kali Linux packages will not replace the main distribution packages, even if Kali Linux has newer versions
- it will be possible to install any Kali Linux programs
- when new versions of Kali Linux programs are released, they will be automatically updated along with other packages in the system
That is, we get the benefits of Kali Linux, but we do not risk spoiling our distribution (although anything can happen).
Start with a complete upgrade of your system:
Then reboot it; that is, we got a completely updated system in which the command
should output the following:
Run the test — try installing the WPScan program on Linux Mint:
This package is missing, so the expected failure:
Add Kali Linux repositories:
To make sure that new repositories are added, try again to update the apt cache:
The operation should fail:
This is normal – it should be so.
For the next operation, we need the gnupg package, install it:
Now, in order for the system to verify Kali Linux packages, you need to add the public key of this distribution. Download it and add it with the following commands:
Now you update the cache again (but at the moment DO NOT upgrade the system – otherwise everything will break and you will not be able to boot anymore):
As you can see, we are invited to upgrade more than one and a half thousand packages – DO NOT do this.
Now we need to set the correct priority for packages from Kali Linux repositories: they will have a lower priority than the others, as a result, Kali Linux packages (for example, kernels) will not be installed automatically, but manually you can install any packages that you need.
Run the command:
Or simply create the file /etc/apt/preferences.d/kali.pref with the following contents:
Updating the package cache again:
As you can see, now the Kali Linux repository does not affect the system when it is updated:
But if we try to install WPScan, which we could not find in the repositories earlier, then now everything will be successful. Although there are nuances – the apt program will not cope with this task:
The problem will be that the wpscan package has dependencies, these dependencies are present in the Kali Linux repositories, but something prevents the apt program from installing them.
Therefore, to install Kali Linux packages, we will use aptitude in a command of the form:
For example, to install wpscan:
This is the effect of Kali Linux repositories (the ability to install its programs) with minimal risk of breaking the Linux distribution into which you add new repositories.
Nevertheless, the risks remain: when installing packages, in the dependencies of which important components of the system, such as the kernel, may be present. Therefore, it is not recommended to install drivers and kernel modules from the Kali Linux repository (you can install anything from the main repositories of your Linux distribution, including video drivers and new kernels). With the vast majority of other programs should not be a problem.
Complete system conversion to Kali Linux
If you need Kali Linux, then just download the Live distribution and install it for yourself.
But there are situations when it is impossible to ‘just download and install’ — for example, when deploying Kali Linux on VPS hosting. I had to solve this problem when deploying the system to DigitalOcean. I’ll talk about this example in the next article about my experience with DigitalOcean.
Источник
Adding repositories kali linux
The topic of repositories is always a large one, and comes up frequently. It is an item which people often get wrong and confused with. Please take the time to read the information below and any references which is linked to before acting on anything.
Default Network Repository Value
On a standard, clean install of Kali Linux, with network access, you should have the following entry present in /etc/apt/sources.list :
If the output doesn’t exactly match up to the above output, you may not be able to install any new additional packages or receive updates. This may happen for any number of reasons, such as:
- You have switched your branch.
- Using a different hardcoded mirror.
You will probably want to read the “switching branches” section to alter this.
Since Kali 2020.3, after Kali’s setup is complete, network repositories will be enabled by default, even if there was no network access during installation.
Switching Branches/Regular Repositories
Kali has various different branches to choose from (please take the time to read which one would be the best option for your setup), and you may be able to switch or include additional repositories.
kali-rolling (Default & frequently updated):
kali-last-snapshot (Point release so more “stable” & the “safest”):
kali-experimental (Packages which are under testing — often used with the rolling repository):
Sources.list Format
- Archive is going to be deb (Regular Binary) or deb-src (Source), depending if you want a package or the source of the package.
- Mirror should be http.kali.org/kali as this is our load balancer, which will direct you to best mirror.
- Branch is what version of Kali you wish to use.
- Component is what packages you wish to use, based on the Debian Free Software Guidelines (DFSG). Kali defaults to everything.
Default Offline Install Values
During the Kali setup process, if you don’t have access to a network connection to reach a repository, you will perform an offline installation of Kali Linux. You will be limited to the packages & the version which is on the medium you installed Kali from. This will then configure Kali to continue to use this medium to install packages from, even after Kali has been installed.
This means you will not get any updates to packages, or any new additional tools, which can be frustrating. You can see if you the offline media enabled if your values match up with whats below (or if you want to enable this option):
If your output matches whats above, please see the switching branch section, if you wish to receive updates.
However, if you do have network connection, which has access to network repositories, it will be enabled for you. You don’t need to do anything.
Non-Kali Repositories
If you want to install additional tools and software (such as signal) outside of what Kali has to offer, you may need to include an extra repository for this to happen. Please do not alter /etc/apt/sources.list , as this is used for the Kali Linux Operating System. Any extra tools and software needs to be placed into their own file in the directory /etc/apt/sources.list.d/ (such as /etc/apt/sources.list.d/repo-name.list , replacing repo-name with the mirror name). It is highly recommended that each mirror should be in its own file.
By adding Kali’s repository to a non-Kali OS (such as trying to add Kali to Ubuntu), this will highly increase the chance of your system not working. It may not happen straight away, but without any warning, it may break. We will not be able to offer support (and based on what we have seen over the years, most other OS will not help too).
Likewise, adding other operating system’s repositories into Kali (such as trying to put Ubuntu on Kali), will break your installation. This is the single most common reason why Kali Linux systems break.
If any guides are telling you to do anything else than the above, this is unofficial advice, and completely not supported by Kali Linux. More often than not, users in this case end up doing a reinstall after learning this lesson.
Mirrors
We have a list of official Kali Linux mirrors, as well as a guide on how to setup your own. This may be kept as a local repository which is only accessible on a LAN, or a remote private one, or if you have the ability to, you may wish to share back to the community and make it public allowing for anyone else in your geographical area to benefit from it.
Source Repositories
By using a deb in the repositories, it will allow for binary packages to be downloaded. However, should you require the source to a package (so you can compile the package yourself if you so wish, or look into debugging a problem with a package), you can add deb-src as a extra line in the repositories.
We used kali-rolling for the branch above, but you can select any value you wish.
Updated on: 2021-Sep-27
Author: g0tmi1k
Источник