Where possible, the Caldera for OT plugins leverage open-source libraries and payloads, unifying their exposure through the Caldera Adversary Emulation framework.
-
The BACnet plugin leverages the open-source protocol stack BACnet Stack - version 1.0.
-
The BACnet stack is licensed with the GPL2 License
-
The command-line protocol service binaries produced by building BACnet Stack are used as their respective ability payloads.
The Caldera for OT BACnet Plugin primarily uses unchanged default payloads from the BACnet stack. However, two payloads were modified from the BACnet stack and rebuilt specifically for this plugin. All modifications made to the original source are detailed below.
Modified files:
- Change 1: Reformatted code – unfolded it to make editing easier
- Change 2: L506
- Using IP[:Port] or MAC address in-place of the Device-ID will
- Create a fake entry that maps Device-ID 1337 to the provided IP/MAC
- Set the Target_Device_Object_Instance to 1337
- 1+2 allows skipping the WhoIs/IAm resolution process.
- bacnet-stack may be able to take an input file that stores prior resolutions – but that was avoided to reduce files on the target system.
- Change 3: L541
- Passing index=-2 will cause
- The length of the object property (list type) to be read
- All indices of the object property (list type) to be read 1-by-1 in ReadProp requests
- 1+2 allows reading arbitrarily long lists
- Without requiring the device to support segmentation (seg occurs when packet exceeds MAX_APDU)
- Disabled optional args --mac, --dnet, --dadr and tied the destination network to local connection when mac is specified.
- Change 1: Reformatted code – unfolded it to make editing easier
- Change 2: L391
- Using IP[:Port] or MAC address in-place of the Device-ID will
- Create a fake entry that maps Device-ID 1337 to the provided IP/MAC
- Set the Target_Device_Object_Instance to 1337
- 1+2 allows skipping the WhoIs/IAm resolution process.
- bacnet-stack may be able to take an input file that stores prior resolutions – but that was avoided to reduce files on the target system.
How to compile the binaries present in the plugin’s payloads folder.
- Download BACnet Stack 1.0
- Copy readprop and writeprop main.c files to their respective destinations under /apps/
- Compile binaries
As noted in "Demo BACnet Applications", to build the applications with MinGW tools on Windows, you may need to "copy the mingw-make.exe
to make.exe
to enable the compile."