pwnagotchi icon indicating copy to clipboard operation
pwnagotchi copied to clipboard

Add support for Pi Zero 2W

Open DrSchottky opened this issue 1 year ago • 25 comments

Description

This patch uses a newer base image and kalipi kernel in order to support newer Pi revisions, like Zero 2W

Motivation and Context

As pointed out in #1046, it would be nice to support the new Zero 2W.

How Has This Been Tested?

This patch has been crowd-tested since I don't have the resources to test all the possible configurations and scenarios. Since I ported nexmon to 2W I distributed unofficial images (on #1046 and /r/pwnagotchi) to let people test them and report bugs. Since I didn't touch the pwnagotchi code itself I wasn't expecting major issues, but wanted to be sure new distro/kernel/firmware weren't introducing regressions

Types of changes

  • [ ] Bug fix (non-breaking change which fixes an issue)
  • [x] New feature (non-breaking change which adds functionality)
  • [ ] Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • [x] My code follows the code style of this project.
  • [x] My change requires a change to the documentation.
  • [ ] I have updated the documentation accordingly.
  • [x] I've read the CONTRIBUTION guide
  • [x] I have signed-off my commits with git commit -s

DrSchottky avatar Jul 30 '22 12:07 DrSchottky

Thanks for your work. This is very cool! It would be great if you add drivers rtl8812, rtl8814 I can't compile them myself on a raspberry, because have a absence error glibc 2.33. I thought, if someone builds image on a fresh version of OS and kernel, then problem will solve... But not :(

AmelieTails avatar Jul 30 '22 18:07 AmelieTails

@AmelieTails aren't them already included in kalipi kernel? If you want to check for this you can find a pre-built image for with these changes on my pwnagotchi fork

DrSchottky avatar Jul 30 '22 18:07 DrSchottky

@AmelieTails aren't them already included in kalipi kernel? If you want to check for this you can find a pre-built image for with these changes on my pwnagotchi fork

Not included, I tried right now 8812 on v1.5.6-beta2. But ive got a raspberry 2, not 2W

220242 avatar Jul 30 '22 18:07 220242

@AmelieTails aren't them already included in kalipi kernel? If you want to check for this you can find a pre-built image for with these changes on my pwnagotchi fork

Not included, I tried right now 8812 on v1.5.6-beta2. But ive got a raspberry 2, not 2W

VID:PID (lsusb) of your dongle?

DrSchottky avatar Jul 30 '22 18:07 DrSchottky

Bus 001 Device 005: ID 0bda:8813 Realtek Semiconductor Corp. RTL8814AU 802.11a/b/g/n/ac Wireless Adapter

AmelieTails avatar Jul 30 '22 18:07 AmelieTails

0bda:8812

@AmelieTails aren't them already included in kalipi kernel? If you want to check for this you can find a pre-built image for with these changes on my pwnagotchi fork

Not included, I tried right now 8812 on v1.5.6-beta2. But ive got a raspberry 2, not 2W

VID:PID (lsusb) of your dongle?

0bda:8812

220242 avatar Jul 30 '22 18:07 220242

image same, required LIBC 2.33, on image 2.28

220242 avatar Jul 30 '22 19:07 220242

Thanks for your work. This is very cool! It would be great if you add drivers rtl8812, rtl8814 I can't compile them myself on a raspberry, because have a absence error glibc 2.33. I thought, if someone builds image on a fresh version of OS and kernel, then problem will solve... But not :(

You may try take it from here https://http.kali.org/pool/main/g/glibc/ and install via dpkg libc-bin_2.33arch and libc6_2.33arch. but I think it requires some dependencies from kali repo. And these dependencies can break everything :)

220242 avatar Jul 30 '22 19:07 220242

You can try to load these ( I cross compiled https://github.com/aircrack-ng/rtl8812au/ for Re4son) rtl8812au-kalipi-5.15.44-20220704.tar.gz

But be careful, it won't work out of the box with pwnagotchi since (AFAIK) it doesn't natively support external adapters so it tries to start and use the embedded wlan as monitor interface

DrSchottky avatar Jul 31 '22 14:07 DrSchottky

Thank you so much! But, "kernel panic" occurs after connecting the adapter. Does not react to anything. With this mod.

AmelieTails avatar Jul 31 '22 16:07 AmelieTails

Thank you so much! But, "kernel panic" occurs after connecting the adapter. Does not react to anything. With this mod.

Did you try plugging the dongle, loading the driver with insmod (from 5.15.44-Re4son-v7+) and turning on the monitor mode as explained on driver repo? Also try stopping pwnagotchi/bettercap services before loading the driver I'm on a 3B (same image)/kernel with a 0bda:a811 dongle and it works for me.

DrSchottky avatar Jul 31 '22 17:07 DrSchottky

Nope, i copied everything to /lib/modules/ , add 88XXau in /etc/modules and used depmod. Reburning card and try insmod, modprobe With insmod "insmod: ERROR: could not insert module 88XXau.ko: Invalid module format". And modprobe "modprobe: FATAL: Module 88XXau.ko not found in directory /lib/modules/5.15.44-Re4son-v7+" after copied 88XXau.ko to this path getting same messenge

image

AmelieTails avatar Jul 31 '22 18:07 AmelieTails

Nope, i copied everything to /lib/modules/ , add 88XXau in /etc/modules and used depmod. Reburning card and try insmod, modprobe With insmod "insmod: ERROR: could not insert module 88XXau.ko: Invalid module format". And modprobe "modprobe: FATAL: Module 88XXau.ko not found in directory /lib/modules/5.15.44-Re4son-v7+" after copied 88XXau.ko to this path getting same messenge

Ouput of uname -a? Also, is cfg80211 loaded? If not load it (modprobe cfg80211) before loading the driver

DrSchottky avatar Jul 31 '22 18:07 DrSchottky

Linux pwnagotchi 5.15.44-Re4son-v7+ #1 SMP Debian kali-pi (2022-07-03) armv7l GNU/Linux I did it, awesome! Thank you! But it works until again start bettercap

systemctl stop pwnagotchi
systemctl stop bettercap
insmod 5.15.44-Re4son-v7+/88XXau.ko
airmon-ng check kill
ip link set wlan0 down
iw dev wlan0 set type monitor
ip link set wlan0 up
systemctl start pwnagotchi

Airodump-ng looks like a scanning(changing channels) but not found any access points

AmelieTails avatar Jul 31 '22 19:07 AmelieTails

But it works until again start bettercap

What do you mean? Anyway, as previously said, there's no native support for external dongles so you need to patch things here and there to use that

DrSchottky avatar Jul 31 '22 20:07 DrSchottky

System freezes after launch bettercap

AmelieTails avatar Jul 31 '22 20:07 AmelieTails

@DrSchottky v1.5.6-beta2 was release 4 days ago and this fix was committed 2 days ago. I assume it not yet included on the latest release? Thanks

makerph avatar Aug 01 '22 08:08 makerph

System freezes after launch bettercap

Expected, rtl8812au driver doesn't like to be put in monitor mode like pwnlib does

@DrSchottky v1.5.6-beta2 was release 4 days ago and this fix was committed 2 days ago. I assume it not yet included on the latest release? Thanks

It is, commits have the wrong timestamp because I forgot to sign off them

DrSchottky avatar Aug 01 '22 08:08 DrSchottky

Thanks for clarification. will test it today on my pi zero 2w and provide feedback if I encounter any issue.

makerph avatar Aug 01 '22 10:08 makerph

I've tested the v1.5.6-beta2 image everything is work fine however the rpi seems to be overheating and I can hear whining/high pitch noise after about ~1-2hrs running. No Issues after switching back to my old SD card with your previously released image. I cannot see any errors on debug mode. Not sure if anyone encounter this.

edit: this noise might be caused by by UPS HAT... will investigate more.

makerph avatar Aug 01 '22 23:08 makerph

I can corroborate this experience. The sound persisted when powered with different battery packs and adapters and seems independent from Wavshare v2 HAT and PiSugar 2. This did not occur with the previous image for me either. I have also experienced my pwnagotchi crashing after around 30 minutes and cannot see errors when this does occur.

tessbreaker avatar Sep 18 '22 20:09 tessbreaker

another observation also, in this this image I got fewer handshakes even I'm in malls (lots of AP around).

makerph avatar Sep 19 '22 09:09 makerph

I think that there will need to be a separate image for this because on my pi0 it leads to performance issues(It pwn's very few wifi's).

adi170-alt avatar Dec 16 '22 18:12 adi170-alt

i have a pi 0 2w and a waveshare v3 and i can connect to pwnagotchi through ssh and everything seems fine but the screen is not working

chunkywill avatar Jan 17 '23 22:01 chunkywill

Raspberry Pi zero 2w, unable to find any APs, Auto, AI, Display, all working, but unable to scan anything

v1.5.6-beta2

dmesg_rp2w.txt

TQMatvey avatar Oct 26 '23 06:10 TQMatvey