Simple Machines Community Forum

SMF Support => SMF 1.1.x Support => Aiheen aloitti: Knitter - heinäkuu 07, 2011, 04:37:56 IP

Otsikko: How to find SMF version and how to inject a new administrator user
Kirjoitti: Knitter - heinäkuu 07, 2011, 04:37:56 IP
Hi,

I'm restoring/moving a SMF database from one hosting to another since the old hosting had problems and SMF stopped working.. I'm entrusted the job of moving everything and restoring the forum but I have no user in the BD that I can use, there are administrator accounts but I wasn't one of them, nor was I a user of the forum. So I would need to put in a new user account in order to properly restore and re-configure SMF. Is there any particular thing that SMF registration process does or can I just insert a new user into the user's table using phpMyAdmin?

Another problem, and again since I'm only trying to restore the forum and had no knowledge of what was installed, is there a way to find what the exact version was? I've looked at some files and they have different version numbers in them and I can't find one single place with the information about the last patch. I know it's a 1.1.x, or I think it is :(

So, I'm basically uploading the files to the new server know, and will be restoring a database backup as soon as possible and try to work from there...

Thanks.
Otsikko: Re: How to find SMF version and how to inject a new administrator user
Kirjoitti: Illori - heinäkuu 07, 2011, 04:51:53 IP
take a look at this I accidentally deleted my admin account. Now what do I do? (http://wiki.simplemachines.org/smf/I_accidentally_lost_my_admin_account!_What_can_I_do)

and you can verify the version in index.php or the main page of the admin panel.
Otsikko: Re: How to find SMF version and how to inject a new administrator user
Kirjoitti: Knitter - heinäkuu 07, 2011, 04:56:12 IP
I've already been to that page but it applies to a user account that already exists in the DB, I have no account created. I could change the password of an existing administrator but I would prefer to have a new account. But since the forum is not yet working nor do I have the password of a current administrator, I can't create a user using SMF.
Otsikko: Re: How to find SMF version and how to inject a new administrator user
Kirjoitti: Illori - heinäkuu 07, 2011, 04:58:55 IP
so you cant even register a new user? then you may be out of luck, it might be possible to just add a new user but i am not familiar with that.
Otsikko: Re: How to find SMF version and how to inject a new administrator user
Kirjoitti: Knitter - heinäkuu 07, 2011, 05:17:55 IP
Hum... ok I'll just take the shortcut of changing the HASH of some administrator user with my own and reset it after I'm done. Don't like to touch other accounts but I want this finished as fast as I can since the forum is down for quite some time now.

Thank you for the help.
Otsikko: Re: How to find SMF version and how to inject a new administrator user
Kirjoitti: Illori - heinäkuu 07, 2011, 05:20:42 IP
i dont think that will work well, as there are 2 parts to the password the hash and the salt
Otsikko: Re: How to find SMF version and how to inject a new administrator user
Kirjoitti: Knitter - heinäkuu 07, 2011, 05:42:21 IP
I found somewhere that the salt was the username appended to the password... I'll confirm and see how it goes.

I managed to find the version number, right at the start of the index file, don't know how I missed it before :o.

Right now I have to correct the DB dump file that is showing duplicated values on an insert, don't know what happen with the dump creation but some values that should have been treated as strings were exported as integers with padding zeros and now MySQL removes the padding and I get duplicated inserts... nothing a few edits don't solve.
Otsikko: Re: How to find SMF version and how to inject a new administrator user
Kirjoitti: Knitter - heinäkuu 08, 2011, 12:05:58 IP
First of all, let me say that finding the salt used to create the hash from password stored along side the resulting hash really brightens my day as I managed to laugh a bit.

Lainaus käyttäjältä: Illori - heinäkuu 07, 2011, 05:20:42 IP
i dont think that will work well, as there are 2 parts to the password the hash and the salt

Secondly I have to confirm that this indeed works and does so without any problem whatsoever as I could just insert an new record in the members table without even bothering to create an hash. I just inserted a new user, with administrator privileges and set the password field to be one of my choosing and in storing the plain password and not the hash.

Of course, I'm using a very old SMF version.

Thanks for the help, managed to solve my problem.