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

Update Ethernet/IP layer #4083

Merged
merged 1 commit into from
Aug 3, 2023
Merged

Update Ethernet/IP layer #4083

merged 1 commit into from
Aug 3, 2023

Conversation

claire-lex
Copy link
Contributor

Checklist:

  • If you are new to Scapy: I have checked CONTRIBUTING.md (esp. section submitting-pull-requests)
  • I squashed commits belonging together
  • I added unit tests or explained why they are not relevant
  • I executed the regression tests (using cd test && ./run_tests or tox)
  • If the PR is still not finished, please create a Draft Pull Request

This PR introduces the following changes to the Ethernet/IP layer, last updated in 2019:

  • Fix a few syntax errors
  • Change the payload build/dissect type from MultipleTypeField to bind_layer
  • Detail the List* requests and replies' fields
  • Add some constants
  • Refactor some classes (I also changed a few names)

I made the PR because some Packets from the layer were apparently untested and wouldn't work against a real Ethernet/IP server.

All the changes have been tested against a physical Ethernet/IP gateway device and were written according to Ethernet/IP (enip) Wireshark dissector's code. Some packets could be added or detailed in the future but I did not have the means to test them (I left comments instead).

@codecov
Copy link

codecov bot commented Jul 31, 2023

Codecov Report

Merging #4083 (f873aa9) into master (8e116af) will decrease coverage by 27.31%.
The diff coverage is 100.00%.

❗ Current head f873aa9 differs from pull request most recent head 0c19169. Consider uploading reports for the commit 0c19169 to get more accurate results

@@             Coverage Diff             @@
##           master    #4083       +/-   ##
===========================================
- Coverage   80.11%   52.81%   -27.31%     
===========================================
  Files         328      328               
  Lines       75836    75847       +11     
===========================================
- Hits        60756    40056    -20700     
- Misses      15080    35791    +20711     
Files Changed Coverage Δ
scapy/contrib/enipTCP.py 93.84% <100.00%> (-0.60%) ⬇️

... and 234 files with indirect coverage changes

@p-l-
Copy link
Member

p-l- commented Jul 31, 2023

Hey @claire-lex!
Thanks for this contribution. Could you update .config/codespell_ignore.txt to add componet and hart, to make codespell happy?
Apart from that, LGTM, but I'd like to have @polybassa's view.

@p-l- p-l- requested a review from polybassa July 31, 2023 22:16
@claire-lex
Copy link
Contributor Author

Hi @p-l- !
All done for the codespell_ignore.txt part :)

@p-l-
Copy link
Member

p-l- commented Aug 1, 2023

For some reason the AS_resolver6() tests are failing for "2001:4860:4860::8888", unrelated to that PR.

>>> as_resolver6 = AS_resolver6()
>>> ret = as_resolver6.resolve("2001:4860:4860::8888", "2001:4860:4860::4444")
>>> ret
[('2001:4860:4860::8888', 4205777769, ''),
 ('2001:4860:4860::4444', 15169, 'GOOGLE, US')]

@p-l- p-l- mentioned this pull request Aug 1, 2023
3 tasks
@p-l-
Copy link
Member

p-l- commented Aug 3, 2023

Hey @claire-lex!
We had an issue with a test that should be fixed now. Could you rebase your PR against current master branch?
Sorry for the inconvenience

Add Hart and CompoNet to Codespell ignore settings
@claire-lex
Copy link
Contributor Author

Hi!
Done :)

@p-l- p-l- merged commit 3bd29da into secdev:master Aug 3, 2023
19 checks passed
@p-l-
Copy link
Member

p-l- commented Aug 3, 2023

Thank you!

@gpotter2 gpotter2 added this to the 2.6.0 milestone Nov 28, 2023
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.

4 participants