Skip to content

Instantly share code, notes, and snippets.

@lemajes
Last active March 23, 2023 12:01
Show Gist options
  • Save lemajes/dc3d452b56ffee7c234af200a4363268 to your computer and use it in GitHub Desktop.
Save lemajes/dc3d452b56ffee7c234af200a4363268 to your computer and use it in GitHub Desktop.
[SQLITE 101] SQLITE 101 #sqlite #101 #gogs #reset #admin

SQLITE 101

  • Connect to specific database: sqlite3 this.db

  • Liste databases: .databases

  • Reset admin (create new user and recover password and salt to overwrite admin ones)

sqlite> SELECT name,passwd,salt FROM user WHERE name='testuser';
testuser|6ed26719fe986fea3a9f997ab3c7853ac64ce5d0f5f278dbb571a50a2a2509a4540dd353506cf1f4b9b6211b04faa1a1fc28|97ZaYtIZwM

sqlite> UPDATE user
...> SET passwd='6ed26719fe986fea3a9f997ab3c7853ac64ce5d0f5f278dbb571a50a2a2509a4540dd353506cf1f4b9b6211b04faa1a1fc28',
   ...> salt='97ZaYtIZwM'
   ...> WHERE name='user';
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment