Automate the captcha
This commit is contained in:
parent
d6e5594395
commit
0a2c198d1b
|
@ -3,3 +3,6 @@
|
||||||
< css/elements.css
|
< css/elements.css
|
||||||
< css/simple.css
|
< css/simple.css
|
||||||
< css/nested.css
|
< css/nested.css
|
||||||
|
|
||||||
|
! app.js
|
||||||
|
< js/captcha.js
|
||||||
|
|
|
@ -1,13 +1,20 @@
|
||||||
/*
|
|
||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
document.getElementById('captcha').value =
|
(() => {
|
||||||
*/
|
let captchaValue = document
|
||||||
|
|
||||||
'use strict';
|
|
||||||
|
|
||||||
let captchaValue =
|
|
||||||
document
|
|
||||||
.querySelector('label[for="captcha"]')
|
.querySelector('label[for="captcha"]')
|
||||||
.textContent
|
.textContent
|
||||||
.match(/'(flag|bump)'/)[1];
|
.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:" %>
|
<%= label_for captcha => "Enter the word 'flag' to confirm:" %>
|
||||||
<%= text_field captcha => id => 'captcha' %>
|
<%= text_field captcha => id => 'captcha' %>
|
||||||
|
<%= asset 'app.js' %>
|
||||||
</div>
|
</div>
|
||||||
<button type="submit" class="form-button">Confirm</button>
|
<button type="submit" class="form-button">Confirm</button>
|
||||||
</form>
|
</form>
|
||||||
|
|
|
@ -10,6 +10,7 @@
|
||||||
<% } =%>
|
<% } =%>
|
||||||
<%= label_for captcha => "Enter the word 'bump' to confirm:" %>
|
<%= label_for captcha => "Enter the word 'bump' to confirm:" %>
|
||||||
<%= text_field captcha => id => 'captcha' %>
|
<%= text_field captcha => id => 'captcha' %>
|
||||||
|
<%= asset 'app.js' %>
|
||||||
</div>
|
</div>
|
||||||
<button type="submit" class="form-button">Confirm</button>
|
<button type="submit" class="form-button">Confirm</button>
|
||||||
</form>
|
</form>
|
||||||
|
|
|
@ -10,6 +10,7 @@
|
||||||
<% } =%>
|
<% } =%>
|
||||||
<%= label_for captcha => "Enter the word 'flag' to confirm:" %>
|
<%= label_for captcha => "Enter the word 'flag' to confirm:" %>
|
||||||
<%= text_field captcha => id => 'captcha' %>
|
<%= text_field captcha => id => 'captcha' %>
|
||||||
|
<%= asset 'app.js' %>
|
||||||
</div>
|
</div>
|
||||||
<button type="submit" class="form-button">Confirm</button>
|
<button type="submit" class="form-button">Confirm</button>
|
||||||
</form>
|
</form>
|
||||||
|
|
Loading…
Reference in New Issue
Block a user