Esempio n. 1
0
    def test_NT_logon(self):
        """
        Test NTLM logon with NT hash
        """
        creds = copy.deepcopy(self.creds)
        creds.password = None
        creds.lm_hash = None

        smb_client = SMBConnection(testtarget)
        smb_client.autologin(creds)
Esempio n. 2
0
    def test_plaintext_logon(self):
        """
        Test NTLM logon using plaintext
        """
        creds = copy.deepcopy(self.creds)
        creds.lm_hash = None
        creds.nt_hash = None

        smb_client = SMBConnection(testtarget)
        smb_client.autologin(creds)
Esempio n. 3
0
    def test_plaintext_aes128_logon(self):
        """
        Test Kerberos logon with plaintext password using AES128 cipher
        """
        creds = copy.deepcopy(self.creds)
        creds.kerberos_key_rc4 = None
        creds.kerberos_key_des = None
        creds.kerberos_key_aes_256 = None
        creds.kerberos_key_aes_128 = None
        creds.kerberos_tgt_ticket = None
        creds.kerberos_tgs_ticket = None
        creds.kerberos_ccache_file_name = None

        smb_client = SMBConnection(testtarget)
        smb_client.autologin(creds)
Esempio n. 4
0
    def test_TGS_logon(self):
        """
        Test Kerberos logon with using TGS ticket
        """
        creds = copy.deepcopy(self.creds)
        creds.plaintext = None
        creds.kerberos_key_rc4 = None
        creds.kerberos_key_des = None
        creds.kerberos_key_aes_128 = None
        creds.kerberos_key_aes_256 = None
        creds.kerberos_tgt_ticket = None
        creds.kerberos_ccache_file_name = None

        smb_client = SMBConnection(testtarget)
        smb_client.autologin(creds)
Esempio n. 5
0
def main():
    # Init the example's logger theme
    hostname = 'DCSERVER'
    ip = '192.168.9.1'
    port = 445


    domain = 'TEST.corp'
    username = '******'
    password = '******'
    nt_hash = ''
    lm_hash = ''
    kerberos_key_aes_256 = 'd3f3593c9debec0be8db57b160f6b0f0c82fb4c0e5dcaa1e1e26ceddcfd05f60'
    kerberos_key_aes_128 = 'fa021d1bf218a731bad4c19b5bcaae8c'
    kerberos_key_des = 'b3644f0d983dd058'
    kerberos_key_rc4 = None
    #kerberos_tgt_ticket = None
    #kerberos_tgs_ticket = None
    #kerberos_ccache_file_name = None
    #force_kerberos = False
    #kerberos_ccache_file = None

    target = SMBTarget()
    target.ip = ip
    target.hostname = hostname
    target.port = port

    creds = SMBCredential()
    creds.domain = domain
    creds.username = username
    creds.password = password
    creds.nt_hash = nt_hash
    creds.lm_hash = lm_hash
    creds.kerberos_key_aes_256 = kerberos_key_aes_256
    creds.kerberos_key_aes_128 = kerberos_key_aes_128
    creds.kerberos_key_des = kerberos_key_des
    creds.kerberos_key_rc4 = nt_hash

    try:
        smb_client = SMBConnection(target, sess_port=target.port)
        smb_client.autologin(target, creds)
    except Exception as e:
        traceback.print_exc()
        print('Failed to log in!')

    print('PASSED FIRST login')
Esempio n. 6
0
 def test_guest_logon(self):
     """
     Test Guest login
     """
     smb_client = SMBConnection(testtarget)
     smb_client.autologin(SMBCredential())