Skip to content

Conversation

@micolous
Copy link
Contributor

@micolous micolous commented Mar 9, 2019

ibeacon: New layer!

  • Decodes iBeacon as a submessage of Apple's BLE broadcast frame format. Does not implement support for other types of Apple BLE broadcasts.
  • Adds tests and example documentation.
  • Moves some beacon-building functionality into scapy.layers.bluetooth.

This also includes some minor documentation changes for Eddystone, in order to reference the same Beacon Locator Android app used for testing iBeacons (as it can handle both -- whereas the Eddystone Validator only handles Eddystone).

This PR requires #1892 to be merged first, as it requires UUIDField. Done!

@codecov
Copy link

codecov bot commented Mar 9, 2019

Codecov Report

Merging #1893 into master will decrease coverage by <.01%.
The diff coverage is 100%.

@@            Coverage Diff             @@
##           master    #1893      +/-   ##
==========================================
- Coverage   85.88%   85.88%   -0.01%     
==========================================
  Files         188      189       +1     
  Lines       43007    43031      +24     
==========================================
+ Hits        36936    36956      +20     
- Misses       6071     6075       +4
Impacted Files Coverage Δ
scapy/contrib/ibeacon.py 100% <100%> (ø)
scapy/automaton.py 81.81% <0%> (-0.56%) ⬇️
scapy/layers/ntp.py 91.51% <0%> (-0.27%) ⬇️
scapy/layers/inet6.py 88.05% <0%> (-0.18%) ⬇️
scapy/sendrecv.py 85.1% <0%> (-0.17%) ⬇️
scapy/layers/bluetooth.py 86.31% <0%> (+0.14%) ⬆️
scapy/layers/tls/basefields.py 80.53% <0%> (+0.67%) ⬆️
scapy/layers/tls/record_sslv2.py 87.7% <0%> (+1.67%) ⬆️

@micolous micolous marked this pull request as ready for review March 24, 2019 07:23
@micolous
Copy link
Contributor Author

Now that #1892 is merged, I've rebased on master, and squashed the fix-up commits in this, please take a look!

@micolous micolous changed the title Add support for iBeacon Bluetooth LE: Add support for iBeacon Mar 30, 2019
@gpotter2
Copy link
Member

gpotter2 commented Mar 30, 2019

Hi, I’ve cleaned up the doc, and moved all layer-specific docs. This PR now conflicts.

Sorry for the delay, I didn’t wanted this PR to conflict the other one 😄

Otherwise all good to me

@micolous
Copy link
Contributor Author

Rebased on master. Codacy was sad about changes introduced by this PR when checking #1957, so lets see how this goes...

@micolous
Copy link
Contributor Author

OK, looks like Codacy and the Travis CI linters are happy now! The AppVeyor issues look like you're trying to resolve them in another PR.

@guedou
Copy link
Member

guedou commented Mar 31, 2019

Nice PR!

From a usage point of view. do you think that IBeacon_Data could be integrated intp Apple_BLE_Submessage?

@micolous
Copy link
Contributor Author

micolous commented Apr 8, 2019

From a usage point of view. do you think that IBeacon_Data could be integrated into Apple_BLE_Submessage?

They're intentionally split -- the structure is described in the documentation.

This allows the non-iBeacon Apple BLE frames to be implemented later, if/when the format becomes publicly known. Right now, they're just Raw, which is consistent with how Scapy handles other unknown payloads.

Merging them would cause any capture containing a frame from some other Apple BLE device to have some unexpected behaviour. And who knows, someone might want to fuzz this protocol...

micolous added a commit to micolous/scapy that referenced this pull request Apr 8, 2019
(includes 1 fix-up; excludes iBeacon in secdev#1893)
@micolous
Copy link
Contributor Author

micolous commented Apr 8, 2019

This is now rebased such that common changes needed for #1957 are in both PRs, and the iBeacon-specific changes are in one (squashed) commit. Hopefully won't conflict if both are merged...

Copy link
Member

@gpotter2 gpotter2 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Feel free to merge. Great PR to me

gpotter2 pushed a commit that referenced this pull request Apr 29, 2019
(includes 1 fix-up; excludes iBeacon in #1893)
- Decodes iBeacon as a submessage of Apple's BLE broadcast frame format.
  Does not implement support for other types of Apple BLE broadcasts.

- Adds tests and example documentation.
@gpotter2
Copy link
Member

Rebased against master to fix the doc conflicts

@gpotter2 gpotter2 merged commit a645e7a into secdev:master Apr 29, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants