<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="description" content="PoW Buster is an optimized solver for interactive Proof of Work challenges.">
<title>PoW Buster</title>
<style>
.hidden {
display: none;
}
</style>
</head>
<body>
<h1>PoW Buster</h1>
<p>A fast, adversarially implemented mCaptcha/Anubis/Cerberus/go-away/Cap.js PoW solver.</p>
<h1>How to use</h1>
<p>
Anubis/Go-away/Cerberus: You should find the challenge JSON in:
<ul>
<li>`head > script#anubis_challenge`</li>
<li>`script#challenge-script[x-challenge]`</li>
<li>a network request that ends with `/make-challenge`</li>
</ul>
Copy the challenge JSON and paste it into the textarea below.
Characters before the first `{` and after the last `}` are ignored.
<br>
Response will be a single redirect URL provided in JavaScript format mirroring the official solver's behavior
after a solution is found.
</p>
<h1>Expected Formats</h1>
<ul>
<li>
Anubis (both forms are accepted):
<ul>
<li>
"fast" and "slow":
<code>{"rules":{"algorithm":"fast","difficulty":4,"report_as":4},"challenge":"xxxxxx"}</code>
</li>
<li>
"preact":
<code>{"rules":{"algorithm":"preact","difficulty":1,"report_as":1},"challenge":{"id":"xxxxxx","randomData":"yyyyyy"}}</code>
</li>
</ul>
</li>
<li>
Cerberus (please add "version" key for older versions):
<code>{"challenge":"8676e9cefd7605e746987bf31262846259c2e550d4e308f66b74cb06a722a6c8","difficulty":12,"nonce":90144522,"ts":1000000000,"signature":"e3cae2bc91a2f303d272ba748a2fe82835ab057e9ff00bacd67bec24e9ae387b810407af545a6589b7f421defead23b9bc6c5ccfd3125fe758819e4312b3a300"}</code>
</li>
<li>
Go-away (Server-Side Only for now):
<code>{"challenge":"000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f", "target": "000fff", "difficulty": 16}</code>
</li>
<li>
CapJS (Server-Side Only for now):
<ul>
<li>
Typical salt:
<code>{"challenge":{"c":50,"s":32,"d":4},"token":"4b1b46efba002091eeff6cfb0a8c2210d4670d9ce013d6e773","expires":0}</code>
<li>
Stretched salt (floating point numbers are expected behavior, server will accept them):
<code>{"challenge":{"c":50,"s":57,"d":4},"token":"4b1b46efba002091eeff6cfb0a8c2210d4670d9ce013d6e773","expires":0}</code>
</li>
</ul>
</li>
</ul>
<h1>Request Form</h1>
<form action="/solve" method="post">
<br>
<textarea id="challenge" name="challenge" rows="10" cols="80"></textarea>
<br>
<button id="solve" type="submit">Solve Server Side (NoJS friendly)</button>
<button id="solve-wasm" type="button" disabled>Solve in WASM</button>
</form>
<div id="wasm-results">
<h1>WASM Results</h1>
<p>WASM Module Loaded? <span id="module-loaded-value">JavaScript Not Executed</span></p>
<div id="wasm-results-inner" class="hidden">
<p><span id="wasm-error-value"></span></p>
<p>Nonce: <span id="nonce-value"></span> (<span id="attempted-nonces-value"></span> attempted)</p>
<p>Latency: <span id="latency-value"></span></p>
<p>Hash Rate: <span id="hash-rate-value"></span></p>
<p>Pass challenge script: <br><textarea rows="10" cols="80" id="pass-challenge-script-value"></textarea></p>
<button id="copy-pass-challenge-script-button" type="button">Copy Pass Challenge Script</button>
</div>
</div>
<footer>
<p>NOTICE: this is a public service limited to manageable load and limited concurrency, please do not abuse it.
Run it on your own server if you need more resources.
<a href="https://github.com/eternal-flame-AD/pow-buster">Source Code</a>
</p>
</footer>
<script type="module">
import init, { solve_json } from "/pkg/pow_buster.js";
let solver = null;
let worker = null;
let solutionResolver = null;
const moduleLoadedEl = document.getElementById("module-loaded-value");
const loadPromise = new Promise((resolve, reject) => {
try {
worker = new Worker("/worker.js", { type: "module" });
worker.onmessage = (e) => {
switch (e.data.type) {
case "ready":
moduleLoadedEl.innerText = "YES (WebWorker)";
solver = (json) => {
return new Promise((resolve, reject) => {
solutionResolver = resolve;
worker.postMessage({
type: "solve",
json,
});
});
};
resolve();
break;
case "solution":
solutionResolver({ ...e.data.solution, "method": "webworker" });
break;
case "error":
reject(e.data.message);
break;
}
};
} catch (e) {
console.error("error loading solver with webworker", e);
reject(e);
}
});
try {
await loadPromise;
} catch (e) {
console.error("error loading solver with webworker", e);
try {
init();
moduleLoadedEl.innerText = "YES (Sync WASM)";
solver = async (json) => {
const solution = solve_json(json);
return {
subtype: solution.subtype,
delay: solution.delay,
response: solution.response,
nonce: solution.nonce,
attempted_nonces: solution.attempted_nonces,
"method": "sync wasm",
};
};
} catch (e) {
moduleLoadedEl.innerText = "ERROR: " + e;
throw e;
}
}
function copyToClipboard(text) {
const textArea = document.createElement("textarea");
textArea.value = text;
document.body.appendChild(textArea);
textArea.select();
document.execCommand("copy");
document.body.removeChild(textArea);
}
const encoder = new TextEncoder();
const wasmErrorEl = document.getElementById("wasm-error-value");
const wasmResultsInnerEl = document.getElementById("wasm-results-inner");
const nonceEl = document.getElementById("nonce-value");
const passChallengeScriptEl = document.getElementById("pass-challenge-script-value");
const copyPassChallengeScriptButton = document.getElementById("copy-pass-challenge-script-button");
copyPassChallengeScriptButton.addEventListener("click", () => {
copyToClipboard(passChallengeScriptEl.value);
});
const attemptedNoncesEl = document.getElementById("attempted-nonces-value");
const latencyEl = document.getElementById("latency-value");
const hashRateEl = document.getElementById("hash-rate-value");
const challengeEl = document.getElementById("challenge");
function findJson(text) {
try {
let left = text.indexOf("{");
let right = text.lastIndexOf("}");
if (left < right) {
return text.slice(left, right + 1);
}
return null;
} catch (e) {
return null;
}
}
const solveButton = document.getElementById("solve-wasm");
solveButton.addEventListener("click", () => {
let json = findJson(challengeEl.value);
if (json) {
let jsonParsed = null;
try {
jsonParsed = JSON.parse(json)
} catch (e) {
alert("Input cannot be parsed as valid JSON.");
return
}
solveButton.disabled = true;
solveButton.innerText = "Busy...";
const start = performance.now();
console.log("solving anubis json", json);
setTimeout(() =>
solver(json).then((result) => {
const end = performance.now();
const duration = end - start;
console.log("result", result);
console.log("duration", duration);
setTimeout(() => {
if (result.subtype === "anubis") {
let finalUrl = "/.within.website/x/cmd/anubis/api/pass-challenge?elapsedTime=" + duration + "&response=" + result.response + "&nonce=" + result.nonce;
if (jsonParsed.challenge && jsonParsed.challenge.id) {
finalUrl += "&id=" + encodeURIComponent(jsonParsed.challenge.id)
}
finalUrl += "&redir=";
passChallengeScriptEl.value = `window.location.replace(${JSON.stringify(finalUrl)} + encodeURIComponent(window.location.href));`;
nonceEl.innerText = result.nonce;
attemptedNoncesEl.innerText = result.attempted_nonces;
} else if (result.subtype === "cerberus") {
let finalScript = `
((hash,nonce) => {
const thisScript = document.getElementById('challenge-script');
function createAnswerForm(hash, solution, baseURL, nonce, ts, signature) {
/*
Copyright (c) 2025 Yanning Chen <self@lightquantum.me>
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
*/
function addHiddenInput(form, name, value) {
const input = document.createElement('input');
input.type = 'hidden';
input.name = name;
input.value = value;
form.appendChild(input);
}
const form = document.createElement('form');
form.method = 'POST';
form.action = baseURL + "/answer";
addHiddenInput(form, 'response', hash);
addHiddenInput(form, 'solution', solution);
addHiddenInput(form, 'nonce', nonce);
addHiddenInput(form, 'ts', ts);
addHiddenInput(form, 'signature', signature);
addHiddenInput(form, 'redir', window.location.href);
document.body.appendChild(form);
return form;
}
const { difficulty, nonce: inputNonce, ts, signature } = JSON.parse(thisScript.getAttribute('x-challenge'));
const { baseURL } = JSON.parse(thisScript.getAttribute('x-meta'));
createAnswerForm(hash, nonce, baseURL, inputNonce, ts, signature).submit();
})("`.trim();
finalScript += `${result.response}",${result.nonce})`;
nonceEl.innerText = result.nonce;
attemptedNoncesEl.innerText = result.attempted_nonces;
passChallengeScriptEl.value = finalScript;
}
hashRateEl.innerText = "N/A";
if (duration >= 50) {
latencyEl.innerText = duration.toFixed(1) + "ms";
hashRateEl.innerText = (Number(result.attempted_nonces) / duration / 1024).toFixed(3) + " MH/s";
} else {
latencyEl.innerText = "<50ms";
}
wasmResultsInnerEl.classList.remove("hidden");
}, Math.max(0, result.delay - duration));
}).catch((e) => {
console.error("error in wasm solver", e);
wasmErrorEl.innerText = "ERROR: " + e;
wasmResultsInnerEl.classList.remove("hidden");
}).finally(() => {
solveButton.disabled = false;
solveButton.innerText = "Solve in WASM";
}), 0);
} else {
alert("No JSON detected in form.");
}
});
solveButton.disabled = false;
</script>
</body>
</html>