Automate the captcha
This commit is contained in:
parent
d6e5594395
commit
0a2c198d1b
|
@ -3,3 +3,6 @@
|
|||
< css/elements.css
|
||||
< css/simple.css
|
||||
< css/nested.css
|
||||
|
||||
! app.js
|
||||
< js/captcha.js
|
||||
|
|
|
@ -1,13 +1,20 @@
|
|||
/*
|
||||
'use strict';
|
||||
|
||||
document.getElementById('captcha').value =
|
||||
*/
|
||||
|
||||
'use strict';
|
||||
|
||||
let captchaValue =
|
||||
document
|
||||
(() => {
|
||||
let captchaValue = document
|
||||
.querySelector('label[for="captcha"]')
|
||||
.textContent
|
||||
.match(/'(flag|bump)'/)[1];
|
||||
let captchaForm = document
|
||||
.querySelector('form[class="form-body"]');
|
||||
|
||||
captchaForm.captcha.value = captchaValue;
|
||||
// Make 'em work for it
|
||||
window.crypto.subtle.generateKey({
|
||||
name: 'RSA-OAEP',
|
||||
modulusLength: 4096,
|
||||
publicExponent: new Uint8Array([1, 0, 1]),
|
||||
hash: 'SHA-512'
|
||||
}, false, ['encrypt', 'decrypt'])
|
||||
.finally(() => captchaForm.submit());
|
||||
})();
|
||||
|
|
|
@ -10,6 +10,7 @@
|
|||
<% } =%>
|
||||
<%= label_for captcha => "Enter the word 'flag' to confirm:" %>
|
||||
<%= text_field captcha => id => 'captcha' %>
|
||||
<%= asset 'app.js' %>
|
||||
</div>
|
||||
<button type="submit" class="form-button">Confirm</button>
|
||||
</form>
|
||||
|
|
|
@ -10,6 +10,7 @@
|
|||
<% } =%>
|
||||
<%= label_for captcha => "Enter the word 'bump' to confirm:" %>
|
||||
<%= text_field captcha => id => 'captcha' %>
|
||||
<%= asset 'app.js' %>
|
||||
</div>
|
||||
<button type="submit" class="form-button">Confirm</button>
|
||||
</form>
|
||||
|
|
|
@ -10,6 +10,7 @@
|
|||
<% } =%>
|
||||
<%= label_for captcha => "Enter the word 'flag' to confirm:" %>
|
||||
<%= text_field captcha => id => 'captcha' %>
|
||||
<%= asset 'app.js' %>
|
||||
</div>
|
||||
<button type="submit" class="form-button">Confirm</button>
|
||||
</form>
|
||||
|
|
Loading…
Reference in a new issue