36 lines
1.2 KiB
Batchfile
36 lines
1.2 KiB
Batchfile
@echo off
|
|
rem ============================================================
|
|
rem Kematian panel - reset admin password (keeps all data)
|
|
rem Project: https://t.me/electronic_sex
|
|
rem ============================================================
|
|
cd /d "%~dp0"
|
|
|
|
if not exist kematian.db (
|
|
echo No database found. Start the panel once (setup.bat) first.
|
|
pause
|
|
exit /b 1
|
|
)
|
|
|
|
echo.
|
|
set /p user="Admin username [leave empty for first admin]: "
|
|
set /p pass="New password (min 6 chars): "
|
|
|
|
if "%pass%"=="" (
|
|
echo Password cannot be empty.
|
|
pause
|
|
exit /b 1
|
|
)
|
|
|
|
python -c "import sqlite3,sys; from werkzeug.security import generate_password_hash; c=sqlite3.connect('kematian.db'); where=('id=(SELECT id FROM admin ORDER BY id LIMIT 1)' if sys.argv[1]=='' else 'username=?'); q='UPDATE admin SET password_hash=? WHERE '+where; args=[generate_password_hash(sys.argv[2])]+([sys.argv[1]] if sys.argv[1] else []); n=c.execute(q,args).rowcount; c.commit(); c.close(); sys.exit(0 if n else 1)" "%user%" "%pass%"
|
|
if errorlevel 1 (
|
|
echo.
|
|
echo [!] No matching admin account found. User not updated.
|
|
pause
|
|
exit /b 1
|
|
)
|
|
|
|
echo.
|
|
echo Password updated. Log in with the new credentials.
|
|
echo (Data, clients and loot are untouched.)
|
|
pause
|