bug fix for 404 program termination during shell upload attempt

This commit is contained in:
Miroslav Stampar 2010-02-03 16:16:34 +00:00
parent 565433097e
commit 7c88e32f9d
2 changed files with 3 additions and 2 deletions

View File

@ -70,6 +70,7 @@ class Connect:
direct = kwargs.get('direct', False) direct = kwargs.get('direct', False)
multipart = kwargs.get('multipart', False) multipart = kwargs.get('multipart', False)
silent = kwargs.get('silent', False) silent = kwargs.get('silent', False)
raise404 = kwargs.get('raise404', True)
page = "" page = ""
cookieStr = "" cookieStr = ""
@ -168,7 +169,7 @@ class Connect:
exceptionMsg = "not authorized, try to provide right HTTP " exceptionMsg = "not authorized, try to provide right HTTP "
exceptionMsg += "authentication type and valid credentials" exceptionMsg += "authentication type and valid credentials"
raise sqlmapConnectionException, exceptionMsg raise sqlmapConnectionException, exceptionMsg
elif e.code == 404: elif e.code == 404 and raise404:
exceptionMsg = "page not found" exceptionMsg = "page not found"
raise sqlmapConnectionException, exceptionMsg raise sqlmapConnectionException, exceptionMsg
else: else:

View File

@ -181,7 +181,7 @@ class Web:
self.webBaseUrl = "%s://%s:%d%s" % (conf.scheme, conf.hostname, conf.port, requestDir) self.webBaseUrl = "%s://%s:%d%s" % (conf.scheme, conf.hostname, conf.port, requestDir)
self.webUploaderUrl = "%s/%s" % (self.webBaseUrl, uploaderName) self.webUploaderUrl = "%s/%s" % (self.webBaseUrl, uploaderName)
self.webUploaderUrl = self.webUploaderUrl.replace("./", "/").replace("\\", "/") self.webUploaderUrl = self.webUploaderUrl.replace("./", "/").replace("\\", "/")
uplPage, _ = Request.getPage(url=self.webUploaderUrl, direct=True) uplPage, _ = Request.getPage(url=self.webUploaderUrl, direct=True, raise404=False)
if "sqlmap file uploader" not in uplPage: if "sqlmap file uploader" not in uplPage:
warnMsg = "unable to upload the uploader " warnMsg = "unable to upload the uploader "