fuzzing and protocol analysis case study of dnp3
play

Fuzzing and protocol analysis case-study of DNP3 Adam Crain, - PowerPoint PPT Presentation

Fuzzing and protocol analysis case-study of DNP3 Adam Crain, Automatak Developed by Harris Corp, handed over to a vendor-neutral User Group in 1993. Many features have been bolted on, including security. Layered Architecture IED/RTU or


  1. Fuzzing and protocol analysis case-study of DNP3 Adam Crain, Automatak

  2. Developed by Harris Corp, handed over to a vendor-neutral User Group in 1993. Many features have been “bolted on”, including security.

  3. Layered Architecture IED/RTU or your SCADA master User code Application Service Data Unit (ASDU) Typical max size of 2KB Application Layer semantics == functions + objects Tx segmentation Transport Layer Rx re-assembly of APDUs Adds CRCs and addressing. Error Link Layer checking and (de) multiplexing.

  4. Application layer messages

  5. Application-layer semantics OBJECTS Measurements, time sync, file transfer, controls, etc, etc FUNCTION CODES ● ∞ combinations READ WRITE ● multiple types per message OPERATE ● Some function codes are CONFIRM “function only” … .. RESPONSE UNSOLICITED

  6. Project Robus • Started in April 2013 • 30+ CVEs found via fuzzing • Deep study of failure modes in one protocol • automatak.com/robus

  7. Focus on serial / masters

  8. DNP3 Fuzzing x Num Test Cases Test DNP3 Message (DL, TL, or AL) x Num Retry (10) Request Link States Request Response Link Status

  9. Common Faults F0 82 00 00 01 00 02 00 00 00 00 FF FF FF FF 0 4294967295 Group 1 4 byte Unsolicited Variation 0 start/stop Response Sizeless?! uint32_t count = stop - start + 1; // ← integer overflow

  10. Less Common Faults Unexpected function code / object combinations DD 82 00 00 0C 01 00 00 01 rnd(11) rnd(11) CROB #1 CROB #2 Control 1 byte Unsolicited Relay start/stop ● buffer overrun Response Output Block ● not malformed! ● unexpected objects ● accepts broadcast

  11. DNP3 Security ● Tightly coupled to the DNP3 Application Layer application layer Secure Authentication ● Auth-only ● New functions Transport Layer ● New objects ● 2 modes of authentication Link Layer

  12. Porous Trust Boundary • Data is dangerous, Application Layer intended function matters not. Logging %n%n%n • Every time you extend DNP3, you make it less Complex Parsing secure. • Optional challenges make security state machine overly complex

  13. 2 modes of authentication “Aggressive mode” – Challenge-response – 2 1 pass authentication pass authentication

  14. Aggressive mode message

  15. Issue #1: Aggressive-mode ambiguity Header / Function ///// Payload Headers //// ???? You can only tell if this is an aggressive mode request by speculatively parsing the 1 st object header. Ambiguity is dangerous.

  16. Issue #2: Lack of an envelope for HMAC Header / Function USER, CSQ //////////////////////////////////////////// HMAC DNP3 headers cannot be “skipped”. They must be parsed sequentially (at least lightly), so that you known where the next one starts.

  17. “Session key status object” • Total size framed by TLV in wrapping header • Composed of fixed-size and variable-length subfields • Final v-length field is the remainder of the encapsulation.

  18. “Update key change reply” • Total size framed by TLV in wrapping header • Composed of fixed-size and variable-length subfields • Final v-length field is the remainder of the encapsulation AND a length prefix.

  19. What does the spec have to say?

  20. SA Conclusions • Prefer a layered approach to SCADA security to that decouples legacy protocol encodings/semantics from security. • Design security to address both function and implementation attack surface.

  21. How can langsec help? Critical infrastructure vendors need better tools • besides hand-rolled parsers. Standards bodies need the theory/guidance to • produce better designs. Protocols need reference implementations to guide • their evolution.

  22. Questions?

Download Presentation
Download Policy: The content available on the website is offered to you 'AS IS' for your personal information and use only. It cannot be commercialized, licensed, or distributed on other websites without prior consent from the author. To download a presentation, simply click this link. If you encounter any difficulties during the download process, it's possible that the publisher has removed the file from their server.

Recommend


More recommend