scapy icon indicating copy to clipboard operation
scapy copied to clipboard

Add support for S1G beacon to the dot11 layer. (#2)

Open rkinder2023 opened this issue 1 year ago • 9 comments

Add support for 802.11ah (S1G) beacon parsing.

  • Includes unit test parsing and confirming an S1G beacon
  • Includes support for the new Frame Control format for type=3, subtype=1 (S1G beacon)
  • Includes changes to support addressing used in S1G beacon.

All dot11 unit tests pass with this change.

Fixes #4439

rkinder2023 avatar Jul 12 '24 01:07 rkinder2023

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 81.67%. Comparing base (afd859a) to head (fc06630).

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #4458   +/-   ##
=======================================
  Coverage   81.67%   81.67%           
=======================================
  Files         355      355           
  Lines       84830    84835    +5     
=======================================
+ Hits        69287    69292    +5     
  Misses      15543    15543           
Files Coverage Δ
scapy/layers/dot11.py 91.52% <100.00%> (+0.07%) :arrow_up:

... and 5 files with indirect coverage changes

codecov[bot] avatar Jul 12 '24 01:07 codecov[bot]

I'm really not sure what to do here as the commit into my master branch shows coverage at the correct level (80.73%). I don't know why coverage is reported so low here.

https://app.codecov.io/github/rkinder2023/scapy-s1g/commit/d377b137fa67845896442fd01615abcd883bc590

Any hints from the maintainers?

rkinder2023 avatar Jul 12 '24 01:07 rkinder2023

G'day folks, can I please get approval for the workflow (review would be great too :)? @gpotter2, @guedou, @p-l- ?

rkinder2023 avatar Jul 17 '24 02:07 rkinder2023

Could I please get another review? I have modified to use a set on the 'type in' as per @p-l-, and updated the frame control field to split into three sections for type 3, subtype 1 (@p-l-, @gpotter2 suggestions). This seems the best solution as a change to the underlying frame control to use BitField for all types and subtypes will introduce significant back-compat issues.

Let me know if there is any more testing/unit testing you'd like on this change? I'd like to push this one in as I have more changes to support the S1G IEs within the beacon queued up.

Thanks guys!

rkinder2023 avatar Jul 25 '24 05:07 rkinder2023

Hi folks, any further review or comments? @p-l- @gpotter2 @guedou?

rkinder2023 avatar Aug 09 '24 02:08 rkinder2023

Yeah sorry for the delay. I wanted to test your PR, and still couldn't get around to do it. Would you mind sharing a pcap that contains a few of the packets you are adding?

gpotter2 avatar Aug 09 '24 07:08 gpotter2

@gpotter2, PCAP parsing for the trace I have doesn't work, I'm working on an acceptable solution to this. I managed to hack something in place in order to extract this beacon frame, but don't yet have something ready for review.

rkinder2023 avatar Aug 11 '24 23:08 rkinder2023

S1G-beacon.pcap.gz

This is the S1G beacon I used for developing the patch. The hack I used to get the pcap to load is here:

https://github.com/rkinder2023/scapy-s1g/commit/fda0baba2845288fc1b1b8d54489807c32650c39

I'm sure there's a better way to make TLVs work properly, but I'm not sure what it is.

rkinder2023 avatar Aug 13 '24 01:08 rkinder2023

@gpotter2, any thoughts on this? Anything else you need me to provide?

rkinder2023 avatar Sep 25 '24 22:09 rkinder2023

Thanks for the PR and terribly sorry for the wait.

gpotter2 avatar Dec 28 '24 12:12 gpotter2