Repository navigation
Conversation
Add the Service Discovery Protocol PDUs (SDP_Hdr, the service search, attribute and search-attribute requests and responses, the error response, SDP_DataElement and SDP_Continuation). Add the HCI and L2CAP messages needed to reach an SDP service on a target: HCI_Cmd_Switch_Role, HCI_Cmd_Read/Write_Simple_Pairing_Mode, HCI_Event_Role_Change, HCI_Event_Authentication_Complete and the L2CAP_ConfSet options (MTU, flush timeout, QoS). Add UTScapy tests for the new layers. AI-Assisted: no
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #5261 +/- ##
==========================================
+ Coverage 80.55% 80.56% +0.01%
==========================================
Files 375 375
Lines 98399 98489 +90
==========================================
+ Hits 79261 79350 +89
- Misses 19138 19139 +1
🚀 New features to boost your workflow:
|
SDP_DataElement dropped text string and URL data when built, as their length came from `size`, which is only computed at build time. The `size` field was also always packed on one byte for size_index 6 and 7, since MultipleTypeField only evaluates the second element of a (cond, cond) tuple when the value is known. `post_build` hid these issues and misplaced the size for size_index 6 and 7: remove it and let FieldLenField compute `size`. Also fix the SDP responses: the service record handle list was never emitted, and the byte count fields of the attribute responses had a non-None default, so they were never computed. Add tests for the null, boolean, integer, UUID, text, URL and sequence data elements, and for every SDP request and response. AI-Assisted: No
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Add the Service Discovery Protocol (SDP) layers to
scapy.layers.bluetooth:SDP_Hdr,SDP_DataElement,SDP_Continuation, and the service search /attribute / search-attribute requests and responses and the error response.
Also add the HCI and L2CAP messages needed to reach an SDP service on a
target:
HCI_Cmd_Switch_Role,HCI_Cmd_Read/Write_Simple_Pairing_Mode,HCI_Event_Role_Change,HCI_Event_Authentication_Complete, and theL2CAP_ConfSetoptions (MTU, flush timeout, QoS).SDP runs over a dynamic L2CAP CID (PSM 0x0001), so no
bind_layersis declaredfor it.
This work was used for the security analysis presented at SSTIC 2025
(https://www.sstic.org/2025/presentation/300_secondes_chrono__prise_de_contrle_d
un_infodivertissement_automobile__distance/) and published at
https://ieeexplore.ieee.org/document/11632048. The SDP dissection test uses a
response captured from a real target.