mitbbs_helper

Skip login captcha.

You will need to install an extension such as Tampermonkey, Greasemonkey or Violentmonkey to install this script.

You will need to install an extension such as Tampermonkey to install this script.

You will need to install an extension such as Tampermonkey or Violentmonkey to install this script.

You will need to install an extension such as Tampermonkey or Userscripts to install this script.

You will need to install an extension such as Tampermonkey to install this script.

You will need to install a user script manager extension to install this script.

(I already have a user script manager, let me install it!)

Advertisement:

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

(I already have a user style manager, let me install it!)

Advertisement:

// ==UserScript==
// @name         mitbbs_helper
// @namespace    https://www.mitbbs.com/
// @version      1.0
// @description  Skip login captcha.
// @author       fantasist
// @match        *://www.mitbbs.com/*mitbbs_login*.php
// @grant        none
// @run-at       document-end
// ==/UserScript==

(function() {
    'use strict';

    var btn = document.createElement("button");
    btn.innerText="免Captcha登陆";
    btn.onclick = () => {
        var jsondata;

        var id = document.getElementsByName("id")[0].value;
        var pass = document.getElementsByName("passwd")[0].value;

        var payload = 'msg={"reqType":"0601","username":"' + id + '","password":"' + pass + '","kickmulti":"yes"}';

        var xhr = new XMLHttpRequest();
        xhr.open("POST", "/iphone_new/service_new.php", true);
        xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
        xhr.send(payload);
        xhr.onreadystatechange = function () {
            if (xhr.readyState === 4 && xhr.status === 200) {
                // in case we reply back from server
                jsondata = JSON.parse(xhr.responseText);
                document.cookie = "UTMPKEY=" + jsondata.data[0].UTMPKEY + ";domain=.mitbbs.com;path=/";
                document.cookie = "UTMPNUM=" + jsondata.data[0].UTMPNUM + ";domain=.mitbbs.com;path=/";
                document.cookie = "UTMPUSERID=" + jsondata.data[0].UTMPUSERID + ";domain=.mitbbs.com;path=/"; // necessary for website, not POST
                window.location = 'https://www.mitbbs.com/newindex/kjjy.php';
            }
        }
    }

    document.getElementsByName("forget")[0].parentNode.appendChild(btn);
})();