avoid tracebacks because the parameter does not exist

This commit is contained in:
Bernardo Damele 2013-02-14 13:18:33 +00:00
parent c9c520a325
commit d42d28392a
10 changed files with 12 additions and 13 deletions

View File

@ -65,7 +65,7 @@ class Registry:
logger.debug("creating batch file '%s'" % self._batPathRemote)
self._createLocalBatchFile()
self.writeFile(self._batPathLocal, self._batPathRemote, "text")
self.writeFile(self._batPathLocal, self._batPathRemote, "text", forceCheck=True)
os.unlink(self._batPathLocal)

View File

@ -16,6 +16,6 @@ class Filesystem(GenericFilesystem):
errMsg = "on Microsoft Access it is not possible to read files"
raise SqlmapUnsupportedFeatureException(errMsg)
def writeFile(self, wFile, dFile, fileType=None):
def writeFile(self, wFile, dFile, fileType=None, forceCheck=False):
errMsg = "on Microsoft Access it is not possible to write files"
raise SqlmapUnsupportedFeatureException(errMsg)

View File

@ -16,6 +16,6 @@ class Filesystem(GenericFilesystem):
errMsg = "on Firebird it is not possible to read files"
raise SqlmapUnsupportedFeatureException(errMsg)
def writeFile(self, wFile, dFile, fileType=None):
def writeFile(self, wFile, dFile, fileType=None, forceCheck=False):
errMsg = "on Firebird it is not possible to write files"
raise SqlmapUnsupportedFeatureException(errMsg)

View File

@ -16,6 +16,6 @@ class Filesystem(GenericFilesystem):
errMsg = "on SAP MaxDB reading of files is not supported"
raise SqlmapUnsupportedFeatureException(errMsg)
def writeFile(self, wFile, dFile, fileType=None):
def writeFile(self, wFile, dFile, fileType=None, forceCheck=False):
errMsg = "on SAP MaxDB writing of files is not supported"
raise SqlmapUnsupportedFeatureException(errMsg)

View File

@ -158,7 +158,7 @@ class Filesystem(GenericFilesystem):
return result
def unionWriteFile(self, wFile, dFile, fileType):
def unionWriteFile(self, wFile, dFile, fileType, forceCheck=False):
errMsg = "Microsoft SQL Server does not support file upload with "
errMsg += "UNION query SQL injection technique"
raise SqlmapUnsupportedFeatureException(errMsg)
@ -340,8 +340,7 @@ class Filesystem(GenericFilesystem):
wFileContent = f.read()
self._stackedWriteFileVbs(tmpPath, wFileContent, dFile, fileType)
written = self.askCheckWrittenFile(wFile, dFile)
written = self.askCheckWrittenFile(wFile, dFile, forceCheck)
if written is False:
message = "do you want to try to upload the file with "

View File

@ -17,7 +17,7 @@ class Filesystem(GenericFilesystem):
errMsg += "Oracle"
raise SqlmapUnsupportedFeatureException(errMsg)
def writeFile(self, wFile, dFile, fileType=None):
def writeFile(self, wFile, dFile, fileType=None, forceCheck=False):
errMsg = "File system write access not yet implemented for "
errMsg += "Oracle"
raise SqlmapUnsupportedFeatureException(errMsg)

View File

@ -28,7 +28,7 @@ class Filesystem(GenericFilesystem):
return self.udfEvalCmd(cmd=rFile, udfName="sys_fileread")
def unionWriteFile(self, wFile, dFile, fileType):
def unionWriteFile(self, wFile, dFile, fileType, forceCheck=False):
errMsg = "PostgreSQL does not support file upload with UNION "
errMsg += "query SQL injection technique"
raise SqlmapUnsupportedFeatureException(errMsg)

View File

@ -16,6 +16,6 @@ class Filesystem(GenericFilesystem):
errMsg = "on SQLite it is not possible to read files"
raise SqlmapUnsupportedFeatureException(errMsg)
def writeFile(self, wFile, dFile, fileType=None):
def writeFile(self, wFile, dFile, fileType=None, forceCheck=False):
errMsg = "on SQLite it is not possible to write files"
raise SqlmapUnsupportedFeatureException(errMsg)

View File

@ -16,6 +16,6 @@ class Filesystem(GenericFilesystem):
errMsg = "on Sybase it is not possible to read files"
raise SqlmapUnsupportedFeatureException(errMsg)
def writeFile(self, wFile, dFile, fileType=None):
def writeFile(self, wFile, dFile, fileType=None, forceCheck=False):
errMsg = "on Sybase it is not possible to write files"
raise SqlmapUnsupportedFeatureException(errMsg)

View File

@ -171,12 +171,12 @@ class Filesystem:
errMsg += "into the specific DBMS plugin"
raise SqlmapUndefinedMethod(errMsg)
def unionWriteFile(self, localFile, remoteFile, fileType):
def unionWriteFile(self, localFile, remoteFile, fileType, forceCheck=False):
errMsg = "'unionWriteFile' method must be defined "
errMsg += "into the specific DBMS plugin"
raise SqlmapUndefinedMethod(errMsg)
def stackedWriteFile(self, localFile, remoteFile, fileType):
def stackedWriteFile(self, localFile, remoteFile, fileType, forceCheck=False):
errMsg = "'stackedWriteFile' method must be defined "
errMsg += "into the specific DBMS plugin"
raise SqlmapUndefinedMethod(errMsg)