mirror of
https://github.com/carlospolop/hacktricks
synced 2024-11-15 01:17:36 +00:00
Update 47808-udp-bacnet.md
This commit is contained in:
parent
43da32d5b8
commit
2a5db77396
1 changed files with 17 additions and 6 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue