Skip to content

Implementation of SMB2 headers#2629

Merged
p-l- merged 1 commit intosecdev:masterfrom
Frky:SMB2
May 7, 2020
Merged

Implementation of SMB2 headers#2629
p-l- merged 1 commit intosecdev:masterfrom
Frky:SMB2

Conversation

@Frky
Copy link
Copy Markdown
Contributor

@Frky Frky commented May 7, 2020

Proposal implementation for SMB2 headers dissection.
This implementation is based on the official documentation of SMB2, available here.

Note that implementation is minimalistic and does not handle every part of the protocol.
For instance, some fields have been implemented as bytes, but would deserve a specific Field class, such as the field SystemTime in SMB2_Negociate_Protocol_Response_Header that should be parsing the date format:

class SMB2_Negociate_Protocol_Response_Header(Packet):
    name = "SMB2 Negociate Protocol Response Header"
    fields_desc = [
        XLEShortField("StructureSize", 0),
        ...
        # TODO FIXME
        XLongField("SystemTime", 0),
        ...

@Frky Frky force-pushed the SMB2 branch 2 times, most recently from 3b9985e to 8e46d38 Compare May 7, 2020 14:34
Includes:
  - change guess_payload_class in Packet to handle lambda filters
  - add NByte and XNBytes fields, StrFieldUtf16
  - add tests for SMB2 and for new fields
@codecov
Copy link
Copy Markdown

codecov Bot commented May 7, 2020

Codecov Report

Merging #2629 into master will decrease coverage by 0.37%.
The diff coverage is 95.23%.

@@            Coverage Diff             @@
##           master    #2629      +/-   ##
==========================================
- Coverage   88.61%   88.24%   -0.38%     
==========================================
  Files         247      248       +1     
  Lines       52053    52555     +502     
==========================================
+ Hits        46125    46375     +250     
- Misses       5928     6180     +252     
Impacted Files Coverage Δ
scapy/config.py 83.78% <ø> (ø)
scapy/fields.py 92.20% <89.58%> (-0.03%) ⬇️
scapy/layers/netbios.py 92.42% <100.00%> (+0.23%) ⬆️
scapy/layers/smb.py 100.00% <100.00%> (ø)
scapy/layers/smb2.py 100.00% <100.00%> (ø)
scapy/packet.py 81.47% <100.00%> (-0.01%) ⬇️
scapy/layers/tls/automaton_srv.py 69.19% <0.00%> (-8.84%) ⬇️
scapy/layers/tls/automaton_cli.py 74.91% <0.00%> (-7.77%) ⬇️
scapy/layers/tls/handshake.py 82.65% <0.00%> (-4.78%) ⬇️
scapy/layers/tls/record_sslv2.py 86.03% <0.00%> (-3.36%) ⬇️
... and 24 more

@p-l- p-l- merged commit e4252a8 into secdev:master May 7, 2020
@Frky Frky deleted the SMB2 branch May 7, 2020 15:21
@gpotter2 gpotter2 mentioned this pull request Jul 15, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants