@@ -5,24 +5,14 @@ BOF (Boiboite Opener Framework) is a testing framework for field protocols
55implementations and devices. It is a Python 3.6+ library that provides means to
66send, receive, create, parse and manipulate frames from supported protocols.
77
8- The library currently supports ** KNXnet/IP** , which is our focus, but it can be
9- extended to other types of BMS or industrial network protocols.
10-
11- There are three ways to use BOF:
12-
13- * Automated: Use of higher-level interaction functions to discover devices and
14- start basic exchanges, without requiring to know anything about the protocol.
15-
16- * Standard: Perform more advanced (legitimate) operations. This requires the end
17- user to know how the protocol works (how to establish connections, what kind
18- of messages to send).
19-
20- * Playful: Modify every single part of exchanged frames and misuse the protocol
21- instead of using it (we fuzz devices with it). The end user should have
22- started digging into the protocol's specifications.
8+ The library currently provides discovery and extended testing features for
9+ ** KNXnet/IP** , which is our focus, but it can be extended to other types of BMS
10+ or industrial network protocols. It also provides passive discovery functions
11+ for industrial networks relying on KNXnet/IP, LLDP and Profinet DCP.
2312
2413** Please note that targeting industrial systems can have a severe impact on
25- buildings and people and that BOF must be used carefully.**
14+ people, industrial operations and buildings and that BOF must be used
15+ carefully.**
2616
2717[ ![ GitHub license] ( https://img.shields.io/badge/License-GPL%20v3-blue.svg )] ( https://github.com/Orange-Cyberdefense/bof/blob/master/LICENSE )
2818[ ![ GitHub release] ( https://img.shields.io/github/release/Orange-Cyberdefense/bof.svg )] ( https://gitHub.com/Orange-Cyberdefense/bof/releases/ )
@@ -55,22 +45,50 @@ Protocol implementations use [Scapy](https://scapy.readthedocs.io/en/latest/)'s
5545Getting started
5646---------------
5747
58- BOF is a Python 3.6+ library that should be imported in scripts. It has no
59- installer yet so you need to refer to the ` bof ` subdirectory which contains the
60- library (inside the repository) in your project or to copy the folder to your
61- project's folder. Then, inside your code (or interactively), you can import the
62- library:
48+ BOF is a Python 3.6+ library that should be imported in scripts.
6349
6450``` python
6551import bof
52+ from bof.layers import profinet, knx
53+ from bof.layers.knx import KnxPacket
6654```
6755
56+ There are three ways to use BOF, not all of them are available depending on the
57+ layer:
58+
59+ * ** Automated** : Import or call directly higher-level functions from layers. No
60+ knowledge about the protocol required.
61+
62+ * ** Standard** : Craft packets from layers to interact with remote devices. Basic
63+ knowledge about the protocol requred.
64+
65+ * ** Playful** : Play with packets, misuse the protocol (we fuzz devices with it).
66+ The end user should have started digging into the protocol's specifications.
67+
68+ | | Automated | Standard | Playful |
69+ | --------------| -----------| ----------| ---------|
70+ | KNX | X | X | X |
71+ | LLDP | X | | |
72+ | Modbus | | X | X |
73+ | Profinet DCP | X | | |
74+
75+
6876Now you can start using BOF!
6977
7078TL;DR
7179-----
7280
73- ### Discover devices on a network
81+ ### Several ways yo discover devices on a network
82+
83+ * Passive discovery from the discovery module:
84+
85+ ``` python
86+ from bof.modules.discovery import *
87+
88+ devices = passive_discovery(iface = " eth0" , verbose = True )
89+ ```
90+
91+ * Device discovery using a layer's high-level function
7492
7593``` python
7694from bof.layers.knx import search
@@ -80,10 +98,15 @@ for device in devices:
8098 print (device)
8199```
82100
83- Should output something like :
101+ * Create and send your own discovery packet :
84102
85103```
86- Device: "boiboite" @ 192.168.1.242:3671 - KNX address: 15.15.255 - Hardware: 00:00:ff:ff:ff:ff (SN: 0123456789)
104+ from bof.layers.knx import *
105+
106+ pkt = KNXPacket(type="search request")
107+ responses = KNXnet.multicast(pkt, (KNX_MULTICAST_ADDR, KNX_PORT))
108+ for response, _ in responses:
109+ print(KNXPacket(response))
87110```
88111
89112### Send and receive packets
0 commit comments