From ee5cb5761272bcee1db9c7a7cf53da402719ab97 Mon Sep 17 00:00:00 2001 From: Hadrien Theveneau Date: Thu, 8 Oct 2015 21:52:00 +0200 Subject: Addition of captcha code in debug messages in DlProtect.py --- module/plugins/crypter/DlProtectCom.py | 1 + 1 file changed, 1 insertion(+) diff --git a/module/plugins/crypter/DlProtectCom.py b/module/plugins/crypter/DlProtectCom.py index 3377d4a8a..7c30dbe9d 100644 --- a/module/plugins/crypter/DlProtectCom.py +++ b/module/plugins/crypter/DlProtectCom.py @@ -57,6 +57,7 @@ class DlProtectCom(SimpleCrypter): m = re.search(r'/captcha\.php\?key=(.+?)"', self.data) if m is not None: captcha_code = self.captcha.decrypt("http://www.dl-protect.com/captcha.php?key=" + m.group(1), input_type="gif") + self.log_debug("Captcha code: %s" % captcha_code) post_req['secure'] = captcha_code self.data = self.load(self.pyfile.url, post=post_req) -- cgit v1.2.3 From 7f19e76b0e58dec7e5715d90350dc5313f659ca1 Mon Sep 17 00:00:00 2001 From: Hadrien Theveneau Date: Thu, 8 Oct 2015 22:23:16 +0200 Subject: Addition of some debug messages in DlProtectCom.py and Captcha.py --- module/plugins/crypter/DlProtectCom.py | 2 ++ module/plugins/internal/Captcha.py | 1 + 2 files changed, 3 insertions(+) diff --git a/module/plugins/crypter/DlProtectCom.py b/module/plugins/crypter/DlProtectCom.py index 7c30dbe9d..32dfd4612 100644 --- a/module/plugins/crypter/DlProtectCom.py +++ b/module/plugins/crypter/DlProtectCom.py @@ -59,6 +59,8 @@ class DlProtectCom(SimpleCrypter): captcha_code = self.captcha.decrypt("http://www.dl-protect.com/captcha.php?key=" + m.group(1), input_type="gif") self.log_debug("Captcha code: %s" % captcha_code) post_req['secure'] = captcha_code + else: + self.log_debug("Captcha code requested but captcha not found") self.data = self.load(self.pyfile.url, post=post_req) diff --git a/module/plugins/internal/Captcha.py b/module/plugins/internal/Captcha.py index 333602e29..d30271dd4 100644 --- a/module/plugins/internal/Captcha.py +++ b/module/plugins/internal/Captcha.py @@ -38,6 +38,7 @@ class Captcha(Plugin): """ Extend to build your custom anti-captcha ocr """ + self.log_debug("This function does nothing") pass -- cgit v1.2.3 From 98a48b21ebd0add5b983bb67a1c2ef48ebd40784 Mon Sep 17 00:00:00 2001 From: Hadrien Theveneau Date: Thu, 8 Oct 2015 23:04:48 +0200 Subject: Addition of some debug messages about captchas and plugins in DlProtectCom.py and PluginManager.py --- module/plugins/PluginManager.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/module/plugins/PluginManager.py b/module/plugins/PluginManager.py index f3f5f47bc..6c1d22359 100644 --- a/module/plugins/PluginManager.py +++ b/module/plugins/PluginManager.py @@ -272,6 +272,9 @@ class PluginManager: self.log.error(_("Error importing %(name)s: %(msg)s") % {"name": name, "msg": str(e)}) if self.core.debug: print_exc() + else: + self.log.debug("Plugin %s not found" % name) + self.log.debug("Available plugins : %s" % str(plugins)) def loadClass(self, type, name): """Returns the class of a plugin with the same name""" -- cgit v1.2.3 From f8b71e503e5aecfa8245e8aacb587aa4e38f936a Mon Sep 17 00:00:00 2001 From: Hadrien Theveneau Date: Thu, 8 Oct 2015 23:30:49 +0200 Subject: Correction of some errors in OCR.py --- module/plugins/internal/OCR.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/module/plugins/internal/OCR.py b/module/plugins/internal/OCR.py index 89eed1832..b4e28ca0f 100644 --- a/module/plugins/internal/OCR.py +++ b/module/plugins/internal/OCR.py @@ -65,7 +65,7 @@ class OCR(Plugin): output = popen.stdout.read() + " | " + popen.stderr.read() popen.stdout.close() popen.stderr.close() - self.pyload.log_debug("Tesseract ReturnCode " + popen.returncode, "Output: " + output) + self.log_debug("Tesseract ReturnCode %d" % popen.returncode, "Output: %s" % output) def run_tesser(self, subset=False, digits=True, lowercase=True, uppercase=True, pagesegmode=None): @@ -82,7 +82,7 @@ class OCR(Plugin): self.log_error(e) return - self.pyload.log_debug("Saving tiff...") + self.log_debug("Saving tiff...") self.image.save(tmpTif.name, 'TIFF') if os.name is "nt": @@ -111,9 +111,9 @@ class OCR(Plugin): tessparams.append("nobatch") tessparams.append(os.path.abspath(tmpSub.name)) - self.pyload.log_debug("Running tesseract...") + self.log_debug("Running tesseract...") self.run(tessparams) - self.pyload.log_debug("Reading txt...") + self.log_debug("Reading txt...") try: with open(tmpTxt.name, 'r') as f: @@ -122,7 +122,7 @@ class OCR(Plugin): except Exception: self.result_captcha = "" - self.pyload.log_info(_("OCR result: ") + self.result_captcha) + self.log_info(_("OCR result: ") + self.result_captcha) try: os.remove(tmpTif.name) os.remove(tmpTxt.name) -- cgit v1.2.3 From 421a7c9c87997a505855bcafa6a8e0e4702cb810 Mon Sep 17 00:00:00 2001 From: Hadrien Theveneau Date: Tue, 27 Oct 2015 18:42:22 +0100 Subject: Show key in debug log in DlProtectCom.py --- module/plugins/crypter/DlProtectCom.py | 1 + 1 file changed, 1 insertion(+) diff --git a/module/plugins/crypter/DlProtectCom.py b/module/plugins/crypter/DlProtectCom.py index 32dfd4612..a3b24a1d6 100644 --- a/module/plugins/crypter/DlProtectCom.py +++ b/module/plugins/crypter/DlProtectCom.py @@ -38,6 +38,7 @@ class DlProtectCom(SimpleCrypter): post_req = {'key' : re.search(r'name="key" value="(.+?)"', self.data).group(1), 'submitform': ""} + self.log_debug("Key: %s" % post_req['key']) if "Please click on continue to see the links" in self.data: post_req['submitform'] = "Continue" -- cgit v1.2.3 From 7eb0e3f633343b7e96053fdfd0342a5f4da50952 Mon Sep 17 00:00:00 2001 From: Hadrien Theveneau Date: Wed, 28 Oct 2015 02:53:26 +0100 Subject: Infinite redirect bug fixing in SimpleCrypter.py --- module/plugins/internal/SimpleCrypter.py | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/module/plugins/internal/SimpleCrypter.py b/module/plugins/internal/SimpleCrypter.py index f37323f90..b36c3d528 100644 --- a/module/plugins/internal/SimpleCrypter.py +++ b/module/plugins/internal/SimpleCrypter.py @@ -149,24 +149,26 @@ class SimpleCrypter(Crypter): def handle_direct(self, pyfile): - link = None + redirect = None maxredirs = self.get_config("maxredirs", default=10, plugin="UserAgentSwitcher") for i in xrange(maxredirs): - url = link or pyfile.url - self.log_debug("Redirect #%d to: %s" % (i, url)) + redirect = redirect or pyfile.url + self.log_debug("Redirect #%d to: %s" % (i, redirect)) - header = self.load(url, just_header=True) + data = self.load(redirect) + header = dict(re.findall(r"(?P.+?): (?P.+?)\r?\n", self.req.http.header)) + #Ugly, but there is no direct way to fetch headers AND data location = header.get('location') if location: - link = location - - elif link: - self.links.append(link) + redirect = location + else: + self.data = data + self.links.extend(self.get_links()) return else: - self.log_warning(_("Too many redirects")) + self.log_error(_("Too many redirects")) def preload(self): -- cgit v1.2.3 From de25bfe52bd77ffca5496708583b2070f97a8513 Mon Sep 17 00:00:00 2001 From: Hadrien Theveneau Date: Tue, 27 Oct 2015 23:30:58 +0100 Subject: Filter interesting urls from ads in DlProtectCom.py --- module/plugins/crypter/DlProtectCom.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/module/plugins/crypter/DlProtectCom.py b/module/plugins/crypter/DlProtectCom.py index a3b24a1d6..10993d729 100644 --- a/module/plugins/crypter/DlProtectCom.py +++ b/module/plugins/crypter/DlProtectCom.py @@ -69,7 +69,8 @@ class DlProtectCom(SimpleCrypter): if errmsg in self.data: self.fail(_(errmsg[1:])) - return re.findall(r'', self.data) + # Filters interesting urls from ads + return re.findall(r'(?P=id)', self.data) getInfo = create_getInfo(DlProtectCom) -- cgit v1.2.3 From 96eccb0d7b3899f7559762b629e0382e5ce9efe7 Mon Sep 17 00:00:00 2001 From: Hadrien Theveneau Date: Wed, 28 Oct 2015 02:03:43 +0100 Subject: Add info encoding to DlProtectCom.py --- module/plugins/crypter/DlProtectCom.py | 53 ++++++++++++++++++++++++++++++++++ 1 file changed, 53 insertions(+) diff --git a/module/plugins/crypter/DlProtectCom.py b/module/plugins/crypter/DlProtectCom.py index 10993d729..81b1cda86 100644 --- a/module/plugins/crypter/DlProtectCom.py +++ b/module/plugins/crypter/DlProtectCom.py @@ -3,6 +3,7 @@ import re import time +import base64 from base64 import urlsafe_b64encode from module.plugins.internal.SimpleCrypter import SimpleCrypter, create_getInfo @@ -30,6 +31,56 @@ class DlProtectCom(SimpleCrypter): OFFLINE_PATTERN = r'Unfortunately, the link you are looking for is not found' + # Information decoding + # For test purposes + def info_decode(self, i): + # Remove end string + assert i.endswith("_%3D") + i = i[0:-4] + # Invert string + i = i[::-1] + # Base 64 decode + i = base64.b64decode(i) + # Split information + infos = i.split('|') + assert(len(infos) == 4) + res = infos[0] + user_agent = infos[1] + plugins = [x.split(';') for x in infos[2].split('&')] + java = {"ENABLE": True, "DISABLE":False}[infos[3]] + # Return information + return {'res':res, + 'user_agent':user_agent, + 'plugins':plugins, + 'java':java} + + # Information encoding + def info_encode(self, info): + # Pack information + res = info['res'] + user_agent = info['user_agent'] + plugins = '&'.join(';'.join(x) for x in info['plugins']) + java = {True:"ENABLE", False:"DISABLE"}[info['java']] + i = '|'.join([res, user_agent, plugins, java]) + # Base 64 encode + i = base64.b64encode(i) + # Invert string + i = i[::-1] + # Add end string and return + i = i + "_%3D" + return i + + # Sample configuration + def conf(self): + useragent = self.get_config('useragent', plugin="UserAgentSwitcher") + conf = {'res': '1280x611x24', + 'java': True, + 'user_agent': useragent, + 'plugins': [['Adobe Acrobat', 'nppdf32.dll', 'Adobe PDF Plug-In For Firefox and Netscape 11.0.13', '11.0.13.17'], + ['Adobe Acrobat', 'nppdf32.dll', 'Adobe PDF Plug-In For Firefox and Netscape 11.0.13', '11.0.13.17'], + ['Java(TM) Platform SE 8 U51', 'npjp2.dll', 'Next Generation Java Plug-in 11.51.2 for Mozilla browsers', '11.51.2.16'], + ['Shockwave Flash', 'NPSWF32_19_0_0_226.dll', 'Shockwave Flash 19.0 r0', '19.0.0.226']]} + return conf def get_links(self): #: Direct link with redirect @@ -42,6 +93,7 @@ class DlProtectCom(SimpleCrypter): if "Please click on continue to see the links" in self.data: post_req['submitform'] = "Continue" + post_req['i'] = self.info_encode(self.conf()) self.wait(2) else: @@ -65,6 +117,7 @@ class DlProtectCom(SimpleCrypter): self.data = self.load(self.pyfile.url, post=post_req) + # Check error messages in pages for errmsg in ("The password is incorrect", "The security code is incorrect"): if errmsg in self.data: self.fail(_(errmsg[1:])) -- cgit v1.2.3 From 2a0a6222559a6fa452915b7d55d33663d3157c42 Mon Sep 17 00:00:00 2001 From: Hadrien Theveneau Date: Wed, 28 Oct 2015 02:45:30 +0100 Subject: Increase version number in DlProtectCom.py --- module/plugins/crypter/DlProtectCom.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/module/plugins/crypter/DlProtectCom.py b/module/plugins/crypter/DlProtectCom.py index 81b1cda86..874815eee 100644 --- a/module/plugins/crypter/DlProtectCom.py +++ b/module/plugins/crypter/DlProtectCom.py @@ -12,7 +12,7 @@ from module.plugins.internal.SimpleCrypter import SimpleCrypter, create_getInfo class DlProtectCom(SimpleCrypter): __name__ = "DlProtectCom" __type__ = "crypter" - __version__ = "0.07" + __version__ = "0.08" __status__ = "testing" __pattern__ = r'https?://(?:www\.)?dl-protect\.com/((en|fr)/)?\w+' -- cgit v1.2.3 From 4812b211ef351e9c932b62aa2e488f0a833100df Mon Sep 17 00:00:00 2001 From: Hadrien Theveneau Date: Wed, 28 Oct 2015 02:54:18 +0100 Subject: Increase version number in SimpleCrypter.py --- module/plugins/internal/SimpleCrypter.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/module/plugins/internal/SimpleCrypter.py b/module/plugins/internal/SimpleCrypter.py index b36c3d528..59b9acc31 100644 --- a/module/plugins/internal/SimpleCrypter.py +++ b/module/plugins/internal/SimpleCrypter.py @@ -11,7 +11,7 @@ from module.plugins.internal.utils import replace_patterns, set_cookie, set_cook class SimpleCrypter(Crypter): __name__ = "SimpleCrypter" __type__ = "crypter" - __version__ = "0.78" + __version__ = "0.79" __status__ = "testing" __pattern__ = r'^unmatchable$' -- cgit v1.2.3