()
return kb.nullConnection is not None
Reference: http://www.wisec.it/sectou.php?id=472f952d79293
Reference: http://www.wisec.it/sectou.php?id=472f952d79293
Reference : http : // www . wisec . it / sectou . php?id = 472f952d79293
def checkNullConnection():
    """
    Reference: http://www.wisec.it/sectou.php?id=472f952d79293
    """

    if conf.data:
        return False

    infoMsg = "testing NULL connection to the target URL"
    logger.info(infoMsg)

    pushValue(kb.pageCompress)
    kb.pageCompress = False

    try:
        page, headers, _ = Request.getPage(method=HTTPMETHOD.HEAD)

        if not page and HTTP_HEADER.CONTENT_LENGTH in (headers or {}):
            kb.nullConnection = NULLCONNECTION.HEAD

            infoMsg = "NULL connection is supported with HEAD header"
            logger.info(infoMsg)
        else:
            page, headers, _ = Request.getPage(auxHeaders={HTTP_HEADER.RANGE: "bytes=-1"})

            if page and len(page) == 1 and HTTP_HEADER.CONTENT_RANGE in (headers or {}):
                kb.nullConnection = NULLCONNECTION.RANGE

                infoMsg = "NULL connection is supported with GET header "
                infoMsg += "'%s'" % kb.nullConnection
                logger.info(infoMsg)
            else:
                _, headers, _ = Request.getPage(skipRead = True)

                if HTTP_HEADER.CONTENT_LENGTH in (headers or {}):
                    kb.nullConnection = NULLCONNECTION.SKIP_READ

                    infoMsg = "NULL connection is supported with 'skip-read' method"
                    logger.info(infoMsg)

    except SqlmapConnectionException, errMsg:
        errMsg = getUnicode(errMsg)
        raise SqlmapConnectionException(errMsg)

    kb.pageCompress = popValue()

    return kb.nullConnection is not None
def checkNullConnection ( ) : if conf . data : return False infoMsg = "testing NULL connection to the target URL" logger . info ( infoMsg ) pushValue ( kb . pageCompress ) kb . pageCompress = False try : page , headers , _ = Request . getPage ( method = HTTPMETHOD . HEAD ) if not page and HTTP_HEADER . CONTENT_LENGTH in ( headers or { } ) : kb . nullConnection = NULLCONNECTION . HEAD infoMsg = "NULL connection is supported with HEAD header" logger . info ( infoMsg ) else : page , headers , _ = Request . getPage ( auxHeaders = { HTTP_HEADER . RANGE : "bytes=-1" } ) if page and len ( page ) == 1 and HTTP_HEADER . CONTENT_RANGE in ( headers or { } ) : kb . nullConnection = NULLCONNECTION . RANGE infoMsg = "NULL connection is supported with GET header " infoMsg += "'%s'" % kb . nullConnection logger . info ( infoMsg ) else : _ , headers , _ = Request . getPage ( skipRead = True ) if HTTP_HEADER . CONTENT_LENGTH in ( headers or { } ) : kb . nullConnection = NULLCONNECTION . SKIP_READ infoMsg = "NULL connection is supported with 'skip-read' method" logger . info ( infoMsg ) except SqlmapConnectionException , errMsg : errMsg = getUnicode ( errMsg ) raise SqlmapConnectionException ( errMsg ) kb . pageCompress = popValue ( ) return kb . nullConnection is not None