(self, localFile, remoteFile, fileType, forceCheck=False)
| 384 | self.execCmd(" & ".join(command for command in commands)) |
| 385 | |
| 386 | def stackedWriteFile(self, localFile, remoteFile, fileType, forceCheck=False): |
| 387 | # NOTE: this is needed here because we use xp_cmdshell extended |
| 388 | # procedure to write a file on the back-end Microsoft SQL Server |
| 389 | # file system |
| 390 | self.initEnv() |
| 391 | self.getRemoteTempPath() |
| 392 | |
| 393 | tmpPath = posixToNtSlashes(conf.tmpPath) |
| 394 | remoteFile = posixToNtSlashes(remoteFile) |
| 395 | |
| 396 | checkFile(localFile) |
| 397 | localFileContent = open(localFile, "rb").read() |
| 398 | |
| 399 | self._stackedWriteFilePS(tmpPath, localFileContent, remoteFile, fileType) |
| 400 | written = self.askCheckWrittenFile(localFile, remoteFile, forceCheck) |
| 401 | |
| 402 | if written is False: |
| 403 | message = "do you want to try to upload the file with " |
| 404 | message += "the custom Visual Basic script technique? [Y/n] " |
| 405 | |
| 406 | if readInput(message, default='Y', boolean=True): |
| 407 | self._stackedWriteFileVbs(tmpPath, localFileContent, remoteFile, fileType) |
| 408 | written = self.askCheckWrittenFile(localFile, remoteFile, forceCheck) |
| 409 | |
| 410 | if written is False: |
| 411 | message = "do you want to try to upload the file with " |
| 412 | message += "the built-in debug.exe technique? [Y/n] " |
| 413 | |
| 414 | if readInput(message, default='Y', boolean=True): |
| 415 | self._stackedWriteFileDebugExe(tmpPath, localFile, localFileContent, remoteFile, fileType) |
| 416 | written = self.askCheckWrittenFile(localFile, remoteFile, forceCheck) |
| 417 | |
| 418 | if written is False: |
| 419 | message = "do you want to try to upload the file with " |
| 420 | message += "the built-in certutil.exe technique? [Y/n] " |
| 421 | |
| 422 | if readInput(message, default='Y', boolean=True): |
| 423 | self._stackedWriteFileCertutilExe(tmpPath, localFile, localFileContent, remoteFile, fileType) |
| 424 | written = self.askCheckWrittenFile(localFile, remoteFile, forceCheck) |
| 425 | |
| 426 | return written |
nothing calls this directly
no test coverage detected