Exemple #1
0
    def __init__(self, logger, command, host, domain, noOutput, connection,
                 method, user, passwd, ntlm_hash):

        if settings.args.mssql and str(connection).find('MSSQL') != -1:
            sql_shell = SQLSHELL(connection, logger)
            sql_shell.do_xp_cmdshell(command, noOutput)

        else:
            if method == 'wmi':
                wmi_exec = WMIEXEC(logger, command, user, passwd, domain,
                                   ntlm_hash, settings.args.aesKey,
                                   settings.args.share, noOutput,
                                   settings.args.kerb)
                wmi_exec.run(host, connection)

            elif method == 'smbexec':
                smb_exec = SMBEXEC(logger, command,
                                   '{}/SMB'.format(settings.args.port), user,
                                   passwd, domain, ntlm_hash,
                                   settings.args.aesKey, settings.args.kerb,
                                   'SHARE', settings.args.share, noOutput)
                smb_exec.run(host)

            elif method == 'atexec':
                atsvc_exec = TSCH_EXEC(logger, command, user, passwd, domain,
                                       ntlm_hash, settings.args.aesKey,
                                       settings.args.kerb, noOutput)
                atsvc_exec.play(host)
Exemple #2
0
    def __init__(self, logger, command, host, domain, noOutput, smbconnection,
                 method, user, passwd, ntlm_hash):

        if method == 'wmi':
            wmi_exec = WMIEXEC(logger, command, user, passwd, domain,
                               ntlm_hash, settings.args.aesKey,
                               settings.args.share, noOutput,
                               settings.args.kerb)
            wmi_exec.run(host, smbconnection)

        elif method == 'smbexec':
            smb_exec = SMBEXEC(logger, command,
                               '{}/SMB'.format(settings.args.port), user,
                               passwd, domain, ntlm_hash, settings.args.aesKey,
                               settings.args.kerb, 'SHARE',
                               settings.args.share, noOutput)
            smb_exec.run(host)

        elif method == 'atexec':
            atsvc_exec = TSCH_EXEC(logger, command, user, passwd, domain,
                                   ntlm_hash, settings.args.aesKey,
                                   settings.args.kerb, noOutput)
            atsvc_exec.play(host)