MCPcopy Create free account
hub / github.com/fortra/impacket / do_listFiles

Method do_listFiles

impacket/examples/smbclient.py:522–541  ·  view source on GitHub ↗
(self, share, ip)

Source from the content-addressed store, hash-verified

520 print(LINE)
521
522 def do_listFiles(self, share, ip):
523 retList = []
524 retFiles = []
525 retInt = 0
526 try:
527 for LINE in self.smb.listPath(self.share, ip):
528 if(LINE.get_longname() == "." or LINE.get_longname() == ".."):
529 pass
530 else:
531 retInt = retInt + 1
532 print(ip.strip("*").replace("//","/") + LINE.get_longname())
533 if(LINE.is_directory()):
534 retval = ip.strip("*").replace("//","/") + LINE.get_longname()
535 retList.append(retval)
536 else:
537 retval = ip.strip("*").replace("//","/") + LINE.get_longname()
538 retFiles.append(retval)
539 except:
540 pass
541 return retList,retFiles,retInt
542
543 def do_tree(self, filepath):
544 folderList = []

Callers 1

do_treeMethod · 0.95

Calls 4

get_longnameMethod · 0.80
is_directoryMethod · 0.80
appendMethod · 0.80
listPathMethod · 0.45

Tested by

no test coverage detected