mirror of
https://github.com/carlospolop/hacktricks
synced 2024-11-15 01:17:36 +00:00
c41af08731
Update Bacnet manual 47808-udp-bacnet.md
84 lines
4 KiB
Markdown
84 lines
4 KiB
Markdown
|
|
|
|
<details>
|
|
|
|
<summary><strong>Learn AWS hacking from zero to hero with</strong> <a href="https://training.hacktricks.xyz/courses/arte"><strong>htARTE (HackTricks AWS Red Team Expert)</strong></a><strong>!</strong></summary>
|
|
|
|
Other ways to support HackTricks:
|
|
|
|
* If you want to see your **company advertised in HackTricks** or **download HackTricks in PDF** Check the [**SUBSCRIPTION PLANS**](https://github.com/sponsors/carlospolop)!
|
|
* Get the [**official PEASS & HackTricks swag**](https://peass.creator-spring.com)
|
|
* Discover [**The PEASS Family**](https://opensea.io/collection/the-peass-family), our collection of exclusive [**NFTs**](https://opensea.io/collection/the-peass-family)
|
|
* **Join the** 💬 [**Discord group**](https://discord.gg/hRep4RUj7f) or the [**telegram group**](https://t.me/peass) or **follow** us on **Twitter** 🐦 [**@carlospolopm**](https://twitter.com/hacktricks_live)**.**
|
|
* **Share your hacking tricks by submitting PRs to the** [**HackTricks**](https://github.com/carlospolop/hacktricks) and [**HackTricks Cloud**](https://github.com/carlospolop/hacktricks-cloud) github repos.
|
|
|
|
</details>
|
|
|
|
|
|
# Protocol Information
|
|
|
|
**BACnet** is a **communications protocol** for Building Automation and Control (BAC) networks that leverages the **ASHRAE**, **ANSI**, and **ISO 16484-5 standard** protocol. It facilitates communication among building automation and control systems, enabling applications such as HVAC control, lighting control, access control, and fire detection systems to exchange information. BACnet ensures interoperability and allows computerized building automation devices to communicate, regardless of the specific services they provide.
|
|
|
|
**Default port:** 47808
|
|
|
|
```text
|
|
PORT STATE SERVICE
|
|
47808/udp open BACNet -- Building Automation and Control NetworksEnumerate
|
|
```
|
|
|
|
# Enumeration
|
|
|
|
## Manual
|
|
|
|
```bash
|
|
pip3 install BAC0
|
|
pip3 install netifaces
|
|
|
|
import BAC0
|
|
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
|
|
|
|
```bash
|
|
nmap --script bacnet-info --script-args full=yes -sU -n -sV -p 47808 <IP>
|
|
```
|
|
|
|
This script does not attempt to join a BACnet network as a foreign device, it simply sends BACnet requests directly to an IP addressable device.
|
|
|
|
## Shodan
|
|
|
|
* `port:47808 instance`
|
|
* `"Instance ID" "Vendor Name"`
|
|
|
|
|
|
|
|
<details>
|
|
|
|
<summary><strong>Learn AWS hacking from zero to hero with</strong> <a href="https://training.hacktricks.xyz/courses/arte"><strong>htARTE (HackTricks AWS Red Team Expert)</strong></a><strong>!</strong></summary>
|
|
|
|
Other ways to support HackTricks:
|
|
|
|
* If you want to see your **company advertised in HackTricks** or **download HackTricks in PDF** Check the [**SUBSCRIPTION PLANS**](https://github.com/sponsors/carlospolop)!
|
|
* Get the [**official PEASS & HackTricks swag**](https://peass.creator-spring.com)
|
|
* Discover [**The PEASS Family**](https://opensea.io/collection/the-peass-family), our collection of exclusive [**NFTs**](https://opensea.io/collection/the-peass-family)
|
|
* **Join the** 💬 [**Discord group**](https://discord.gg/hRep4RUj7f) or the [**telegram group**](https://t.me/peass) or **follow** us on **Twitter** 🐦 [**@carlospolopm**](https://twitter.com/hacktricks_live)**.**
|
|
* **Share your hacking tricks by submitting PRs to the** [**HackTricks**](https://github.com/carlospolop/hacktricks) and [**HackTricks Cloud**](https://github.com/carlospolop/hacktricks-cloud) github repos.
|
|
|
|
</details>
|
|
|
|
|