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

[WIP] OPC UA #1569

Closed
wants to merge 78 commits into from
Closed

[WIP] OPC UA #1569

wants to merge 78 commits into from

Conversation

mlgiraud
Copy link

A while ago i implemented the OPC UA layer for scapy.
Although this isn't really finished i thought it would be useful to create a PR so that if someone else considers implementing the OPC UA layer they can start based off my work, instead of starting from scratch.
I currently don't have the time to finish this but might come back to it later.

Implemented:

  • Schema Parser to parse OPC UA schema files
  • Basic types
  • Encryption (only two security policies for now)

Currently missing:

  • Unit tests
  • The Automata should be reworked since they're ugly right now
  • Pub/Sub

The performance is still really awful. Since I'm still rather new to python maybe someone can have a look at where i went wrong on the performance side.

currently only Two and Four byte NodeIds are implemented
Avoids the use of conditional fields.
UaTcp and the two SC packets are linked
by the dispatch hook function
Currently the schema parser does not correctly
create types with lengthOf fields (e.g. arrays)
Enumerated types also have no meaning for now.

The missing NodeIds were implemented but still need
some work regarding the dispatch_hooks (ExpandedNodeId)
ExpandedNodeIds can now correctly be decoded without having to
explicitly be explicitly specified.
Also started implementing correct length fields in the schema parser.
The message part of the payload is now correctly
decoded depending on the binary encoding id.
The _has_XXX functions are now generated
with a function because they are mostly the same
except for the encoding and the field value.
UaMessage now caches created classes increasing efficiency a lot.
The raw encoding doesn't work yet.
Also added some helper stuff.
ExtensionObject raw bytes are now decoded properly.
PacketFields have been replaced by UaPacketFields
that allow access to the containing packet.
The current version uses the
cryptography modules of free-opcua.
Credit needs to be added.
Only asymmetric encryption supported so far.
@guedou
Copy link
Member

guedou commented Aug 6, 2019

Any update on this PR?

@mlgiraud
Copy link
Author

mlgiraud commented Aug 7, 2019

I currently don't have any time to work on this. If anyone wants to pick up where i left off, feel free to ask any questions regarding my code. I haven't tested the code recently, but if the scapy internals didn't change too much in the last year, the code should still work.

@guedou
Copy link
Member

guedou commented Mar 9, 2020

I added a reference to this PR in #399 and I am closing it due to no activity.

@guedou guedou closed this Mar 9, 2020
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