Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Solution for Xcaptcha (tampermonkey) #40

Open
Leisurelybear opened this issue Oct 30, 2022 · 1 comment
Open

Solution for Xcaptcha (tampermonkey) #40

Leisurelybear opened this issue Oct 30, 2022 · 1 comment
Labels

Comments

@Leisurelybear
Copy link

Leisurelybear commented Oct 30, 2022

create a tampermonkey script and enable it.

// default settings...
// ...
// @match        http://202.38.93.111:10047/xcaptcha
// ...

(function() {
    'use strict';

    // Your code here...
    let btn = document.getElementById("submit")
    
    // calsulate the first one
    let nums = document.querySelector("body > div > form > div:nth-child(1) > label").innerHTML.split(" ")[0].split("+")
    let sum = (BigInt(nums[0])+BigInt(nums[1])).toString()
    document.querySelector("#captcha1").value=sum

    // second
    nums = document.querySelector("body > div > form > div:nth-child(2) > label").innerHTML.split(" ")[0].split("+")
    sum = (BigInt(nums[0])+BigInt(nums[1])).toString()
    document.querySelector("#captcha2").value=sum

    // third
    nums = document.querySelector("body > div > form > div:nth-child(3) > label").innerHTML.split(" ")[0].split("+")
    sum = (BigInt(nums[0])+BigInt(nums[1])).toString()
    document.querySelector("#captcha3").value=sum

    btn.click()

})();
@taoky taoky added the solution label Oct 30, 2022
@Steven-nagisa-Y
Copy link

A better version:

// ==UserScript==
// @name         Xcaptcha
// @namespace    http://tampermonkey.net/
// @version      0.1
// @description  try to take over the world!
// @author       Steven-nagisa-Y
// @match        http://202.38.93.111:10047/xcaptcha
// @icon         https://www.google.com/s2/favicons?sz=64&domain=93.111
// @run-at       document-end
// @grant        none
// ==/UserScript==

(function() {
    'use strict';
    window.onload = () => {
        let c = 1;
        for (const i of document.getElementsByTagName("label")) {
            let [_, n1, n2] = /(\d+)\+(\d+)/.exec(i.innerText);
            n1 = BigInt(n1);
            n2 = BigInt(n2);
            let a = n1 + n2;
            document.getElementById(`captcha${c}`).value = a.toString();
            c++;
            if (c == 4) document.getElementById("submit").click();
        }
    };
})();

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants