From b032fdbf7477583d694e75ece0a13b3477ff1f11 Mon Sep 17 00:00:00 2001 From: Miroslav Stampar Date: Wed, 20 Oct 2010 08:56:58 +0000 Subject: [PATCH] added randInt to error injection vectors --- lib/request/inject.py | 5 ++++- xml/queries.xml | 9 ++++----- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/lib/request/inject.py b/lib/request/inject.py index fc5e1064e..713258a0b 100644 --- a/lib/request/inject.py +++ b/lib/request/inject.py @@ -19,6 +19,7 @@ from lib.core.common import expandAsteriskForColumns from lib.core.common import parseUnionPage from lib.core.common import popValue from lib.core.common import pushValue +from lib.core.common import randomInt from lib.core.common import readInput from lib.core.common import replaceNewlineTabs from lib.core.common import safeStringFormat @@ -337,6 +338,8 @@ def __goError(expression, resumeValue=True): Retrieve the output of a SQL query taking advantage of an error SQL injection vulnerability on the affected parameter. """ + logic = conf.logic + randInt = randomInt(1) query = agent.prefixQuery(" %s" % queries[kb.misc.testedDbms].error) query = agent.postfixQuery(query) payload = agent.payload(newValue=query) @@ -362,7 +365,7 @@ def __goError(expression, resumeValue=True): debugMsg = "query: %s" % expressionUnescaped logger.debug(debugMsg) - forgedPayload = safeStringFormat(payload, expressionUnescaped) + forgedPayload = safeStringFormat(payload, (logic, randInt, expressionUnescaped)) result = Request.queryPage(urlencode(forgedPayload), content=True) match = re.search(queries[kb.misc.testedDbms].errorRegex, result[0], re.DOTALL | re.IGNORECASE) diff --git a/xml/queries.xml b/xml/queries.xml index c0e13cfa8..ac08b36ae 100644 --- a/xml/queries.xml +++ b/xml/queries.xml @@ -24,7 +24,7 @@ - + @@ -91,8 +91,7 @@ - - + @@ -176,7 +175,7 @@ - + @@ -243,7 +242,7 @@ - +