From d81cc8c0c46d295a3746ac658069820c95efe895 Mon Sep 17 00:00:00 2001 From: RaNaN Date: Thu, 11 Feb 2010 14:57:27 +0100 Subject: cnl, EOL, path fixes --- module/web/cnl/views.py | 28 ++++++++++++++++++++-------- 1 file changed, 20 insertions(+), 8 deletions(-) (limited to 'module/web/cnl/views.py') diff --git a/module/web/cnl/views.py b/module/web/cnl/views.py index 9d309dbf6..30d72ca5a 100644 --- a/module/web/cnl/views.py +++ b/module/web/cnl/views.py @@ -37,7 +37,7 @@ def local_check(function): @local_check def flash(request): - return HttpResponse() + return HttpResponse("JDownloader") @local_check def add(request): @@ -73,13 +73,25 @@ def addcrypted2(request): crypted = base64.standard_b64decode(unquote(crypted.replace(" ", "+"))) - jk = re.findall(r"return ('|\")(.+)('|\")", jk)[0][1] + print jk + try: + jk = re.findall(r"return ('|\")(.+)('|\")", jk)[0][1] + except: + ## Test for some known js functions to decode + if jk.find("dec") > -1 and jk.find("org") > -1: + org = re.findall(r"var org = ('|\")([^\"']+)", jk)[0][1] + jk = list(org) + jk.reverse() + jk = "".join(jk) + print jk + + Key = binascii.unhexlify(jk) IV = Key obj = AES.new(Key, AES.MODE_CBC, IV) - result = obj.decrypt(crypted).replace("\x00", "").split("\n") + result = obj.decrypt(crypted).replace("\x00", "").replace("\r","").split("\n") result = filter(lambda x: x != "", result) @@ -103,9 +115,9 @@ def flashgot(request): @local_check def crossdomain(request): - rep = "\r\n" - rep += "\r\n" - rep += "\r\n" - rep += "\r\n" - rep += "\r\n" + rep = "\n" + rep += "\n" + rep += "\n" + rep += "\n" + rep += "" return HttpResponse(rep) \ No newline at end of file -- cgit v1.2.3