Hello Everyone,
I have a MikroTik router but unfortunately I have forgotten the admin password.
I want to recover or reset the password without losing the existing configuration.
Hello Everyone,
I have a MikroTik router but unfortunately I have forgotten the admin password.
I want to recover or reset the password without losing the existing configuration.
Hi,
You are out of luck. No way to reset password only.
But if you a hacker, you can use the router's netboot functionality of the RouterBoot, and mount the nand from like netbooted OpenWrt, but use the correct image that don't format the nand, just booting OpenWRT.
Here maybe a old working way of doing this:
http://manio.skyboo.net/mikrotik/
The link is a bit outdated...
Now the salted hash is stored, rather than the practically "clear text" password...
(and then the file could be extracted from the .backup, if you had one, without needing all this...)
But do you need the password, is the config and the filesystem encrypted in the nand ?
And what file in the system is the config ?
They are not encrypted, the various parts of the configuration are sql3lite databases,
but the cleartext password can no longer be extracted from the salted hash.
Not exactly "plain" filesystem, however, JFYI:
Even if prcedure is possible then IMHO it's out of technical skills of OP.
There’s a way to dump (or at least simulate access to) the configuration. I used VMWare’s ESXi and I can’t provide instructions for other platforms.
BOM:
The idea was being able to attach the transplant disk to both the workbench and simulated mikrotik, to change the filesystem “on the fly” or without having to disconnect the disk from one VM to be able to connect to the other and run tests.
Now that everything is setup, the password removal. When you first boot a newly flashed system, it creates a file containing the hashed/encrypted credentials. I don’t exactly remember which file it is but if you remove it from your dumped filesystem and reboot the simulated VM, you are allowed to set a new password and run commands. I noticed that during boot, if some hardware devices aren’t available or aren´t recognized as such, some configs are lost, others are corrupted, BUT you will be able to (painstakingly) retrieve most of it using the router’s traditional command lines, maybe even certificates, if you have the skills.
Maybe the file is user.dat/idx (delete both) or system.dat/idx. You can do trial-and-error or create a diff between the filesystem tree of both root dirs and look for files that exist in the dumped one but not on the image’s original.
Hope it helps someone.
If it was only possible to repack the filesystem without the credentials file and reflash it to the device, it would be possible to reset the password again, without losing the configuration (provided that you don´t boot the FS in another VM or do anything else).
But this would require a level or expertise, tools and time I don´t have to validate.