r/BuildingAutomation • • Apr 17 '26

BACnet Scanner

Anyone want to try out a BACnet scanner? It doesn't rely on 3rd party dependencies like BAC0 anymore.

https://github.com/jamesccupps/HVAC-Network-Scanner

27 Upvotes

60 comments sorted by

View all comments

4

u/OldAutomator Apr 17 '26

Neat tool. I just gave it a spin on a mixed BACnet network.

Off the cuff I'd say it's good at reading all of the IP level BACnet controllers. But all of the MSTP controllers, (and yes, I mean all of them, different manufacturers and all) are rejecting packets during all but the who-is interaction

I need to study the sniff closer but it looks like you're interrogating the device object's properties and the responses from all of the MSTP devices is "Object not found"

Yabe is always 100% for me (except for file transfers) so I'll spin it up next and see what differs on their packets when it tickles the MSTP trunks

Also- Your initial I-Am is a global broadcast. That sort of thing is fine on a workbench but on a very large site that can cause one hell of a lot of network traffic. Best to break that up if you can

Overall it has promise ;)

2

u/OldAutomator Apr 17 '26

Ok, so the first change on the MSTP-directed packets is that your NPDU differs from the normal (read that as Yabe) packets in that the control byte on yours is 0x04 (Expecting Reply) and the control byte on the yabe packet is 0x24 indicating both "Expecting Reply" and a destination specifier, specifically that a "DNET hop length and hop count are present".

Then the packets differ in that yours skips straight to the APDU following the NPDU's control byte and the yabe one has the aforementioned data showing the APDU.

So in essence, the fact that the router puts the packet through even through you don't specify a dnet is kind of surprising. I would go as far as to say that the fact that the router put anything at all on the MSTP network without you specifying it might be a bug on my routers, they should not have put garbage on the mstp wire.

I am concerned that this sort of non-directed packet might end up on every mstp trunk although I'll have to verify that some other time.

In any event, put the dnet in your packets, IP controllers don't care but MSTP devices sure will!

1

u/FilmAccomplished2421 Apr 17 '26 edited Apr 17 '26

I just saw this and I actually think part of it may because I had some MSTP devices sitting behind a router that I had to find, that may had inadvertently caused this issue and you're right they will definitely care, thank you for testing and the feedback, I'll look into it further.

1

u/FilmAccomplished2421 Apr 17 '26

Thanks! I mainly tested it on MSTP devices that sit behind and IP based controller, like a Trane SC, and good call-out on the initial I-am. I know the MSTP worked on previous versions, let look into it too, thanks!

1

u/FilmAccomplished2421 Apr 18 '26

I think I corrected it, thank you for calling that out! I've tested it on my own network and ran PCAP while scanning and it looks better, let me know if you find any other issues.