diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..8506f52 --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +*.img +*.img.gz diff --git a/README.md b/README.md index 9663df1..c1a5058 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -This Pi-gen icreated image is configured to set up a wifi access point, and SSH. +This Pi-gen created image is configured to set up a wifi access point, SSH and a web terminal. The default account is username: `dt` password: `proxmark3` @@ -7,8 +7,22 @@ Connect to the `PM3` wifi hot spot with the passphrase `DangerousThings` Once logged in you will need to compile the PM3 software at the moment. ``` -cd proxmark3 && make clean && make -j +cd proxmark3 && make clean && make sudo make install ``` -To remake the image you will need my fork of the pi-gen repository. Copy `pm3.config` to `config` and follow the instructions in the `README.md` file +To remake the image you will need the pi-gen repository. + +```git clone https://github.com/RPI-Distro/pi-gen ``` + +If you are building for ARM64 then make sure you checkout the ARM64 branch + +```git checkout arm64``` + +Then you will need to copy the contents of the pi-gen subdirectory from this repository into place. + +```cp -rp ./pi-gen/* /pi-gen/``` + +Finally you can create the image following the instructions in the pi-gen repository. This will create an output image in `/pi-gen/work/Proxmark3/export-image` You will be looking for the one ending in `-pm3.img` + + diff --git a/pi-gen/READMEpm3.md b/pi-gen/READMEpm3.md new file mode 100644 index 0000000..c2efdf0 --- /dev/null +++ b/pi-gen/READMEpm3.md @@ -0,0 +1,14 @@ +This version of Pi-gen is configured to set up a wifio access point, and SSH. + +The default account is username: `dt` password: `proxmark3` + +Connect to the `PM3` wifi hot spot with the passphrase `DangerousThings` + +Once logged in you will need to compile the PM3 software at the moment. + +``` +cd proxmark3 && make clean && make -j +sudo make install +``` + +To remake the image you will need to copy `pm3.config` to `config` and follow the instructions in the `README.md` file diff --git a/pi-gen/config b/pi-gen/config new file mode 100644 index 0000000..55162b0 --- /dev/null +++ b/pi-gen/config @@ -0,0 +1,14 @@ +IMG_NAME="Proxmark3" +USE_QCOW2=0 +RELEASE="bullseye" +DEPLOY_ZIP=1 +USE_QEMU=0 +LOCALE_DEFAULT="en_US.UTF-8" +TARGET_HOSTNAME="Proxmark3" +KEYBOARD_KEYMAP="us" +TIMEZONE_DEFAULT="America/Los_Angeles" +FIRST_USER_NAME="dt" +FIRST_USER_PASS="proxmark3" +ENABLE_SSH=1 +WPA_COUNTRY="US" +STAGE_LIST="stage0 stage1 stage2 stageDTPM3" diff --git a/pi-gen/pm3.config b/pi-gen/pm3.config new file mode 100644 index 0000000..55162b0 --- /dev/null +++ b/pi-gen/pm3.config @@ -0,0 +1,14 @@ +IMG_NAME="Proxmark3" +USE_QCOW2=0 +RELEASE="bullseye" +DEPLOY_ZIP=1 +USE_QEMU=0 +LOCALE_DEFAULT="en_US.UTF-8" +TARGET_HOSTNAME="Proxmark3" +KEYBOARD_KEYMAP="us" +TIMEZONE_DEFAULT="America/Los_Angeles" +FIRST_USER_NAME="dt" +FIRST_USER_PASS="proxmark3" +ENABLE_SSH=1 +WPA_COUNTRY="US" +STAGE_LIST="stage0 stage1 stage2 stageDTPM3" diff --git a/pi-gen/stageDTPM3/00-install-packages/00-packages-nr b/pi-gen/stageDTPM3/00-install-packages/00-packages-nr new file mode 100644 index 0000000..b939f9c --- /dev/null +++ b/pi-gen/stageDTPM3/00-install-packages/00-packages-nr @@ -0,0 +1,13 @@ +git +ca-certificates +build-essential +pkg-config +libreadline-dev +gcc-arm-none-eabi +libnewlib-dev +libbz2-dev +libbluetooth-dev +libpython3-dev +libssl-dev +hostapd +dnsmasq diff --git a/pi-gen/stageDTPM3/01-proxmark3/00-run-chroot.sh b/pi-gen/stageDTPM3/01-proxmark3/00-run-chroot.sh new file mode 100644 index 0000000..29fa9b6 --- /dev/null +++ b/pi-gen/stageDTPM3/01-proxmark3/00-run-chroot.sh @@ -0,0 +1,10 @@ +#!/bin/bash -e + +su - dt +git clone https://github.com/RfidResearchGroup/proxmark3 +cd proxmark3 +echo PLATFORM=PM3GENERIC > Makefile.platform +#make clean && make -j +exit +#make install + diff --git a/pi-gen/stageDTPM3/02-Wireless-AP/00-run-chroot.sh b/pi-gen/stageDTPM3/02-Wireless-AP/00-run-chroot.sh new file mode 100644 index 0000000..9c56e93 --- /dev/null +++ b/pi-gen/stageDTPM3/02-Wireless-AP/00-run-chroot.sh @@ -0,0 +1,35 @@ +#!/bin/bash -e + +cat << EOF >> /etc/dhcpcd.conf + +inteface wlan0 +static ip_address=192.168.23.1/24 + +EOF + +mv /etc/dnsmasq.conf /etc/dnsmasq.orig + +cat << EOF > /etc/dnsmasq.conf +interface=wlan0 + dhcp-range=192.168.23.17,192.168.23.42,255.255.255.0,24h +EOF + +cat << EOF > /etc/hostapd/hostapd.conf +interface=wlan0 +country_code=US +hw_mode=g +channel=7 +wmm_enabled=0 +macaddr_acl=0 +auth_algs=1 +ignore_broadcast_ssid=0 +wpa=2 +wpa_key_mgmt=WPA-PSK +wpa_pairwise=TKIP +rsn_pairwise=CCMP +ssid=PM3 +wpa_passphrase=DangerousThings +EOF + +sed -i 's/#DAEMON_CONF=""/DAEMON_CONF="\/etc\/hostapd\/hostapd.conf"/' /etc/default/hostapd + diff --git a/pi-gen/stageDTPM3/03-ttyd/00-run-chroot.sh b/pi-gen/stageDTPM3/03-ttyd/00-run-chroot.sh new file mode 100644 index 0000000..91566c7 --- /dev/null +++ b/pi-gen/stageDTPM3/03-ttyd/00-run-chroot.sh @@ -0,0 +1,16 @@ +#!/bin/bash -e + +#cd /usr/local/bin +wget https://github.com/tsl0922/ttyd/releases/download/1.6.3/ttyd.aarch64 +wget https://github.com/tsl0922/ttyd/releases/download/1.6.3/ttyd.armhf +wget https://github.com/tsl0922/ttyd/releases/download/1.6.3/ttyd.arm + + +cat << EOF > /usr/local/bin/ttyd +#! /bin/bash +/usr/local/bin/ttyd.`/usr/bin/uname -m` $@ +EOF + +chown root:root /usr/local/bin/ttyd* +chmod a+x /usr/local/bin/ttyd* + diff --git a/pi-gen/stageDTPM3/EXPORT_IMAGE b/pi-gen/stageDTPM3/EXPORT_IMAGE new file mode 100644 index 0000000..54d5624 --- /dev/null +++ b/pi-gen/stageDTPM3/EXPORT_IMAGE @@ -0,0 +1,4 @@ +IMG_SUFFIX="-pm3" +if [ "${USE_QEMU}" = "1" ]; then + export IMG_SUFFIX="${IMG_SUFFIX}-qemu" +fi diff --git a/pi-gen/stageDTPM3/SKIP_NOOBS b/pi-gen/stageDTPM3/SKIP_NOOBS new file mode 100644 index 0000000..c797543 --- /dev/null +++ b/pi-gen/stageDTPM3/SKIP_NOOBS @@ -0,0 +1,2 @@ +NOOBS_NAME="Raspberry Pi OS Lite PM3 (64-bit)" +NOOBS_DESCRIPTION="A port of Debian with Proxmrk3 but no desktop environment" diff --git a/pi-gen/stageDTPM3/prerun.sh b/pi-gen/stageDTPM3/prerun.sh new file mode 100755 index 0000000..9acd13c --- /dev/null +++ b/pi-gen/stageDTPM3/prerun.sh @@ -0,0 +1,5 @@ +#!/bin/bash -e + +if [ ! -d "${ROOTFS_DIR}" ]; then + copy_previous +fi