This commit is contained in:
Bernardo Damele 2012-04-04 12:44:25 +00:00
parent c0946ce2c9
commit 025c531d22

View File

@ -34,29 +34,12 @@ from lib.core.data import logger
from lib.core.data import queries from lib.core.data import queries
from lib.core.enums import DBMS from lib.core.enums import DBMS
from lib.core.enums import PAYLOAD from lib.core.enums import PAYLOAD
from lib.core.settings import FROM_DUMMY_TABLE
from lib.core.settings import MAX_DNS_LABEL from lib.core.settings import MAX_DNS_LABEL
from lib.core.settings import PARTIAL_VALUE_MARKER from lib.core.settings import PARTIAL_VALUE_MARKER
from lib.core.unescaper import unescaper from lib.core.unescaper import unescaper
from lib.request.connect import Connect as Request from lib.request.connect import Connect as Request
def dnsTest(payload):
logger.info("testing for data retrieval through DNS channel")
randInt = randomInt()
kb.dnsTest = dnsUse(payload, "SELECT %d%s" % (randInt, FROM_DUMMY_TABLE.get(Backend.getIdentifiedDbms(), ""))) == str(randInt)
if not kb.dnsTest:
errMsg = "data retrieval through DNS channel failed. Turning off DNS exfiltration support"
logger.error(errMsg)
conf.dnsDomain = None
else:
infoMsg = "data retrieval through DNS channel was successful"
logger.info(infoMsg)
def dnsUse(payload, expression): def dnsUse(payload, expression):
""" """
Retrieve the output of a SQL query taking advantage of the DNS Retrieve the output of a SQL query taking advantage of the DNS