mirror of
https://github.com/carlospolop/hacktricks
synced 2024-11-21 20:23:18 +00:00
Merge pull request #796 from 0x4net/master
Update Bacnet manual 47808-udp-bacnet.md
This commit is contained in:
commit
c41af08731
1 changed files with 17 additions and 6 deletions
|
@ -32,13 +32,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