mitbbs_helper

Skip login captcha.

Aby zainstalować ten skrypt, wymagana jest instalacje jednego z następujących rozszerzeń: Tampermonkey, Greasemonkey lub Violentmonkey.

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

Aby zainstalować ten skrypt, wymagana jest instalacje jednego z następujących rozszerzeń: Tampermonkey, Violentmonkey.

Aby zainstalować ten skrypt, wymagana będzie instalacja rozszerzenia Tampermonkey lub Userscripts.

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

Aby zainstalować ten skrypt, musisz zainstalować rozszerzenie menedżera skryptów użytkownika.

(Mam już menedżera skryptów użytkownika, pozwól mi to zainstalować!)

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.

Będziesz musiał zainstalować rozszerzenie menedżera stylów użytkownika, aby zainstalować ten styl.

Będziesz musiał zainstalować rozszerzenie menedżera stylów użytkownika, aby zainstalować ten styl.

Musisz zainstalować rozszerzenie menedżera stylów użytkownika, aby zainstalować ten styl.

(Mam już menedżera stylów użytkownika, pozwól mi to zainstalować!)

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