You don't have to use the web UI at all. You can configure a Check Point firewall or management entirely from the command line using config_system.
As for the actual issue, "factory default" on the box is just a snapshot with a weird name. It can be modified to set a non-default password, enable TOTP, and so forth, and every time you "restore to factory defaults", it will go back to that non-default configuration. @Exonix, you need to download the ISO for the version you want to run, write it to a thumb drive with ISOmorphic, and reinstall the boxes using that drive. That will definitely get you back to the default admin:admin credential.