Nov-05-2017, 07:59 PM
Hi. how i can use smb.py and smbConnection.py from impacket to run a file?
I'm looking for something like:
Help on method openFile in module impacket.smbconnection:
openFile(self, treeId, pathName, desiredAccess=3, shareMode=1, creationOption=64, creationDisposition=1, fileAttributes=128, impersonationLevel=2, securityFlags=0, oplockLevel=0, createContexts=None) method of impacket.smbconnection.SMBConnection instance
opens a remote file
:param HANDLE treeId: a valid handle for the share where the file is to be opened
:param string pathName: the path name to open
:return: a valid file descriptor, if not raises a SessionError exception.
please explain with example.
I'm looking for something like:
dir = smbConn.connectTree('C$') smbConn.openFile(dir, '/picture.jpg')when i use help show me this:
Help on method openFile in module impacket.smbconnection:
openFile(self, treeId, pathName, desiredAccess=3, shareMode=1, creationOption=64, creationDisposition=1, fileAttributes=128, impersonationLevel=2, securityFlags=0, oplockLevel=0, createContexts=None) method of impacket.smbconnection.SMBConnection instance
opens a remote file
:param HANDLE treeId: a valid handle for the share where the file is to be opened
:param string pathName: the path name to open
:return: a valid file descriptor, if not raises a SessionError exception.
please explain with example.
