|
|
@@ -1,6 +1,5 @@
|
|
|
import json
|
|
|
import sqlite3
|
|
|
-import bcrypt
|
|
|
import hashlib
|
|
|
import threading
|
|
|
|
|
|
@@ -10,10 +9,11 @@ from mark import load_conn2, namumark
|
|
|
try:
|
|
|
f = open('set.json', 'r')
|
|
|
except FileNotFoundError as e:
|
|
|
- print('Error: set.json is not found. please run setup script first.')
|
|
|
+ print('Error: set.json is not found. Please run setup script first.')
|
|
|
exit()
|
|
|
else:
|
|
|
f.close()
|
|
|
+
|
|
|
json_data = open('set.json').read()
|
|
|
set_data = json.loads(json_data)
|
|
|
|
|
|
@@ -22,16 +22,16 @@ curs = conn.cursor()
|
|
|
|
|
|
load_conn(conn)
|
|
|
|
|
|
-print('1. backlink reset')
|
|
|
-print('2. recaptcha delete')
|
|
|
-print('3. ban delete')
|
|
|
-print('4. change host')
|
|
|
-print('5. change port')
|
|
|
-print('6. change skin')
|
|
|
-print('7. change password')
|
|
|
-print('8. reset version')
|
|
|
+print('1. Backlink reset')
|
|
|
+print('2. reCAPTCHA delete')
|
|
|
+print('3. Ban delete')
|
|
|
+print('4. Change host')
|
|
|
+print('5. Change port')
|
|
|
+print('6. Change skin')
|
|
|
+print('7. Change password')
|
|
|
+print('8. Reset version')
|
|
|
|
|
|
-print('select : ', end = '')
|
|
|
+print('Select : ', end = '')
|
|
|
what_i_do = input()
|
|
|
|
|
|
if what_i_do == '1':
|
|
|
@@ -58,7 +58,7 @@ elif what_i_do == '2':
|
|
|
curs.execute("delete from other where name = 'recaptcha'")
|
|
|
curs.execute("delete from other where name = 'sec_re'")
|
|
|
elif what_i_do == '3':
|
|
|
- print('ip or name : ', end = '')
|
|
|
+ print('IP or Name : ', end = '')
|
|
|
user_data = input()
|
|
|
|
|
|
if re.search("^([0-9]{1,3}\.[0-9]{1,3})$", user_data):
|
|
|
@@ -69,47 +69,36 @@ elif what_i_do == '3':
|
|
|
curs.execute("insert into rb (block, end, today, blocker, why, band) values (?, ?, ?, ?, ?, ?)", [user_data, load_lang('release', 1), get_time(), load_lang('tool', 1) + ':emergency', '', band])
|
|
|
curs.execute("delete from ban where block = ?", [user_data])
|
|
|
elif what_i_do == '4':
|
|
|
- print('host : ', end = '')
|
|
|
+ print('Host : ', end = '')
|
|
|
host = input()
|
|
|
|
|
|
curs.execute("update other set data = ? where name = 'host'", [host])
|
|
|
elif what_i_do == '5':
|
|
|
- try:
|
|
|
- print('port : ', end = '')
|
|
|
- port = int(input())
|
|
|
- except ValueError:
|
|
|
- print('Error: Please input int value')
|
|
|
- exit()
|
|
|
+ print('Port : ', end = '')
|
|
|
+ port = int(input())
|
|
|
|
|
|
curs.execute("update other set data = ? where name = 'port'", [port])
|
|
|
elif what_i_do == '6':
|
|
|
- print('skin name : ', end = '')
|
|
|
+ print('Skin\'s name : ', end = '')
|
|
|
skin = input()
|
|
|
|
|
|
curs.execute("update other set data = ? where name = 'skin'", [skin])
|
|
|
elif what_i_do == '7':
|
|
|
- try:
|
|
|
- print('1. sha256')
|
|
|
- print('2. sha3')
|
|
|
- print('3. bcrypt')
|
|
|
- print('select : ', end = '')
|
|
|
- what_i_do = int(input())
|
|
|
- except ValueError:
|
|
|
- print('Error: Please input int value')
|
|
|
- exit()
|
|
|
-
|
|
|
- print('user name : ', end = '')
|
|
|
+ print('1. sha256')
|
|
|
+ print('2. sha3')
|
|
|
+ print('Select : ', end = '')
|
|
|
+ what_i_do = int(input())
|
|
|
+
|
|
|
+ print('User\'s name : ', end = '')
|
|
|
user_name = input()
|
|
|
|
|
|
- print('user password : ', end = '')
|
|
|
+ print('User\'s password : ', end = '')
|
|
|
user_pw = input()
|
|
|
|
|
|
if what_i_do == '1':
|
|
|
hashed = hashlib.sha256(bytes(user_pw, 'utf-8')).hexdigest()
|
|
|
elif what_i_do == '2':
|
|
|
hashed = sha3_256(bytes(user_pw, 'utf-8')).hexdigest()
|
|
|
- elif what_i_do == '3':
|
|
|
- hashed = bcrypt.hashpw(bytes(user_pw, 'utf-8'), bcrypt.gensalt()).decode()
|
|
|
|
|
|
curs.execute("update user set pw = ? where id = ?", [hashed, user_name])
|
|
|
elif what_i_do == '8':
|
|
|
@@ -117,4 +106,4 @@ elif what_i_do == '8':
|
|
|
|
|
|
conn.commit()
|
|
|
|
|
|
-print('ok')
|
|
|
+print('OK')
|