From 44ea2cc31c2f08e5334240508930b78e43559db0 Mon Sep 17 00:00:00 2001 From: MemoryForPython <1241112575@qq.com> Date: Mon, 28 Mar 2016 07:52:20 +0800 Subject: [PATCH] Delete crackHash.py --- crackHash.py | 2898 -------------------------------------------------- 1 file changed, 2898 deletions(-) delete mode 100644 crackHash.py diff --git a/crackHash.py b/crackHash.py deleted file mode 100644 index f19baee..0000000 --- a/crackHash.py +++ /dev/null @@ -1,2898 +0,0 @@ -#!/usr/bin/python -# -*- coding: iso-8859-1 -*- -# -*- coding: utf-8 -*- -######################################################################################################## -# -# crackhash.py - v0.01 -# -# 国外在线破解hash的小脚本。 -# -##################################################################################################### -try: - import sys - import hashlib - import urllib2 - import getopt - from os import path - from urllib import urlencode - from re import search, findall - from random import seed, randint - from base64 import decodestring, encodestring - from cookielib import LWPCookieJar -except: - print """ -运行出错: - - 以下的python 库尚未安装: - - 该应用程序需要的库:sys, hashlib, urllib, urllib2, os, re, random, getopt, base64 and cookielib. - - 请检查这些依赖库是否安装在您的操作系统上 - - 提示:安装这些库的格式为: - - apt-get install 库名字 - - 例如: apt-get install httplib2 - - 或者使用以下方式: - - easy_install httplib2 - -""" - sys.exit(1) - -try: - from httplib2 import Http -except: - print """ -运行出错: - - Python 依赖库: httplib2 尚未被安装在您的系统中. - - 请在使用该程序之前安装该依赖库。 - -""" - sys.exit(1) - -try: - from libxml2 import parseDoc -except: - print """ - -运行出错: - - Python 依赖库: libxml2 尚未被安装在您的系统中. - - 如果缺失该依赖库,部分插件将无法正常工作。 - - 请在使用该程序之前安装该依赖库。 - -""" - -######################################################################################################## -### 定义常量 -######################################################################################################## - -MD4 = "md4" -MD5 = "md5" -SHA1 = "sha1" -SHA224 = "sha224" -SHA256 = "sha256" -SHA384 = "sha384" -SHA512 = "sha512" -RIPEMD = "rmd160" -LM = "lm" -NTLM = "ntlm" -MYSQL = "mysql" -CISCO7 = "cisco7" -JUNIPER = "juniper" -GOST = "gost" -WHIRLPOOL = "whirlpool" -LDAP_MD5 = "ldap_md5" -LDAP_SHA1 = "ldap_sha1" - -USER_AGENTS = [ - "Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:2.0b8pre) Gecko/20101213 Firefox/4.0b8pre", - "Mozilla/5.0 (compatible; MSIE 10.0; Windows NT 6.1; Trident/6.0)", - "Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 7.1; Trident/5.0)", - "Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; Trident/5.0) chromeframe/10.0.648.205", - "Opera/9.80 (Windows NT 6.1; U; sv) Presto/2.7.62 Version/11.01", - "Opera/9.80 (Windows NT 6.1; U; pl) Presto/2.7.62 Version/11.00", - "Opera/9.80 (X11; Linux i686; U; pl) Presto/2.6.30 Version/10.61", - "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_7_0) AppleWebKit/535.2 (KHTML, like Gecko) Chrome/15.0.861.0 Safari/535.2", - "Mozilla/5.0 (Windows NT 5.1) AppleWebKit/535.2 (KHTML, like Gecko) Chrome/15.0.872.0 Safari/535.2", - "Mozilla/5.0 (Windows NT 6.1) AppleWebKit/535.1 (KHTML, like Gecko) Chrome/14.0.812.0 Safari/535.1", -] - - -######################################################################################################## -### 定义破解网站 -######################################################################################################## - - -class NETMD5CRACK: - name = "netmd5crack" - url = "http://www.netmd5crack.com" - supported_algorithm = [MD5] - - def isSupported(self, alg): - # 如果成功破解,返回true,如果不能被破解,则返回false - if alg in self.supported_algorithm: - return True - else: - return False - - def crack(self, hashvalue, alg): - """Try to crack the hash. - @param hashvalue Hash to crack. - @param alg Algorithm to crack.""" - - # 检查是否支持该种算法 - if not self.isSupported(alg): - return None - - # 创建查询URL - url = "http://www.netmd5crack.com/cgi-bin/Crack.py?InputHash=%s" % (hashvalue) - - # 进行http 网络查询 - response = do_HTTP_request(url) - - # 分析响应 - html = None - if response: - html = response.read() - else: - return None - - regexp = r'%s[^<]*' % (hashvalue) - match = search(regexp, html) - - if match: - match2 = search("Sorry, we don't have that hash in our database", match.group()) - if match2: - return None - else: - return match.group().split('border')[2].split('<')[0][2:] - - -class BENRAMSEY: - name = "benramsey" - url = "http://tools.benramsey.com" - supported_algorithm = [MD5] - - def isSupported(self, alg): - if alg in self.supported_algorithm: - return True - else: - return False - - def crack(self, hashvalue, alg): - """Try to crack the hash. - @param hashvalue Hash to crack. - @param alg Algorithm to crack.""" - - # 检查是否支持该种算法 - if not self.isSupported(alg): - return None - - # 创建查询URL - url = "http://tools.benramsey.com/md5/md5.php?hash=%s" % (hashvalue) - - # 进行http 网络查询 - response = do_HTTP_request(url) - - # 分析响应 - html = None - if response: - html = response.read() - else: - return None - - match = search(r'', html) - - if match: - return match.group().split(']')[0][17:] - else: - return None - - -class GROMWEB: - name = "gromweb" - url = "http://md5.gromweb.com" - supported_algorithm = [MD5] - - def isSupported(self, alg): - """Return True if HASHCRACK can crack this type of algorithm and - False if it cannot.""" - - if alg in self.supported_algorithm: - return True - else: - return False - - def crack(self, hashvalue, alg): - """Try to crack the hash. - @param hashvalue Hash to crack. - @param alg Algorithm to crack.""" - - # 检查是否支持该种算法 - if not self.isSupported(alg): - return None - - # 创建查询URL - url = "http://md5.gromweb.com/query/%s" % (hashvalue) - - # 进行http 网络查询 - response = do_HTTP_request(url) - - # 分析响应 - if response: - return response.read() - - return response - - -class HASHCRACKING: - name = "hashcracking" - url = "http://md5.hashcracking.com" - supported_algorithm = [MD5] - - def isSupported(self, alg): - """Return True if HASHCRACK can crack this type of algorithm and - False if it cannot.""" - - if alg in self.supported_algorithm: - return True - else: - return False - - def crack(self, hashvalue, alg): - """Try to crack the hash. - @param hashvalue Hash to crack. - @param alg Algorithm to crack.""" - - # 检查是否支持该种算法 - if not self.isSupported(alg): - return None - - # 创建查询URL - url = "http://md5.hashcracking.com/search.php?md5=%s" % (hashvalue) - - # 进行http 网络查询 - response = do_HTTP_request(url) - - # 分析响应 - html = None - if response: - html = response.read() - else: - return None - - match = search(r'\sis.*', html) - - if match: - return match.group()[4:] - - return None - - -class VICTOROV: - name = "hashcracking" - url = "http://victorov.su" - supported_algorithm = [MD5] - - def isSupported(self, alg): - """Return True if HASHCRACK can crack this type of algorithm and - False if it cannot.""" - - if alg in self.supported_algorithm: - return True - else: - return False - - def crack(self, hashvalue, alg): - """Try to crack the hash. - @param hashvalue Hash to crack. - @param alg Algorithm to crack.""" - - # 检查是否支持该种算法 - if not self.isSupported(alg): - return None - - # 创建查询URL - url = "http://victorov.su/md5/?md5e=&md5d=%s" % (hashvalue) - - # 进行http 网络查询 - response = do_HTTP_request(url) - - # 分析响应 - html = None - if response: - html = response.read() - else: - return None - - match = search(r': [^<]*
', html) - - if match: - return match.group().split('b>')[1][:-2] - - return None - - -class THEKAINE: - name = "thekaine" - url = "http://md5.thekaine.de" - supported_algorithm = [MD5] - - def isSupported(self, alg): - """Return True if HASHCRACK can crack this type of algorithm and - False if it cannot.""" - - if alg in self.supported_algorithm: - return True - else: - return False - - def crack(self, hashvalue, alg): - """Try to crack the hash. - @param hashvalue Hash to crack. - @param alg Algorithm to crack.""" - - # 检查是否支持该种算法 - if not self.isSupported(alg): - return None - - # 创建查询URL - url = "http://md5.thekaine.de/?hash=%s" % (hashvalue) - - # 进行http 网络查询 - response = do_HTTP_request(url) - - # 分析响应 - html = None - if response: - html = response.read() - else: - return None - - match = search(r'

[^<]*', html) - - if match: - - match2 = search(r'not found', match.group()) - - if match2: - return None - else: - return match.group().split('b>')[1][:-2] - - -class TMTO: - name = "tmto" - url = "http://www.tmto.org" - supported_algorithm = [MD5] - - def isSupported(self, alg): - """Return True if HASHCRACK can crack this type of algorithm and - False if it cannot.""" - - if alg in self.supported_algorithm: - return True - else: - return False - - def crack(self, hashvalue, alg): - """Try to crack the hash. - @param hashvalue Hash to crack. - @param alg Algorithm to crack.""" - - # 检查是否支持该种算法 - if not self.isSupported(alg): - return None - - # 创建查询URL - url = "http://www.tmto.org/api/latest/?hash=%s&auth=true" % (hashvalue) - - # 进行http 网络查询 - response = do_HTTP_request(url) - - # 分析响应 - html = None - if response: - html = response.read() - else: - return None - - match = search(r'text="[^"]+"', html) - - if match: - return decodestring(match.group().split('"')[1]) - else: - return None - - -class MD5_DB: - name = "md5-db" - url = "http://md5-db.de" - supported_algorithm = [MD5] - - def isSupported(self, alg): - """Return True if HASHCRACK can crack this type of algorithm and - False if it cannot.""" - - if alg in self.supported_algorithm: - return True - else: - return False - - def crack(self, hashvalue, alg): - """Try to crack the hash. - @param hashvalue Hash to crack. - @param alg Algorithm to crack.""" - - # 检查是否支持该种算法 - if not self.isSupported(alg): - return None - - # 创建查询URL - url = "http://md5-db.de/%s.html" % (hashvalue) - - # 进行http 网络查询 - response = do_HTTP_request(url) - - # 分析响应 - if not response: - return None - - html = None - if response: - html = response.read() - else: - return None - - match = search( - r'Es wurden 1 m.gliche Begriffe gefunden, die den Hash \w* verwenden: