Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The Windows Update #4214

Merged
merged 15 commits into from
Feb 1, 2024
Merged

The Windows Update #4214

merged 15 commits into from
Feb 1, 2024

Conversation

gpotter2
Copy link
Member

@gpotter2 gpotter2 commented Dec 25, 2023

This PR includes a major refactor regarding several Windows specific protocols, particularily SMB2/3 and DCE/RPC. It also touches many parts of Scapy's core in order to accommodate those changes.

This includes:

  • DCE/RPC:
    • DCERPC_Client with support for NCACN_IP_TCP and NCACN_NP
    • DCERPC_Server with support for NCACN_IP_TCP and NCACN_NP
    • Finish NDR engine !
    • Server/Client Endpoint mapper support - Premises of a few special clients (Netlogon, DCOM, ...)
    • A few RPC interfaces (to debug/test the DCE/RPC engine. TODO: MORE !) - Documentation !
  • SMB2/3:
    • Protocol refactor, many more SMB2/3 structures supported
    • Server (class + 'simple' util smbserver()) (2.0.2 to 3.1.1)
    • Client (class + interactive CLI smbclient()) (2.0.2 only)
    • SMB socket, RPC over SMB socket, etc.
    • Documentation !
  • Kerberos:
    • KerberosSSP to use in SMB/RPC clients/servers
    • Crypto: use cryptography, latest RFC8009, typing, etc.
    • Util functions krb_as_req, krb_tgt_req, kpasswd (both modes), etc.
    • [MS-KILE] variants, SFU and more !
    • Both MIT and Windows variations support
  • NTLM:
    • refactor, clean SSP
    • remove relay (TODO: reimplement with the new system)
  • Extensive GSSAPI / SPNEGO support !
  • Ticketer++
    • CCache support: read/write
    • Kerberos integration: ask/renew/resign/edit tickets
    • Change ticket fields through a GUI ! and more !
  • LDAP
    • Fixes, ASN.1 Windows variation support
    • dclocator, answering machine for "LDAP PING"
  • Automaton:
    • fixes (memory usage on Windows)
    • support for EOF events
    • spawn() mode, better socket.socket support and more !
  • StreamSocket changes, support for TCP reassembly, etc !
  • Unit tests for everything (using samba, etc.)

How to review:

  • build the doc locally and browse SMB/Kerberos/DCERPC
  • try out smbclient and smbserver against Windows machines
  • look at the code

fixes #4170

Copy link

codecov bot commented Dec 25, 2023

Codecov Report

Merging #4214 (1a328ea) into master (ae79fcb) will increase coverage by 0.20%.
Report is 4 commits behind head on master.
The diff coverage is 72.71%.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #4214      +/-   ##
==========================================
+ Coverage   81.77%   81.97%   +0.20%     
==========================================
  Files         331      345      +14     
  Lines       76716    81410    +4694     
==========================================
+ Hits        62731    66734    +4003     
- Misses      13985    14676     +691     
Files Coverage Δ
scapy/__init__.py 83.78% <100.00%> (+0.22%) ⬆️
scapy/arch/libpcap.py 73.80% <100.00%> (ø)
scapy/asn1/mib.py 91.27% <ø> (ø)
scapy/contrib/automotive/bmw/hsfz.py 59.78% <ø> (ø)
scapy/contrib/automotive/doip.py 76.19% <ø> (ø)
scapy/error.py 97.05% <100.00%> (+0.04%) ⬆️
scapy/layers/dhcp6.py 86.04% <100.00%> (+0.15%) ⬆️
scapy/layers/http.py 78.73% <ø> (+0.22%) ⬆️
scapy/layers/inet6.py 88.60% <100.00%> (+0.06%) ⬆️
scapy/layers/kerberos.py 54.43% <ø> (-17.09%) ⬇️
... and 42 more

... and 7 files with indirect coverage changes

@gpotter2 gpotter2 force-pushed the the-windows-update branch 18 times, most recently from ba83083 to 341a787 Compare December 26, 2023 01:39
@gpotter2 gpotter2 force-pushed the the-windows-update branch 7 times, most recently from 0395fe4 to f9c2603 Compare December 30, 2023 10:59
@gpotter2 gpotter2 force-pushed the the-windows-update branch 3 times, most recently from d22aafa to bd5761f Compare January 4, 2024 17:40
This PR includes a major refactor regarding several Windows specific
protocols, particularily SMB2/3 and DCE/RPC. It also touches many parts
of Scapy's core in order to accommodate those changes.

This includes:
  - DCE/RPC:
      - DCERPC_Client with support for NCACN_IP_TCP and NCACN_NP
      - DCERPC_Server with support for NCACN_IP_TCP and NCACN_NP
      - Finish NDR engine !
      - Server/Client Endpoint mapper support
      - Premises of a few special clients (Netlogon, DCOM, ...)
      - A few RPC interfaces (to debug/test the DCE/RPC engine. TODO:
        MORE !)
      - Documentation !
  - SMB2/3:
      - Protocol refactor, many more SMB2/3 structures supported
      - Server (class + 'simple' util smbserver()) (2.0.2 to 3.1.1)
      - Client (class + interactive CLI smbclient()) (2.0.2 only)
      - SMB socket, RPC over SMB socket, etc.
      - Documentation !
  - Kerberos:
      - KerberosSSP to use in SMB/RPC clients/servers
      - Crypto: use cryptography, latest RFC8009, typing, etc.
      - Util functions krb_as_req, krb_tgt_req, kpasswd (both modes), etc.
      - [MS-KILE] variants, SFU and more !
      - Both MIT and Windows variations support
  - NTLM:
      - refactor, clean SSP
      - remove relay (TODO: reimplement with the new system)
  - Extensive GSSAPI / SPNEGO support !
  - Ticketer++
      - CCache support: read/write
      - Kerberos integration: ask/renew/resign/edit tickets
      - Change ticket fields through a GUI ! and more !
  - LDAP
      - Fixes, ASN.1 Windows variation support
      - dclocator, answering machine for "LDAP PING"
  - Automaton:
      - fixes (memory usage on Windows)
      - support for EOF events
      - spawn() mode, better socket.socket support and more !
  - StreamSocket changes, support for TCP reassembly, etc !
  - Unit tests for everything (using samba, etc.)
scapy/layers/msrpce/msnrpc.py Fixed Show fixed Hide fixed
scapy/layers/msrpce/msnrpc.py Fixed Show fixed Hide fixed
@polybassa
Copy link
Contributor

I reviewed a few files that I have an idea about, and everything looks good so far

guedou
guedou previously approved these changes Jan 29, 2024
Copy link
Member

@guedou guedou left a comment

Choose a reason for hiding this comment

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

Awesome PR!

doc/scapy/layers/dcerpc.rst Show resolved Hide resolved
doc/scapy/layers/dcerpc.rst Outdated Show resolved Hide resolved
scapy/layers/http.py Show resolved Hide resolved
scapy/layers/msrpce/msnrpc.py Dismissed Show dismissed Hide dismissed
scapy/layers/msrpce/msnrpc.py Dismissed Show dismissed Hide dismissed
@gpotter2 gpotter2 merged commit 86e1764 into secdev:master Feb 1, 2024
22 checks passed
@gpotter2 gpotter2 deleted the the-windows-update branch February 1, 2024 10:19
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.

Scapy does not handle compounded SMB2 request/response correctly
4 participants