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

DNP3 support #11

Open
glaslos opened this issue Apr 11, 2013 · 19 comments
Open

DNP3 support #11

glaslos opened this issue Apr 11, 2013 · 19 comments

Comments

@glaslos
Copy link
Member

glaslos commented Apr 11, 2013

Skills required: Python, basic C++, dissecting network traffic.
* Time estimation:* We assume this to be a three months project.
Short Description: Improve Conpot’s current very minimal support for the DNP3 protocol. Goal is to provide a server capable of basic DNP3 communication.

Description:
Conpot provides a variety of common protocols: Modbus, S7Comm, SNMP, HTTP and Kamstrup. We are always working on getting additional protocols supported. This is a rather complicated task as many protocols don't have an open source implementation, documentation is rather complex or simply not available. One of the protocols we are interested in is DNP3 (Distributed Network Protocol) which is similar to IEC 60870-5 and often used for communication between control centers, RTUs (Remote Terminal Units) and IEDs (Intelligent Electronic Devices). Conpot has a feature which we call the Proxy Module. This allows us to proxy incoming requests through Conpot to a service and back to the client. When we implement a new protocol in Conpot, we set up an instance with this proxy module and tunnel all requests from the client to e.g. a real device or a service with that protocol running on another host. Then, piece by piece, we are decoding the message in Conpot while it passes through so we get insight into the intention of the request. Right now we have a very basic decoder for the DNP3 protocol which we would like to extend.

More information:

@ghost ghost assigned glaslos Sep 24, 2013
@glaslos
Copy link
Member Author

glaslos commented Aug 11, 2014

I made some successful tests with the proxy module: https://github.com/glastopf/conpot/tree/dnp3_proxy

@adepasquale
Copy link
Member

@glaslos
Copy link
Member Author

glaslos commented Sep 28, 2014

The documentation should be up to date. Have a look at the decoder and how to extend it.

@glaslos
Copy link
Member Author

glaslos commented Sep 29, 2014

Let me know if you run into any problems or need some help.

@adepasquale
Copy link
Member

I've just built and installed cverges' DNP3 fork successfully.

Is this right or do I need to install automatak's one?

Now I'll read something about DNP3 and then I'll have a look at the decoder in the dnp3_proxy branch.

@glaslos
Copy link
Member Author

glaslos commented Oct 28, 2014

I went straight to the automatak code and installed the samples, some instructions can be found here: https://github.com/mushorg/conpot/blob/dnp3_proxy/docs/source/components/protocols/dnp3.rst

@adepasquale
Copy link
Member

Ok thanks I'll do.

@adepasquale
Copy link
Member

Done, outstationdemo and masterdemo samples are running fine.

@glaslos
Copy link
Member Author

glaslos commented Oct 28, 2014

I have changed the outstations listening port to +=1 so conpot can listen on the default port and I didn't had to change the client. Let me know if you run into trouble merging master into the branch. And feel free to continue using that branch.

@adepasquale
Copy link
Member

Just as a reminder to myself, I patched the source file /cpp/examples/outstation/DemoMain.cpp and changed 20000 to 20001.

@johnnykv johnnykv modified the milestones: 0.4.1, 0.4.0 Dec 20, 2014
@glaslos
Copy link
Member Author

glaslos commented Mar 24, 2015

This is helpful during development: http://www.automatak.com/opendnp3/decoder/

@glaslos
Copy link
Member Author

glaslos commented Jul 20, 2015

@adepasquale have you looked more into this?

@adepasquale
Copy link
Member

Even if this might overlap with the DNP3 proxy branch, I'd like to code wireshark dissectors first. Then implement DNP3 only after I have better understood the protocol.

@glaslos
Copy link
Member Author

glaslos commented Jul 20, 2015

Sounds good to me. I might have a student interested in working on this after all. I still think writing a proper wrapper around automataks opendnp3 library would be pretty awesome...

@glaslos glaslos changed the title Investigate DNP3 support DNP3 support Jul 20, 2015
@glaslos glaslos modified the milestones: 0.4.1, 0.6.0 Nov 11, 2015
@glaslos glaslos removed this from the 0.6.0 milestone Nov 7, 2016
@xandfury
Copy link
Member

xandfury commented Dec 27, 2018

Although my experience with swig is limited, I think auto generated python API is a little hackish - and may lead to unexpected behavior. I would instead suggest using Boost.python to write the wrapper for the handler.
This way the python API would be seamless to work with, since we know what we are getting into 😉
We can use automak's lib for writing the handler.

@xandfury xandfury pinned this issue Dec 27, 2018
@xandfury
Copy link
Member

There has been promising updates on this 🙂 pydnp3

@prashantvidja
Copy link
Contributor

Any progress?
I am also planning to add dnp3 support in conpot.

@MortalAndTry
Copy link

Six years on, we're still in demand for DNP3, and the old branch is no longer usable.

@glaslos
Copy link
Member Author

glaslos commented Apr 2, 2020

Six years on, we're still in demand for DNP3, and the old branch is no longer usable.

You think you can help in any way?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants