Browse Source

added AddAll + fixed gui

psy 4 months ago
parent
commit
21e9ba5364
4 changed files with 51 additions and 8 deletions
  1. 2 0
      core/crack.py
  2. 15 5
      core/main.py
  3. 4 1
      core/update.py
  4. 30 2
      core/webgui.py

+ 2 - 0
core/crack.py

@@ -87,6 +87,8 @@ class CIntruderCrack(object):
             im = im.convert("P")
         except:
             print "\nError during cracking!. Is that captcha supported?\n"
+            if os.path.exists('core/images/previews'):
+                shutil.rmtree('core/images/previews') # remove last OCR
             return
         temp = {}
         try:

+ 15 - 5
core/main.py

@@ -19,7 +19,7 @@ with cintruder; if not, write to the Free Software Foundation, Inc., 51
 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
 """
 import os, traceback, hashlib, sys, time, socket, urlparse
-import platform, subprocess, re, webbrowser
+import platform, subprocess, re, webbrowser, shutil
 from core.options import CIntruderOptions
 from core.crack import CIntruderCrack
 from core.ocr import CIntruderOCR
@@ -49,6 +49,8 @@ class cintruder():
         self.isurl = 0
         self.os_sys = platform.system()
         self._webbrowser = webbrowser
+        self.GIT_REPOSITORY = 'https://code.03c8.net/epsylon/cintruder' # oficial code source [OK! 26/01/2019]
+        self.GIT_REPOSITORY2 = 'https://github.com/epsylon/cintruder' # mirror source [since: 04/06/2018]
 
     def set_options(self, options):
         """
@@ -314,11 +316,15 @@ class cintruder():
         if options.update:
             self.banner()
             try:
-                print("\nTrying to update automatically to the latest stable version\n")
-                Updater()
+                print("\n[AI] Trying to update automatically to the latest stable version\n")
+                Updater() 
             except:
-                print("\nSomething was wrong!. To have working this feature, you should clone CIntruder with:\n")
-                print("$ git clone https://github.com/epsylon/cintruder\n")
+                print "Not any .git repository found!\n"
+                print "="*30
+                print "\nTo have working this feature, you should clone CIntruder with:\n"
+                print "$ git clone %s" % self.GIT_REPOSITORY
+                print "\nAlso you can try this other mirror:\n"
+                print "$ git clone %s" % self.GIT_REPOSITORY2 + "\n"
         #step 0: list output results and get captcha targets
         if options.listmods:
             print "====================================="
@@ -392,6 +398,8 @@ class cintruder():
                     for captcha in captchas:
                         if captcha is None:
                             print "\n[Error] Applying OCR algorithm... Is that captcha supported?\n"
+                            if os.path.exists('core/images/previews'):
+                                shutil.rmtree('core/images/previews') # remove last OCR
                         else:
                             print "Target:", options.train
                             print "=======\n"
@@ -413,6 +421,8 @@ class cintruder():
                 for captcha in captchas:
                     if captcha is None:
                         print "\n[Error] Trying to bruteforce... Is that captcha supported?\n"
+                        if os.path.exists('core/images/previews'):
+                            shutil.rmtree('core/images/previews') # remove last OCR
                     else:
                         print "Target: ", options.crack
                         print "======="

+ 4 - 1
core/update.py

@@ -27,13 +27,16 @@ class Updater(object):
     Update CIntruder automatically from a .git repository
     """     
     def __init__(self):
-        GIT_REPOSITORY = "https://github.com/epsylon/cintruder"
+        GIT_REPOSITORY = "https://code.03c8.net/epsylon/cintruder"
+        GIT_REPOSITORY2 = "https://github.com/epsylon/cintruder"
         rootDir = os.path.abspath(os.path.join(os.path.dirname( __file__ ), '..', ''))
         if not os.path.exists(os.path.join(rootDir, ".git")):
             print "Not any .git repository found!\n"
             print "="*30
             print "\nTo have working this feature, you should clone CIntruder with:\n"
             print "$ git clone %s" % GIT_REPOSITORY
+            print "\nAlso you can try this other mirror:\n"
+            print "$ git clone %s" % GIT_REPOSITORY2 + "\n"
         else:
             checkout = execute("git checkout . && git pull", shell=True, stdout=PIPE, stderr=PIPE).communicate()[0]
             print checkout

File diff suppressed because it is too large
+ 30 - 2
core/webgui.py