Skip to content

Instantly share code, notes, and snippets.

@kyl191
Created June 11, 2018 02:24
Show Gist options
  • Save kyl191/a06fa26f7cd1f7752e88c1e69c5069c7 to your computer and use it in GitHub Desktop.
Save kyl191/a06fa26f7cd1f7752e88c1e69c5069c7 to your computer and use it in GitHub Desktop.
ZenGallery password reset
# connect to db using mysql
$ mysql
MariaDB [(none)]> use zen_gallery_db;
MariaDB [zen_gallery_db]> select value from zp_options where name = 'extra_auth_hash_text';
(keep this value!)
# separate python process
import hashlib
hashlib.sha1('{username}{password}{value_from_above}'.encode('utf-8')).hexdigest()
# back to mysql
MariaDB [zen_gallery_db]> select * from zp_administrators;
# (find your id in this list)
MariaDB [zen_gallery_db]> update zp_administrators set pass='{python_output}' where id='{yourid}';
MariaDB [zen_gallery_db]> update zp_administrators set passhash=1 where id='{yourid}';
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment