Skip to content

Instantly share code, notes, and snippets.

@Informatic
Last active August 29, 2024 21:01
Show Gist options
  • Save Informatic/d9661fd4959bb1a551e3ee6cfc2e399c to your computer and use it in GitHub Desktop.
Save Informatic/d9661fd4959bb1a551e3ee6cfc2e399c to your computer and use it in GitHub Desktop.
from hashlib import sha1
import hmac
import binascii
import time
import struct
ploy = "..."
secret = binascii.unhexlify(b"...")
now = struct.pack(">Q", round(time.time() / 30))
hashed = hmac.new(secret, now, sha1)
out = hashed.digest()
idx = out[-1] & 15
totp = (struct.unpack(">i", out[idx : idx + 4])[0] & (2**31 - 1)) % (10**6)
print("https://zlgn.pl/view/dashboard?ploy=%s&loyal=%06d" % (ploy, totp))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment