check if syscheck2 or syscheckhde and newer

This commit is contained in:
CrafterPika 2024-11-01 15:51:10 +01:00
parent 2b93e20f66
commit 724761d130
Signed by: crafterpika
GPG key ID: B4E0BA4B52B201DC
2 changed files with 12 additions and 3 deletions

13
app.py
View file

@ -68,14 +68,23 @@ def syscheck_report():
console_id = get_console_id(report_txt)
if console_id == "0":
return "ERROR: Not a valid sysCheck!", 200
console_id_censor = console_id[:-4]+"***"
# figure difference between syscheck2 and syscheckhde and newer
if report_txt.split("\n")[0].startswith("sysCheck v2.1.0b19"):
console_id_censor = console_id[:-4]+"****"
old_syscheck = True
else:
old_syscheck = False
console_id = console_id[:-4]
timestamp = int(time.time())
report_id = id_generator(6, 'AaBbCcDdFfeEgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWXxYyZz1234567890')
if form_data["password"][0] in config["upload_passwords"]:
try:
with open(f"{report_dir}/{report_id}.csv", "a+") as report:
report.write(report_txt.replace(console_id, console_id_censor))
if old_syscheck:
report.write(report_txt.replace(console_id, console_id_censor))
else:
report.write(report_txt)
db = sqlite3.connect(db_dir)
cursor = db.cursor()

View file

@ -1,7 +1,7 @@
{
"ip": "0.0.0.0",
"port": "6969",
"version": "1.0.7",
"version": "1.0.8",
"upload_passwords": [
"d2wRuTEObSAN",
"B277eNGp789a"