(self, smbClient, tcpShell=None, outputfile=None, dfs_auto_follow=False)
| 41 | |
| 42 | class MiniImpacketShell(cmd.Cmd): |
| 43 | def __init__(self, smbClient, tcpShell=None, outputfile=None, dfs_auto_follow=False): |
| 44 | #If the tcpShell parameter is passed (used in ntlmrelayx), |
| 45 | # all input and output is redirected to a tcp socket |
| 46 | # instead of to stdin / stdout |
| 47 | if tcpShell is not None: |
| 48 | cmd.Cmd.__init__(self, stdin=tcpShell.stdin, stdout=tcpShell.stdout) |
| 49 | sys.stdout = tcpShell.stdout |
| 50 | sys.stdin = tcpShell.stdin |
| 51 | sys.stderr = tcpShell.stdout |
| 52 | self.use_rawinput = False |
| 53 | self.shell = tcpShell |
| 54 | else: |
| 55 | cmd.Cmd.__init__(self) |
| 56 | self.shell = None |
| 57 | |
| 58 | self.prompt = '# ' |
| 59 | self.smb = smbClient |
| 60 | self.username, self.password, self.domain, self.lmhash, self.nthash, self.aesKey, self.TGT, self.TGS = smbClient.getCredentials() |
| 61 | self.tid = None |
| 62 | self.intro = 'Type help for list of commands' |
| 63 | self.pwd = '' |
| 64 | self.share = None |
| 65 | self.loggedIn = True |
| 66 | self.last_output = None |
| 67 | self.completion = [] |
| 68 | self.outputfile = outputfile |
| 69 | self.use_kerberos = smbClient.getSMBServer().getKerberos() if hasattr(smbClient.getSMBServer(), 'getKerberos') else False |
| 70 | self.kdcHost = getattr(smbClient, '_kdcHost', None) |
| 71 | # DFS support |
| 72 | self.dfs_auto_follow = dfs_auto_follow |
| 73 | self.dfs_connections = {} |
| 74 | self.dfs_referral_cache = {} |
| 75 | self.dfs_context_stack = [] # Stack of {smb, tid, share, pwd, dfs_target_info} |
| 76 | self.dfs_target_info = None |
| 77 | |
| 78 | @property |
| 79 | def is_dfs_context(self): |
nothing calls this directly
no test coverage detected