Update 47808-udp-bacnet.md

This commit is contained in:
0x4net 2024-02-07 10:01:20 -06:00 committed by GitHub
parent 43da32d5b8
commit 2a5db77396
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -35,13 +35,24 @@ PORT STATE SERVICE
```bash
pip3 install BAC0
pip3 install netifaces
import BAC0
bbmdIP = '<IP>:47808'
bbmdTTL = 900
bacnet = BAC0.connect(bbmdAddress=bbmdIP, bbmdTTL=bbmdTTL) #Connect
bacnet.vendorName.strValue
#I couldn't find how to obtain the same data as nmap with this library or any other
#talk me if you know how please
import time
myIP = '<Your IP>/<MASK>' #You need to be on the same subnet as the bacnet device. Example: '192.168.1.4/24'
bacnet = BAC0.connect(ip=myIP)
bacnet.whois() #Broadcast request of bacnet devices
time.sleep(5) #Wait for devices to respond
for i, (deviceId, companyId, devIp, numDeviceId) in enumerate(bacnet.devices):
print(f"-------- Device #{numDeviceId} --------")
print(f"Device: {deviceId}")
print(f"IP: {devIp}")
print(f"Company: {companyId}")
readDevice = bacnet.readMultiple(f"{devIp} device {numDeviceId} all")
print(f"Model Name: {readDevice[11]}")
print(f"Version: {readDevice[2]}")
# print(readDevice) #List all available info about the device
```
## Automatic