-
-
Notifications
You must be signed in to change notification settings - Fork 244
Expand file tree
/
Copy pathconnect_page_bsky.html
More file actions
312 lines (288 loc) · 11.2 KB
/
Copy pathconnect_page_bsky.html
File metadata and controls
312 lines (288 loc) · 11.2 KB
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
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>account login</title>
<style>
body {
background-color: rgb(50,50,90);
color: white;
font-family: sans-serif;
}
#centered {
position: absolute;
width: 270px;
height: 380px;
background-color: rgb(70,70,110);
border-radius: 10px;
padding: 10px 15px;
}
#https-notice {
font-size: 16px;
padding: 10px 15px;
background: rgb(164, 65, 65);
border-radius: 5px;
z-index: 5;
position: relative;
margin-bottom: 15px;
}
#show-on-demand-notice {
font-size: 16px;
padding: 10px 15px;
background: rgb(220, 79, 79);
border-radius: 5px;
z-index: 5;
position: relative;
}
td {
width: 120px;
}
td span {
white-space: nowrap;
}
td input {
width: 150px;
}
table {
margin-top: 40px;
}
#submit-button-container {
margin-top: 30px;
text-align: center;
width: 270px;
}
#submit-btn {
background-color: rgb(90,90,130);
padding: 5px 10px;
border-radius: 5px;
cursor: pointer;
text-decoration: none;
color: white;
text-align: center;
}
#submit-btn:visited {
color: white;
}
#submit-btn:hover {
background-color: rgb(100,100,140);
}
#bottom-notice {
margin-top: 55px;
}
#bottom-notice span {
margin-bottom: 10px;
display: block;
}
#bottom-notice a, #bottom-notice a:visited {
color: white;
}
.font-size-small {
color: #aaa;
font-size: 10px;
}
</style>
</head>
<body>
<div id="https-notice">
<span>[!] you are visiting this webpage over HTTP. your sent data will be obfuscated but proper encryption is not possible. visit this page over HTTPS for better security.</span>
</div>
<div id="show-on-demand-notice" style="display: none;">
<span>show_on_demand_notice_text</span>
</div>
<div id="centered">
<form action="/autoshare_connect" method="POST" id="autoshare-connect">
<table>
<tr>
<td>
<span>username:</span>
</td>
<td>
<input type="input1_type" name="input1" autocomplete="off" spellcheck="false">
<input type="input2_type" name="input2" autocomplete="off" spellcheck="false">
<input type="input3_type" name="input3" autocomplete="off" spellcheck="false">
<input type="input4_type" name="input4" autocomplete="off" spellcheck="false">
<input type="input5_type" name="input5" autocomplete="off" spellcheck="false">
<input type="input6_type" name="input6" autocomplete="off" spellcheck="false">
<input type="input7_type" name="input7" autocomplete="off" spellcheck="false">
<input type="input8_type" name="input8" autocomplete="off" spellcheck="false">
</td>
</tr>
<tr>
<td>
<span>app password:</span>
</td>
<td>
<input type="input9_type" name="input9" autocomplete="off" spellcheck="false">
<input type="input10_type" name="input10" autocomplete="off" spellcheck="false">
<input type="input11_type" name="input11" autocomplete="off" spellcheck="false">
<input type="input12_type" name="input12" autocomplete="off" spellcheck="false">
<input type="input13_type" name="input13" autocomplete="off" spellcheck="false">
<input type="input14_type" name="input14" autocomplete="off" spellcheck="false">
<input type="input15_type" name="input15" autocomplete="off" spellcheck="false">
<input type="input16_type" name="input16" autocomplete="off" spellcheck="false">
</td>
</tr>
<tr id="verify-code-inputs">
<td>
<span>verify code:</span>
</td>
<td>
<input type="input17_type" name="input17" autocomplete="off" spellcheck="false">
</td>
</tr>
<input type="hidden" name="crc" id="crc-input">
<tr style="text-align: center;">
<td colspan="2">
<div id="submit-button-container">
<a href="javascript:void(0)" id="submit-btn" onclick="submitData()">submit</a>
</div>
</td>
</tr>
</table>
</form>
<div id="bottom-notice">
<span>yt2009 <b>dev</b> contact: <a href="https://github.com/ftde0" target="_blank">https://github.com/ftde0</a></span>
<span>yt2009 <b>instance host</b> contact: <i>(to be filled)</i></span>
<span class="font-size-small">
neither the instance host, nor the dev has access to your bsky account without your access tokens.
<br>your raw username and password aren't saved.<br><br>
yt2009 is not affiliated nor endorsed with bsky.
</span>
</div>
</div>
<script>
if(location.protocol && location.protocol.indexOf("https") !== -1) {
document.getElementById("https-notice").style.display = "none"
}
function center() {
var center_width = 300
var center_height = 400
var height = window.innerHeight || document.documentElement.clientHeight
var width = window.innerWidth || document.documentElement.clientWidth
var l = (width / 2) - (center_width / 2)
var t = (height / 2) - (center_height / 2)
document.getElementById("centered").style.left = l + "px"
document.getElementById("centered").style.top = t + "px"
}
center()
window.onresize = center;
function fakeData(length, hex) {
var a = []
while(a.length !== length) {
var i = Math.floor(Math.random() * 70) + 48
if(hex) {
i = String.fromCharCode(i)
}
a.push(i)
}
return a;
}
function shift(input, amount) {
var a = []
input = input.split("")
for(var i in input) {
if(input[i]) {
a.push(input[i].charCodeAt(0) + amount)
}
}
return a;
}
function joinCodes(charcodes) {
var s = ""
for(var c in charcodes) {
if(charcodes[c]) {
s += String.fromCharCode(charcodes[c])
}
}
return s;
}
function padStart(string, maxLength, fillString) {
try {
return string.padStart(maxLength, fillString)
}
catch(error) {
var a = ""
while(a.length !== (maxLength - string.length)) {
a += fillString
}
a += string;
return a;
}
}
function submitData() {
var usernameInput = document.getElementById("input-username")
var passwordInput = document.getElementById("input-password")
var verifiInput = document.getElementById("input-verifi")
// username
var usernameLength = usernameInput.value.length;
var usernameShift = Math.floor(Math.random() * 120) + 1
var shiftedUsername = shift(usernameInput.value, usernameShift)
var fakeUsernames = []
while(fakeUsernames.length !== 7) {
fakeUsernames.push(fakeData(usernameLength, true))
}
// password
var pwdLength = passwordInput.value.length;
var pwdShift = Math.floor(Math.random() * 120) + 1
var shiftedPwd = shift(passwordInput.value, pwdShift)
var fakePwds = []
while(fakePwds.length !== 7) {
fakePwds.push(fakeData(pwdLength, true))
}
// apply shifts and fakes
var inputs = document.getElementsByTagName("input")
var usernameInputs = [1,2,3,4,5,6,7,8]
var pwdInputs = [9,10,11,12,13,14,15,16]
var tui = 0;
for(var i in usernameInputs) {
if(usernameInputs[i] && typeof(usernameInputs[i]) == "number") {
var code = "input" + usernameInputs[i];
var e = document.getElementsByName(code)
if(e[0]
&& e[0].getAttribute("name") !== usernameInput.getAttribute("name")) {
e[0].value = fakeUsernames[tui].join("")
tui++
}
}
}
var tpi = 0;
for(var i in pwdInputs) {
if(pwdInputs[i] && typeof(pwdInputs[i]) == "number") {
var code = "input" + pwdInputs[i];
var e = document.getElementsByName(code)
if(e[0]
&& e[0].getAttribute("name") !== passwordInput.getAttribute("name")) {
e[0].value = fakePwds[tpi].join("")
tpi++
}
}
}
var usernameCIP1 = parseInt(
usernameInput.getAttribute("name").replace("input", "")
).toString(16)
usernameCIP1 = padStart(usernameCIP1, 2, "0")
var usernameCIP2 = usernameShift.toString(16)
usernameCIP2 = padStart(usernameCIP2, 2, "0")
var pwdCIP1 = parseInt(
passwordInput.getAttribute("name").replace("input", "")
).toString(16)
pwdCIP1 = padStart(pwdCIP1, 2, "0")
var pwdCIP2 = pwdShift.toString(16)
pwdCIP2 = padStart(pwdCIP2, 2, "0")
usernameInput.value = joinCodes(shiftedUsername);
passwordInput.value = joinCodes(shiftedPwd)
var fullCI = [
usernameCIP1, usernameCIP2,
pwdCIP1, pwdCIP2
]
if(verifiInput) {
fullCI.push(verifiInput.value)
}
fullCI = fullCI.join("")
document.getElementById("crc-input").value = "TYPE_B-" + fullCI;
document.getElementById("autoshare-connect").submit()
}
</script>
</body>
</html>