2024-02-08 22:23:24 +00:00
|
|
|
|
<details>
|
|
|
|
|
|
|
|
|
|
<summary><strong>从零开始学习AWS黑客技术,成为专家</strong> <a href="https://training.hacktricks.xyz/courses/arte"><strong>htARTE(HackTricks AWS红队专家)</strong></a><strong>!</strong></summary>
|
|
|
|
|
|
|
|
|
|
其他支持HackTricks的方式:
|
|
|
|
|
|
|
|
|
|
* 如果您想看到您的**公司在HackTricks中做广告**或**下载PDF格式的HackTricks**,请查看[**订阅计划**](https://github.com/sponsors/carlospolop)!
|
|
|
|
|
* 获取[**官方PEASS & HackTricks周边产品**](https://peass.creator-spring.com)
|
2024-02-14 10:09:05 +00:00
|
|
|
|
* 探索[**PEASS家族**](https://opensea.io/collection/the-peass-family),我们的独家[**NFTs**](https://opensea.io/collection/the-peass-family)
|
2024-02-09 12:48:25 +00:00
|
|
|
|
* **加入** 💬 [**Discord群**](https://discord.gg/hRep4RUj7f) 或 [**电报群**](https://t.me/peass) 或 **关注**我们的**Twitter** 🐦 [**@carlospolopm**](https://twitter.com/hacktricks_live)**。**
|
2024-02-08 22:23:24 +00:00
|
|
|
|
* 通过向[**HackTricks**](https://github.com/carlospolop/hacktricks)和[**HackTricks Cloud**](https://github.com/carlospolop/hacktricks-cloud) github仓库提交PR来分享您的黑客技巧。
|
|
|
|
|
|
|
|
|
|
</details>
|
2020-07-15 15:43:14 +00:00
|
|
|
|
|
|
|
|
|
|
2024-02-08 22:23:24 +00:00
|
|
|
|
# 协议信息
|
|
|
|
|
|
2024-02-14 10:09:05 +00:00
|
|
|
|
**BACnet**是一种用于建筑自动化和控制(BAC)网络的**通信协议**,利用**ASHRAE**、**ANSI**和**ISO 16484-5标准**协议。它促进建筑自动化和控制系统之间的通信,实现诸如暖通空调控制、照明控制、门禁控制和火灾检测系统等应用之间的信息交换。BACnet确保互操作性,使计算机化建筑自动化设备能够通信,无论它们提供的具体服务是什么。
|
2020-07-15 15:43:14 +00:00
|
|
|
|
|
2023-08-03 19:12:22 +00:00
|
|
|
|
**默认端口:** 47808
|
2020-07-15 15:43:14 +00:00
|
|
|
|
```text
|
|
|
|
|
PORT STATE SERVICE
|
|
|
|
|
47808/udp open BACNet -- Building Automation and Control NetworksEnumerate
|
|
|
|
|
```
|
2023-08-03 19:12:22 +00:00
|
|
|
|
# 枚举
|
|
|
|
|
|
2024-01-05 23:03:10 +00:00
|
|
|
|
## 手动
|
2020-07-15 15:43:14 +00:00
|
|
|
|
```bash
|
|
|
|
|
pip3 install BAC0
|
2024-02-14 10:09:05 +00:00
|
|
|
|
pip3 install netifaces
|
|
|
|
|
|
2020-07-15 15:43:14 +00:00
|
|
|
|
import BAC0
|
2024-02-14 10:09:05 +00:00
|
|
|
|
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
|
2020-07-15 15:43:14 +00:00
|
|
|
|
```
|
2024-02-14 10:09:05 +00:00
|
|
|
|
## 自动化
|
2020-07-15 15:43:14 +00:00
|
|
|
|
```bash
|
|
|
|
|
nmap --script bacnet-info --script-args full=yes -sU -n -sV -p 47808 <IP>
|
|
|
|
|
```
|
2024-02-14 10:09:05 +00:00
|
|
|
|
这个脚本并不尝试作为外部设备加入BACnet网络,而是直接向一个可通过IP地址访问的设备发送BACnet请求。
|
2020-07-15 15:43:14 +00:00
|
|
|
|
|
2022-05-01 12:49:36 +00:00
|
|
|
|
## Shodan
|
2020-07-15 15:43:14 +00:00
|
|
|
|
|
|
|
|
|
* `port:47808 instance`
|
|
|
|
|
* `"Instance ID" "Vendor Name"`
|