Wrote a small Python CLI to edit Mikrotik Winbox 4's unencrypted .cdb connection database from the command line.
Targets one entry at a time (looked up by IP or MAC) and can change the address, login, password, comment,
group, or RoMON agent - or delete the entry outright.
The .cdb format is undocumented binary, reverse-engineered from a single Winbox 4.1 sample. A future Winbox update could change the layout and break this tool — the round-trip check is your first line of defense; if it errors on your file, treat the format as unknown and don't run edits.
Every write keeps a .bak next to the file (created once, reused within a 10-minute window so a sequence of edits doesn't quietly overwrite your pre-batch state), writes atomically, and re-parses the result to confirm the target record really has the new values — the backup is restored automatically if anything looks off. A small check_roundtrip.py helper additionally proves the parser can re-emit any given input byte-identically.
Reverse-engineered against my own Winbox 4.1 database (~350 entries) during a lager network migration.
No external dependencies, MIT-licensed, byte-identical round-trip verified on the sample.
Sharing in case it saves someone else an afternoon:
Cheers!