Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for Pi Zero 2W #1108

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open

Conversation

DrSchottky
Copy link

@DrSchottky DrSchottky commented Jul 30, 2022

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)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

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

Signed-off-by: DrSchottky <6048264+DrSchottky@users.noreply.github.com>
… on official repo

Signed-off-by: DrSchottky <6048264+DrSchottky@users.noreply.github.com>
…e not compatible with that version of Flask

Signed-off-by: DrSchottky <6048264+DrSchottky@users.noreply.github.com>
… and Raspbian to Raspberry Pi OS

Signed-off-by: DrSchottky <6048264+DrSchottky@users.noreply.github.com>
Signed-off-by: DrSchottky <6048264+DrSchottky@users.noreply.github.com>
Signed-off-by: DrSchottky <6048264+DrSchottky@users.noreply.github.com>
@AmelieTails
Copy link

AmelieTails commented Jul 30, 2022

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 :(

@DrSchottky
Copy link
Author

@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

@220242
Copy link

220242 commented Jul 30, 2022

@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

@DrSchottky
Copy link
Author

@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?

@AmelieTails
Copy link

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

@220242
Copy link

220242 commented Jul 30, 2022

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
Copy link

220242 commented Jul 30, 2022

image
same, required LIBC 2.33, on image 2.28

@220242
Copy link

220242 commented Jul 30, 2022

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 :)

@DrSchottky
Copy link
Author

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

@AmelieTails
Copy link

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

@DrSchottky
Copy link
Author

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.

@AmelieTails
Copy link

AmelieTails commented Jul 31, 2022

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

@DrSchottky
Copy link
Author

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

@AmelieTails
Copy link

AmelieTails commented Jul 31, 2022

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

@DrSchottky
Copy link
Author

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

@AmelieTails
Copy link

System freezes after launch bettercap

@makerph
Copy link

makerph commented Aug 1, 2022

@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

@DrSchottky
Copy link
Author

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

@makerph
Copy link

makerph commented Aug 1, 2022

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

@makerph
Copy link

makerph commented Aug 1, 2022

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.

@tessbreaker
Copy link

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.

@makerph
Copy link

makerph commented Sep 19, 2022

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

@llamasoft llamasoft mentioned this pull request Oct 4, 2022
9 tasks
@adi170-alt
Copy link

adi170-alt commented Dec 16, 2022

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).

@chunkywill
Copy link

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

@TQMatvey
Copy link

TQMatvey commented Oct 26, 2023

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

8 participants