From 36152ba7dec241e9b10cfc01bd2aeb78547cb046 Mon Sep 17 00:00:00 2001 From: Nold360 Date: Tue, 16 Apr 2013 10:00:46 +0200 Subject: Added circlecaptcha to NCryptIn-Plugin --- module/plugins/crypter/NCryptIn.py | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) (limited to 'module') diff --git a/module/plugins/crypter/NCryptIn.py b/module/plugins/crypter/NCryptIn.py index a8eaac631..996ff581e 100644 --- a/module/plugins/crypter/NCryptIn.py +++ b/module/plugins/crypter/NCryptIn.py @@ -52,6 +52,7 @@ class NCryptIn(Crypter): package_links.extend(self.handleContainers()) package_links.extend(self.handleCNL2()) package_links = set(package_links) + self.logDebug(package_links) # Pack self.packages = [(package_name, package_links, folder_name)] @@ -65,7 +66,7 @@ class NCryptIn(Crypter): rexpr = re.compile(pattern, re.DOTALL) content = re.sub(rexpr, "", content) return content - + def isOnline(self): if "Your folder does not exist" in self.cleanedHtml: self.logDebug("File not found") @@ -121,6 +122,19 @@ class NCryptIn(Crypter): challenge, code = recaptcha.challenge(id) postData['recaptcha_challenge_field'] = challenge postData['recaptcha_response_field'] = code + + # Resolve circlecaptcha + if "circlecaptcha" in form: + self.captcha = True + self.logDebug("Captcha protected") + captcha_img_url = "http://ncrypt.in/classes/captcha/circlecaptcha.php" + coords = self.decryptCaptcha(captcha_img_url, forceUser=True, imgtype="png", result_type='positional') + self.logDebug("Captcha resolved, coords [%s]" % str(coords)) + self.captcha_post_url = self.pyfile.url + + postData['circle.x'] = coords[0] + postData['circle.y'] = coords[1] + # Unlock protection postData['submit_protected'] = 'Continue to folder ' @@ -221,4 +235,4 @@ class NCryptIn(Crypter): # Log and return self.logDebug("Block has %d links" % len(links)) - return links \ No newline at end of file + return links -- cgit v1.2.3 From b8bc5ecae9de0eb2bc6f6310d024ecc2fc845c84 Mon Sep 17 00:00:00 2001 From: Nold360 Date: Tue, 16 Apr 2013 10:02:52 +0200 Subject: Added Workaround for duplicate links in NCryptIn --- module/plugins/crypter/NCryptIn.py | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) (limited to 'module') diff --git a/module/plugins/crypter/NCryptIn.py b/module/plugins/crypter/NCryptIn.py index 996ff581e..0d0a884cf 100644 --- a/module/plugins/crypter/NCryptIn.py +++ b/module/plugins/crypter/NCryptIn.py @@ -51,6 +51,7 @@ class NCryptIn(Crypter): package_links.extend(self.handleWebLinks()) package_links.extend(self.handleContainers()) package_links.extend(self.handleCNL2()) + package_links = self.removeContainers(package_links) package_links = set(package_links) self.logDebug(package_links) @@ -67,6 +68,19 @@ class NCryptIn(Crypter): content = re.sub(rexpr, "", content) return content + def removeContainers(self,package_links): + tmp_package_links = package_links[:] + for link in tmp_package_links: + self.logDebug(link) + if ".dlc" in link or ".ccf" in link or ".rsdf" in link: + self.logDebug("Removing [%s] from package_links" % link) + package_links.remove(link) + + if len(package_links) > 0: + return package_links + else: + return tmp_package_links + def isOnline(self): if "Your folder does not exist" in self.cleanedHtml: self.logDebug("File not found") @@ -123,7 +137,7 @@ class NCryptIn(Crypter): postData['recaptcha_challenge_field'] = challenge postData['recaptcha_response_field'] = code - # Resolve circlecaptcha + # Resolve anicaptcha if "circlecaptcha" in form: self.captcha = True self.logDebug("Captcha protected") -- cgit v1.2.3 From feac135f3bf8d1b4fa47c427daaf09f20e8d3ff3 Mon Sep 17 00:00:00 2001 From: Nold360 Date: Tue, 16 Apr 2013 10:16:57 +0200 Subject: I hate this comment.. but now it's finally fixed... --- module/plugins/crypter/NCryptIn.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'module') diff --git a/module/plugins/crypter/NCryptIn.py b/module/plugins/crypter/NCryptIn.py index 0d0a884cf..63ac58a43 100644 --- a/module/plugins/crypter/NCryptIn.py +++ b/module/plugins/crypter/NCryptIn.py @@ -137,7 +137,7 @@ class NCryptIn(Crypter): postData['recaptcha_challenge_field'] = challenge postData['recaptcha_response_field'] = code - # Resolve anicaptcha + # Resolve circlecaptcha if "circlecaptcha" in form: self.captcha = True self.logDebug("Captcha protected") -- cgit v1.2.3 From c53df556a166ca9dedc67b7ca2c11fe08d88bf02 Mon Sep 17 00:00:00 2001 From: Nold360 Date: Tue, 16 Apr 2013 12:27:52 +0200 Subject: Converted tabs to spaces --- module/plugins/crypter/NCryptIn.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'module') diff --git a/module/plugins/crypter/NCryptIn.py b/module/plugins/crypter/NCryptIn.py index 63ac58a43..5e1ea347c 100644 --- a/module/plugins/crypter/NCryptIn.py +++ b/module/plugins/crypter/NCryptIn.py @@ -50,10 +50,9 @@ class NCryptIn(Crypter): package_links = [] package_links.extend(self.handleWebLinks()) package_links.extend(self.handleContainers()) - package_links.extend(self.handleCNL2()) - package_links = self.removeContainers(package_links) + package_links.extend(self.handleCNL2()) + package_links = self.removeContainers(package_links) package_links = set(package_links) - self.logDebug(package_links) # Pack self.packages = [(package_name, package_links, folder_name)] -- cgit v1.2.3