MCPcopy Index your code
hub / github.com/trustedsec/ptf / show_module

Function show_module

src/framework.py:136–166  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

134
135
136def show_module():
137 modules_path = os.getcwd() + "/modules/"
138 print ("\n")
139 print((bcolors.BOLD + "The PenTesters Framework Modules" + bcolors.ENDC))
140 print(("""=================================
141
142 """) + (bcolors.BOLD) + ("""Name Description """) + (bcolors.ENDC) + ("""
143 ---- ---------------
144 """))
145
146 print (
147 " modules/install_update_all This will install or update all tools with modules within PTF")
148 print (
149 " modules/update_installed This will update all installed tools within PTF")
150 for path, subdirs, files in os.walk(modules_path):
151 for name in sorted(files):
152 # join the structure
153 filename = os.path.join(path, name)
154 # strip un-needed files
155 if not name in ('__init__.py', 'install_update_all.py', 'update_installed.py'):
156 # shorten it up a little bit
157 filename_short = filename.replace(os.getcwd() + "/", "")
158 filename_short = filename_short.replace(".py", "")
159 filename_short = filename_short.replace(".txt", "")
160 filename_short = str(filename_short)
161 description = module_parser(filename, "DESCRIPTION")
162 # print the module name
163 if description != None:
164 temp_number = 53 - len(filename_short)
165 print(" " + filename_short + " " * temp_number + description)
166 print("\n")
167
168def show_new_modules():
169 modules_path = os.getcwd() + "/modules/"

Callers 1

handle_promptFunction · 0.85

Calls 1

module_parserFunction · 0.85

Tested by

no test coverage detected