minor fix (credentials were only set for the first target)

This commit is contained in:
Miroslav Stampar
2012-06-04 22:30:12 +00:00
parent 738073105e
commit f94ebe3107
2 changed files with 19 additions and 7 deletions

View File

@@ -34,6 +34,7 @@ from lib.core.exception import sqlmapFilePathException
from lib.core.exception import sqlmapGenericException
from lib.core.exception import sqlmapSyntaxException
from lib.core.exception import sqlmapUserQuitException
from lib.core.option import authHandler
from lib.core.option import __setDBMS
from lib.core.option import __setKnowledgeBaseAttributes
from lib.core.session import resumeConfKb
@@ -331,6 +332,14 @@ def __setResultsFile():
logger.info("using '%s' as results file" % conf.resultsFilename)
def __setAuthCred():
"""
Adds authentication credentials (if any) for current target to the password manager (used by connection handler).
"""
if kb.passwordMgr:
kb.passwordMgr.add_password(None, "%s://%s" % (conf.scheme, conf.hostname), conf.authUsername, conf.authPassword)
def __createFilesDir():
"""
Create the file directory.
@@ -440,3 +449,4 @@ def setupTargetEnv():
__setHashDB()
__resumeHashDBValues()
__setResultsFile()
__setAuthCred()