diff --git a/lib/core/option.py b/lib/core/option.py index b7f4ed4bf..4c13ffc4e 100644 --- a/lib/core/option.py +++ b/lib/core/option.py @@ -152,7 +152,12 @@ def __urllib2Opener(): conf.cj = cookielib.CookieJar() else: conf.cj = cookielib.MozillaCookieJar() - conf.cj.load(conf.loC) + try: + conf.cj.load(conf.loC) + except cookielib.LoadError, msg: + errMsg = "there was a problem loading " + errMsg += "cookies file ('%s')" % msg + raise sqlmapGenericException, errMsg handlers.append(urllib2.HTTPCookieProcessor(conf.cj)) @@ -1889,6 +1894,11 @@ def __basicOptionValidation(): errMsg += "supported charsets" raise sqlmapSyntaxException, errMsg + if conf.loC: + if not os.path.exists(conf.loC): + errMsg = "cookies file '%s' does not exist" % conf.loC + raise sqlmapFilePathException, errMsg + def __resolveCrossReferences(): lib.core.threads.readInput = readInput lib.core.common.getPageTemplate = getPageTemplate