MCPcopy Create free account
hub / github.com/Geeoon/asploit / _Base__mkdir

Method _Base__mkdir

src/ASPClassicExploitProcessor.py:353–377  ·  view source on GitHub ↗
(self, options: str)

Source from the content-addressed store, hash-verified

351 @brief See base class for details.
352 """
353 def _Base__mkdir(self, options: str):
354 path = self.directory + "\\" + options.replace("/", "\\")
355 backslash = '\\' # f-string can't have backslash, so we need this
356 res = self.__eval(
357 "Set fileSys = "
358 "Server.CreateObject(\"Scripting.FileSystemObject\"):"
359 f"If fileSys.FolderExists(\"{path}\") Then:"
360 f"Response.AddHeader \"{self.header}\", \"Already Exists.\":"
361 "Else:"
362 f"folders = Split(\"{options.replace('/', backslash)}\", \"\\\"):"
363 "currentFolder = \"\":"
364 "For i = 0 To UBound(folders):"
365 "currentFolder = currentFolder & folders(i):"
366 f"currentPath = \"{self.directory + backslash}\" & currentFolder:"
367 f"If Not fileSys.FolderExists(currentPath) Then:"
368 "fileSys.CreateFolder(currentPath):"
369 "End If:"
370 "currentFolder = currentFolder & \"\\\":"
371 "Next:"
372
373 f"Response.AddHeader \"{self.header}\", \"Done.\":"
374 "End If:"
375 )
376 res = ""
377 print(res)

Callers

nothing calls this directly

Calls 1

__evalMethod · 0.95

Tested by

no test coverage detected