-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathindex.html
219 lines (191 loc) · 5.98 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css" integrity="sha384-Gn5384xqQ1aoWXA+058RXPxPg6fy4IWvTNh0E263XmFcJlSAwiGgFAW/dAiS6JXm" crossorigin="anonymous">
<title>HASHES.PRO | Hash Identifyer</title>
<style type="text/css">
#hashesInputField {
width: 100%;
height: 400px;
}
body {
background-color: #f9f9f9;
}
.blockquote-footer {
text-align: right;
}
</style>
</head>
<body>
<div class="container">
<header><h1>HASHES.PRO</h1></header>
<content>
<label for="hashesInputField"><h4>Enter hashes one per line to be identified</h4></label>
<textarea id="hashesInputField" placeholder="hash1
hash2
hash3"></textarea>
<br>
<br>
<button id="identify" type="button" class="btn btn-primary">Identify hashes</button>
<table class="table thead-light d-none">
<thead>
<tr>
<th scope="col">Hash</th>
<th scope="col">Type</th>
<th scope="col">HashCat Mode</th>
<th scope="col">John Mode</th>
</tr>
</thead>
<tbody id="results"></tbody>
</table>
</content>
<footer class="blockquote-footer">
<a href="https://github.com/Vegasq/hashespro">Made by Nick here</a>
<br>
<a href="https://github.com/HashPals/Name-That-Hash">Based on Name-That-Hash by HashPals</a>
<br>
<a href="https://github.com/noraj/haiti/">Based on Haiti by noraj</a>
<br>
<a href="https://github.com/bee-san/pyWhat">Based on pyWhat by bee-san</a>
</footer>
</div>
</body>
</html>
<script type="text/javascript">
async function getPyWhatHashTypes(){
var knownHashTypes = [];
var resp = await fetch("https://raw.githubusercontent.com/bee-san/pyWhat/main/pywhat/Data/regex.json");
var data = await resp.json();
for (var i = data.length - 1; i >= 0; i--) {
try {
var r = new RegExp(data[i].Regex, 'i');
} catch(err) {
continue;
}
knownHashTypes.push({
name: "pyWhat: " + data[i].Name,
re: r,
});
}
return knownHashTypes;
}
async function getHaitiHashTypes(){
var knownHashTypes = [];
var resp = await fetch("https://raw.githubusercontent.com/noraj/haiti/master/data/prototypes.json");
var data = await resp.json();
for (var i = data.length - 1; i >= 0; i--) {
var r = new RegExp(data[i].regex, 'i');
for (var j = data[i].modes.length - 1; j >= 0; j--) {
knownHashTypes.push({
name: "haiti: " + data[i].modes[j].name,
re: r,
hashcat: data[i].modes[j].hashcat,
john: data[i].modes[j].john,
});
}
}
return knownHashTypes;
}
async function getNTHHashTypes(){
var knownHashTypes = [];
var resp = await fetch("https://raw.githubusercontent.com/HashPals/Name-That-Hash/main/name_that_hash/hashes.py");
var data = await resp.text();
let hashProto = new RegExp(/re\.compile\(r\"(.+?)\".*?modes=\[(.*?)\]/, 'gms');
let regexExtractor = new RegExp(/re\.compile\(r\"(.*?)\"/, 'gms');
let nameExtractor = new RegExp(/name=.?\"(.*?)\"/, 'gms');
let hashcatExtractor = new RegExp(/hashcat=(\d+?),/, 'gms');
let johnExtractor = new RegExp(/john=\"(.+?)\",/, 'gms');
const found = data.match(hashProto);
for (var i = found.length - 1; i >= 0; i--) {
var regexes = [...found[i].matchAll(regexExtractor)];
var names = [...found[i].matchAll(nameExtractor)];
var hashcatModes = [...found[i].matchAll(hashcatExtractor)];;
var johnModes = [...found[i].matchAll(johnExtractor)];
if (regexes !== undefined) {
var r = new RegExp(regexes[0][1], 'i');
if (hashcatModes !== undefined && hashcatModes.length > 0) {
hashcatModes = hashcatModes[0][1];
}
if (johnModes !== undefined && johnModes.length > 0) {
johnModes = johnModes[0][1];
}
knownHashTypes.push({
name: "NTH: " + names[0][1],
re: r,
hashcat: hashcatModes,
john: johnModes,
});
}
}
return knownHashTypes;
}
function identifyHash(hashTypes, hash){
var results = [];
for (var j = hashTypes.length - 1; j >= 0; j--) {
var match = hash.match(hashTypes[j].re);
if (match !== null) {
results.push({
hash: hash,
hashType: hashTypes[j],
});
}
}
return results;
}
function displayResults(results){
var table = "";
var row = "";
for (var i = results.length - 1; i >= 0; i--) {
var result = results[i];
if (results[i].hashType !== undefined) {
row = `<tr>
<td>${result.hash}</td>
<td>${result.hashType.name}</td>
<td>${result.hashType.hashcat}</td>
<td>${result.hashType.john}</td>
</tr>`;
} else {
row = `<tr>
<td>${result.hash}</td>
<td>?</td>
<td>?</td>
<td>?</td>
</tr>`;
}
table += row;
}
document.getElementById("results").innerHTML = table;
document.getElementById("results").parentNode.classList.remove('d-none');
}
async function identify(){
let hashesFieldValue = document.getElementById("hashesInputField").value;
let hashes = hashesFieldValue.split("\n");
var haitiHashTypes = await getHaitiHashTypes();
var nthHashTypes = await getNTHHashTypes();
var pywhatHashTypes = await getPyWhatHashTypes();
var hashTypes = haitiHashTypes.concat(nthHashTypes);
var hashTypes = hashTypes.concat(pywhatHashTypes);
var results = [];
for (var i = hashes.length - 1; i >= 0; i--) {
var detected = identifyHash(hashTypes, hashes[i]);
for (var j = detected.length - 1; j >= 0; j--) {
results.push(detected[j]);
}
}
displayResults(results);
};
(function init(){
let button = document.getElementById("identify");
button.addEventListener("click", identify);
})();
</script>
<!-- Global site tag (gtag.js) - Google Analytics -->
<script async src="https://www.googletagmanager.com/gtag/js?id=G-LH6XZPJ24D"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', 'G-LH6XZPJ24D');
</script>