diff --git a/lib/core/agent.py b/lib/core/agent.py index 9321b1455..670420a6a 100644 --- a/lib/core/agent.py +++ b/lib/core/agent.py @@ -275,7 +275,7 @@ class Agent(object): inferenceQuery = inference.query payload = payload.replace("[INFERENCE]", inferenceQuery) - else: + elif not kb.testMode: errMsg = "invalid usage of inference payload without " errMsg += "knowledge of underlying DBMS" raise SqlmapNoneDataException(errMsg) diff --git a/lib/request/inject.py b/lib/request/inject.py index e75b3d267..abc6d5a73 100644 --- a/lib/request/inject.py +++ b/lib/request/inject.py @@ -286,13 +286,14 @@ def _goBooleanProxy(expression): initTechnique(kb.technique) - query = agent.prefixQuery(kb.injection.data[kb.technique].vector) - query = agent.suffixQuery(query) - payload = agent.payload(newValue=query) - output = _goDns(payload, expression) + if conf.dnsName: + query = agent.prefixQuery(kb.injection.data[kb.technique].vector) + query = agent.suffixQuery(query) + payload = agent.payload(newValue=query) + output = _goDns(payload, expression) - if output is not None: - return output + if output is not None: + return output vector = kb.injection.data[kb.technique].vector vector = vector.replace("[INFERENCE]", expression)