Benutzer-Werkzeuge

Webseiten-Werkzeuge


raspberry-pi-monitor-mode

Dies ist eine alte Version des Dokuments!


Raspberry Pi 3 B+ mit Wireless Monitor Mode Unterstützung aufsetzen

Image auf MicroSD Karte schreiben

rdisk4 wg. dem Macbook, die Nummer weicht auf anderen Systemen ab - also bitte darauf achten dass man nicht versehentlich eine falsche Platte überschreibt.

BennyE$ sudo dd if=2018-06-27-raspbian-stretch-lite.img of=/dev/rdisk4 bs=1024k
Password:
1776+0 records in
1776+0 records out

Raspberry Pi einrichten

Kein rpi-update durchführen! Dadurch fehlen einige Dateien für den Kernel und wir können keine Firmware bauen!

sudo raspi-config → Keyboard einstellen → Interfacing → SSH einschalten → Land für die Wireless Schnittstelle festlegen (z.B. DE)

sudo apt-get update && sudo apt-get upgrade

sudo reboot

Raspberry Pi für Wireless Monitor Mode vorbereiten

Dieser Vorgang (Änderung der Firmware) kann den Raspberry Pi irreperabel beschädigen!

pi@raspberrypi:~ $ sudo raspi-config
-> Eigenes Passwort festlegen!

pi@raspberrypi:~ $ sudo su
root@raspberrypi:/home/pi# sudo apt-get install raspberrypi-kernel-headers git libgmp3-dev gawk qpdf bison flex make
Reading package lists... Done
Building dependency tree       
Reading state information... Done
make is already the newest version (4.1-9.1).
make set to manually installed.
The following additional packages will be installed:
  git-man libbison-dev liberror-perl libfl-dev libgmp-dev libgmpxx4ldbl libqpdf17 libsigsegv2 m4
Suggested packages:
  bison-doc gawk-doc git-daemon-run | git-daemon-sysvinit git-doc git-el git-email git-gui gitk gitweb git-arch
  git-cvs git-mediawiki git-svn gmp-doc libgmp10-doc libmpfr-dev m4-doc
The following NEW packages will be installed:
  bison flex gawk git git-man libbison-dev liberror-perl libfl-dev libgmp-dev libgmp3-dev libgmpxx4ldbl libqpdf17
  libsigsegv2 m4 qpdf raspberrypi-kernel-headers
0 upgraded, 16 newly installed, 0 to remove and 0 not upgraded.
Need to get 24.5 MB of archives.
After this operation, 140 MB of additional disk space will be used.
Do you want to continue? [Y/n] 

-> Y

Werkzeug zur Modifikation der Firmware vorbereiten

root@raspberrypi:/home/pi# git clone https://github.com/seemoo-lab/nexmon.git
Cloning into 'nexmon'...
remote: Enumerating objects: 33085, done.
remote: Total 33085 (delta 0), reused 0 (delta 0), pack-reused 33085
Receiving objects: 100% (33085/33085), 355.78 MiB | 6.05 MiB/s, done.
Resolving deltas: 100% (14894/14894), done.
Checking out files: 100% (33209/33209), done.
root@raspberrypi:/home/pi# cd nexmon/
root@raspberrypi:/home/pi/nexmon# cd buildtools/isl-0.10/
root@raspberrypi:/home/pi/nexmon/buildtools/isl-0.10# ./configure
(warten)
root@raspberrypi:/home/pi/nexmon/buildtools/isl-0.10# make
(warten)
root@raspberrypi:/home/pi/nexmon/buildtools/isl-0.10# make install
(warten)
root@raspberrypi:/home/pi/nexmon/buildtools/isl-0.10# ln -s /usr/local/lib/libisl.so /usr/lib/arm-linux-gnueabihf/libisl.so.10

root@raspberrypi:/home/pi/nexmon/buildtools/isl-0.10# cd ..
root@raspberrypi:/home/pi/nexmon/buildtools# cd ..

root@raspberrypi:/home/pi/nexmon# source setup_env.sh
root@raspberrypi:/home/pi/nexmon# make
(warten)

Der Raspberry Pi 3 B+ verwendet den BCM43455 für Wireless.

root@raspberrypi:/home/pi/nexmon# cd patches/bcm43455c0/7_45_154/nexmon/

root@raspberrypi:/home/pi/nexmon/patches/bcm43455c0/7_45_154/nexmon# make


          ###########   ###########   ##########    ##########           
         ############  ############  ############  ############          
         ##            ##            ##   ##   ##  ##        ##          
         ##            ##            ##   ##   ##  ##        ##          
         ###########   ####  ######  ##   ##   ##  ##    ######          
          ###########  ####  #       ##   ##   ##  ##    #    #          
                   ##  ##    ######  ##   ##   ##  ##    #    #          
                   ##  ##    #       ##   ##   ##  ##    #    #          
         ############  ##### ######  ##   ##   ##  ##### ######          
         ###########    ###########  ##   ##   ##   ##########           

            S E C U R E   M O B I L E   N E T W O R K I N G               


                               presents:                                  

              # ###   ###  #   # # ###  ###   ###  # ###                  
              ##   # #   #  # #  ##   ##   # #   # ##   #                 
              #    # #####   #   #    #    # #   # #    #                 
              #    # #      # #  #    #    # #   # #    #                 
              #    #  #### #   # #    #    #  ###  #    #                 

                The C-based Firmware Patching Framework                   


                           !!! WARNING !!!                                
    Our software may damage your hardware and may void your hardware’s    
     warranty! You use our tools at your own risk and responsibility      


  COLLECTING STATISTICS read /home/pi/nexmon/STATISTICS.md for more information
  COMPILING src/injection.c => obj/injection.o (details: log/compiler.log)
  COMPILING src/patch.c => obj/patch.o (details: log/compiler.log)
  COMPILING src/console.c => obj/console.o (details: log/compiler.log)
  COMPILING src/version.c => obj/version.o (details: log/compiler.log)
  COMPILING src/sendframe.c => obj/sendframe.o (details: log/compiler.log)
  COMPILING src/monitormode.c => obj/monitormode.o (details: log/compiler.log)
  COPYING UCODE /home/pi/nexmon/firmwares/bcm43455c0/7_45_154/ucode.bin => gen/ucode.bin
  COMPRESSING UCODE gen/ucode.bin => gen/ucode_compressed.bin
  GENERATING C FILE gen/ucode_compressed.bin => src/ucode_compressed.c
  COMPILING src/ucode_compressed.c => obj/ucode_compressed.o (details: log/compiler.log)
  COMPILING /home/pi/nexmon/patches/common/wrapper.c => obj/wrapper.o (details: log/compiler.log)
  COMPILING /home/pi/nexmon/patches/common/argprintf.c => obj/argprintf.o (details: log/compiler.log)
  COMPILING /home/pi/nexmon/patches/common/helper.c => obj/helper.o (details: log/compiler.log)
  COMPILING /home/pi/nexmon/patches/common/udptunnel.c => obj/udptunnel.o (details: log/compiler.log)
  COMPILING /home/pi/nexmon/patches/common/ucode_compression_code.c => obj/ucode_compression_code.o (details: log/compiler.log)
  COMPILING /home/pi/nexmon/patches/common/objmem.c => obj/objmem.o (details: log/compiler.log)
  COMPILING /home/pi/nexmon/patches/common/securitycookie.c => obj/securitycookie.o (details: log/compiler.log)
  COMPILING /home/pi/nexmon/patches/common/radiotap.c => obj/radiotap.o (details: log/compiler.log)
  COMPILING /home/pi/nexmon/firmwares/bcm43455c0/7_45_154/flashpatches.c => obj/flashpatches.o (details: log/compiler.log)
  GENERATING LINKER FILE gen/nexmon.pre => gen/nexmon.ld
  GENERATING LINKER FILE gen/nexmon.pre => gen/flashpatches.ld
  GENERATING LINKER FILE gen/memory.ld
  LINKING OBJECTS => gen/patch.elf (details: log/linker.log, log/linker.err)
  GENERATING MAKE FILE gen/nexmon.pre => gen/nexmon.mk
  GENERATING MAKE FILE gen/nexmon.pre => gen/flashpatches.mk
  APPLYING FLASHPATCHES gen/flashpatches.mk => brcmfmac43455-sdio.bin (details: log/flashpatches.log)
  APPLYING PATCHES gen/nexmon.mk => brcmfmac43455-sdio.bin (details: log/patches.log)
  BUILDING DRIVER for kernel 4.14 brcmfmac_4.14.y-nexmon/brcmfmac.ko (details: log/driver.log)

root@raspberrypi:/home/pi/nexmon/patches/bcm43455c0/7_45_154/nexmon# make backup-firmware
cp /lib/firmware/brcm/brcmfmac43455-sdio.bin brcmfmac43455-sdio.bin.orig
root@raspberrypi:/home/pi/nexmon/patches/bcm43455c0/7_45_154/nexmon# make install-firmware


          ###########   ###########   ##########    ##########           
         ############  ############  ############  ############          
         ##            ##            ##   ##   ##  ##        ##          
         ##            ##            ##   ##   ##  ##        ##          
         ###########   ####  ######  ##   ##   ##  ##    ######          
          ###########  ####  #       ##   ##   ##  ##    #    #          
                   ##  ##    ######  ##   ##   ##  ##    #    #          
                   ##  ##    #       ##   ##   ##  ##    #    #          
         ############  ##### ######  ##   ##   ##  ##### ######          
         ###########    ###########  ##   ##   ##   ##########           

            S E C U R E   M O B I L E   N E T W O R K I N G               


                               presents:                                  

              # ###   ###  #   # # ###  ###   ###  # ###                  
              ##   # #   #  # #  ##   ##   # #   # ##   #                 
              #    # #####   #   #    #    # #   # #    #                 
              #    # #      # #  #    #    # #   # #    #                 
              #    #  #### #   # #    #    #  ###  #    #                 

                The C-based Firmware Patching Framework                   


                           !!! WARNING !!!                                
    Our software may damage your hardware and may void your hardware’s    
     warranty! You use our tools at your own risk and responsibility      


  COLLECTING STATISTICS read /home/pi/nexmon/STATISTICS.md for more information
  COMPILING src/version.c => obj/version.o (details: log/compiler.log)
  GENERATING LINKER FILE gen/nexmon.pre => gen/nexmon.ld
  GENERATING LINKER FILE gen/nexmon.pre => gen/flashpatches.ld
  LINKING OBJECTS => gen/patch.elf (details: log/linker.log, log/linker.err)
  GENERATING MAKE FILE gen/nexmon.pre => gen/nexmon.mk
  GENERATING MAKE FILE gen/nexmon.pre => gen/flashpatches.mk
  APPLYING FLASHPATCHES gen/flashpatches.mk => brcmfmac43455-sdio.bin (details: log/flashpatches.log)
  APPLYING PATCHES gen/nexmon.mk => brcmfmac43455-sdio.bin (details: log/patches.log)
  BUILDING DRIVER for kernel 4.14 brcmfmac_4.14.y-nexmon/brcmfmac.ko (details: log/driver.log)
  COPYING brcmfmac43455-sdio.bin => /lib/firmware/brcm/brcmfmac43455-sdio.bin
  UNLOADING brcmfmac
  RELOADING brcmfmac

root@raspberrypi:/home/pi/nexmon/patches/bcm43455c0/7_45_154/nexmon# cd ..
root@raspberrypi:/home/pi/nexmon/patches/bcm43455c0/7_45_154# cd ..
root@raspberrypi:/home/pi/nexmon/patches/bcm43455c0# cd ..
root@raspberrypi:/home/pi/nexmon/patches# cd ..

Neuen Treiber bootfest machen:
root@raspberrypi:/home/pi# cp nexmon/patches/bcm43455c0/7_45_154/nexmon/brcmfmac_4.14.y-nexmon/brcmfmac.ko /lib/modules/4.14.71-v7+/kernel/drivers/net/wireless/broadcom/brcm80211/brcmfmac/brcmfmac.ko
root@raspberrypi:/home/pi# depmod -a
root@raspberrypi:/home/pi# reboot

Pakete mitschneiden

root@raspberrypi:/home/pi# apt-get remove wpasupplicant

root@raspberrypi:/home/pi# sudo apt-get install tcpdump

root@raspberrypi:/home/pi# ip link set dev wlan0 down
root@raspberrypi:/home/pi# iw phy `iw dev wlan0 info | gawk '/wiphy/ {printf "phy" $2}'` interface add mon0 type monitor
root@raspberrypi:/home/pi# ip link set dev mon0 up
root@raspberrypi:/home/pi# iwconfig mon0 channel X

root@raspberrypi:/home/pi# tcpdump -i mon0

Mir ist bis bisher nicht gelungen dass da auch „DATA“ sichtbar wird, bisher scheinen dies nur „No DATA“ Pakete zu sein.

raspberry-pi-monitor-mode.1539960521.txt.gz · Zuletzt geändert: 2024/06/09 10:29 (Externe Bearbeitung)

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki