GNU Radio Meets Scapy - FOSDEM · Python. A Simple WLAN Frame GNU Radio meets Scapy // Bastian...

25
GNU Radio Meets Scapy [email protected] www.bastibl.net February 2019 FOSDEM SDR Dev Room Brussels, Belgium

Transcript of GNU Radio Meets Scapy - FOSDEM · Python. A Simple WLAN Frame GNU Radio meets Scapy // Bastian...

Page 1: GNU Radio Meets Scapy - FOSDEM · Python. A Simple WLAN Frame GNU Radio meets Scapy // Bastian Bloessl 12  MAC PHY. Connecting to the Network Stack GNU Radio

GNU Radio Meets Scapy

[email protected]

www.bastibl.net

February 2019 ▪ FOSDEM SDR Dev Room ▪ Brussels, Belgium

Page 2: GNU Radio Meets Scapy - FOSDEM · Python. A Simple WLAN Frame GNU Radio meets Scapy // Bastian Bloessl 12  MAC PHY. Connecting to the Network Stack GNU Radio

www.wime-project.net

▪ WLAN and ZigBee Transceiver

2GNU Radio meets Scapy // Bastian Bloessl

Page 3: GNU Radio Meets Scapy - FOSDEM · Python. A Simple WLAN Frame GNU Radio meets Scapy // Bastian Bloessl 12  MAC PHY. Connecting to the Network Stack GNU Radio

Instant GNU Radio

3GNU Radio meets Scapy // Bastian Bloessl

GNU Radio

GQRX

https://github.com/bastibl/instant-gnuradio

Fosphor

Inspectrum

GR Wiki

Page 4: GNU Radio Meets Scapy - FOSDEM · Python. A Simple WLAN Frame GNU Radio meets Scapy // Bastian Bloessl 12  MAC PHY. Connecting to the Network Stack GNU Radio

Instant GNU Radio

▪ https://github.com/bastibl/instant-gnuradio

4GNU Radio meets Scapy // Bastian Bloesslhttps://github.com/bastibl/instant-gnuradio

Page 5: GNU Radio Meets Scapy - FOSDEM · Python. A Simple WLAN Frame GNU Radio meets Scapy // Bastian Bloessl 12  MAC PHY. Connecting to the Network Stack GNU Radio

Instant GNU Radio

▪ Built with Packer

▪ VM Image

▪ Many applications pre-installed

▪ Easy to extend and customize

5GNU Radio meets Scapy // Bastian Bloessl

SDR Apps Your stuff?Ubuntu

Page 6: GNU Radio Meets Scapy - FOSDEM · Python. A Simple WLAN Frame GNU Radio meets Scapy // Bastian Bloessl 12  MAC PHY. Connecting to the Network Stack GNU Radio

Learn SDR

6GNU Radio meets Scapy // Bastian Bloessl

www.learn-sdr.org

https://www.learn-sdr.org/

Page 7: GNU Radio Meets Scapy - FOSDEM · Python. A Simple WLAN Frame GNU Radio meets Scapy // Bastian Bloessl 12  MAC PHY. Connecting to the Network Stack GNU Radio

GNU Radio WLAN/ZigBee

▪ PHY only (MAC adds only static wrapper)

▪ No CSMA, no ACKs, no network stack

▪ How can I send data?

▪ How can I interact with devices?

7GNU Radio meets Scapy // Bastian Bloessl

PHY

MAC

??

Page 8: GNU Radio Meets Scapy - FOSDEM · Python. A Simple WLAN Frame GNU Radio meets Scapy // Bastian Bloessl 12  MAC PHY. Connecting to the Network Stack GNU Radio

A GNU Radio Transceiver

8GNU Radio meets Scapy // Bastian Bloessl

PHYMAC“hello world!”

Page 9: GNU Radio Meets Scapy - FOSDEM · Python. A Simple WLAN Frame GNU Radio meets Scapy // Bastian Bloessl 12  MAC PHY. Connecting to the Network Stack GNU Radio

A Simple WLAN Frame

9GNU Radio meets Scapy // Bastian Bloessl

PHYMAC“hello world!”

Page 10: GNU Radio Meets Scapy - FOSDEM · Python. A Simple WLAN Frame GNU Radio meets Scapy // Bastian Bloessl 12  MAC PHY. Connecting to the Network Stack GNU Radio

A Simple WLAN Frame

10GNU Radio meets Scapy // Bastian Bloessl

PHYMAC<data from UDP>

Page 11: GNU Radio Meets Scapy - FOSDEM · Python. A Simple WLAN Frame GNU Radio meets Scapy // Bastian Bloessl 12  MAC PHY. Connecting to the Network Stack GNU Radio

Connecting to UDP Socket

11GNU Radio meets Scapy // Bastian Bloessl

▪ Netcat

▪ Python

Page 12: GNU Radio Meets Scapy - FOSDEM · Python. A Simple WLAN Frame GNU Radio meets Scapy // Bastian Bloessl 12  MAC PHY. Connecting to the Network Stack GNU Radio

A Simple WLAN Frame

12GNU Radio meets Scapy // Bastian Bloessl

PHYMAC<data from UDP>

Page 13: GNU Radio Meets Scapy - FOSDEM · Python. A Simple WLAN Frame GNU Radio meets Scapy // Bastian Bloessl 12  MAC PHY. Connecting to the Network Stack GNU Radio

Connecting to the Network Stack

13GNU Radio meets Scapy // Bastian Bloessl

PHYMACIP…

Page 14: GNU Radio Meets Scapy - FOSDEM · Python. A Simple WLAN Frame GNU Radio meets Scapy // Bastian Bloessl 12  MAC PHY. Connecting to the Network Stack GNU Radio

Connecting to the Network Stack

14GNU Radio meets Scapy // Bastian Bloessl

PHYMACIP…

Page 15: GNU Radio Meets Scapy - FOSDEM · Python. A Simple WLAN Frame GNU Radio meets Scapy // Bastian Bloessl 12  MAC PHY. Connecting to the Network Stack GNU Radio

Virtual WLAN Device

15GNU Radio meets Scapy // Bastian Bloessl

Driver

WLAN Card

mac80211

cfg80211

Virtual WLAN

Network stack

Kernel

User

Page 16: GNU Radio Meets Scapy - FOSDEM · Python. A Simple WLAN Frame GNU Radio meets Scapy // Bastian Bloessl 12  MAC PHY. Connecting to the Network Stack GNU Radio

Packet Crafting

16GNU Radio meets Scapy // Bastian Bloessl

▪ Ethernet frame (the hard way)

Page 17: GNU Radio Meets Scapy - FOSDEM · Python. A Simple WLAN Frame GNU Radio meets Scapy // Bastian Bloessl 12  MAC PHY. Connecting to the Network Stack GNU Radio

Scapy

17GNU Radio meets Scapy // Bastian Bloessl

▪ Python turned into adomain-specific language

▪ Open Source

▪ https://scapy.net/

Page 18: GNU Radio Meets Scapy - FOSDEM · Python. A Simple WLAN Frame GNU Radio meets Scapy // Bastian Bloessl 12  MAC PHY. Connecting to the Network Stack GNU Radio

Packet Crafting

18GNU Radio meets Scapy // Bastian Bloessl

Page 19: GNU Radio Meets Scapy - FOSDEM · Python. A Simple WLAN Frame GNU Radio meets Scapy // Bastian Bloessl 12  MAC PHY. Connecting to the Network Stack GNU Radio

Advantages

▪ More flexibility▪ Drivers

▪ No device configuration

▪ No Prototypes (802.11p)

▪ More accessible (ZigBee)

19GNU Radio meets Scapy // Bastian Bloessl

Page 20: GNU Radio Meets Scapy - FOSDEM · Python. A Simple WLAN Frame GNU Radio meets Scapy // Bastian Bloessl 12  MAC PHY. Connecting to the Network Stack GNU Radio

Flow Graph with Scapy

20GNU Radio meets Scapy // Bastian Bloessl

Page 21: GNU Radio Meets Scapy - FOSDEM · Python. A Simple WLAN Frame GNU Radio meets Scapy // Bastian Bloessl 12  MAC PHY. Connecting to the Network Stack GNU Radio

WLAN Frames

21GNU Radio meets Scapy // Bastian Bloessl

▪ Beacon frame

▪ Fuzzing

▪ Deauth

Page 22: GNU Radio Meets Scapy - FOSDEM · Python. A Simple WLAN Frame GNU Radio meets Scapy // Bastian Bloessl 12  MAC PHY. Connecting to the Network Stack GNU Radio

Smart Meter

22GNU Radio meets Scapy // Bastian Bloessl

Page 23: GNU Radio Meets Scapy - FOSDEM · Python. A Simple WLAN Frame GNU Radio meets Scapy // Bastian Bloessl 12  MAC PHY. Connecting to the Network Stack GNU Radio

ZigBee Frame Injection

▪ Data

▪ Fuzzing

23GNU Radio meets Scapy // Bastian Bloessl

Page 24: GNU Radio Meets Scapy - FOSDEM · Python. A Simple WLAN Frame GNU Radio meets Scapy // Bastian Bloessl 12  MAC PHY. Connecting to the Network Stack GNU Radio

Demo

Page 25: GNU Radio Meets Scapy - FOSDEM · Python. A Simple WLAN Frame GNU Radio meets Scapy // Bastian Bloessl 12  MAC PHY. Connecting to the Network Stack GNU Radio

GNU Radio Meets Scapy

[email protected]

www.bastibl.net

February 2019 ▪ FOSDEM SDR Dev Room ▪ Brussels, Belgium