"Bodeting" - The Activity of going insane reverse engineering a PSA System
|
|
há 5 meses atrás | |
|---|---|---|
| executables | há 5 meses atrás | |
| firmware | há 6 meses atrás | |
| research | há 5 meses atrás | |
| snmp-mibs | há 6 meses atrás | |
| README.md | há 5 meses atrás |
If you want to help out with figuring things out this is where to look I'd say
Server: MQX HTTP - Freescale Embedded Web Server)RTCS FTP Server Readyd:\JenkinsJobs\workspace\Indus\Harmonys\Harmonys_trio\Metis_appli\Middlewares\Third_Party\LwIP\Based on repeated appearances in both firmware strings :
| Username | Password |
|---|---|
public |
jkl1vi5erjnfh |
public |
aSe2=9Z8gOi37* |
PS: Not tested extensively
Each IP Button Bodet Sound Protocol Payload follows a consistent format:
[MEL HEADER]-[LENGTH]-[START]-[SEQUENCE]-[COMMAND]-[ZONE INFO]-[METADATA]-[CHECKSUM]
Seems to send two of the packets each time a button is pressed
4D 45 4C0021 = 33 bytes0100FF, suggesting padding or reserved spaceExamples:
3001 = Melody5001 = Alarm5002 = StopEach zone bit is encoded as:
byte_index = (zone - 1) // 8
bit_index = (zone - 1) % 8
set bit (7 - bit_index) in byte[byte_index]
You can enable multiple zones in a single packet by OR-ing the relevant bits
Examples:
8000 0000 0000 0000 0000 0000 = Zone 8 only0000 8000 0000 0000 0000 0000 = Zone 16 only0000 0000 0000 0000 0020 0000 = Zone 86Note : this is just an assumption not enough testing has been done
After Zone Info:
0001 - Probably Fixed field (sometimes 0002 with certain multizone commands)03 - Volume (1-8)02 - Repeat count (or 00 for infinite)09 - Melody ID (9 in this case)0100 - end-of-command marker, appears to terminate command blocks (expept for stop commands)014a)4d454c 0021 0100 28ff 3001 8000 0000 0000 0000 0000 0000 0001 03 00 01 09 0100 01d5
8000 ...03, Repeats = 00 (infinite)0901D54d454c 001a 0100 24ff 5002 ffff ffff ffff ffff ffff ffff 0f 0107
FF FF ... (you actually cant choose which zone to turn of system refuses zonemaps here)5002)0F 01 instead of 0100 → supports theory that 0100 indicates only the end of melody/alarm command block0107The checksum algorithm used by Bodet PSA protocol has been successfully reverse engineered thanks to severe insanity (I didn't realize it as 2 bytes until I already wasted 5 days reverse engineering it). It works as follows btw:
def compute_psa_checksum(data: bytes) -> bytes:
var_e = 0x0000 # Starting seed value
for i in range(len(data)):
var_e ^= (data[i] + i) & 0xFFFF
return var_e.to_bytes(2, 'big') # 2-byte checksum, big-endian
PS: I extracted this info by decompiling the SIGMA Software Package by Bodet
Key characteristics:
This algorithm allows for generating valid packets for the Bodet PSA system. It was verified against known working packets and matches the behavior observed in the system.
To use this algorithm:
For a ready-to-use implementation, see the hex_checksum.py script in this repository.
##
The Bodet Harmony button configuration uses TCP port 5666 with a simple text+binary protocol:
bou 1 get-att\nMelodys\n54321\n\x00 to get current configbou 1 set-att\nMelodys\n54321\n + modified 170-byte configbou 2 set-att\nack\n\x00For multi-zone targeting (like Button 1: Zones 1,2,4,8,16):
8b80 = zones 1+2+4+8+16 combined0300 = zones 1+2 onlyMelodys as ecosystem ID54321 as authentication tokenThis document analyzes the TCP-based configuration protocol used by Bodet Harmony button devices. The protocol operates on port 5666 and uses a text-based command structure for device configuration.
Commands follow a text-based structure: bou [ID] [command]\n[parameters]\n[binary_data]
Request from Software: 626f752031206765742d6174740a4d656c6f6479730a35343332310a00
Decoded: bou 1 get-att\nMelodys\n54321\n\x00
bou 1 = Most likely Button 1 on the Deviceget-att = Get attributes commandMelodys = Device Ecosystem (Melody IP)54321 = Could be device ID, firmware version, or authentication token\x00 = Null terminatorPossible Settings that can well be set per button : Action type : On or Off Melody Number : 1-30 Number of Repeats : 1-4 (Or maybe 0 for Infinite Repetition like with Sigma master clock and is grayed out if infinite repeats is selected) Volume : 1-8 Repeat Continuously : Yes or No Alarm : Yes or No All zones (radio button) All Selected Zones (ranges from zone 1 to 100 of which each individually can be turned on or off)
Raw Response (170 bytes): 626f752032206765742d6174740a01000101010201010101010101010100000000000020000000000000000000000000200000000000000000000000002000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001a191b04050607080000000101010101060606050505050500000000000000000a00
Known set Parameters for each button : Button 1 :I Action type : On Melody Number : 26 Repeates - Volume : 6 Repeat Continuously : Yes Alarm : No All Selected zones : Zone 6 only
Decoded Header: bou 2 get-att\n[170 bytes of binary configuration data]
The 170-byte payload appears to contain:
Bytes 0-12: Button Configuration Matrix 01000101010201010101010101000000000020000000000000000000000000200000000000000000000000002000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
This looks like a button mapping matrix where:
01, 02 might represent different button types or actions20 (0x20 = 32 decimal) could be zone assignments or timing valuesBytes 140-156: Device Settings 1a191b04050607080000000101010101060606050505050500000000000000000a00
Breaking this down:
1a191b = Could be firmware version (26.25.27 in decimal) (this is 100% the melody Number! we have Button 1 : Melody 26, Button 2 : Melody 25, Button 3 : Melody 27, Button 4 : all off)04050607080000 = Possibly button assignments or melody IDs (could also just be dummy data maybe ?)000101010101 = Enable/disable flags for 6 buttons (but we only have 4 ????)060606050505050 = Volume levels or repeat counts for each button (i mean we have not one vol 5 action fyi)0a00 = Footer/checksumConfiguration Change Request: 626f752031207365742d6174740a4d656c6f6479730a35343332310a[184 bytes config data]
Decoded: bou 1 set-att\nMelodys\n54321\n[new configuration data]
The configuration data in SET commands is similar to GET responses but may include:
Device Acknowledgment:
626f752032
Decoded: bou 2 set-att\nack\n\x00
Simple acknowledgment that configuration was applied successfully.
Configuration String: 626f752031207365742d6174740a4d656c6f6479730a35343332310a010001010101010101010000000000000000200000000000000000000000002000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000008090a0b050607080404040401010101080808080505050501010101000000000a00
Button Configuration:
Key Binary Fields:
08090a0b = melodies 8,9,10,11 in decimal04040404 = 4 repeats for all buttons08080808 = volume 8 for all buttonsConfiguration String: 626f752031207365742d6174740a4d656c6f6479730a35343332310a010001010101010101010000000000000000200000000000000000000000002000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000008090a0b050607080102030401010101080808080505050501010101000000000a00
Button Configuration:
Key Discovery:
01020304 = individual repeat counts per buttonConfiguration String: 626f752031207365742d6174740a4d656c6f6479730a35343332310a010001010101010101010000000000000000200000000000000000000000002000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000008090a0b050607080102030401010101080808080505050500000000000000000a00
Button Configuration:
Key Difference:
01010101 to 00000000Configuration String: 626f752031207365742d6174740a4d656c6f6479730a35343332310a010001010101010101010101010100000000200000000000000000000000002000000000000000000000000020000000000000000000000000200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000008090a0b050607080102030401010101080808080505050500000000000000000a00
Button Configuration:
Zone Configuration Change:
Configuration String: 626f752031207365742d6174740a4d656c6f6479730a35343332310a0100010101010101010101010101000000008b8000000000000000000000008b0000000000000000000000000b000000000000000000000000030000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000008090a0b050607080102030401010101080808080505050500000000000000000a00
Button Configuration:
Zone Encoding Analysis:
8b80 = Button 1 zones (1+2+4+8+16 = zones with bits set)8b00 = Button 2 zones (1+2+4+8)0b00 = Button 3 zones (1+2+4)0300 = Button 4 zones (1+2)Critical Discovery - Zone Bitfield Encoding: The zone configuration uses a bitfield where:
Header Section (14 bytes):
bou 1 set-att\nMelodys\n54321\n
Configuration Data (170 bytes):
08090a0b = melodies 8,9,10,11050607080 = unknown system parameters, static accross multiple devices010101 = button enable confirmations0a00 = configuration checksum?For programmatic configuration:
The Bodet Harmony configuration protocol provides comprehensive control over button behavior through a well-structured binary format. The examples demonstrate sophisticated zone targeting capabilities and granular per-button control. However, the static authentication and predictable structure present security concerns that require network-level protections.
The executables/hexen.py script is not recommended, I used it to make some sample data by listening if the Harmony Speaker would produce noises. It is filled with cursewords