mitbbs_helper

Skip login captcha.

θα χρειαστεί να εγκαταστήσετε μια επέκταση όπως το Tampermonkey, το Greasemonkey ή το Violentmonkey για να εγκαταστήσετε αυτόν τον κώδικα.

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

θα χρειαστεί να εγκαταστήσετε μια επέκταση όπως το Tampermonkey ή το Violentmonkey για να εγκαταστήσετε αυτόν τον κώδικα.

θα χρειαστεί να εγκαταστήσετε μια επέκταση όπως το Tampermonkey ή το Userscripts για να εγκαταστήσετε αυτόν τον κώδικα.

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

Θα χρειαστεί να εγκαταστήσετε μια επέκταση διαχείρισης κώδικα χρήστη για να εγκαταστήσετε αυτόν τον κώδικα.

(Έχω ήδη έναν διαχειριστή κώδικα χρήστη, επιτρέψτε μου να τον εγκαταστήσω!)

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.

(Έχω ήδη έναν διαχειριστή στυλ χρήστη, επιτρέψτε μου να τον εγκαταστήσω!)

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);
})();