Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
This repository was archived by the owner on Oct 5, 2022. It is now read-only.
/sc-dissectorPublic archive

BACnet/SC support for Wireshark

License

NotificationsYou must be signed in to change notification settings

natebenes/sc-dissector

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

(:trumpet:Note: This project has been archived followingthe release of Wireshark 4.0, which includes native support for Secure Connect. 🎺)

BACnet Secure Connect Dissector for Wireshark

With this plugin, you can view and analyzeBACnet Secure Connect (BACnet/SC) traffic from withinWireshark. This plugin has been tested with node-to-hub communication and node-to-node (direct connect) communication.

Screenshot of Wireshark showing a BACnet/SC node establishing a connection.

Installation

Ensure that you have a recent (>= 3.0.0) version of Wireshark installed. Then, add the includedbsc.lua file to your WiresharkPlugin Directory. That's it.

How do I find my plugin directory?

  1. OpenHelp -> About Wireshark on Windows and Linux orWireshark -> About Wireshark on MacOS.

Screenshot showing a mouse about to click on the About Wireshark menu.

  1. Go to theFolders tab.

Screenshot showing the folders tab.

  1. Click on the link in the row labeledPersonal Lua Plugins. If the folder doesn't already exist, Wireshark will offer to create it for you.

Screenshot showing the Personal Lua Plugins entry in the folder table.

  1. A folder will open. This is where you should put the includedbsc.lua file.

Setup

BACnet/SC is different than other BACnet data links because it runs on top of another existing transport layer called WebSockets. WebSockets run on top of HTTP, HTTP runs on top of TLS, and TLS runs on top of TCP (wowsers).

Asking Wireshark to decode your traffic

If your traffic is on TCP port 80 or 443, you can skip this part.

  1. OpenAnalyze -> Decode As and click the+ icon to add a new row to the table.

  2. If your traffic is TLS encrypted, setField toTLS Port. Otherwise, setField toTCP port.

  3. SetValue to the TCP port number you are using, andCurrent toHTTP. If you are using port 47808, it should look like this:

    Screenshot showing the configured Decode As table.

Decrypting your TLS traffic

If your traffic is in plain text, you can skip this part.

BACnet/SC traffic is encrypted over the wire, which is good because no one else on the network can read it or tamper with it. It's also frustrating if you want to troubleshoot a device.

Getting the keys

Fortunately, Wireshark has support fordecrypting TLS traffic. Doing this requires having access to one of the nodes' private keys OR having access to to a key log file. Getting access to either of these things is usually application and device specific.

If you're a software developer looking to add support for key log files to your application, here are a few links that might get you started:

Registering them with Wireshark

  1. OpenEdit -> Preferences on Windows and Linux orWireshark -> Preferences on MacOS.

  2. Expand the tree item labeledProtocols and click onTLS.

    Screenshot showing part of the TLS menu.

    1. If you have a private key from a node, register it by clickingEdit button and adding it to theRSA keys list.
    2. If you have a key log file, clickBrowse to set the(Pre)-Master-Secret log filename.
  3. ClickOK to save your changes.

Usage

Once the plugin is installed and TLS decryption is working, you should be able to explore and analyze BACnet APDUs and NPDUs like normal.

Screenshot showing a captured BACnet APDU.

Additionally, you will be able to view fully dissected BACnet/SC headers and payloads.

Supported message types

This plugin supports dissecting the following BACnet/SC message types:

  • BVLC-Result
  • Encapsulated-NPDU
  • Address-Resolution
  • Address-Resolution-ACK
  • Advertisement
  • Advertisement-Solicitation
  • Connect-Request
  • Connect-Accept
  • Disconnect-Request
  • Disconnect-Accept
  • Heartbeat-Request
  • Heartbeat-ACK

Additionally, limited support is provided for working with Proprietary-Message messages.

Example filters

Screenshot showing a filtered Wireshark capture.

With this plugin, you can filter messages based on over forty different fields. Here are some examples:

DescriptionExpression
All BACnet messagesbsc
Link layer broadcast messagesbsc.destination_vmac == ff:ff:ff:ff:ff:ff
Connect requests from96742512-60b0-4e50-bd0e-accaadcf164ebsc.connect_request.uuid == 96742512-60b0-4e50-bd0e-accaadcf164e
Nodes connected to a secondary hubbsc.advertisement.conn_status == 2
Proprietary header options from vendor510bsc.option.vendor_id == 510

Supported fields

All messages

FieldSelectorData Type
Functionbsc.functionuint8
Controlbsc.controluint8
Reserved Bitsbsc.control.reserveduint8
Originating Virtual Addressbsc.control.has_orig_vmacbool
Destination Virtual Addressbsc.control.has_dest_vmacbool
Destination Optionsbsc.control.has_dest_optsbool
Data Optionsbsc.control.has_data_optsbool
Message IDbsc.message_iduint16
Originating Virtual Addressbsc.originating_vmacether
Destination Virtual Addressbsc.destination_vmacether
Destination Optionbsc.destination_optionnone
Data Optionbsc.data_optionnone
Header Option Markerbsc.option.markernone
More Options Follow?bsc.option.has_morebool
Must Understand?bsc.option.must_understandbool
Header Option Data Present?bsc.option.has_databool
Option Typebsc.option.typeuint8
Option Lengthbsc.option.lengthuint16
Option Databsc.option.datanone
Vendor IDbsc.option.vendor_iduint16
Proprietary Typebsc.option.proprietary_typeuint8
Databsc.option.proprietary_datanone
Payloadbsc.payloadnone

BVLC-Result messages

FieldSelectorData Type
Functionbsc.bvlc_result.functionuint8
Resultbsc.bvlc_result.codeuint8
Error Markerbsc.bvlc_result.error_markeruint8
Error Classbsc.bvlc_result.error_classuint16
Error Codebsc.bvlc_result.error_codeuint16
Error Detailsbsc.bvlc_result.error_detailsstring

Address-Resolution-ACK messages

FieldSelectorData Type
WebSocket URIbsc.address_resolution.uristring

Advertisement messages

FieldSelectorData Type
Hub Connection Statusbsc.advertisement.conn_statusuint8
Accepts Direct Connectsbsc.advertisement.accepts_direct_connectsuint8
Maximum BVLC Lengthbsc.advertisement.maximum_bvlc_lenuint16
Maximum NPDU Lengthbsc.advertisement.maximum_npdu_lenuint16

Connect-Request messages

FieldSelectorData Type
VMAC Addressbsc.connect_request.vmacether
Device UUIDbsc.connect_request.uuidguid
Maximum BVLC Lengthbsc.connect_request.maximum_bvlc_lenuint16
Maximum NPDU Lengthbsc.connect_request.maximum_npdu_lenuint16

Connect-Accept messages

FieldSelectorData Type
VMAC Addressbsc.connect_accept.vmacether
Device UUIDbsc.connect_accept.uuidguid
Maximum BVLC Lengthbsc.connect_accept.maximum_bvlc_lenuint16
Maximum NPDU Lengthbsc.connect_accept.maximum_npdu_lenuint16

Proprietary Messages

FieldSelectorData Type
Vendor IDbsc.proprietary_message.vendor_iduint16
Functionbsc.proprietary_message.functionuint8
Proprietary Databsc.proprietary_message.databytes

Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

FAQ

Why isn't this built into Wireshark like other parts of BACnet?

Getting BACnet/SC support into Wireshark is my ultimate goal.

Rather than developing abuilt-in dissector right away, I thought it might be nice to build some consensus around what sort of information needs to be surfaced from BACnet/SC messages and what the best way to present it is.

How is this software licensed?

LikeWireshark, this software is licensed under the GPL


[8]ページ先頭

©2009-2025 Movatter.jp