MCPcopy
hub / github.com/RUB-NDS/PRET / verify_path

Method verify_path

printer.py:741–756  ·  view source on GitHub ↗
(self, path, found={})

Source from the content-addressed store, hash-verified

739
740 # check for path traversal
741 def verify_path(self, path, found={}):
742 # 1st method: EXISTS
743 opt1 = self.dir_exists(path) or False
744 # 2nd method: DIRLIST
745 dir2 = self.dirlist(path, False)
746 opt2 = True if dir2 else False
747 # show fuzzing results
748 output().fuzzed(path, "", ("", opt1, opt2))
749 if opt2: # DIRLIST successful
750 # add path if not already listed
751 if dir2 not in list(found.values()):
752 found[path] = dir2
753 output().raw("Listing directory.")
754 self.do_ls(path)
755 elif opt1: # only EXISTS successful
756 found[path] = None
757
758 # check for remote files (write)
759 def verify_write(self, path, name, data, cmd):

Callers 1

fuzz_pathMethod · 0.95

Calls 6

outputClass · 0.90
fuzzedMethod · 0.80
rawMethod · 0.80
dir_existsMethod · 0.45
dirlistMethod · 0.45
do_lsMethod · 0.45

Tested by

no test coverage detected