Linux worldls-302.fr.planethoster.net 4.18.0-553.8.1.lve.el7h.x86_64 #1 SMP Thu Jul 4 15:19:33 UTC 2024 x86_64
LiteSpeed
Server IP : 10.185.0.203 & Your IP : 216.73.217.14
Domains :
Cant Read [ /etc/named.conf ]
User : gerathty
Terminal
Auto Root
Create File
Create Folder
Localroot Suggester
Backdoor Destroyer
Readme
/
lib /
python2.7 /
site-packages /
pyzor /
Delete
Unzip
Name
Size
Permission
Date
Action
engines
[ DIR ]
drwxr-xr-x
2017-07-03 22:07
hacks
[ DIR ]
drwxr-xr-x
2017-07-03 22:07
__init__.py
1.38
KB
-rw-r--r--
2014-12-10 14:25
__init__.pyc
2.42
KB
-rw-r--r--
2017-07-03 22:07
account.py
2.49
KB
-rw-r--r--
2014-12-10 14:10
account.pyc
3.2
KB
-rw-r--r--
2017-07-03 22:07
client.py
10.56
KB
-rw-r--r--
2014-12-10 14:10
client.pyc
12.77
KB
-rw-r--r--
2017-07-03 22:07
config.py
8.95
KB
-rw-r--r--
2014-12-10 14:10
config.pyc
8.07
KB
-rw-r--r--
2017-07-03 22:07
digest.py
5.74
KB
-rw-r--r--
2014-12-10 14:10
digest.pyc
6.25
KB
-rw-r--r--
2017-07-03 22:07
forwarder.py
2.51
KB
-rw-r--r--
2014-12-10 14:10
forwarder.pyc
2.87
KB
-rw-r--r--
2017-07-03 22:07
message.py
3.93
KB
-rw-r--r--
2014-12-10 14:10
message.pyc
8.52
KB
-rw-r--r--
2017-07-03 22:07
server.py
15.41
KB
-rw-r--r--
2014-12-10 14:10
server.pyc
16.16
KB
-rw-r--r--
2017-07-03 22:07
Save
Rename
"""A collection of utilities that facilitate working with Pyzor accounts. Note that accounts are not necessary (on the client or server), as an "anonymous" account always exists.""" import time import hashlib import pyzor def sign_msg(hashed_key, timestamp, msg, hash_=hashlib.sha1): """Converts the key, timestamp (epoch seconds), and msg into a digest. lower(H(H(M) + ':' T + ':' + K)) M is message T is integer epoch timestamp K is hashed_key H is the hash function (currently SHA1) """ msg = msg.as_string().strip().encode("utf8") digest = hash_() digest.update(hash_(msg).digest()) digest.update((":%d:%s" % (timestamp, hashed_key)).encode("utf8")) return digest.hexdigest().lower() def hash_key(key, user, hash_=hashlib.sha1): """Returns the hash key for this username and password. lower(H(U + ':' + lower(K))) K is key (hex string) U is username H is the hash function (currently SHA1) """ result = ("%s:%s" % (user, key.lower())).encode("utf8") return hash_(result).hexdigest().lower() def verify_signature(msg, user_key): """Verify that the provided message is correctly signed. The message must have "User", "Time", and "Sig" headers. If the signature is valid, then the function returns normally. If the signature is not valid, then a pyzor.SignatureError() exception is raised.""" timestamp = int(msg["Time"]) user = msg["User"] provided_signature = msg["Sig"] # Check that this signature is not too old. if abs(time.time() - timestamp) > pyzor.MAX_TIMESTAMP_DIFFERENCE: raise pyzor.SignatureError("Timestamp not within allowed range.") # Calculate what the correct signature is. hashed_user_key = hash_key(user_key, user) # The signature is not part of the message that is signed. del msg["Sig"] correct_signature = sign_msg(hashed_user_key, timestamp, msg) if correct_signature != provided_signature: raise pyzor.SignatureError("Invalid signature.") class Account(object): def __init__(self, username, salt, key): self.username = username self.salt = salt self.key = key def key_from_hexstr(s): try: salt, key = s.split(",") except ValueError: raise ValueError("Invalid number of parts for key; perhaps you " "forgot the comma at the beginning for the " "salt divider?") return salt, key AnonymousAccount = Account(pyzor.anonymous_user, None, "")