You should netinstall with a known good config. Once a router is compromised an attacker can get system level access that you cannot detect or repair from RouterOS UI.
If your router was compromised, netinstall it from zero. Use a known good export to restore (the backups would be easier - but there is no way to inspect what would be restored to the router), and go from there.
In other words: nuke’m from orbit - it’s the only way!