Comments (3)
I am working on an embedded systems project for school and essentially I want to passively capture the BLE packets. I am really only interested in the metadata, so things like frame headers and MAC addresses. Is btlejack the right tool for this?
from btlejack.
I managed to sort of hack it to output. Not sure why the output is never passed to CLIAccessAddressSniffer. I don't know much about python either.
I'm not sure where to get the Access Address, so I used a constant of 1 for now.
So I am at least getting some output. Not sure how to get the rest of the data, any suggestions on where to plug into?
diff --git a/btlejack/__init__.py b/btlejack/__init__.py
index 185f21a..bffbe55 100755
--- a/btlejack/__init__.py
+++ b/btlejack/__init__.py
@@ -260,7 +261,7 @@ def main():
if args.scan_aa:
try:
- supervisor = CLIAccessAddressSniffer(verbose=args.verbose, devices=args.devices)
+ supervisor = CLIAccessAddressSniffer(verbose=args.verbose, devices=args.devices, output=output)
except DeviceError as error:
print('[!] Please connect a compatible Micro:Bit in order to use BtleJack')
sys.exit(-1)
diff --git a/btlejack/supervisors.py b/btlejack/supervisors.py
index 61b3d3f..f7ba4b5 100755
--- a/btlejack/supervisors.py
+++ b/btlejack/supervisors.py
@@ -99,6 +99,7 @@ class AccessAddressSniffer(Supervisor):
self.interface.scan_access_addresses()
def on_packet_received(self, packet):
+ self.on_ll_packet(packet)
"""
Dispatch received packets.
"""
diff --git a/btlejack/ui.py b/btlejack/ui.py
index 1f8820f..d500e7d 100755
--- a/btlejack/ui.py
+++ b/btlejack/ui.py
@@ -346,9 +346,22 @@ class CLIAccessAddressSniffer(AccessAddressSniffer):
def on_ll_packet(self, packet):
"""
- Called when a BLE LL packet is captured.
+ A BLE LL packet has been captured.
"""
- pass
+ timestamp = time()
+ ts_sec = int(timestamp)
+ ts_usec = int((timestamp - ts_sec)*1000000)
+ if self.output is not None:
+
+ # Is it a Nordic Tap output format ?
+ if isinstance(self.output, PcapNordicTapWriter) or isinstance(self.output, PcapBlePHDRWriter):
+ self.output.write_packet(ts_sec, ts_usec, 1, packet.data)
+ else:
+ self.output.write_packet(ts_sec, ts_usec, 1, packet.data[10:])
+
+ pkt_hex = ' '.join(['%02x' % c for c in packet.data[10:]])
+ print('LL Data: ' + pkt_hex)
+
def on_verbose(self, packet):
"""
from btlejack.
Oh, I see. There is no capture during access address discovery (-s option), only while following an existing connection (-f or -c options). During the connection discovery process, btlejack does not capture and decode BLE packets but instead only focuses on the first bytes of every packet received.
This is a statistical attack aiming at identifying every access address used by packets sent in the air, and only that. No way it will capture data during this step (and that would be useless as we don't know how to check CRC since CRCInit has not been recovered yet, without mentionning channel hopping and sync as well ...)
from btlejack.
Related Issues (20)
- Pi Cluster Hat HOT 1
- Firmware update BLE400 HOT 1
- Reading Source/Destination MAC Address HOT 4
- No Results with RPI4 / RPI3 latest Version HOT 9
- Question: Micro:Bit v2 support? HOT 40
- How to make it work with nRF52 DK? HOT 1
- Malformed Packages in wireshark HOT 1
- btlejack complete uninstall HOT 1
- Computing Hop Increment - TIME SENSITIVE HOT 3
- Not working after programming HOT 3
- Support for various attacks planned?
- micro:bit v 2.21 HOT 4
- Garbage on the command line while determining channel map HOT 1
- typo: selectrion
- Wireshark seeing malformed packets
- encryption information packets HOT 1
- Does the btlejack-fw-v2.hex working on NRF52840? HOT 5
- Issues with Btlejack v2 on Micro:Bit V2.21 or alternatives? HOT 1
- Btlejack v2 and Adafruit Bluefruit LE Sniffer Issues
- Connection Lost Error
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from btlejack.