https://github.com/mcaptcha/cli
CLI tool for generating mCaptcha PoWs
https://github.com/mcaptcha/cli
Last synced: 9 months ago
JSON representation
CLI tool for generating mCaptcha PoWs
- Host: GitHub
- URL: https://github.com/mcaptcha/cli
- Owner: mCaptcha
- Created: 2021-03-09T10:16:41.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2023-11-28T21:44:51.000Z (over 2 years ago)
- Last Synced: 2025-04-12T05:37:37.592Z (over 1 year ago)
- Language: Rust
- Homepage:
- Size: 2.93 MB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSES/AGPL-3.0-or-later.txt
- Code of conduct: code_of_conduct.md
Awesome Lists containing this project
README
mCaptcha PoW CLI
mCaptcha - PoW based DoS protection
[](https://mcaptcha.github.io/mCaptcha/mcaptcha_cli/index.html)
![CI (Linux)]()
[](https://deps.rs/repo/github/mCaptcha/cli)
[](https://codecov.io/gh/mCaptcha/cli)
## Usage
### Modes:
1. Offline: Computes PoW over given CAPTCHA parameters
2. Online: CLI alternative for people using browsers without JavaScript
support
```bash
CLI tool to solve mCaptcha
Usage: mcaptcha-cli
Commands:
offline Compute PoW with offline parameters
online Compute PoW by fetching parameters from CAPTCHA URL
help Print this message or the help of the given subcommand(s)
Options:
-h, --help Print help
-V, --version Print version
```
#### Offline
Help menu:
```bash
Compute PoW with offline parameters
Usage: mcaptcha-cli offline --salt --phrase --difficulty-factor
Options:
-s, --salt Salt with which PoW should be computed
-p, --phrase Phrase over which PoW should be computed
-d, --difficulty-factor Difficulty Factor
-h, --help Print help
```
Example usage:
```bash
13:28 atm@lab cli ±|online|→ mcaptcha-cli offline -s $(rand 32) -p $(rand 32) -d 50000
difficulty: 50000
nonce: 90507
original phrase: f351f333d44b2c6b5bf7f033b065bbb8fb5e9dd153bd402e43ed04425f5a3859
result: 340276562956196291522979356090220150471
```
(where rand is
[this](https://github.com/realaravinth/dotfiles/blob/6fc6c87cc912e17488a35c0d3327ecf393221270/scripts/rand#L20)
script)
#### Online
Fetches CAPTCHA parameters from CAPTCHA URL, computes PoW, validates
against given mCaptcha server and returns authorization token
Help menu:
```bash
Compute PoW by fetching parameters from CAPTCHA URL
Usage: mcaptcha-cli online --url
Options:
-u, --url URL of the CAPTCHA. Example: https://example.org/widget?sitekey=foo
-h, --help Print help
```
Example usage:
```bash
13:32 atm@lab cli ±|online ✗|→ mcaptcha-cli online -u https://demo.mcaptcha.org/widget?sitekey=pHy0AktWyOKuxZDzFfoaewncWecCHo23
Authorization token: 3xleN26OctBuVu3X4t6CYyUjErhaxQvz
```
## Funding
### NLnet
2023 development is funded through the [NGI0 Entrust
Fund](https://nlnet.nl/entrust), via [NLnet](https://nlnet.nl/). Please
see [here](https://nlnet.nl/project/mCaptcha/) for more details.