Skip to content

Commit d41f9e9

Browse files
authored
(credits to weebzo) added check session function
Added check function
2 parents ca8b831 + 4528e41 commit d41f9e9

File tree

2 files changed

+20
-0
lines changed

2 files changed

+20
-0
lines changed

keyauth.py

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -241,6 +241,24 @@ def file(self, fileid):
241241
time.sleep(5)
242242
sys.exit()
243243
return binascii.unhexlify(json["contents"])
244+
245+
def check(self):
246+
init_iv = SHA256.new(str(uuid4())[:8].encode()).hexdigest()
247+
post_data = {
248+
"type": binascii.hexlify(("check").encode()),
249+
"sessionid": binascii.hexlify(self.sessionid.encode()),
250+
"name": binascii.hexlify(self.name.encode()),
251+
"ownerid": binascii.hexlify(self.ownerid.encode()),
252+
"init_iv": init_iv
253+
}
254+
response = self.__do_request(post_data)
255+
256+
response = encryption.decrypt(response, self.enckey, init_iv)
257+
json = jsond.loads(response)
258+
if json["success"]:
259+
return True
260+
else:
261+
return False
244262

245263
def webhook(self, webid, param):
246264

main.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
3.Upgrade
2020
4.License Key Only
2121
""")
22+
print(f"Current Session Validation Status: {keyauthapp.check()}")
2223
ans=input("Select Option: ")
2324
if ans=="1":
2425
user = input('Provide username: ')
@@ -47,3 +48,4 @@
4748
print("Created at: " + datetime.utcfromtimestamp(int(keyauthapp.user_data.createdate)).strftime('%Y-%m-%d %H:%M:%S'))
4849
print("Last login at: " + datetime.utcfromtimestamp(int(keyauthapp.user_data.lastlogin)).strftime('%Y-%m-%d %H:%M:%S'))
4950
print("Expires at: " + datetime.utcfromtimestamp(int(keyauthapp.user_data.expires)).strftime('%Y-%m-%d %H:%M:%S'))
51+
print(f"Current Session Validation Status: {keyauthapp.check()}")

0 commit comments

Comments
 (0)