From cf4ded052964047de88d676045329b8fa4fca2dc Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Thu, 22 Jan 2015 21:31:19 +0100 Subject: Update plugins after CaptchaService changes --- module/plugins/container/RSDF.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'module/plugins/container/RSDF.py') diff --git a/module/plugins/container/RSDF.py b/module/plugins/container/RSDF.py index 0c43f0e6c..e263c3fe3 100644 --- a/module/plugins/container/RSDF.py +++ b/module/plugins/container/RSDF.py @@ -39,7 +39,7 @@ class RSDF(Container): with open(infile, 'r') as rsdf: data = rsdf.read() except IOError, e: - self.fail(str(e)) + self.fail(e) if re.search(r"404 - Not Found", data) is None: data = binascii.unhexlify(''.join(data.split())) -- cgit v1.2.3 From 64b48b5cae505aa0bab310687cf2f6c9f48057f1 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Fri, 23 Jan 2015 00:51:00 +0100 Subject: Improve container __pattern__ --- module/plugins/container/RSDF.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'module/plugins/container/RSDF.py') diff --git a/module/plugins/container/RSDF.py b/module/plugins/container/RSDF.py index e263c3fe3..0c36293ec 100644 --- a/module/plugins/container/RSDF.py +++ b/module/plugins/container/RSDF.py @@ -12,9 +12,9 @@ from module.utils import fs_encode class RSDF(Container): __name__ = "RSDF" - __version__ = "0.24" + __version__ = "0.25" - __pattern__ = r'.+\.rsdf' + __pattern__ = r'.+\.rsdf$' __description__ = """RSDF container decrypter plugin""" __license__ = "GPLv3" -- cgit v1.2.3 From cb9e67a5437ddfafd6a93f5a208b9faf3f2d5575 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Thu, 29 Jan 2015 15:56:57 +0100 Subject: Some file encoding fixup + optimizations --- module/plugins/container/RSDF.py | 36 +++++++++++++++++------------------- 1 file changed, 17 insertions(+), 19 deletions(-) (limited to 'module/plugins/container/RSDF.py') diff --git a/module/plugins/container/RSDF.py b/module/plugins/container/RSDF.py index 0c36293ec..20a0d34cd 100644 --- a/module/plugins/container/RSDF.py +++ b/module/plugins/container/RSDF.py @@ -6,13 +6,16 @@ import base64 import binascii import re +from Crypto.Cipher import AES + from module.plugins.Container import Container from module.utils import fs_encode class RSDF(Container): __name__ = "RSDF" - __version__ = "0.25" + __type__ = "container" + __version__ = "0.26" __pattern__ = r'.+\.rsdf$' @@ -22,35 +25,30 @@ class RSDF(Container): ("spoob", "spoob@pyload.org")] - def decrypt(self, pyfile): - - from Crypto.Cipher import AES + KEY = "8C35192D964DC3182C6F84F3252239EB4A320D2500000000" + IV = "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF" - infile = fs_encode(pyfile.url.replace("\n", "")) - Key = binascii.unhexlify('8C35192D964DC3182C6F84F3252239EB4A320D2500000000') - IV = binascii.unhexlify('FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF') + def decrypt(self, pyfile): + Key = binascii.unhexlify(self.KEY) IV_Cipher = AES.new(Key, AES.MODE_ECB) - IV = IV_Cipher.encrypt(IV) + IV = IV_Cipher.encrypt(binascii.unhexlify(self.IV)) obj = AES.new(Key, AES.MODE_CFB, IV) try: - with open(infile, 'r') as rsdf: + file = fs_encode(pyfile.url.strip()) + with open(file, 'r') as rsdf: data = rsdf.read() + except IOError, e: self.fail(e) - if re.search(r"404 - Not Found", data) is None: - data = binascii.unhexlify(''.join(data.split())) - data = data.splitlines() + if re.search(r"404 - Not Found", data): + return - for link in data: - if not link: - continue - link = base64.b64decode(link) - link = obj.decrypt(link) + for link in binascii.unhexlify(''.join(data.split())).splitlines(): + if not link: + link = obj.decrypt(base64.b64decode(link)) decryptedUrl = link.replace('CCF: ', '') self.urls.append(decryptedUrl) - - self.logDebug("Adding package %s with %d links" % (pyfile.package().name, len(self.urls))) -- cgit v1.2.3 From 79725268402043906f619f7c09e848e02ab8a17b Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Sat, 31 Jan 2015 22:00:59 +0100 Subject: Spare code cosmetics --- module/plugins/container/RSDF.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'module/plugins/container/RSDF.py') diff --git a/module/plugins/container/RSDF.py b/module/plugins/container/RSDF.py index 20a0d34cd..06b3c3b2b 100644 --- a/module/plugins/container/RSDF.py +++ b/module/plugins/container/RSDF.py @@ -2,7 +2,6 @@ from __future__ import with_statement -import base64 import binascii import re @@ -49,6 +48,6 @@ class RSDF(Container): for link in binascii.unhexlify(''.join(data.split())).splitlines(): if not link: - link = obj.decrypt(base64.b64decode(link)) + link = obj.decrypt(link.decode('base64')) decryptedUrl = link.replace('CCF: ', '') self.urls.append(decryptedUrl) -- cgit v1.2.3 From 193cb8dbe1b24c24fb919461f16b2215e85da739 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Tue, 3 Feb 2015 16:09:13 +0100 Subject: Update container plugins --- module/plugins/container/RSDF.py | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) (limited to 'module/plugins/container/RSDF.py') diff --git a/module/plugins/container/RSDF.py b/module/plugins/container/RSDF.py index 06b3c3b2b..8f9bfc0d5 100644 --- a/module/plugins/container/RSDF.py +++ b/module/plugins/container/RSDF.py @@ -14,14 +14,15 @@ from module.utils import fs_encode class RSDF(Container): __name__ = "RSDF" __type__ = "container" - __version__ = "0.26" + __version__ = "0.27" __pattern__ = r'.+\.rsdf$' __description__ = """RSDF container decrypter plugin""" __license__ = "GPLv3" __authors__ = [("RaNaN", "RaNaN@pyload.org"), - ("spoob", "spoob@pyload.org")] + ("spoob", "spoob@pyload.org"), + ("Walter Purcaro", "vuolter@gmail.com")] KEY = "8C35192D964DC3182C6F84F3252239EB4A320D2500000000" @@ -29,11 +30,10 @@ class RSDF(Container): def decrypt(self, pyfile): - Key = binascii.unhexlify(self.KEY) - IV_Cipher = AES.new(Key, AES.MODE_ECB) - IV = IV_Cipher.encrypt(binascii.unhexlify(self.IV)) + KEY = binascii.unhexlify(self.KEY) + IV = AES.new(Key, AES.MODE_ECB).encrypt(binascii.unhexlify(self.IV)) - obj = AES.new(Key, AES.MODE_CFB, IV) + cipher = AES.new(KEY, AES.MODE_CFB, IV) try: file = fs_encode(pyfile.url.strip()) @@ -47,7 +47,6 @@ class RSDF(Container): return for link in binascii.unhexlify(''.join(data.split())).splitlines(): - if not link: - link = obj.decrypt(link.decode('base64')) - decryptedUrl = link.replace('CCF: ', '') - self.urls.append(decryptedUrl) + if link: + link = cipher.decrypt(link.decode('base64')).replace('CCF: ', '') + self.urls.append(link) -- cgit v1.2.3