Skip to content

Instantly share code, notes, and snippets.

@op01
Created August 5, 2016 02:24
Show Gist options
  • Save op01/a5e485f546033ffd5b3677026a4c98e6 to your computer and use it in GitHub Desktop.
Save op01/a5e485f546033ffd5b3677026a4c98e6 to your computer and use it in GitHub Desktop.
// ==UserScript==
// @name Reg Chula
// @namespace sssss
// @description wtf
// @include https://www2.reg.chula.ac.th/cu/reg/logon/logonframe.html
// @version 1
// @grant none
// ==/UserScript==
document.body.onload = function() {
document.getElementsByTagName('frame')[2].contentDocument.getElementsByName('code')[0].parentNode.innerHTML += "<button id='autoCap'>AUTO CAPTCHA !!!</button>";
document.getElementsByTagName('frame')[2].contentDocument.getElementById('autoCap').onclick = fillCaptcha;
}
function fillCaptcha(t) {
flag = ""
for(var i of document.getElementsByTagName('frame')[2].contentDocument.getElementsByTagName('img'))
{
atr = i.getAttribute('src');
if(atr.indexOf('/random/')!=-1)
flag += ("BA9876543210ZYXWVUTSRQPONMLKJIHGFEDCBA9876543210DCYXWVUTSRQPONMLKJIHZGFEDCBA9876543210YXWVUTSRQPONMLKJIHGFE"[parseInt(atr.substring(40,atr.lastIndexOf('.')))])
}
//alert(flag);
console.log("REKT CHULA !!!",flag)
document.getElementsByTagName('frame')[2].contentDocument.getElementsByName('code')[0].value = flag;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment