From d42d28392a3ff02dfed84961b96d0b19a997315b Mon Sep 17 00:00:00 2001 From: Bernardo Damele Date: Thu, 14 Feb 2013 13:18:33 +0000 Subject: [PATCH] avoid tracebacks because the parameter does not exist --- lib/takeover/registry.py | 2 +- plugins/dbms/access/filesystem.py | 2 +- plugins/dbms/firebird/filesystem.py | 2 +- plugins/dbms/maxdb/filesystem.py | 2 +- plugins/dbms/mssqlserver/filesystem.py | 5 ++--- plugins/dbms/oracle/filesystem.py | 2 +- plugins/dbms/postgresql/filesystem.py | 2 +- plugins/dbms/sqlite/filesystem.py | 2 +- plugins/dbms/sybase/filesystem.py | 2 +- plugins/generic/filesystem.py | 4 ++-- 10 files changed, 12 insertions(+), 13 deletions(-) diff --git a/lib/takeover/registry.py b/lib/takeover/registry.py index 77491cd8b..beb670f15 100644 --- a/lib/takeover/registry.py +++ b/lib/takeover/registry.py @@ -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) diff --git a/plugins/dbms/access/filesystem.py b/plugins/dbms/access/filesystem.py index cdc286474..bb0ea1d2c 100644 --- a/plugins/dbms/access/filesystem.py +++ b/plugins/dbms/access/filesystem.py @@ -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) diff --git a/plugins/dbms/firebird/filesystem.py b/plugins/dbms/firebird/filesystem.py index 0f8d84a8a..da8fc26ed 100644 --- a/plugins/dbms/firebird/filesystem.py +++ b/plugins/dbms/firebird/filesystem.py @@ -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) diff --git a/plugins/dbms/maxdb/filesystem.py b/plugins/dbms/maxdb/filesystem.py index 43fd29d27..e679a8cd1 100644 --- a/plugins/dbms/maxdb/filesystem.py +++ b/plugins/dbms/maxdb/filesystem.py @@ -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) diff --git a/plugins/dbms/mssqlserver/filesystem.py b/plugins/dbms/mssqlserver/filesystem.py index 076874ac7..d4ea9c82d 100644 --- a/plugins/dbms/mssqlserver/filesystem.py +++ b/plugins/dbms/mssqlserver/filesystem.py @@ -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 " diff --git a/plugins/dbms/oracle/filesystem.py b/plugins/dbms/oracle/filesystem.py index d276a2f5f..fe012c968 100644 --- a/plugins/dbms/oracle/filesystem.py +++ b/plugins/dbms/oracle/filesystem.py @@ -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) diff --git a/plugins/dbms/postgresql/filesystem.py b/plugins/dbms/postgresql/filesystem.py index 6c3e8e385..0b9820b83 100644 --- a/plugins/dbms/postgresql/filesystem.py +++ b/plugins/dbms/postgresql/filesystem.py @@ -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) diff --git a/plugins/dbms/sqlite/filesystem.py b/plugins/dbms/sqlite/filesystem.py index df7d7a969..2e6877451 100644 --- a/plugins/dbms/sqlite/filesystem.py +++ b/plugins/dbms/sqlite/filesystem.py @@ -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) diff --git a/plugins/dbms/sybase/filesystem.py b/plugins/dbms/sybase/filesystem.py index f960c92c9..1452832b9 100644 --- a/plugins/dbms/sybase/filesystem.py +++ b/plugins/dbms/sybase/filesystem.py @@ -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) diff --git a/plugins/generic/filesystem.py b/plugins/generic/filesystem.py index 17d9dee8e..82367c5ec 100644 --- a/plugins/generic/filesystem.py +++ b/plugins/generic/filesystem.py @@ -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)