-
Notifications
You must be signed in to change notification settings - Fork 0
/
randomToken.html
117 lines (106 loc) · 3.46 KB
/
randomToken.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
<!DOCTYPE html>
<html>
<head>
<title>WiFi Token</title>
</head>
<body>
<script type="text/javascript">
function randomString1(length, chars) {
var result = '';
for (var i = length; i > 0; --i) {
result += chars[Math.floor(Math.random() * chars.length)]
};
return result;
};
// generate hundred random token
// 1402410240
for (var i=0;i < 14024;i++){
var token = randomString1(6, '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ');
document.body.append(token);
// ajaxRequest(token)
};
// if (window.find("44OSJX")) {
// console.log("match found");
// alert("match found");
// } else {
// window.location.reload();
// console.log("no match found");
// }
// 0|0|0|0|0|0
// 0|0|0|0|0|1
// 0|0|0|0|1|0
var chars = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ";
var num = [0,1,2,3,4,5,6,7,8,9];
var arr = [0,0,0,0,0,0];
for (var i = 0; i < chars.length; i++) {
arr[0] = chars[i]
for (var j = 0; j < chars.length; j++) {
arr[1] = chars[j]
// for (var k = 0; k < chars.length; k++) {
// arr[2] = chars[k];
// for (var l = 0; l < chars.length; l++) {
// arr[3] = chars[l]
// for (var m = 0; m < chars.length; m++) {
// arr[4] = chars[m]
// for (var n = 0; n < chars.length; n++) {
// arr[5] = chars[n]
// console.log(arr[0]+arr[1]+arr[2]+arr[3]+arr[4]+arr[5])
// await sendRequest(arr[0]+arr[1]+arr[2]+arr[3]+arr[4]+arr[5]);
// }
// }
// }
// }
}
}
var cx = [
['0','1','2','3','4','5','6','7','8','9','A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z'],
['0','1','2','3','4','5','6','7','8','9','A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z'],
['0','1','2','3','4','5','6','7','8','9','A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z'],
['0','1','2','3','4','5','6','7','8','9','A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z'],
['0','1','2','3','4','5','6','7','8','9','A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z'],
['0','1','2','3','4','5','6','7','8','9','A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z'],
];
var c = [
['7','8','9','A','B','C','D'],
['0','1','2','3','4','5','6'],
['0','1','2','3','4','5','6'],
['0','1','2','3','4','5','6'],
['0','1','2','3','4','5','6'],
['0','1','2','3','4','5','6'],
];
function permutate(abc, memo) {
var options;
memo = memo || abc.shift().slice(0);
if(abc.length) {
options = abc.shift();
return permutate(abc, memo.reduce(function(all, item){
return all.concat(options.map(function(option){
return option + item;
}))
}, []))
}
return memo;
};
// window.TOKENS = permutate(c);
// console.log(TOKENS);
// function request() {
// for (var i = 0; i < TOKENS.length; i++) {
// ajaxRequest(TOKENS[i])
// }
// }
async function ajaxRequest(code) {
return new Promise(function(resolve, reject) {
var xhr = new XMLHttpRequest();
xhr.onreadystagechange = function() {
if (this.readyState == 4 && this.status == 200) {
resolve(true)
// console.log(xhr.responseText);
}
};
xhr.open("GET", "/data?code=" + code, true);
xhr.send();
})
}
</script>
</body>
</html>