Reseting Wizard's Password
Jump to navigation
Jump to search
There are a few techniques, and each technique has its advocates:
Use a tool:
- Download Omega from ftp://ftp.tinymux.org
- ./configure;make to build Omega
- ./omega -1 yourflatfile newflatfile
- diff -Nau yourflatfile newflatfile to verify that it only changed the password.
Omega resets the password of #1 to 'potrzebie' for PennMUSH, TinyMUSH, TinyMUX, and RhostMUSH flatfiles. It automatically detects the type and flatfile version, but you should still verify that it changes only the password.
Flatfile-only Technique:
- Create a player (or use an existing one) with a known password.
- Take note of the dbref (e.g., #1234).
- @shutdown the game.
- Unload to a flatfile.
- Search for a line with !1234 (regex is ^!1234$) representing the beginning of object #1234.
- Find attribute 5 (look for ^>5$), and on the line below that is a password with $SHA1$ in it.
- Copy the $SHA1$ line (clipboard or yank buffer or whatever your editor calls it).
- Search for a line with !1 (regex is ^!1$) representing the beginning of object #1. It will be located earlier in the file.
- Find attribute 5 (look for ^>5$), and on the line below that is a password with $SHA1$ in it.
- Replace #1's encrypted password with the one from #1234 by replacing that line with the one you copied in Step 7.
- Save and exit.
- Reload the flatfile cleanly.
- ./Startmux
- You should be able to logon to #1 with the same password that #1234 had.
Flatfile+Compile Technique:
- @shutdown the game.
- Unload to a flatfile.
- Search for a line with !1 (regex is ^!1$) representing the beginning of object #1.
- Find attribute 5 (look for ^>5$), and on the line below that is a password with $SHA1$ in it.
- Remove both lines (>5 and the line containing $SHA1$).
- Save and exit.
- Reload the flatfile cleanly.
- In player.cpp, around line 471 in function check_pass, change '#if 0' to "#if 1' and re-compile. This allows #1's password to be set from the login screen only if it is missing from the database.
- ./Startmux
- You should be able to logon to #1 with a new password.
Debugger Technique:
- Make sure you compiled with debugging turned on (the -g option which is on by default).
- Use gdb to attach to the netmux process.
- Set a break point on the check_pass() function.
- Attempt to logon as #1.
- At the end of check_pass(), use debugger commands to change bValidPass to 1.
- From withing #1, attempt to use @password to reset the password using any old passord you want, and perform the same steps above to ensure bValidPass is 1.
Compile-only Technique:
Change the code in player.cpp, in the check_pass() function so that it recognizing #1 specifically, looks for a specific, chosen string of your choosing, and allows it without even looking at the password stored in the database.