Skip to content

Commit

Permalink
merged upstream/master
Browse files Browse the repository at this point in the history
  • Loading branch information
ropnop committed Jan 31, 2020
2 parents 824a123 + a1a8d47 commit 1db70e4
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 9 deletions.
2 changes: 1 addition & 1 deletion impacket/dcerpc/v5/tsch.py
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ class GUID_ARRAY(NDRUniConformantArray):

class PGUID_ARRAY(NDRPOINTER):
referent = (
('Data',TASK_NAMES_ARRAY),
('Data',GUID_ARRAY),
)

# 3.2.5.4.13 SchRpcRun (Opnum 12)
Expand Down
2 changes: 1 addition & 1 deletion impacket/examples/ntlmrelayx/attacks/smbattack.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ def run(self):
LOG.info('Started interactive SMB client shell via TCP on 127.0.0.1:%d' % self.tcpshell.port)
#Start listening and launch interactive shell
self.tcpshell.listen()
self.shell = MiniImpacketShell(self.__SMBConnection,self.tcpshell.socketfile)
self.shell = MiniImpacketShell(self.__SMBConnection, self.tcpshell)
self.shell.cmdloop()
return
if self.config.exeFile is not None:
Expand Down
10 changes: 8 additions & 2 deletions impacket/examples/ntlmrelayx/utils/tcpshell.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,5 +30,11 @@ def listen(self):
#Don't allow a backlog
serversocket.listen(0)
self.connection, host = serversocket.accept()
#Create a file object from the socket
self.socketfile = self.connection.makefile()
#Create file objects from the socket
self.stdin = self.connection.makefile("r")
self.stdout = self.connection.makefile("w")

def close(self):
self.stdout.close()
self.stdin.close()
self.connection.close()
10 changes: 5 additions & 5 deletions impacket/examples/smbclient.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,15 +37,15 @@
import readline

class MiniImpacketShell(cmd.Cmd):
def __init__(self, smbClient,tcpShell=None):
def __init__(self, smbClient, tcpShell=None):
#If the tcpShell parameter is passed (used in ntlmrelayx),
# all input and output is redirected to a tcp socket
# instead of to stdin / stdout
if tcpShell is not None:
cmd.Cmd.__init__(self,stdin=tcpShell,stdout=tcpShell)
sys.stdout = tcpShell
sys.stdin = tcpShell
sys.stderr = tcpShell
cmd.Cmd.__init__(self, stdin=tcpShell.stdin, stdout=tcpShell.stdout)
sys.stdout = tcpShell.stdout
sys.stdin = tcpShell.stdin
sys.stderr = tcpShell.stdout
self.use_rawinput = False
self.shell = tcpShell
else:
Expand Down

0 comments on commit 1db70e4

Please sign in to comment.