-
Notifications
You must be signed in to change notification settings - Fork 5
/
index.html
182 lines (182 loc) · 7.8 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
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<meta name="description" content="capJS is a javascript library that operates on capture files, a rewrite of multicapconverter">
<meta name="keywords" content="capJS, multicapconverter, cap2hccapx, cap2hcwpax">
<meta name="author" content="Abdelhafidh Belalia">
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css" integrity="sha384-ggOyR0iXCbMQv3Xipma34MD+dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw1T" crossorigin="anonymous">
<title>capJS - a javascript library that operates on capture files</title>
<style>
body {
color: #D2DAE2;
background-color: #18191a;
padding: 2rem 0;
}
textarea {
display: inline-block;
width: 100%;
color: #D2DAE2;
background-color: #121314;
font-family: monospace;
padding: .375rem .75rem;
border-radius: .25rem;
}
textarea:focus {
outline: #fc3465 solid 1px;
}
a, a:focus, a:hover, a:active{
color: #fc3465;
}
.custom-control-input:checked~.custom-control-label::before {
border-color: #fc3465;
background-color: #fc3465;
}
hr {
border-top: 1px solid rgb(210, 218, 226);
}
.container {
max-width: 768px !important;
}
.form-check label, label.btn{
user-select: none;
cursor: pointer;
}
</style>
</head>
<body>
<div class="container">
<header>
<h1>capJS</h1>
<p>capJS is a javascript library that operates on capture files</p>
</header>
<hr>
<div class="container">
<h2 class="display-4">CAP 2 HCWPAX</h2>
<p class="lead">Convert a capture file to hcwpax (hashcat mode = 22000)</p>
<div class="row">
<div class="col">
<div class="form-group">
<label for="id_cap" class="btn btn-block btn-danger">Choose a Capture file</label>
<input type="file" class="d-none" id="id_cap" accept=".cap,.pcap,.pcapng,.cap.gz,.pcap.gz,.pcapng.gz">
<a data-toggle="collapse" href="#id_advanced_options" role="button" aria-expanded="false" aria-controls="id_advanced_options">Advanced Options</a>
<div class="collapse" id="id_advanced_options">
<div class="form-check">
<div class="custom-control custom-switch">
<input type="checkbox" class="custom-control-input" id="id_best_only" checked>
<label class="custom-control-label" for="id_best_only" title="Export one preferred handshake/pmkid per network">Best Only</label>
</div>
</div>
<div class="form-check">
<div class="custom-control custom-switch">
<input type="checkbox" class="custom-control-input" id="id_export_unauthenticated">
<label class="custom-control-label" for="id_export_unauthenticated" title="Export unauthenticated handshakes">Allow unauthenticated (Not Recommended)</label>
</div>
</div>
<div class="form-check">
<div class="custom-control custom-switch">
<input type="checkbox" class="custom-control-input" id="id_ignore_ts">
<label class="custom-control-label" for="id_ignore_ts" title="Ignore timestamps check">Ignore TS (Not Recommended)</label>
</div>
</div>
<div class="form-check">
<div class="custom-control custom-switch">
<input type="checkbox" class="custom-control-input" id="id_ignore_ie">
<label class="custom-control-label" for="id_ignore_ie" title="Ignore information element / AKM Check">Ignore IE (Not Recommended)</label>
</div>
</div>
</div>
</div>
<div class="form-group">
<label for="id_hcwpaxs">Output</label>
<textarea rows="7" id="id_hcwpaxs" wrap="off" readonly></textarea>
<button class="btn btn-dark btn-block" id="id_copy_hcwpaxs">Copy</button>
</div>
<div class="form-group">
<label for="id_passwords">Passwords</label>
<textarea rows="6" id="id_passwords" wrap="off" placeholder="Possible Passwords will be listed here if found." readonly></textarea>
<button class="btn btn-dark btn-block" id="id_copy_passwords">Copy</button>
</div>
<div class="form-group">
<label for="id_log">Log</label>
<textarea rows="5" id="id_log" wrap="off" readonly></textarea>
</div>
</div>
</div>
</div>
<hr>
<h3>Contribute</h3>
<p>If you are having issues with capJS or having any feature requests, feel free to open issues in the <a href="https://github.com/s77rt/capJS/issues/" target="_blank">capJS Github issues page</a> as necessary.</p>
<footer>
<div class="text-right">
<span>v<span id="id_version"></span> capJS, Code licensed MIT</span>
</div>
</footer>
</div>
<script src="https://code.jquery.com/jquery-3.3.1.slim.min.js" integrity="sha384-q8i/X+965DzO0rT7abK41JStQIAqVgRVzpbzo5smXKp4YfRvH+8abtTE1Pi6jizo" crossorigin="anonymous"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.7/umd/popper.min.js" integrity="sha384-UO2eT0CpHqdSJQ6hJty5KVphtPhzWj9WO1clHTMGa3JDZwrnQq4sF86dIHNDz0W1" crossorigin="anonymous"></script>
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js" integrity="sha384-JjSmVgyd0p3pXB1rRibZUAYoIIy6OrQ6VrjIEaFf/nJGzIxFDsf4x0xIM+B07jRM" crossorigin="anonymous"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/pako/1.0.11/pako_inflate.min.js" integrity="sha512-Xq51C9+MjQc6mTBRjXpUBuIzWUbxJNqa8KzxqcNe0hccW/dRG99kenA3/zVX2D7G4v59z8nDDxjBPTTAUTNRWA==" crossorigin="anonymous"></script>
<script src="js/capjs.min.js?v=0.2.1"></script>
<script>
(function () {
// Overwrite console
var logger = document.getElementById('id_log');
console.log = function (message) {
if (typeof message == 'object') {
logger.value += (JSON && JSON.stringify ? JSON.stringify(message) : message) + '\n';
} else {
logger.value += message + '\n';
}
}
})();
document.getElementById("id_version").innerText = capJS.version;
document.getElementById("id_cap").addEventListener("change", function() {
document.getElementById("id_log").value = '';
document.getElementById("id_hcwpaxs").value = '';
document.getElementById("id_passwords").value = '';
var files = this.files;
if (files.length) {
ReadCap(files[0]);
}
this.value = '';
}, false);
document.getElementById("id_copy_hcwpaxs").onclick = function(){
document.getElementById("id_hcwpaxs").select();
document.execCommand('copy');
this.innerText = "Copied!";
function revert_innerText(e) {
e.innerText = "Copy";
}
setTimeout(revert_innerText, 2000, this);
}
document.getElementById("id_copy_passwords").onclick = function(){
document.getElementById("id_passwords").select();
document.execCommand('copy');
this.innerText = "Copied!";
function revert_innerText(e) {
e.innerText = "Copy";
}
setTimeout(revert_innerText, 2000, this);
}
function ReadCap(file) {
var format = file.name.split('.').pop().toLowerCase();
if (format == "gz")
format = file.name.split('.').slice(-2).join('.');
var best_only = document.getElementById('id_best_only').checked;
var export_unauthenticated = document.getElementById('id_export_unauthenticated').checked;
var ignore_ts = document.getElementById('id_ignore_ts').checked;
var ignore_ie = document.getElementById('id_ignore_ie').checked;
var reader = new FileReader();
reader.onload = function() {
const mycap = new capJS(reader.result, format, best_only, export_unauthenticated, ignore_ts, ignore_ie);
mycap.Analysis();
document.getElementById("id_hcwpaxs").value = mycap.Getf('hcwpax');
document.getElementById("id_passwords").value = mycap.GetPasswords();
}
reader.readAsArrayBuffer(file);
}
</script>
</body>
</html>