kali-on-cardputerzero

Kali Linux Cyberdeck Edition for M5Stack CardputerZero (arm64)

Latest Release Image Release License: MIT

Cyberdeck Edition brings together the best of three worlds: Kali Linux’s full arm64 security toolset, the handheld Linux UI foundation from Flipper One (flipctl-slint), and M5Stack CardputerZero’s pocketable hardware (Cardputer Zero, Raspberry Pi Compute Module Zero Lite / RP3A0, 512 MB LPDDR2, hardware rev v5).

Why this exists: While looking forward to Flipper One, pairing its handheld UI ideas with full Kali Linux on the CardputerZero hardware I already carry turned out to be a magical combination, turning three separate ecosystems into one pocket cyberdeck.

Instead of treating the 1.9” SPI screen as a secondary status display, the image boots straight into a native 320x170 RGB565 DRM/KMS shell (czctl) built with Slint. It pairs czctl with a built-in :8899 Browser Web KVM, 12 hosted Wayland offensive and hardware apps, a ProFont multi-zoom terminal (cz-term), and a composite USB-C OTG Arsenal, while keeping full M5Stack hardware and Cap support, optional APPLaunch switching, and an on-demand HDMI LXDE desktop within ~118 MiB idle RAM.

What Defines Cyberdeck Edition


Quick Start

Flash Prebuilt Image

  1. Download kali-cardputerzero-arm64.img.xz (~1.1 GiB) and kali-cardputerzero-arm64.img.xz.sha256 from the latest GitHub Release (linked in the release badge above).
  2. Write the image to a 16 GB+ microSD card:
    • Raspberry Pi Imager / BalenaEtcher: select Use custom and skip OS customization so config.txt and cmdline.txt are not overwritten.
    • Linux / macOS CLI:
      sha256sum -c kali-cardputerzero-arm64.img.xz.sha256
      xzcat kali-cardputerzero-arm64.img.xz | sudo dd of=/dev/sdX bs=4M status=progress conv=fsync
      sync
      
  3. Boot the CardputerZero. On first boot, cz-firstboot-resize expands the ext4 root filesystem online to fill the card and czctl starts on the 320x170 LCD and :8899 Web KVM.

Default Access

[!IMPORTANT] Like upstream Kali ARM images, SSH, :8899 Web KVM, and passwordless sudo are enabled by default with kali / kali. Run passwd on first login (and restrict SSH / port 8899 if needed) before joining untrusted networks.


Controls, Shell & App Deck

Physical Keymap & Gestures

Keys / Gesture In czctl & Hosted Apps In Text Inputs & Terminals
4 5 6 7 8 1:1 bezel-aligned softkeys (WiFi, Menu, Term, SysMon, Kali on Idle) Digits '4'-'8'
F / Z / X / C (or ,///;/.) Thumb D-Pad (Up / Left / Down / Right) with hold repeat Literal characters
Enter / ` (Esc) Confirm (OK) / Back Enter / Escape
Shift / Sym / Fn Full 46-key + 32-symbol TCA8418 hardware layers Full punctuation & symbols
Tap Tab Open live App Switcher across running Wayland apps Tab completion
Hold Tab (1.2s) Lock Screen (locks keypad + turns off LCD PWM backlight) N/A
Hold Esc (2.8s) Hardware Rescue (force-closes hung foreground app & reclaims LCD) Hold Esc 1.2s or Ctrl+Alt+Q exits cz-term / cz-term80

Built-In Menus, Terminals & Apps


Composite USB-C OTG Arsenal, Wireless & HDMI

USB-C OTG Gadget & BadUSB (cz-usb-gadget / cz-badusb)

Connect the USB-C OTG port to a host or target. Composite modes keep usb0 (10.55.0.1/24 with point-to-point DHCP --dhcp-option=3 --dhcp-option=6) online alongside HID, MTP, or storage:

sudo cz-usb-gadget combo                            # usb0 (10.55.0.1/24) + /dev/hidg0 BadUSB HID
sudo cz-usb-gadget mtp                              # usb0 + MTP (/home/kali, isos, payloads) + ttyGS0
sudo cz-usb-gadget create-loot 64                   # Create 64 MB FAT32 loot image in ~/isos/
sudo cz-usb-gadget loot ~/isos/kali-loot-64m.img    # usb0 + read-write USB flash drive
sudo cz-usb-gadget iso ~/isos/netboot.iso           # usb0 + read-only bootable USB CD-ROM/drive
sudo cz-usb-gadget net                              # usb0 Ethernet only (ssh kali@10.55.0.1 | :8899)
sudo cz-usb-gadget hid                              # /dev/hidg0 USB HID keyboard only
sudo cz-usb-gadget off                              # Tear down gadget & return mux to USB Host mode

# Fire DuckyScript 1.0 payloads (auto-enables combo mode so SSH/:8899 stay reachable):
cz-badusb ~/payloads/01-linux-recon-terminal.duck
cz-badusb --menu

Wireless, Monitor Mode & Kali Toolsets

On-Demand HDMI LXDE Desktop (cz-hdmi-hotplug)

The 1.9” SPI LCD and Mini-HDMI run independently: czctl keeps the internal TCA8418 keypad isolated on seat1 while HDMI runs a full Kali LXDE session. When Mini-HDMI is unplugged, lightdm stays stopped (saving ~75-90 MiB RAM) and starts automatically on hotplug (cz-hdmi-hotplug status|auto|always|off).


Hardware Support

Board support combines Raspberry Pi Linux (6.18.39+rpt-rpi-v8), out-of-tree drivers and Device Tree overlays from m5stack-linux-dtoverlays, and audio/display/APT configuration from CardputerZero/pi-gen:

Subsystem Hardware / Bus Kernel Driver(s) & Firmware User-Space
SoC & Boot Raspberry Pi CM0 Lite (RP3A0 / BCM2837, Cortex-A53 arm64, 512 MB LPDDR2) bcm2710-rpi-cm0.dtb, raspi-firmware, Linux 6.18.39+rpt-rpi-v8 (apt-mark hold), zstd ZRAM (75%) ext4 (noatime), cz-firstboot-resize, SSH host keygen, strict ARMv8.0 LSE gate
1.9” IPS LCD ST7789v3 320x170 RGB565 on SPI0 CS0 (GPIO25 DC) + M5IOE1 PWM3 backlight panel-mipi-dbi-m.ko, st7789v_m5stack.ko, pwm_bl_m5stack.ko, cardputerzero,st7789v_lcd.bin, fb_load.service czctl DRM/KMS shell + headless sway Wayland host + /dev/fb_lcd (cz-term, APPLaunch), fbcon=map:99
HDMI Output VideoCore IV KMS (vc4-kms-v3d,cma-64) vc4, 98-vc4-no-glamor.conf, zz-cardputerzero-hdmi-display.rules, 91-cz-hdmi-hotplug.rules On-demand LightDM + LXDE (cz-hdmi-hotplug), fb-mirror.py LCD mirror, VT2-VT6 consoles
46-Key Keypad + LEDs TCA8418 (0x34 I2C1, IRQ GPIO27) + Caps/Fn/Tab LEDs on M5IOE1 tca8418_keypad_m5stack.ko (cardputerzero-v5-overlay.dtbo) Isolated on seat1 (72-seat-cardputer-czctl.rules, Xorg Ignore), tty1 masked, /dev/uinput Web KVM
Audio Everest ES8389 (0x10 I2C1 + I2S), 1W speaker (GPIO24), mic, 3.5mm jack detect (GPIO17) es8389_m5stack.ko, simple-amplifier.ko, cardputerzero-audio.ko PipeWire + WirePlumber + RTKit (Voice Recorder, Internet Radio, ES8389 prioritized over HDMI)
Onboard Wi-Fi BCM43439 / CYW4343A2 SDIO (wlan0, 2.4 GHz) brcmfmac + CM0 cyfmac43439-sdio.txt (boardflags3=0x04000000, nexmon excluded) NetworkManager, czctl Wi-Fi UI, Wi-Fi Recon, WiFiScan
USB Wireless USB-A Host / USB-C OTG (wlan1) Patched realtek-rtl88xxau-dkms (88XXau.ko on Linux 6.18, USB hotplug) + atheros / mediatek / realtek firmware Wi-Fi Recon, WiFiScan, monstart / monstop, aircrack-ng, wifite, hcxdumptool, kismet, bettercap
Bluetooth 5.0 BCM4343A2 HCI UART (/dev/serial1 -> ttyAMA0) BCM4343A2.raspberrypi,0-compute-module.hcd, pi-bluetooth (btuart / hciuart.service) bluez (AutoEnable=false at boot), Bluetooth & BLE, BT/USB HID Pad (BLE HID over GATT)
CSI Camera Sony IMX219 8 MP (dtoverlay=imx219, camera_auto_detect=0) imx219, unicam, /dev/dma_heap/vidbuf_cached (60-dma-heap.rules) SONAME-matched /opt/rpi-libcamera (libcamera.so.0.7 + ipa_rpi_vc4.so) + /dev/fb_lcd camera_app wrapper
Battery & Power TI BQ27220 (0x55 I2C1) / ETA6965 + power-fail shutdown (GPIO6) bq27xxx_battery.ko, bq27xxx_battery_i2c.ko (bq27220_v5.dtbo), powerfail_suo.ko, i2c-dev /sys/class/power_supply/, czctl Battery Info, cz-hw-status
IMU + Mag Bosch BMI270 (0x68 I2C1) + BMM150 bmi270_core.ko, bmi270_i2c.ko, bmc150_magn.ko, bmc150_magn_bmi270.ko, bmi270-init-data.fw /sys/bus/iio/devices/iio:device*, M5 Compass
RTC Epson RX8130CE (0x32 I2C1) rtc-ds1307 (epson,rx8130), udev hwclock --hctosys at boot /dev/rtc0 (hwclock -r / hwclock -w)
Infrared IR TX (GPIO12) + IR RX (GPIO13) gpio-ir-tx & gpio-ir (/dev/lirc0, /dev/lirc1, group video) IR Arsenal (LIRC TX/RX + ~/ir/tv-universal.ir), ir-ctl, M5 IR Remote & IR Chat
USB OTG + Power Mux dwc2 USB 2.0 OTG + M5IOE1 (0x4f I2C1) m5ioe1.ko, libcomposite, /sys/class/leds/{ext_usb_gpio_fun,ext_5v_out,grove_5v_out,grove_fun} USB Arsenal, cz-usb-gadget / cz-flipper-gadget, cz-badusb, umtprd MTP, czctl 5V/mux toggles
14-Pin Cap & Grove SPI0 (CS1 + GPIO22 CS2), UART0 (/dev/ttyS0), I2C1, GPIO + PWM gpio-forwarder.ko, spi0-spidev2-gpio22-overlay.dtbo, raspi-utils-dt, pigpio (pigpiod) LoRa SX1262 + ATGM336H GNSS (gpsd.socket on /dev/ttyS0), CC1101 Sub-GHz + NFC (libnfc, mfoc, mfcuk)

Build from Source & Live Deployment

Building follows the Kali custom Raspberry Pi image layout on a Debian, Ubuntu, or Kali host (~15 GB free disk space). APT indices and M5Stack sources are verified against PGP InRelease metadata and upstream.lock.json, and every Cortex-A53 binary is audited via objdump -d to reject unguarded ARMv8.1+ LSE instructions.

sudo apt update && sudo apt install -y \
  parted dosfstools e2fsprogs btrfs-progs util-linux rsync xz-utils zstd binutils \
  dpkg curl git ca-certificates device-tree-compiler python3 mmdebstrap debootstrap \
  zerofree build-essential pkg-config cargo rustc \
  libudev-dev libdrm-dev libgbm-dev libwayland-dev libxkbcommon-dev \
  libfontconfig1-dev libpulse-dev libmp3lame-dev libogg-dev libvorbis-dev

# Only needed when cross-building on x86_64:
sudo apt install -y qemu-user-static binfmt-support arch-test \
  gcc-aarch64-linux-gnu g++-aarch64-linux-gnu binutils-aarch64-linux-gnu
rustup target add aarch64-unknown-linux-gnu   # if using rustup

# Build default ext4 image (zerofree-compacted) -> output/kali-cardputerzero-arm64.img.xz:
sudo ./build-kali-cardputerzero.sh

# Optional: strict lockfile mode or experimental Btrfs multi-profile mode:
sudo M5_UPDATE_MODE=locked ./build-kali-cardputerzero.sh
sudo ROOT_FS=btrfs ./build-kali-cardputerzero.sh

(Optional ROOT_FS=btrfs builds adapt subvolume profile helpers from flipperos-btrfs-tools and flipperone-linux-build-scripts.)

Flash, Pre-Seed SSH Key, or Deploy Live Over SSH

# Flash directly with root-disk safety checks, and optionally pre-seed an SSH key:
sudo FLASH_DEV=/dev/sdX ./build-kali-cardputerzero.sh flash
sudo DEPLOY_SSH_DEV=/dev/sdX DEPLOY_SSH_PUBKEY=~/.ssh/id_ed25519.pub ./build-kali-cardputerzero.sh deploy-ssh

# Deploy czctl, Wayland apps, C utilities, OTG tools & camera fix live to a running unit:
./scripts/deploy-live.sh kali@<cardputer-ip>

# Run UI token checks, Rust workspace tests, and standalone C checks:
sh shell/ci/no-raw-colours.sh
CARGO_PROFILE_TEST_DEBUG=0 cargo test --manifest-path shell/Cargo.toml --workspace
./scripts/build-cz-shell.sh
make -C src && make -C src check

Repository Layout

Shout-Out

Big shout-out to the Flipper One project at Flipper Devices for establishing a clean, well-engineered handheld Linux foundation (flipctl-slint, flipperone-linux-build-scripts, and flipperos-btrfs-tools). Its token-driven panel UI, :8899 browser KVM design, Wayland app hosting model, and pixel fonts made czctl on the CardputerZero possible, alongside the work of the M5Stack / CardputerZero, Kali Linux, and Raspberry Pi communities.

License & Attribution