Как установить docker kali linux

Installing Docker on Kali Linux (updated for 2021.1)

Sep 28, 2017 · 3 min read

February 2021 update:

  • These instructions have been tested and are working on Kali Linux 2021.01
  • At the same time, Docker version that is available through Kali repositories is now quite fresh, so the easiest way to install Docker, unless you absolutely need the latest version, is:
    sudo apt-get update && sudo apt-get install -y docker.io
    at the time of writing, you actually get the same version ( 20.10.3 ) using both methods, which might diverge in the future.
  • Instructions below also make use of the new way of adding package signing keys to the system as apt-key is being deprecated (note, Docker documentation hasn’t been appropriately updated yet). More details here:https://github.com/docker/docker.github.io/issues/11625

This is a quick guide on how to install Docker Engine on Kali Linux using official Docker repositories, see the note above about OS-provided packages. These steps have been tested on Kali 2021.1.

This guide is based on official Docker documentation (https://docs.docker.com/engine/installation/linux/docker-ce/debian/), with slight modification as adding a repository doesn’t work (we’re adding Debian repository to Kali distro).

Raspberry Pi instructions have been tested to work on both 32-bit and 64-bit Kali Linux.

Since Kali Linux 2020.1, a non-root user is created by default, details here — https://www.kali.org/news/kali-default-non-root-user/ .

Kali has a myriad of tools, but it you want to run a tool that is not included, the cleanest way to do it is via a Docker container. As an example, I was looking into a tool called changeme (https://github.com/ztgrace/changeme) that scans for default passwords, released at DerbyCon 7. Doing it the Docker way:

was easy and didn’t pollute the rest of the system with python dependencies etc. Also, there is an older version of the tool included in Kali package repositories, with Docker you can try new versions of existing tools without any library version conflicts etc.

I’m no Docker expert by any means, so if you’ve used Docker on Kali, feel free to share what you liked about it.

Preparation

Before starting, ensure your Kali Linux is fully up to date.

Add Docker PGP key (saved to /usr/share/keyrings/ ):

Configure Docker APT repository (Kali is based on Debian testing, which will be called buster upon release, and Docker now has support for it):

For Raspberry Pi 32-bit — use the following command instead:

For Raspberry Pi 64-bit — use the following command instead:

Install Docker

If you had older versions of Docker installed, uninstall them:

For Raspberry Pi, use the following command instead:

( aufs-dkms package errors out when trying to install on Raspberry Pi, by using —no-install-recommends switch we avoid the issue by not installing aufs-dkms , and Docker still works fine.)

To allow your non-root user to use Docker, add the user to docker group:

Читайте также:  Какое лучше ядро linux

Log out and log back in for this change to apply. Note a warning from Docker documentation: the docker group grants privileges equivalent to the root user. For details on how this impacts security in your system, see Docker Daemon Attack Surface.

Источник

Docker в Kali Linux

Здесь задаём вопросы, обсуждаем проблемы по использованию Docker в Kali Linux.

Также делимся интересными способами использования Docker или об интересных контейнерах Docker.

Общая информация о Docker

Концепция Docker в упаковке программ и целых операционных систем в контейнеры. Эти контейнеры легко развёртывать (устанавливать). Их можно быстро сбросить до исходного состояния. Можно иметь несколько одинаковых программ с разными настройками. Программа распространяются с уже необходимыми зависимостями — легко устанавливать.

Кроме достоинств есть ряд недостатков и неудобств: проблемы с прямым доступом к железу, графическому интерфейсу, если вам нужна какая-то программа, то в нагрузку к ней идёт вся операционная система (!) и другие проблемы и недостатки.

ИМХО, сильно на любителя. Но нужно уметь работать с Docker хотя бы для из-за того, что некоторые авторы в качестве предпочтительного способа распространения своих программ используют Docker.

Как установить Docker в Kali Linux

Как использовать Docker в Kali Linux

Поиск контейнера, к примеру, с airgeddon:

После того, как вы решили, какой образ использовать, вы можете загрузить его на вашу машину используя подкоманду pull:

Кстати, обновление контейнера выполняется точно также:

После загрузки образа вы можете запустить контейнер с загруженным образом подкомандой run. Если на момент выполнения подкоманды run образ ещё не был загружен, клиент Docker сперва загрузит образ, а затем запустит контейнер с этим образом:

Для просмотра образов, загруженных на вашу машину, введите:

В качестве примера запустим контейнер, использующий последнюю версию образа Kali Linux. Комбинация ключей -i и -t позволяет осуществлять интерактивный доступ к контейнеру:

Помните, что при каждом «обычном» запуске создаётся новый клон контейнера. Для запуска ранее запущенного контейнера, его нужно указывать явно.

Подборка материалов, которые я переводил про Docker:

Источник

Как установить Docker на Kali Linux?

В этой заметке я расскажу простыми словами, что такое Docker и для чего он нужен, а также рассмотрим его пошаговую установку в операционной системе Kali Linux.

Что такое Docker?

Docker — это программная платформа (PaaS), написана на языке Go и основана на контейнерной виртуализации (контейнеризация), которая действует на уровне ядра операционной системы и предназначена для создания изолированных виртуальных стандартизованных блоков (контейнеров), а также управления ими. Каждый контейнер изолирован друг от друга, в него можно упаковать любую программную среду, например поместить готовое к запуску приложение, со всем стеком: библиотеками, драйверами, конфигурациями, зависимостями, компонентами и т.д. По-сути, Docker это мини-виртуальная машина, которую можно скачать и установить на любом компьютере с поддержкой Docker. Идеально подойдет для разработки, тестирования и развертывания программного обеспечения, независимо от платформы и среды. Сам Docker легко интегрируется в любой Linux-дистрибутив. Для Windows — существует отдельное десктопное приложение.

Кому пригодиться Docker?

Данная технология изначально создана для программистов и DevOps-инженеров, которым нужно обеспечить непрерывное развертывание и тестирование своих приложений (CI/CD), независимо от рабочего окружения. Но постепенно спектр ее применения разросся и сейчас, к примеру, множество интересных программ и утилит для Linux поставляются сразу в виде готовых Docker-образов, которые скачиваются и запускаются на вашей хост-машине. Это комфортно, так как не нужно волноваться о возможных ошибках установки пакетов и фиксить зависимости (отсутствующие библиотеки, которые требуются для запуска приложения). Также Докер-контейнеры могут быть полезны при веб-разработке, развертывании приложений на сервере, использующие различные версии софта или конфликтующие библиотеки. Пример: упаковал сложное веб-приложение вместе со средой запуска, перенес на сервер с поддержкой Docker, быстро развернул, запустил, протестировал, отправил на продакшн.

Установка Docker в Kali Linux

Установка Docker в Kali Linux не займет много времени:

sudo apt update
sudo apt install docker.io
sudo systemctl enable docker.socket

Читайте также:  Microsoft windows usb support

Базовые команды Docker для терминала Linux

docker pull image //загрузка образа
docker run image //запуск образа
docker ps //просмотр запущенных контейнеров
docker stats //статистика использования ресурсов
docker logs container //просмотр логов контейнера
docker stop container //остановка контейнера
docker kill container //убить контейнер
docker rm container //удаление контейнера
docker rmi image //удаление образа

Недостатки Docker

И все же у Докера есть как плюсы, так и минусы. Вот некоторые из них:

  • Docker-контейнеры могут использовать больше ресурсов ядра, по сравнению с обычными приложениями;
  • Docker на самом деле не гарантирует вам 100% безопасность, а поэтому требует тонкой настройки со стороны Cybersecurity-специалиста (разобраться с привилегиями и правилами фаервола, не загружать контейнеры из ненадежных источников, использовать средства защиты на уровне ядра и т.д.).
  • Некоторая сложность с самостоятельной сборкой контейнеров и docker-compose — программное средство для совместного использования контейнеров. Пригодиться, если необходимо, например, соединить linux, nginx, php и mysql (организовать LEMP стек). Но инструмент не такой легкий, как может показаться, и требует детального обучения.
  • Docker не хранит ваши файлы. То есть, у него нет встроенного хранилища (в отличие от прямого конкурента — Google Kubernetes). При перезагрузке контейнера данные будут утеряны.
  • Docker «заточен» в основном под Linux-ядро. Поэтому, его сложно назвать кроссплатформенным.

Источник

How to Install Docker on Kali Linux 2020.1

Figure 1 Docker

Docker Usage

Working as a pentester, you would not limit your usage to the pre-installed tools within Kali Linux. You would have to use a lot of different tools from different repositories. Installing these tools in your Kali Linux root repository is time consuming when you have many tools to install. Docker is a run-time container for all tools and creates isolated containers for you to install your tools.

Step 1: Configure APT Keys

Always perform APT updating:

Step 2: Get PGP Key for official Docker

Step 3: Configure APT to Download, Install, and Update Docker

If everything is set up properly, then you will see a terminal window that appears as follows:

Step 4: Install Docker

The installation process I am following is given in Docker official documentation but as it has some minor bugs, I have added some commands to ensure proper installation. For this purpose, the following set of commands should be executed:

Step 5: Update the APT Again

Step 6: Terminate Outdated Versions Previously Installed

Step 7: Install Docker on Kali System

In the above command, “-y” stands for the “yes” condition. When installing a tool in the terminal, the user will be asked for permission to install the tool.

If the above steps have been performed correctly, than you will be able to see the following output on your terminal window:

Step 8: Start the Docker Container

(Optional) Step 9: Set up Docker to Start Automatically on Reboot

This is an optional feature command; it will start Docker every time your OS boots. If you do not perform pentesting a lot, then you do not need to enable this feature.

Step 10: Verify Installation

The following command is taken from Docker official documentation. This command verifies if Docker is working.

The warning you see on the terminal window is normal, and Docker is working successfully. You should be able to see the following text on your terminal window:

Conclusion

Docker is a useful tool for penetration testing, and it is becoming more popular day by day. It can be helpful to work inside an isolated container, particularly while working with pentesting.

About the author

Younis Said

I am a freelancing software project developer, a software engineering graduate and a content writer. I love working with Linux and open-source software.

Источник

Install Docker in Kali Linux and Run Other OS

Docker can replace the virtual machines in future. For being a container based docker can run application using it’s own engine. It is isolated but share OS and where appropriate, bin/libraries to know about docker we can check this article.

Читайте также:  Скрины для установки windows

Now we learn how we can install docker in our Kali Linux machine.

For the newer versions of systems like Kali Linux 2020 versions doesn’t need lengthy process. There we can use one simple command to install docker:
This command will install docker on our system.

Docker installation Older Method

If we are in any older system then we need to follow this guide to install docker on our machine.
First we need to add docker gpg key. We can do it by using following command:-

If it ask for the sudo password then we provide it and press Enter. Basically it will add Debian Linux’s gpg key in our Kali Linux and will show us «OK» if the process become successful as following screenshot.

If we want to use docker we need to add it’s repository in our system. So we open the sources.list file in our /etc.apt/sources.list on mousepad text editor by using following command:

deb [arch=amd64] https://download.docker.com/linux/debian buster stable

This is shown in following screenshot.

Then we save and close it. Now we update our system using following command:

This update command will update our docker repository as per following screenshot.

Now we can simply install the docker by applying following command:

This command will install the docker system. The screenshot is following.

This process will take some time depending on our internet speed.

After installation we can check docker’s help menu by using simply add docker command:

Using Docker Services

Let’s start the docker service by using following command:

Now we check that our installation is correct is correct or not by using following command:

Running this command will check for hello world in our local ant there is nothing then it download hello world from docker’s repository, then show us a hello message as shown in following screenshot:

If hello-world works then we have successfully installed docker, now we can install other OS images using docker. We can see the list of available official images in docker’s official website.

We can pull images from the website by running command:

Then we can run it. We also can pull and run images directly.

For an example we directly pull and run Ubuntu in our Kali Linux system. To do that use use following command:-

Installing Ububtu in our Kali Linux using docker

In the above screenshot we can see docker is downloading Ubuntu which size is 26 MB. Only 26 MB of Ubuntu yes we are not kidding. Isn’t it really cool ?

Let the process finish. This process will take some time depending on our internet speed, and will automatically run Ubuntu as shown in following screenshot.

Now wee are in Ubuntu terminal. Let’s check it by applying following command:

In the following screenshot we can see that we are not in Kali Linux and we are in the Ubuntu 18.

Ubuntu in Kali Linux using Docker

This is how we can run other OS like debian, fedora and even Windows in our Kali Linux with very little image file size using docker.

We can check the docker service status with the help of following command:

To see the locally saved docker images we simply run:

This is how we can install and use docker in our Kali Linux. If we miss anything or got some issue in docker comment down, we always happy to help. Follow our blog for more tutorials and follow us on Twitter and Medium for quick updates.

Источник

Оцените статью