Exemplo n.º 1
0
def __getSecurityCookieValue():
    oRequestHandler = cRequestHandler(URL_NEWS, False)
    oRequestHandler.removeNewLines(False)
    oRequestHandler.removeBreakLines(False)
    sHtmlContent = oRequestHandler.request()
    sPattern = "var hash=\[(.*?)\]"
    oParser = cParser()
    aResult = oParser.parse(sHtmlContent, sPattern)
    if aResult[0] == False:
        logger.error("Can't find script file for cookie")
    result = jsunprotect.jsunprotect(sHtmlContent)
    if not result:
        logger.error("Not protected or Deactivator not found")
        return ''
    else:
        logger.info(result)
        oRequestHandler = cRequestHandler(URL_MAIN+'/?'+result, False)
        oRequestHandler.addHeaderEntry('Referer', URL_MAIN)
        #oRequestHandler.addHeaderEntry('Accept', '*/*')
        oRequestHandler.addHeaderEntry('Host', domain)
        oRequestHandler.request()
        return ''
    for aEntry in aResult[1][0].split(","):
		sScriptFile = URL_MAIN +'/'+ str(aEntry).replace("'","").strip()
		sScriptFile.replace(" ","")

		logger.info("scriptfile: %s" % sScriptFile)
		oRequestHandler = cRequestHandler(sScriptFile)
		oRequestHandler.addHeaderEntry('Referer', URL_MAIN)
		oRequestHandler.addHeaderEntry('Accept', '*/*')
		oRequestHandler.addHeaderEntry('Host', domain)
		sHtmlContent = oRequestHandler.request()

    sPattern = "escape\(hsh \+ \"([^\"]+)\"\)"
    oParser = cParser()
    aResult = oParser.parse(sHtmlContent, sPattern)

    if not aResult[0]:
        logger.info("No hash value found for the cookie")
        return ''

    sHash = aResult[1][0]

    sHash = sHashSnippet + sHash
    sSecurityCookieValue = "sitechrx=" + str(sHash) + ";Path=/"

    oRequestHandler = cRequestHandler(URL_MAIN)
    oRequestHandler.addHeaderEntry("Cookie", sSecurityCookieValue)
    oRequestHandler.request()

    logger.info("Token: %s" % sSecurityCookieValue)

    return sSecurityCookieValue    
Exemplo n.º 2
0
def __getSecurityCookieValue():
    oRequestHandler = cRequestHandler(URL_MAIN, False)
    oRequestHandler.removeNewLines(False)
    oRequestHandler.removeBreakLines(False)
    sHtmlContent = oRequestHandler.request()
    sPattern = "var hash=\[(.*?)\]"
    oParser = cParser()
    aResult = oParser.parse(sHtmlContent, sPattern)
    if aResult[0] == False:
        logger.error("Can't find script file for cookie")
    result = jsunprotect.jsunprotect(sHtmlContent)
    if not result:
        logger.error("Not protected or Deactivator not found")
        return ''
    else:
        logger.info(result)
        oRequestHandler = cRequestHandler(URL_MAIN + '/?' + result, False)
        oRequestHandler.addHeaderEntry('Referer', URL_MAIN)
        #oRequestHandler.addHeaderEntry('Accept', '*/*')
        oRequestHandler.addHeaderEntry('Host', domain)
        oRequestHandler.request()
        return ''
    for aEntry in aResult[1][0].split(","):
        sScriptFile = URL_MAIN + '/' + str(aEntry).replace("'", "").strip()
        sScriptFile.replace(" ", "")

        logger.info("scriptfile: %s" % sScriptFile)
        oRequestHandler = cRequestHandler(sScriptFile)
        oRequestHandler.addHeaderEntry('Referer', URL_MAIN)
        oRequestHandler.addHeaderEntry('Accept', '*/*')
        oRequestHandler.addHeaderEntry('Host', domain)
        sHtmlContent = oRequestHandler.request()

    sPattern = "escape\(hsh \+ \"([^\"]+)\"\)"
    oParser = cParser()
    aResult = oParser.parse(sHtmlContent, sPattern)

    if not aResult[0]:
        logger.info("No hash value found for the cookie")
        return ''

    sHash = aResult[1][0]

    sHash = sHashSnippet + sHash
    sSecurityCookieValue = "sitechrx=" + str(sHash) + ";Path=/"

    oRequestHandler = cRequestHandler(URL_MAIN)
    oRequestHandler.addHeaderEntry("Cookie", sSecurityCookieValue)
    oRequestHandler.request()

    logger.info("Token: %s" % sSecurityCookieValue)

    return sSecurityCookieValue
Exemplo n.º 3
0
def __clearProtection():
    oRequestHandler = cRequestHandler(URL_MAIN + '/index.php', False)
    oRequestHandler.removeNewLines(False)
    oRequestHandler.removeBreakLines(False)
    sHtmlContent = oRequestHandler.request()
    result = jsunprotect.jsunprotect(sHtmlContent)
    if not result:
        logger.info("Not protected or Deactivator not found")
        return ''
    else:
        logger.info(result)
        oRequestHandler = cRequestHandler(URL_MAIN + '?' + result, False)
        oRequestHandler.addHeaderEntry('Referer', URL_MAIN)
        oRequestHandler.addHeaderEntry('Host', 'www.' + DOMAIN)
        oRequestHandler.request()
        return ''
Exemplo n.º 4
0
def __clearProtection():
    oRequestHandler = cRequestHandler(URL_MAIN, False)
    oRequestHandler.removeNewLines(False)
    oRequestHandler.removeBreakLines(False)
    sHtmlContent = oRequestHandler.request()
    result = jsunprotect.jsunprotect(sHtmlContent)
    if not result:
        logger.error("Not protected or Deactivator not found")
        return ''
    else:
        logger.info(result)
        oRequestHandler = cRequestHandler(URL_MAIN+'?'+result, False)
        oRequestHandler.addHeaderEntry('Referer', URL_MAIN)
        oRequestHandler.addHeaderEntry('Host', 'www.movie4k.to')
        oRequestHandler.request()
        return ''
Exemplo n.º 5
0
def __clearProtection():
    oRequestHandler = cRequestHandler(URL_MAIN, False)
    oRequestHandler.removeNewLines(False)
    oRequestHandler.removeBreakLines(False)
    sHtmlContent = oRequestHandler.request()
    result = jsunprotect.jsunprotect(sHtmlContent)
    if not result:
        logger.info("Not protected or Deactivator not found")
        return ""
    else:
        logger.info(result)
        oRequestHandler = cRequestHandler(URL_MAIN + "?" + result, False)
        oRequestHandler.addHeaderEntry("Referer", URL_MAIN)
        oRequestHandler.addHeaderEntry("Host", "www." + DOMAIN)
        oRequestHandler.request()
        return ""