Kali linux on raspberry pi zero w

Kali linux on raspberry pi zero w

The Raspberry Pi Zero W P4wnP1 A.L.O.A. (A Little Offensive Application) image is a highly customized version of Kali Linux. It allows you to connect the Raspberry Pi to a computer, and send commands, or use its networking, all without having to interact with it, although you can do that too!

The P4wnP1 A.L.O.A software includes a number of features that the original P4wnP1 had such as Plug & Play USB device emulation, and Wi-Fi via a modified copy of the Nexmon firmware which allows for KARMA attacks, Bluetooth support, Wi-Fi covert channel, and while monitor mode is included, it is NOT supported, but also adds HIDScript which is similar to DuckyScript for payloads but based on JavaScript.

Currently the P4wnP1 A.L.O.A. image only supports the Raspberry Pi Zero W, not Zero 2 W.

Quick install and usage

  1. Download and validate the Kali Linux Raspberry Pi Zero W P4wnP1 ALOA image from the downloads area. The process for validating an image is described in more detail on Downloading Kali Linux.
  2. Use the dd utility to image this file to your microSD card. In our example, we use a microSD which is located at /dev/sdb . Change this as needed.

This process will wipe out your microSD card. If you choose the wrong storage device, you may wipe out your computers hard disk.

This process can take a while, depending on your PC, your microSD card’s speed, and the size of the Kali Linux image.

  1. Once the dd operation is complete, plug the microSD card into your Raspberry Pi Zero W.
  2. From another computer, connect to the default wireless network 💥🖥💥 Ⓟ➃ⓌⓃ🅟❶ of P4wnP1 A.L.O.A. with the password MaMe82-P4wnP1
  3. Once you are connected to the P4wnP1 A.L.O.A. wireless network, you can access the system via either:
  • The web interface (http://172.24.0.1:8000)
  • Command line using SSH ( ssh [email protected] ), then run the P4wnP1_cli command
  • Locally compile the P4wnP1 A.L.O.A. CLI software, and pass host along with your commands

One of the important customizations of this Kali Linux image, is that both the root and kali users can SSH in. The root user has the default password of toor .

Features

P4wnP1 A.L.O.A. by MaMe82 is a framework which turns a Raspberry Pi Zero W into a flexible, low-cost platform for pentesting, red teaming and physical engagements… or into “A Little Offensive Appliance”.

P4wnP1 A.L.O.A. is not meant to:

  • Be a “weaponized” tool
  • Provide RTR payloads, which could be carried out by everybody, without understanding what’s going on or which risks are involved
  • Be a flexible, low-cost, pocket sized platform
  • Serve as enabler for tasks like the one described here
  • Support prototyping, testing and carrying out all kinds of USB related tasks, commonly used during pentest or redteam engagements, without providing a finalized static solution

P4wnP1 A.L.O.A. provides a configuration, which utilizes the given components to do the following things:

  • Drive-by against Windows hosts in order to deliver in-memory client code to download stage2 via HID covert channel, based on keystroke injection (HIDScript)
  • Starting the keystroke injection, as soon as P4wnP1 is connected to a USB host (TriggerAction issuing HIDScript)
  • Bring up the stager, which delivers the Wi-Fi covert channel client agent via HID covert channel, as soon as the keystroke injection starts (TriggerAction running a bash script, which again starts the external server)
  • Bring up the Wi-Fi covert channel server, when needed (same TriggerAction and BashScript)
  • Deploy a USB setup which provides a USB keyboard (to allow keystroke injection) and an additional raw HID device (serves as covert channel for stage2 delivery) — the USB settings are stored in a settings template
  • Deploy a Wi-Fi setup, which allows remote access to P4wnP1, in order to allow interaction with the CLI frontend of the Wi-Fi covert channel server — the Wi-Fi settings are stored in a settings template
  • Provide a single point of entry, to deploy all the needed configurations at once (done by a Master Template, which consists of proper Wi-Fi settings, proper USB settings and the TriggerActions needed to start the HIDScript)
Читайте также:  Amd linux drivers ubuntu

The best place for up to date information is on the project’s README.

If you need a reminder of the default passwords again:

Problems, questions, feedback? Join us in the forums

Updated on: 2023-May-30
Author: steev

Источник

Pi-Tail

Optional: – Run “ vncserver ” in the Pi-Tail, fire up a vnc viewer on your phone and connect to 127.0.0.1:5901 Note: Give it a few minutes when you connect for the first time. It’s going to be quicker next time around. It’s still much faster to stick to the command line though. For more info about how to tunnel a vnc connection through ssh, check out this thread.

Read /boot/Pi-Tail.README & /boot/Pi-Tail.HOWTO for more information and tethering options

How it works:

The Pi-Tail is running Kali Linux and your smartphone acts as the power supply, screen, keyboard and mouse. Awesome team work.

The network configuration can be prepared offline making it the perfect field companion. Just write the image to a micro-sd card, adjust /boot/interfaces and /boot/wpa_supplicant.conf to fit your tether requirements, insert the card into your pi and hook it up to your mobile. For bluetooth tethering, just add your smartphone’s mac address into /boot/pi-tailbt.conf .

Pi-Tail checks during boot if ethernet gadget mode is enabled and if not, it will automatically switch to mass storage gadget mode. That means it appears to your mobile phone as a usb stick. You can now edit the network configuration with your phone.

During the boot process, Pi-Tail will pick up your network config and copy it across to the system partition. The effective config is copied back to /boot/interfaces.active and /boot/wpa_supplicant.active for offline troubleshooting.

Enable “wifi hostspot” or “usb tethering»on your phone and the Pi-Tail should connect automatically. Bluetooth works the other way: You have three minutes after boot up to pair with your Pi-Tail.

Open ConnectBot on your mobile and connect to the Pi-Tail. Configure port forwarding and fire up a vnc viewer of your choice and you can enjoy kali linux in all it’s glory on the go.

Читайте также:  Посмотреть подключенные usb устройства linux

Default Wi-Fi: You can use the example config files. Just change your smartphone’s SSID to “ sepultura ” with the password “ R4t4m4h4tt4 ” and your Pi-Tail will tether straight away.

Problems, questions, feedback? Join us in the forums: https://forums.kali.org/

Updated on: 2023-Mar-13
Author: re4son

Источник

Установка Kali Linux на raspberry pi Zero W. ⁠ ⁠

Для установки вам понадобится HDMI-дисплей, к которому можно подключить Pi, а также Wi-Fi сеть для полноценной работы встроенной беспроводной карты (тут можно попробовать использовать точку доступа вашего телефона).

Шаг 1. Скачайте образ, который не покажет вам радугу

Сначала скачайте вот этот образ из блога Re4son(Это кастомный образ Kali для Pi Zero W, который не выдаст вам радужный экран.

Шаг 2. Запишите образ на SD-карту

Эта часть будет такой же, как в нашем последнем посте на эту тему. Если вы используете Windows, то для записи образа вы можете воспользоваться Win32 Disk Imager. Для Mac вы можете использовать инструмент ApplePiBakerили Etcher. Если это в вашем случае вызывает какие-то ошибки, то лучший в этом случае способ создания загрузочной SD-карты — через терминал.

На Mac перед подключением SD-карты запустите в терминале следующую команду:

Эта команда отобразит список всех подключенных к вашей системе дисков. Потом вставьте вашу SD-карту и снова запустите эту команду. Обратите внимание на имя файловой системы на вашей SD-карте (это та, которая не была там раньше). Это должно выглядеть таким образом: «/dev/disk2s1», и вы должны быть очень внимательны, чтобы ничего не перепутать на последующих шагах, иначе вы можете перезаписать ваш жесткий диск.

Теперь мы будем использовать команду dd для загрузки образа Kali на карту. Сначала размонтируем ее раздел, чтобы вы могли записать хоть что-то на нее. Это делается при помощи команды ниже, где «x» — нужный номер диска:

sudo diskutil unmount /dev/diskX

Затем, чтобы загрузить образ на SD-карту, выполните в консоли следующую команду. Если после первого номера диска (например, rdisk2s1) есть буква «s», то не вставляйте эту «s» и следующий за ней номер. Итак, «rdisk2s1» должен выглядеть как «rdisk2». Вот как эта команда должна выглядеть в итоге:

sudo dd bs=1m if=путь_до_образа_Kali of=/dev/rdiskX

Чтобы начать процесс записи, нажмите «Enter» и обратите внимание, что команда dd не выдает на экран никакой информации о ходе процесса, если, конечно, не произойдет какая-нибудь ошибка или пока процесс не завершится. Чтобы просмотреть прогресс выполнения во время записи, вы можете нажать Ctrl + T. Подождите, пока процесс завершится. Вы узнаете, что процесс записи завершен, когда увидите информацию о количестве записанных байт.

Благодаря Re4son, у нас уже есть настроенный SSH и уже настроено множество других полезных параметров. Подключите адаптер HDMI к дисплею, подключите OTG-хаб, Bluetooth клавиатуру/мышь, антенну и источник питания. Вставьте SD-карту, и чтобы загрузить Pi Zero W, подключите питание (т.к. кнопки включения у нее нет).

У нее есть порт Micro-USB для питания и другой — для USB-адаптера. Вы должны подключить питание к разъему Micro-USB к внешней стороне платы, как в нашем примере на фото.

После загрузки в Kali Linux введите имя пользователя root и пароль toor. Вам нужно будет обновить дистрибутив, чтобы получить полную функциональность, поэтому не волнуйтесь, если картинка на мониторе будет выглядеть немного странно.

Читайте также:  Linux file hosting server

Читать также: Как безопасно пользоваться публичным Wi-Fi

Шаг 4. Устранение проблем в процессе обновления

После большого количества проб и ошибок мы смогли подключиться только к незащищенным сетям, поэтому мы просто создали на смартфоне незащищенную беспроводную точку доступа, чтобы можно было к ней подключить Pi. Мы также слышали о том, что можно обновить систему, если подключить к контактам GPIO кабеля USB-TTL для питания и первой загрузки Pi Zero W, но сами мы этот способ не пробовали, т.к. для него нужна пайка (хотя он работает на полноразмерном Pi).

Как только Kali Linux загрузится, найдите значок Wi-Fi в правом верхнем углу экрана. Кликните на него, чтобы посмотреть на доступные сети и подключиться к открытой беспроводной сети, используя горячую точку вашего телефона (если необходимо). Как только Pi будет подключен, мы запустим обновление в терминале с помощью команды:

sudo apt update && sudo apt full-upgrade

Поскольку службы Bluetooth по умолчанию отключены, то вы можете запустить их, выполнив следующую команду.

sudo systemctl enable bluetooth && sudo systemctl enable hciuart

Шаг 5. Очистка и настройка

Нам нужно изменить стандартные SSH-ключи, для этого нужно выполнить в консоли следующее:

cd /etc/ssh/ mkdir insecure_old mv ssh_host* insecure_old/ dpkg-reconfigure openssh-server

Кроме того, чтобы убедиться, что вы не используете пароль по умолчанию, измените пароль пользователя root, набрав в консоли:

Шаг 6. Включение автоматического входа в систему

Наш образ с системой идет уже с предварительно настроенным SSH, но для его использования нам нужно включить автологин. Для этого нужно изменить некоторые параметры конфигурации системы. В терминале выполните:

Удалите решетки (#) перед следующими строками:

pam-autologin-service = PAM service to use for autologinautologin-user=root autologin-user-timeout=0

Убедитесь, что часть для автоматического входа выглядит так, как это показано на скриншоте ниже.

Сохраните изменения и выйдите с помощью Ctrl+X, затем введите:

Вам нужно будет изменить эти три строки, начиная со строки 11:

# Allow access without authentication auth required pam_succeed_if.so user != root quiet_success auth required pam_permit.so

# Allow access without authentication ###auth required pam_succeed_if.so user != root quiet_success auth required pam_permit.so

Сохраните изменения и закройте nano. Теперь у вас должен работать автологин. Перезагрузитесь, чтобы проверить, работает ли функция автологина. Если да, то вы можете войти в систему через SSH с вашего телефона или ноутбука. Если у вас возникли проблемы, тогда перейдите в директорию /etc/pam.d/, удалите «lightdm-autologin» и запустите следующую команду:

Шаг 7. Тест SSH & Autologin

Подключите Pi Zero W к ближайшей точке доступа Wi-Fi с паролем, чтобы убедиться, что карта Wi-Fi работает правильно, а затем запустите ifconfig, чтобы узнать IP-адрес внутренней беспроводной карты Pi Zero W, wlan0.

С компьютера или телефона, подключенного к той же беспроводной сети, подключитесь к Pi Zero W, набрав в терминале:

Введите пароль, который вы изменили на шаге 5. Если вы видите сообщение дня, вы знаете, что все работает как нужно! Чтобы создать свой собственный экран MOTD (сообщения дня), введите следующую команду после того, как войдете в Pi Zero W:

Удалите содержимое и вставьте все, что вы хотите показывать при каждом входе в систему.

Источник

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