Linux server.edchosting.com 4.18.0-553.79.1.lve.el7h.x86_64 #1 SMP Wed Oct 15 16:34:46 UTC 2025 x86_64
LiteSpeed
Server IP : 75.98.162.185 & Your IP : 216.73.216.163
Domains :
Cant Read [ /etc/named.conf ]
User : goons4good
Terminal
Auto Root
Create File
Create Folder
Localroot Suggester
Backdoor Destroyer
Readme
/
lib64 /
python3.6 /
site-packages /
M2Crypto /
Delete
Unzip
Name
Size
Permission
Date
Action
SSL
[ DIR ]
drwxr-xr-x
2021-09-16 10:31
__pycache__
[ DIR ]
drwxr-xr-x
2021-09-16 10:31
ASN1.py
7.39
KB
-rw-r--r--
2018-10-09 08:50
AuthCookie.py
5.08
KB
-rw-r--r--
2018-10-09 08:50
BIO.py
10.67
KB
-rw-r--r--
2018-10-09 08:50
BN.py
1.63
KB
-rw-r--r--
2017-10-06 15:46
DH.py
2.88
KB
-rw-r--r--
2018-03-13 10:16
DSA.py
13.97
KB
-rw-r--r--
2018-03-13 10:16
EC.py
15.6
KB
-rw-r--r--
2018-03-13 10:16
EVP.py
13.6
KB
-rw-r--r--
2018-03-13 10:16
Engine.py
4.54
KB
-rw-r--r--
2018-10-09 08:50
Err.py
1.88
KB
-rw-r--r--
2019-05-31 09:59
RC4.py
874
B
-rw-r--r--
2018-03-13 10:16
RSA.py
14.14
KB
-rw-r--r--
2019-05-31 10:11
Rand.py
4.37
KB
-rw-r--r--
2018-10-09 08:50
SMIME.py
8.78
KB
-rw-r--r--
2018-03-13 10:16
X509.py
41.93
KB
-rw-r--r--
2018-10-09 08:50
__init__.py
1.57
KB
-rw-r--r--
2019-06-10 07:45
_m2crypto.cpython-36m-x86_64-linux-gnu.so
527.93
KB
-rwxr-xr-x
2019-11-21 04:00
callback.py
298
B
-rw-r--r--
2017-10-06 15:46
ftpslib.py
2.76
KB
-rw-r--r--
2018-03-13 10:16
httpslib.py
10.05
KB
-rw-r--r--
2019-04-26 11:13
m2.py
830
B
-rw-r--r--
2017-10-06 15:46
m2crypto.py
2.4
KB
-rw-r--r--
2019-06-10 07:54
m2urllib.py
4.09
KB
-rw-r--r--
2018-03-06 17:45
m2urllib2.py
6.24
KB
-rw-r--r--
2018-11-22 06:39
m2xmlrpclib.py
2.33
KB
-rw-r--r--
2018-03-13 10:16
six.py
31.6
KB
-rw-r--r--
2018-10-09 08:50
threading.py
447
B
-rw-r--r--
2017-10-06 15:46
util.py
2
KB
-rw-r--r--
2018-10-09 08:50
Save
Rename
from __future__ import absolute_import """Secure Authenticator Cookies Copyright (c) 1999-2002 Ng Pheng Siong. All rights reserved.""" import logging import re import time from M2Crypto import Rand, m2, py27plus, six, util from M2Crypto.six.moves.http_cookies import SimpleCookie # pylint: disable=no-name-in-module,import-error if py27plus: from typing import re as type_re, AnyStr, Dict, Optional, Union # noqa _MIX_FORMAT = 'exp=%f&data=%s&digest=' _MIX_RE = re.compile(r'exp=(\d+\.\d+)&data=(.+)&digest=(\S*)') log = logging.getLogger(__name__) def mix(expiry, data, format=_MIX_FORMAT): # type: (float, AnyStr, str) -> AnyStr return format % (expiry, data) def unmix(dough, regex=_MIX_RE): # type: (AnyStr, type_re) -> object mo = regex.match(dough) if mo: return float(mo.group(1)), mo.group(2) else: return None def unmix3(dough, regex=_MIX_RE): # type: (AnyStr, type_re) -> Optional[tuple[float, AnyStr, AnyStr]] mo = regex.match(dough) if mo: return float(mo.group(1)), mo.group(2), mo.group(3) else: return None _TOKEN = '_M2AUTH_' # type: str class AuthCookieJar(object): _keylen = 20 # type: int def __init__(self): # type: () -> None self._key = Rand.rand_bytes(self._keylen) def _hmac(self, key, data): # type: (bytes, str) -> str return util.bin_to_hex(m2.hmac(key, six.ensure_binary(data), m2.sha1())) def makeCookie(self, expiry, data): # type: (float, str) -> AuthCookie """ Make a cookie :param expiry: expiration time (float in seconds) :param data: cookie content :return: AuthCookie object """ if not isinstance(expiry, (six.integer_types, float)): raise ValueError('Expiration time must be number, not "%s' % expiry) dough = mix(expiry, data) return AuthCookie(expiry, data, dough, self._hmac(self._key, dough)) def isGoodCookie(self, cookie): # type: (AuthCookie) -> Union[bool, int] assert isinstance(cookie, AuthCookie) if cookie.isExpired(): return 0 c = self.makeCookie(cookie._expiry, cookie._data) return (c._expiry == cookie._expiry) \ and (c._data == cookie._data) \ and (c._mac == cookie._mac) \ and (c.output() == cookie.output()) def isGoodCookieString(self, cookie_str, _debug=False): # type: (Union[dict, bytes], bool) -> Union[bool, int] c = SimpleCookie() c.load(cookie_str) if _TOKEN not in c: log.debug('_TOKEN not in c (keys = %s)', dir(c)) return 0 undough = unmix3(c[_TOKEN].value) if undough is None: log.debug('undough is None') return 0 exp, data, mac = undough c2 = self.makeCookie(exp, data) if _debug and (c2._mac == mac): log.error('cookie_str = %s', cookie_str) log.error('c2.isExpired = %s', c2.isExpired()) log.error('mac = %s', mac) log.error('c2._mac = %s', c2._mac) log.error('c2._mac == mac: %s', str(c2._mac == mac)) return (not c2.isExpired()) and (c2._mac == mac) class AuthCookie(object): def __init__(self, expiry, data, dough, mac): # type: (float, str, str, str) -> None """ Create new authentication cookie :param expiry: expiration time (in seconds) :param data: cookie payload (as a string) :param dough: expiry & data concatenated to URL compliant string :param mac: SHA1-based HMAC of dough and random key """ self._expiry = expiry self._data = data self._mac = mac self._cookie = SimpleCookie() self._cookie[_TOKEN] = '%s%s' % (dough, mac) self._name = '%s%s' % (dough, mac) # WebKit only. def expiry(self): # type: () -> float """Return the cookie's expiry time.""" return self._expiry def data(self): # type: () -> str """Return the data portion of the cookie.""" return self._data def mac(self): # type: () -> str """Return the cookie's MAC.""" return self._mac def output(self, header="Set-Cookie:"): # type: (Optional[str]) -> str """Return the cookie's output in "Set-Cookie" format.""" return self._cookie.output(header=header) def value(self): # type: () -> str """Return the cookie's output minus the "Set-Cookie: " portion. """ return self._cookie[_TOKEN].value def isExpired(self): # type: () -> bool """Return 1 if the cookie has expired, 0 otherwise.""" return isinstance(self._expiry, (float, six.integer_types)) and \ (time.time() > self._expiry) # Following two methods are for WebKit only. # I may wish to push them to WKAuthCookie, but they are part # of the API now. Oh well. def name(self): # type: () -> str return self._name def headerValue(self): # type: () -> str return self.value()