Benutzer-Werkzeuge

Webseiten-Werkzeuge


raspberry-pi-monitor-mode

Unterschiede

Hier werden die Unterschiede zwischen zwei Versionen angezeigt.

Link zu dieser Vergleichsansicht

Beide Seiten der vorigen RevisionVorhergehende Überarbeitung
Nächste Überarbeitung
Vorhergehende Überarbeitung
raspberry-pi-monitor-mode [2018/10/20 14:47] – [Irritationen mit dem Country Code] bennyraspberry-pi-monitor-mode [2018/11/12 00:50] (aktuell) benny
Zeile 1: Zeile 1:
 ====== Raspberry Pi 3 B+ mit Wireless Monitor Mode Unterstützung aufsetzen ====== ====== Raspberry Pi 3 B+ mit Wireless Monitor Mode Unterstützung aufsetzen ======
  
-===== Image auf MicroSD Karte schreiben =====+In diesem Artikel wird beschrieben wie ein Raspberry Pi 3 B+ mit einem speziellen Wireless-USB-Stick verwendet wird um 80 MHz breite Kanäle aufzuzeichnen zu können. Dies ist mit anderen Lösungen entweder sehr kostspielig (kommerzielle Lösung) oder äußert umständlich. Generell würde das hier beschriebene Verfahren auch mit älteren Raspberry Pis funktionieren, da die Onboard 11ac Schnittstelle nicht zum vollständigen Erfolg führte (siehe unten). 
 + 
 +Der Großteil dieses Artikels basiert auf der Verwendung von diesem Wireless-LAN Adapter (für den es passende Treiber für Linux gibt, mit Monitoring Mode Unterstützung): https://www.amazon.de/Alfa-AWUS036ACH-Dual-Adapter-AC1200/dp/B00VEEBOPG/ 
 + 
 +===== MicroSD Karte vorbereiten ===== 
 + 
 +  * Bitte zuerst **Raspbian Stretch Lite** von https://www.raspberrypi.org/downloads/raspbian/ herunterladen 
 +  * Mit macOS kann man das Image einfach per Terminal/Konsole auf die MicroSD Karte schreiben, wer Windows nutzt kann dafür z.B. Etcher verwenden 
 + 
 +<WRAP center round important 60%> 
 +Unter macOS verwendert man für **dd** das Ziel **rdiskX** (wobei X die Laufwerknummer ist) um das Image zu schreiben. Bitte genau prüfen welches das korrekte Laufwerk ist, sonst kann man sich hier selbst einen schlimmen Datenverlust erzeugen! 
 +</WRAP>
  
-rdisk4 wg. dem Macbook, die Nummer weicht auf anderen Systemen ab - also bitte darauf achten dass man nicht versehentlich eine falsche Platte überschreibt. 
 <code> <code>
-BennyE$ sudo dd if=2018-06-27-raspbian-stretch-lite.img of=/dev/rdisk4 bs=1024k+mbp:Downloads BennyE$ diskutil list 
 +/dev/disk0 (internal, physical): 
 +   #:                       TYPE NAME                    SIZE       IDENTIFIER 
 +   0:      GUID_partition_scheme                        *500.3 GB   disk0 
 +   1:                        EFI EFI                     209.7 MB   disk0s1 
 +   2:                 Apple_APFS Container disk1         500.1 GB   disk0s2 
 + 
 +/dev/disk1 (synthesized): 
 +   #:                       TYPE NAME                    SIZE       IDENTIFIER 
 +   0:      APFS Container Scheme -                      +500.1 GB   disk1 
 +                                 Physical Store disk0s2 
 +   1:                APFS Volume Macintosh HD            434.3 GB   disk1s1 
 +   2:                APFS Volume Preboot                 20.7 MB    disk1s2 
 +   3:                APFS Volume Recovery                515.1 MB   disk1s3 
 +   4:                APFS Volume VM                      3.2 GB     disk1s4 
 + 
 +/dev/disk2 (internal, physical): 
 +   #:                       TYPE NAME                    SIZE       IDENTIFIER 
 +   0:     FDisk_partition_scheme                        *16.1 GB    disk2 
 +   1:             Windows_FAT_32 NO NAME                 64.0 MB    disk2s1 
 +   2:                      Linux                         15.5 GB    disk2s2 
 + 
 +mbp:Downloads BennyE$ diskutil umountdisk /dev/disk2 
 +Unmount of all volumes on disk2 was successful 
 +mbp:Downloads BennyE$ sudo dd if=2018-06-27-raspbian-stretch-lite.img of=/dev/rdisk2 bs=1024k
 Password: Password:
 1776+0 records in 1776+0 records in
 1776+0 records out 1776+0 records out
 +1862270976 bytes transferred in 155.904460 secs (11944950 bytes/sec)
 +mbp:Downloads BennyE$ diskutil umountdisk /dev/disk2
 +Unmount of all volumes on disk2 was successful
 </code> </code>
 +
 +  * Mit iostat kann man in einer separaten Konsole den Schreibvorgang auch prüfen
 +
 +<code>
 +mbp:~ BennyE$ iostat disk2 10
 +              disk2       cpu    load average
 +    KB/t  tps  MB/s  us sy id   1m   5m   15m
 +  411.49    0  0.00    5 88  1.95 2.08 2.27
 + 1024.00   11 11.40    4 89  1.97 2.07 2.27
 + 1024.00   11 11.40    5 87  2.06 2.09 2.27
 + 1024.00   12 11.69  10  6 84  1.90 2.05 2.25
 + 1024.00   11 11.50  10  5 85  1.98 2.07 2.26
 + 1024.00   12 11.59    5 86  1.97 2.06 2.25
 + 1024.00   11 11.50  10  6 85  2.06 2.08 2.25
 + 1024.00   11 11.39    6 85  2.12 2.09 2.26
 + 1024.00   12 11.59    6 85  2.10 2.09 2.25
 + 1024.00   11 11.50    6 85  2.08 2.08 2.25
 + 1024.00   12 11.60    5 87  1.99 2.06 2.24
 + 1024.00   11 11.50  10  6 84  1.92 2.04 2.23
 + 1024.00   11 11.00  10  6 84  1.85 2.03 2.22
 + 1024.00   11 11.49    5 87  1.72 1.99 2.21
 + 1024.00   12 11.60  10  5 85  1.83 2.01 2.21
 + 1024.00   11 11.50    5 85  1.87 2.01 2.21
 +  134.46    4  0.54    5 86  2.33 2.10 2.24
 +    0.00    0  0.00    4 86  2.12 2.07 2.23
 +</code>
 +
 +  * Die MicroSD Karte in den Raspberry Pi stecken und starten
  
 ===== Raspberry Pi einrichten ===== ===== Raspberry Pi einrichten =====
 +
 +  * Beim ersten Start ist "SSH" nicht aktiv und das Tastaturlayout steht auf Englisch
 +  * Der Login erfolgt mit dem Benutzer "pi" und dem Passwort "raspberry" (auf deutscher Tastatur daher "raspberrz", zumindest bis man das korrekt einstellt)
 +  * Nach der Anmeldung dann "sudo raspi-config" aufrufen
 +      * Localisation Options -> Change Keyboard Layout -> dort dann durch die Menüs das deutsche Tastaturlayout wählen
 +      * Localisation Options -> Change Wi-fi Country -> DE wählen
 +      * Interfacing Options -> SSH wählen und einschalten
 +      * Nun kann man sich aus der Ferne per SSH anmelden
 +
 +==== Passwort ändern ====
 +
 +<WRAP center round important 60%>
 +Da der Raspberry Pi nun aus der Ferne per SSH erreichbar ist, muss zuerst das Passwort des Benutzers "pi" geändert werden!
 +</WRAP>
 +
 +<code>
 +Linux raspberrypi 4.14.50-v7+ #1122 SMP Tue Jun 19 12:26:26 BST 2018 armv7l
 +
 +The programs included with the Debian GNU/Linux system are free software;
 +the exact distribution terms for each program are described in the
 +individual files in /usr/share/doc/*/copyright.
 +
 +Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent
 +permitted by applicable law.
 +Last login: Sat Nov 10 10:05:37 2018
 +
 +SSH is enabled and the default password for the 'pi' user has not been changed.
 +This is a security risk - please login as the 'pi' user and type 'passwd' to set a new password.
 +
 +pi@raspberrypi:~ $ 
 +pi@raspberrypi:~ $ passwd
 +Changing password for pi.
 +(current) UNIX password: 
 +Enter new UNIX password: 
 +Retype new UNIX password: 
 +passwd: password updated successfully
 +</code>
 +
 +==== Die erste Aktualisierung ====
  
 <WRAP center round alert 60%> <WRAP center round alert 60%>
-Kein rpi-update durchführen! Dadurch fehlen einige Dateien für den Kernel und wir können keine Firmware bauen!+Kein **rpi-update** durchführen! Dadurch fehlen einige Dateien für den Kernel (Stichwort: /build Verzeichnis) und wir können keine eigenen Treiber / eigene Firmware bauen!
 </WRAP> </WRAP>
  
-sudo raspi-config +<code> 
--> Keyboard einstellen +pi@raspberrypi:~ $ sudo apt-get update 
--> Interfacing -> SSH einschalten +Get:1 http://archive.raspberrypi.org/debian stretch InRelease [25.3 kB] 
--> Land für die Wireless Schnittstelle festlegen (z.BDE)+Get:2 http://raspbian.raspberrypi.org/raspbian stretch InRelease [15.0 kB]    
 +Get:3 http://archive.raspberrypi.org/debian stretch/main armhf Packages [181 kB] 
 +Get:4 http://archive.raspberrypi.org/debian stretch/ui armhf Packages [34.3 kB] 
 +Get:5 http://raspbian.raspberrypi.org/raspbian stretch/main armhf Packages [11.7 MB]  
 +Get:6 http://raspbian.raspberrypi.org/raspbian stretch/contrib armhf Packages [56.9 kB] 
 +Get:7 http://raspbian.raspberrypi.org/raspbian stretch/non-free armhf Packages [95.2 kB] 
 +Fetched 12.1 MB in 8s (1,362 kB/s)                                                                                                                    
 +Reading package lists... Done 
 +pi@raspberrypi:~ $ sudo apt-get upgrade 
 +Reading package lists... Done 
 +Building dependency tree        
 +Reading state information... Done 
 +Calculating upgrade... Done 
 +The following packages will be upgraded: 
 +  ca-certificates curl dhcpcd5 dpkg dpkg-dev fake-hwclock file firmware-atheros firmware-brcm80211 firmware-libertas firmware-misc-nonfree 
 +  firmware-realtek libcurl3 libcurl3-gnutls libdpkg-perl libmagic-mgc libmagic1 libpam-systemd libpython2.7-minimal libpython2.7-stdlib libpython3.5 
 +  libpython3.5-minimal libpython3.5-stdlib libraspberrypi-bin libraspberrypi-dev libraspberrypi-doc libraspberrypi0 libsystemd0 libudev1 
 +  libwbclient0 openssh-client openssh-server openssh-sftp-server patch pi-bluetooth python-rpi.gpio python2.7 python2.7-minimal python3.5 
 +  python3.5-minimal raspberrypi-bootloader raspberrypi-kernel samba-common shared-mime-info ssh systemd systemd-sysv tzdata udev 
 +49 upgraded, 0 newly installed, 0 to remove and 0 not upgraded. 
 +Need to get 104 MB of archives. 
 +After this operation, 867 kB of additional disk space will be used. 
 +Do you want to continue? [Y/n]  
 +</code>
  
-sudo apt-get update && sudo apt-get upgrade+Damit ist der Raspberry Pi erstmal eine Zeit beschäftigt.
  
-sudo reboot+==== Weitere Pakete installieren ====
  
-===== Raspberry Pi für Wireless Monitor Mode vorbereiten =====+Nun installieren wir zusätzliche Pakete, um dann einen eigenen Treiber (der den Monitor Mode unterstützt) bauen zu können. 
 + 
 +<code> 
 +pi@raspberrypi:~ $ sudo apt-get install build-essential bc git dkms aircrack-ng tcpdump vim raspberrypi-kernel-headers -y 
 +Reading package lists... Done 
 +Building dependency tree        
 +Reading state information... Done 
 +build-essential is already the newest version (12.3). 
 +The following additional packages will be installed: 
 +  ethtool git-man ieee-data liberror-perl libgpm2 libpcap0.8 vim-runtime 
 +Suggested packages: 
 +  python3-apport menu git-daemon-run | git-daemon-sysvinit git-doc git-el git-email git-gui gitk gitweb git-arch git-cvs git-mediawiki git-svn gpm 
 +  ctags vim-doc vim-scripts 
 +The following NEW packages will be installed: 
 +  aircrack-ng bc dkms ethtool git git-man ieee-data liberror-perl libgpm2 libpcap0.8 raspberrypi-kernel-headers tcpdump vim vim-runtime 
 +0 upgraded, 14 newly installed, 0 to remove and 0 not upgraded. 
 +Need to get 31.5 MB of archives. 
 +After this operation, 173 MB of additional disk space will be used. 
 +</code> 
 + 
 +<WRAP center round tip 60%> 
 +An dieser Stelle empfehle ich den Raspberry Pi mit **sudo reboot** neuzustarten! In den folgenden Schritten werden wir Treiber kompilieren und dafür ist es gut wenn der aktualisierte Kernel läuft (und damit zum Quelltext passt den wir dafür ebenfalls heruntergeladen haben). 
 +</WRAP> 
 + 
 + 
 +==== VIM und die Mausunterstützung ==== 
 +Wer schon einmal per SSH mit VIM gearbeitet hat und dann versucht hat etwas zu kopieren, der hat die Mausunterstützung von VIM sicher schon kennengelernt. Wer dies nicht möchte, schaltet diese Unterstützung aus. 
 + 
 +<code> 
 +pi@raspberrypi:~ $ sudo vi /etc/vim/vimrc.local 
 +set mouse= 
 +set ttymouse= 
 + 
 +(mit :wq abspeichern und beenden) 
 +</code> 
 + 
 +==== Quellcode für Treiber herunterladen und kompilieren ==== 
 + 
 +<WRAP center round tip 60%> 
 +Vielen Dank an das **aircrack-ng** Team die dies möglich machen! Weitere Details sind hier zu finden: https://github.com/aircrack-ng/rtl8812au 
 +</WRAP> 
 + 
 +<code> 
 +pi@raspberrypi:~ $ git clone https://github.com/aircrack-ng/rtl8812au 
 +Cloning into 'rtl8812au'... 
 +remote: Enumerating objects: 118, done. 
 +remote: Counting objects: 100% (118/118), done. 
 +remote: Compressing objects: 100% (86/86), done. 
 +remote: Total 5924 (delta 49), reused 70 (delta 32), pack-reused 5806 
 +Receiving objects: 100% (5924/5924), 12.50 MiB | 1.57 MiB/s, done. 
 +Resolving deltas: 100% (4047/4047), done. 
 + 
 +pi@raspberrypi:~ $ cd rtl8812au/ 
 +pi@raspberrypi:~/rtl8812au $ vi Makefile  
 + 
 +CONFIG_PLATFORM_I386_PC suchen und auf "n" setzen 
 +CONFIG_PLATFORM_ARM_RPI suchen und auf "y" setzen 
 + 
 +(vim mit :wq beenden und die obige Änderung speichern!) 
 +</code> 
 + 
 +==== rtl8812au Treiber mit DKMS kompilieren ==== 
 + 
 +Den Treiber über diese DKMS-Funktion zu erstellen hat den Vorteil dass beim nächsten Kernel-Update der Treiber einfach neu gebaut werden kann ohne dass man dies manuell tun müsste. 
 + 
 +<code> 
 +pi@raspberrypi:~/rtl8812au $ sudo ./dkms-install.sh  
 +About to run dkms install steps... 
 +Error! DKMS tree already contains: rtl8812au-5.1.5 
 +You cannot add the same module/version combo more than once. 
 + 
 +Kernel preparation unnecessary for this kernel.  Skipping... 
 + 
 +Building module: 
 +cleaning build area... 
 +'make' KVER=4.14.71-v7+ && 'make' RTL8814=1 KVER=4.14.71-v7+......................................................................................................................................................................................... 
 +cleaning build area... 
 + 
 +DKMS: build completed. 
 + 
 +8812au: 
 +Running module version sanity check. 
 + - Original module 
 +   - No original module exists within this kernel 
 + - Installation 
 +   - Installing to /lib/modules/4.14.71-v7+/updates/ 
 + 
 +8814au.ko: 
 +Running module version sanity check. 
 + - Original module 
 +   - No original module exists within this kernel 
 + - Installation 
 +   - Installing to /lib/modules/4.14.71-v7+/updates/ 
 + 
 +depmod.... 
 + 
 +DKMS: install completed. 
 +Finished running dkms install steps. 
 +</code> 
 + 
 +==== Optional: Fehlerbehebung ==== 
 +Wer diese Fehlermeldung sieht, hat meinen Hinweis mit dem Reboot nicht beachtet. Bitte den Raspberry Pi neustarten und es dann erneut versuchen. 
 +<code> 
 +pi@raspberrypi:~/rtl8812au $ sudo ./dkms-install.sh  
 +About to run dkms install steps... 
 + 
 +Creating symlink /var/lib/dkms/rtl8812au/5.1.5/source -> 
 +                 /usr/src/rtl8812au-5.1.5 
 + 
 +DKMS: add completed. 
 +Error! echo 
 +Your kernel headers for kernel 4.14.50-v7+ cannot be found at 
 +/lib/modules/4.14.50-v7+/build or /lib/modules/4.14.50-v7+/source. 
 +Error! echo 
 +Your kernel headers for kernel 4.14.50-v7+ cannot be found at 
 +/lib/modules/4.14.50-v7+/build or /lib/modules/4.14.50-v7+/source. 
 +Finished running dkms install steps. 
 +</code> 
 + 
 +==== udev Regel zur Bezeichnungs der Schnittstellen ==== 
 +Mit dieser Regel ändern wir die Bezeichnung der Karten in der von uns festgelegten Form bei jedem Start des Raspberry Pi bzw. immer dann wenn die USB-Sticks verbunden werden. 
 +<code> 
 +pi@raspberrypi:~ $ sudo vi /etc/udev/rules.d/10-wlan.rules  
 +SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:c0:ca:a5:AA:BB", ATTR{dev_id}=="0x0", ATTR{type}=="1", KERNEL=="wlan*", NAME="wlan1" 
 +SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:c0:ca:a5:CC:DD", ATTR{dev_id}=="0x0", ATTR{type}=="1", KERNEL=="wlan*", NAME="wlan2" 
 +</code> 
 + 
 +==== DHCP auf den Interfaces wlan1 & wlan2 deaktivieren ==== 
 + 
 +<code> 
 +pi@raspberrypi:~ $ sudo vi /etc/dhcpcd.conf  
 + 
 +denyinterfaces wlan1 wlan2 
 +</code> 
 + 
 +==== Die wlan1 & wlan2 Schnittstellen auf 80 MHz breite Kanäle einstellen ==== 
 +Nehmen wir mal an dass Kanal 100 und 112 in 80 MHz mitgeschnitten werden sollen... 
 +airmon-ng bietet uns an Prozesse aus dem Weg zu räumen die uns bei der Aufzeichnung stören könnten, daher machen wir das bevor wir die Schnittstellen zu Monitor-Interfaces machen. 
 + 
 +<code> 
 +pi@raspberrypi:~ $ sudo airmon-ng check 
 + 
 +Found 4 processes that could cause trouble. 
 +If airodump-ng, aireplay-ng or airtun-ng stops working after 
 +a short period of time, you may want to run 'airmon-ng check kill' 
 + 
 +  PID Name 
 +  319 avahi-daemon 
 +  348 avahi-daemon 
 +  401 wpa_supplicant 
 +  516 dhcpcd 
 + 
 +pi@raspberrypi:~ $ sudo airmon-ng check kill 
 + 
 +Killing these processes: 
 + 
 +  PID Name 
 +  401 wpa_supplicant 
 +  516 dhcpcd 
 + 
 +pi@raspberrypi:~ $ sudo airmon-ng check 
 + 
 +pi@raspberrypi:~ $ sudo iw dev wlan1 set type monitor 
 +pi@raspberrypi:~ $ sudo iw dev wlan2 set type monitor  
 + 
 +pi@raspberrypi:~ $ sudo ip link set wlan1 up 
 +pi@raspberrypi:~ $ sudo ip link set wlan2 up 
 + 
 +pi@raspberrypi:~ $ sudo iw wlan1 set freq 5500 80 5530 
 +pi@raspberrypi:~ $ sudo iw wlan2 set freq 5560 80 5550 
 + 
 +pi@raspberrypi:~ $ sudo iw wlan1 info 
 +Interface wlan1 
 + ifindex 4 
 + wdev 0x100000001 
 + addr 00:c0:ca:a5:77:83 
 + type monitor 
 + wiphy 1 
 + channel 100 (5500 MHz), width: 80 MHz, center1: 5470 MHz 
 + txpower 18.00 dBm 
 +pi@raspberrypi:~ $ sudo iw wlan2 info 
 +Interface wlan2 
 + ifindex 5 
 + wdev 0x200000001 
 + addr 00:c0:ca:a5:79:12 
 + type monitor 
 + wiphy 2 
 + channel 112 (5560 MHz), width: 80 MHz, center1: 5530 MHz 
 + txpower 18.00 dBm 
 +</code> 
 + 
 +==== Optional: Eigenes "iw" bauen ==== 
 +Im obigen Fenster ist es vielleicht aufgefallen, dass die Wahl der Kanäle nun nicht unbedingt selbsterklärend war. Zum Glück wird das Werkzeug "iw" weiterhin gut gepflegt und im nächsten Debian (und voraussichtlich auch Raspbian) wird dann die aktualisierte Variante in Version 4.14 dabei sein. Bis dahin kann man sich dies natürlich selbst bauen, wie dies geht zeige ich hier. :) 
 + 
 +<code> 
 +pi@raspberrypi:~ $ iw --version 
 +iw version 4.9 
 +pi@raspberrypi:~ $ wget https://git.kernel.org/pub/scm/linux/kernel/git/jberg/iw.git/snapshot/iw-4.14.tar.gz 
 +--2018-11-10 15:43:31--  https://git.kernel.org/pub/scm/linux/kernel/git/jberg/iw.git/snapshot/iw-4.14.tar.gz 
 +Resolving git.kernel.org (git.kernel.org)... 2604:1380:4090:1700::1, 147.75.44.153 
 +Connecting to git.kernel.org (git.kernel.org)|2604:1380:4090:1700::1|:443... connected. 
 +HTTP request sent, awaiting response... 200 OK 
 +Length: unspecified [application/x-gzip] 
 +Saving to: ‘iw-4.14.tar.gz’ 
 + 
 +iw-4.14.tar.gz                         [ <=>                                                           ] 141.60K  --.-KB/   in 0.09s    
 + 
 +2018-11-10 15:43:46 (1.51 MB/s) - ‘iw-4.14.tar.gz’ saved [144999] 
 + 
 +pi@raspberrypi:~ $  
 +pi@raspberrypi:~ $  
 +pi@raspberrypi:~ $ ls 
 +iw-4.14.tar.gz  rtl8812au 
 +pi@raspberrypi:~ $ file iw-4.14.tar.gz  
 +iw-4.14.tar.gz: gzip compressed data, from Unix 
 +pi@raspberrypi:~ $  
 +pi@raspberrypi:~ $  
 +pi@raspberrypi:~ $ tar xzvf iw-4.14.tar.gz  
 +iw-4.14/ 
 +iw-4.14/.gitignore 
 +iw-4.14/Android.mk 
 +iw-4.14/CONTRIBUTING 
 +iw-4.14/COPYING 
 +iw-4.14/Makefile 
 +iw-4.14/README 
 +iw-4.14/ap.c 
 +iw-4.14/bitrate.c 
 +iw-4.14/coalesce.c 
 +iw-4.14/connect.c 
 +iw-4.14/cqm.c 
 +iw-4.14/event.c 
 +iw-4.14/genl.c 
 +iw-4.14/hwsim.c 
 +iw-4.14/ibss.c 
 +iw-4.14/ieee80211.h 
 +iw-4.14/info.c 
 +iw-4.14/interface.c 
 +iw-4.14/iw.8 
 +iw-4.14/iw.c 
 +iw-4.14/iw.h 
 +iw-4.14/link.c 
 +iw-4.14/mesh.c 
 +iw-4.14/mgmt.c 
 +iw-4.14/mpath.c 
 +iw-4.14/mpp.c 
 +iw-4.14/nl80211.h 
 +iw-4.14/ocb.c 
 +iw-4.14/offch.c 
 +iw-4.14/p2p.c 
 +iw-4.14/phy.c 
 +iw-4.14/ps.c 
 +iw-4.14/reason.c 
 +iw-4.14/reg.c 
 +iw-4.14/roc.c 
 +iw-4.14/scan.c 
 +iw-4.14/sections.c 
 +iw-4.14/station.c 
 +iw-4.14/status.c 
 +iw-4.14/survey.c 
 +iw-4.14/util.c 
 +iw-4.14/vendor.c 
 +iw-4.14/version.sh 
 +iw-4.14/wowlan.c 
 +pi@raspberrypi:~ $ cd iw-4.14/ 
 +pi@raspberrypi:~/iw-4.14 $ ls 
 +Android.mk  connect.c     event.c  ieee80211.h  iw.c      mesh.c   nl80211.h  phy.c     reg.c       station.c  vendor.c 
 +ap.c        CONTRIBUTING  genl.c   info.c       iw.h      mgmt.c   ocb.c      ps.c      roc.c       status.c   version.sh 
 +bitrate.c   COPYING       hwsim.c  interface.c  link.c    mpath.c  offch.c    README    scan.c      survey.c   wowlan.c 
 +coalesce.c  cqm.c         ibss.c   iw.8         Makefile  mpp.c    p2p.c      reason.c  sections.c  util.c 
 + 
 +(Damit iw-4.14 erfolgreich baut, brauchen wir libnl1 bzw. auch -dev.) 
 + 
 +pi@raspberrypi:~/iw-4.14 $ sudo apt-get install libnl-dev 
 +Reading package lists... Done 
 +Building dependency tree        
 +Reading state information... Done 
 +The following additional packages will be installed: 
 +  libnl1 
 +Suggested packages: 
 +  libnl-doc 
 +The following NEW packages will be installed: 
 +  libnl-dev libnl1 
 +0 upgraded, 2 newly installed, 0 to remove and 0 not upgraded. 
 +Need to get 156 kB of archives. 
 +After this operation, 409 kB of additional disk space will be used. 
 +Do you want to continue? [Y/n]  
 +Get:1 http://mirror.de.leaseweb.net/raspbian/raspbian stretch/main armhf libnl1 armhf 1.1-8 [122 kB] 
 +Get:2 http://ftp.halifax.rwth-aachen.de/raspbian/raspbian stretch/main armhf libnl-dev armhf 1.1-8 [33.8 kB] 
 +Fetched 156 kB in 0s (254 kB/s)                                         
 +Selecting previously unselected package libnl1:armhf. 
 +(Reading database ... 69642 files and directories currently installed.) 
 +Preparing to unpack .../libnl1_1.1-8_armhf.deb ... 
 +Unpacking libnl1:armhf (1.1-8) ... 
 +Selecting previously unselected package libnl-dev. 
 +Preparing to unpack .../libnl-dev_1.1-8_armhf.deb ... 
 +Unpacking libnl-dev (1.1-8) ... 
 +Setting up libnl1:armhf (1.1-8) ... 
 +Setting up libnl-dev (1.1-8) ... 
 + 
 +pi@raspberrypi:~/iw-4.14 $ make 
 + CC   iw.o 
 + CC   genl.o 
 + CC   event.o 
 + CC   info.o 
 + CC   phy.o 
 + CC   interface.o 
 + CC   ibss.o 
 + CC   station.o 
 + CC   survey.o 
 + CC   util.o 
 + CC   ocb.o 
 + CC   mesh.o 
 + CC   mpath.o 
 + CC   mpp.o 
 + CC   scan.o 
 + CC   reg.o 
 + GEN  version.c 
 + CC   version.o 
 + CC   reason.o 
 + CC   status.o 
 + CC   connect.o 
 + CC   link.o 
 + CC   offch.o 
 + CC   ps.o 
 + CC   cqm.o 
 + CC   bitrate.o 
 + CC   wowlan.o 
 + CC   coalesce.o 
 + CC   roc.o 
 + CC   p2p.o 
 + CC   vendor.o 
 + CC   mgmt.o 
 + CC   ap.o 
 + CC   sections.o 
 + CC   iw 
 + 
 +Es ist nun wirklich einfach die Kanäle zu setzen. 
 + 
 +pi@raspberrypi:~/iw-4.14 $ sudo ./iw wlan1 set channel 52 80MHz 
 +pi@raspberrypi:~/iw-4.14 $ sudo ./iw wlan2 set channel 100 80MHz 
 + 
 +pi@raspberrypi:~/iw-4.14 $ ./iw wlan1 info 
 +Interface wlan1 
 + ifindex 4 
 + wdev 0x100000001 
 + addr 00:c0:ca:a5:77:83 
 + type monitor 
 + wiphy 1 
 + channel 52 (5260 MHz), width: 80 MHz, center1: 5230 MHz 
 + txpower 18.00 dBm 
 + 
 +pi@raspberrypi:~/iw-4.14 $ ./iw wlan2 info 
 +Interface wlan2 
 + ifindex 5 
 + wdev 0x200000001 
 + addr 00:c0:ca:a5:79:12 
 + type monitor 
 + wiphy 2 
 + channel 100 (5500 MHz), width: 80 MHz, center1: 5470 MHz 
 + txpower 18.00 dBm 
 +</code> 
 + 
 +==== Wireshark installieren ==== 
 +Mit der Installation von Wireshark ist der Raspberry Pi wieder einen Moment beschäftigt. Die Frage ob Benutzer in der Lage sein sollen die Daten mitzuschneiden, sollte mit "Ja" beantwortet werden. Nach Abschluss der Installation muss der Benutzer **pi** noch in die Gruppe wireshark aufgenommen werden. Danach sollte man sich einmal abmelden und wieder anmelden, um diese Änderung wirksam zu machen. 
 + 
 +<code> 
 +pi@raspberrypi:~ $ sudo apt-get install wireshark 
 +(dies dauert erstmal wieder) 
 + 
 +pi@raspberrypi:~ $ sudo adduser pi wireshark 
 +Adding user `pi' to group `wireshark' ... 
 +Adding user pi to group wireshark 
 +Done. 
 +</code> 
 + 
 +==== Zugriff aus der Ferne (z.B. von einem Laptop) ==== 
 +Mein Plan von meinem Firmen Laptop per MobaXterm über SSH mit X-Forwarding auf Wireshark zuzugreifen wurde von ziemlichen Verzögerungen geplagt. Daher nun ein Versuch mit VNC ... 
 + 
 +<code> 
 +pi@raspberrypi:~ $ sudo apt-get install tightvncserver fluxbox xterm 
 +(Das dauert jetzt wieder etwas) 
 + 
 +Erstmal ein VNC-Passwort festlegen (maximal acht Zeichen, nichts wertvolles) 
 +pi@raspberrypi:~ $ vncpasswd 
 +Using password file /home/pi/.vnc/passwd 
 +Password:  
 +Verify:    
 +Would you like to enter a view-only password (y/n)? n 
 + 
 +pi@raspberrypi:~ $ vi .vnc/xstartup  
 +(Dort in die letzte Zeile folgendes eintragen) 
 +fluxbox & 
 + 
 +pi@raspberrypi:~/.vnc $ vncserver 
 + 
 +</code> 
 + 
 +Bessere Alternative könnte wohl sein RealVNC zu verwenden. Das wird direkt über "sudo raspi-config" aktiviert. 
 +<code> 
 +sudo systemctl enable vncserver-virtuald.service 
 +sudo systemctl enable vncserver-x11-serviced.service 
 +</code> 
 + 
 +<WRAP center round tip 60%> 
 +Bis hier bin ich bisher gekommen, wirklich hübsch sieht dieser Wireshark jetzt noch nicht aus - aber ein Anfang :) 
 +</WRAP> 
 + 
 + 
 + 
 +===== Erfahrungen mit anderen Wireless-Adaptern ===== 
 + 
 +==== Erfahrungen/Ergebnis mit Broadcom BCM43455 (onboard Raspberry Pi 3 B+) ==== 
 +Mit "nexmon" Firmware-Patch funktioniert der "monitor mode", allerdings sind keine DATA Pakete sichtbar sondern nur Beacons und Multicast. (Es ist möglich dass zukünftige Korrekturen/Erweiterungen die Funktion doch noch nachrüsten.) 
 + 
 +Status: Wer mit dem Pi 3 B+ nur Beacons mitschneiden will, ist hiermit schon gut aufgehoben - aber für erweiterte Analyse ist es mir bisher nicht gut genug. 
 + 
 +==== Erfahrungen/Ergebnis mit TP-Link Archer T2UH (v1/v2) ==== 
 +Ein schreckliches Stück Hardwaregeschichte das es nicht wert ist gekauft zu werden. Die Treiberunterstützung vom Hersteller ist traurig schlecht. In 2018 offiziell einen Treiber bis Kernel v3.16 anzubieten ist schon wirklich dreist (und sich dafür mit Linux-Unterstützung zu rühmen). 
 +Es gibt modifizierte Treiber z.B. im GitHub Repository von [[https://github.com/ulli-kroll/mt7610u|Ulli Kroll]], die zumindest auf v4.14 kompilieren, aber auch nicht für den "monitor mode" funktionieren. Der Versuch den Stick mit airmon-ng zu initialisieren führt dazu dass sich der Kernel weghängt. Sowohl HW v1.0 als auch v2.0 funktionieren nicht für den Monitor Mode (habe beide Varianten getestet). 
 + 
 +Status: m( 
 + 
 +===== Anleitung: Broadcom BCM43455 (onboard Raspberry Pi 3 B+) für Wireless Monitor Mode vorbereiten =====
  
 <WRAP center round important 60%> <WRAP center round important 60%>
Zeile 33: Zeile 582:
  
 <code> <code>
-pi@raspberrypi:~ $ sudo raspi-config 
--> Eigenes Passwort festlegen! 
- 
 pi@raspberrypi:~ $ sudo su pi@raspberrypi:~ $ sudo su
 root@raspberrypi:/home/pi# sudo apt-get install raspberrypi-kernel-headers git libgmp3-dev gawk qpdf bison flex make root@raspberrypi:/home/pi# sudo apt-get install raspberrypi-kernel-headers git libgmp3-dev gawk qpdf bison flex make
Zeile 219: Zeile 765:
  
 <code> <code>
-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# ip link set dev wlan0 down
raspberry-pi-monitor-mode.1540046826.txt.gz · Zuletzt geändert: 2018/10/20 14:47 von benny

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki