Commit a569bc95 authored by insert's avatar insert 🎺

Initial commit

parents
# userscripts
> A collection of userscripts made by me
\ No newline at end of file
// ==UserScript==
// @name Educake Exploit
// @namespace https://insrt.uk
// @version 0.1
// @description provides answers for questions during test
// @author insert
// @match https://www.educake.co.uk/*
// @grant none
// @require https://code.jquery.com/jquery-3.3.1.min.js
// @run-at document-start
// ==/UserScript==
(function () {
'use strict';
let version = '0.1';
let Log = message => console.log('%c[educake] ' + message, 'text-shadow: 2px 2px black');
console.log('%c > insrt.uk', 'font-size: 4em;');
console.log('%c @ educake exploit ', 'font-size: 2em; color: #8888aa');
Log("Enabling v" + version + ", created by insert <insrt.uk>.");
document.onreadystatechange = function () {
if (document.readyState === "interactive") {
// privacy
let node = document.createElement('style');
node.innerHTML = '.logedin_details { filter: blur(7px); } .logedin_details:hover { filter: blur(0px); }';
document.body.appendChild(node);
// styling
let border = $('.border');
border.css('borderTop', '3px solid #315181');
border.css('borderBottom', '3px solid #315181');
$('.text_box, .multiplelabel, .contrastbutton, .logedin_details, .showMainButton, a.bluebutton.buttontemplate.marginfifteenright.right')
.attr('style', 'background: #2a2a2a !important');
$('#back_image').css('display', 'none');
$('body').css('background', '#0a0a0a');
$('#header, #footer, #educake_text, #analyse_section, #teacher_view_results').attr('style', 'background: #1a1a1a !important');
// the actual exploit
if (document.URL == 'https://www.educake.co.uk/online-test') {
let eln = document.createElement('p');
eln.innerHTML = 'educake exploit v' + version;
$('#template_container_onlinetest_question_widget > div > .text_box').append(eln);
if ($('#answerspace')) {
$.post('/online-test', {
flag: 1
}, res => {
Log("Pulled answer.");
let data = JSON.parse(res);
let ans = /(The right answer is [\s\S]+)<\/p>/g.exec(data.html);
let el = document.createElement('div');
el.classList.add('head');
el.classList.add('fadein');
el.style.marginTop = '0';
el.style.fontWeight = '800';
el.innerHTML = ans[1].replace(/\n/g, '');
let widget = $('#template_container_onlinetest_question_widget > div');
Log("Injecting element into body.");
widget.children()[2].after(el);
let parsed = /"([\s\S]+?)"/g.exec(ans);
if (parsed != null) {
Log('Found suitable answer, autofilling..');
$('#answerspace').val(parsed[1]);
$('#answerspace').focus();
}
});
} else {
Log('Not a Q/A page.');
}
}
}
}
})();
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment