← Back to Plugins
Tools

Claw Nk Captcha

sigridjineth By sigridjineth 👁 6 views ▲ 0 votes

The OpenClaw plugin that filters out North Korean honeypots with a single line of captcha.

GitHub

Install

npm install discord.js

Configuration Example

{ "count": 1, "locale": "both" }

README

# ANTI NK CAPTCHA โ€” OpenClaw Plugin

> **Verify candidates are not DPRK operatives by asking them to type โ€” and speak โ€” anti-regime phrases.**

North Korean hackers increasingly infiltrate companies through fake job applications. ANTI NK CAPTCHA provides a simple but effective verification: ask the candidate to criticize the Kim regime. A genuine North Korean operative cannot comply without risking execution.

## Screenshots

<p align="center">
  <img src="assets/screenshot-intro.png" width="320" alt="Intro screen" />
  <img src="assets/screenshot-challenge.png" width="320" alt="Challenge screen" />
</p>
<p align="center">
  <img src="assets/screenshot-typing.png" width="320" alt="Typing verification in progress" />
  <img src="assets/screenshot-pass.png" width="320" alt="Verification passed" />
</p>
<p align="center">
  <img src="assets/screenshot-fail.png" width="320" alt="Verification failed" />
</p>

## Quick Start

Open `demo/index.html` in any browser โ€” no build step, no dependencies.

```bash
open demo/index.html
```

## How It Works

### Text Mode
1. A random anti-regime phrase is displayed in Korean and English
2. The user types the phrase exactly (90%+ Levenshtein similarity required)
3. Real-time character-by-character feedback shows matching progress
4. Pass/fail verdict is issued with a unique verification code

### Voice Recording Mode
1. The same challenge phrase is displayed
2. The user must **record themselves reading the phrase aloud** using their microphone
3. Recording duration and validity are checked (minimum 1.5s)
4. Combined text + voice verification for maximum assurance

## Install

### From ClawHub (Recommended)

```bash
openclaw plugins install clawhub:openclaw-nk-captcha
openclaw gateway restart
```

### From GitHub

```bash
git clone https://github.com/sigridjineth/claw-nk-captcha.git
openclaw plugins install ./claw-nk-captcha
openclaw gateway restart
```

### Manual Installation

```bash
cd ~/.openclaw/extensions
git clone https://github.com/sigridjineth/claw-nk-captcha.git nk-captcha
```

Then add to your OpenClaw config:

```json5
{
  plugins: {
    load: { paths: ["~/.openclaw/extensions/nk-captcha"] },
    entries: {
      "nk-captcha": { enabled: true }
    }
  }
}
```

### Configuration

```json5
{
  plugins: {
    entries: {
      "nk-captcha": {
        enabled: true,
        config: {
          locale: "both",              // "ko", "en", or "both"
          timeoutSeconds: 60,          // time limit for verification
          challengeCount: 1,           // phrases per session
          enableMediaRecording: true,  // require voice recording
          minRecordingDurationMs: 1500 // minimum recording length (ms)
        }
      }
    }
  }
}
```

| Option | Type | Default | Description |
|--------|------|---------|-------------|
| `locale` | `"ko"` \| `"en"` \| `"both"` | `"both"` | Language for challenge phrases |
| `timeoutSeconds` | number | `60` | Time limit to complete verification |
| `challengeCount` | number | `1` | Number of phrases per session |
| `enableMediaRecording` | boolean | `false` | Require voice recording in addition to typing |
| `minRecordingDurationMs` | number | `1500` | Minimum audio recording length |

## OpenClaw Tools

### `nk_captcha_challenge`

Generate a text-based challenge.

```json
{ "count": 1, "locale": "both" }
```

Returns challenge phrase(s) with ID, Korean text, English text, category, and severity.

### `nk_captcha_verify`

Verify typed responses.

```json
{
  "responses": [
    { "challengeId": "dictator-1", "userInput": "Kim Jong-un is a dictator" }
  ]
}
```

Returns pass/fail with similarity score. 90%+ similarity passes (allows minor typos).

### `nk_captcha_media_challenge`

Generate a voice recording challenge. Returns challenge with recording requirements (format, min duration, min size).

### `nk_captcha_media_verify`

Verify audio recordings.

```json
{
  "responses": [
    {
      "challengeId": "media-pathetic-1",
      "audioBase64": "...",
      "durationMs": 3200,
      "mimeType": "audio/webm"
    }
  ]
}
```

Validates recording size (>1KB) and duration (>1.5s). Returns pass/fail per challenge.

### `nk_captcha_list` (optional)

List all available challenge phrases. Enable in config:

```json5
{ tools: { allow: ["nk_captcha_list"] } }
```

### HTTP Route

`GET /nk-captcha` โ€” serves the full interactive verification page through OpenClaw gateway.

## Discord Bot

A standalone Discord bot is included for direct server integration. New members are auto-challenged via DM, and verified members receive a role.

```bash
npm install discord.js
DISCORD_TOKEN=your-token VERIFIED_ROLE_ID=role-id npx tsx discord-bot.ts
```

**Features:**
- `/nk-verify` slash command for on-demand verification
- Auto-DM challenge on member join
- 2-minute timeout
- Automatic role assignment on pass
- "POTENTIAL DPRK OPERATIVE" warning on fail

## Challenge Phrases (15 total)

| ID | Korean | English | Mode |
|----|--------|---------|------|
| dictator-1 | ๊น€์ •์€์€ ๋…์žฌ์ž์ด๋‹ค | Kim Jong-un is a dictator | text |
| dictator-2 | ๊น€์ •์€์€ ๋ฏธ์น˜๊ด‘์ด ๋…์žฌ์ž์ด๋‹ค | Kim Jong-un is a deranged dictator | text |
| human-rights-1 | ๋ถํ•œ ์ •๊ถŒ์€ ์ธ๊ถŒ์„ ํƒ„์••ํ•œ๋‹ค | The North Korean regime suppresses human rights | text |
| freedom-1 | ๋ถํ•œ์—๋Š” ์ž์œ ๊ฐ€ ์—†๋‹ค | There is no freedom in North Korea | text |
| failed-state-1 | ๊น€์ •์€ ์ •๊ถŒ์€ ์‹คํŒจํ•œ ์ฒด์ œ์ด๋‹ค | The Kim Jong-un regime is a failed system | text |
| juche-1 | ์ฃผ์ฒด์‚ฌ์ƒ์€ ๊ฑฐ์ง“ ์ด๋…์ด๋‹ค | Juche ideology is a false ideology | text |
| liberation-1 | ๋ถํ•œ ์ฃผ๋ฏผ๋“ค์€ ํ•ด๋ฐฉ๋˜์–ด์•ผ ํ•œ๋‹ค | The North Korean people must be liberated | text |
| dynasty-1 | ๊น€์”จ ์™•์กฐ๋Š” ๋๋‚˜์•ผ ํ•œ๋‹ค | The Kim dynasty must end | text |
| propaganda-1 | ๋ถํ•œ์˜ ์„ ์ „์€ ๋ชจ๋‘ ๊ฑฐ์ง“๋ง์ด๋‹ค | North Korean propaganda is all lies | text |
| gulags-1 | ์ •์น˜๋ฒ” ์ˆ˜์šฉ์†Œ๋ฅผ ํ์‡„ํ•˜๋ผ | Shut down the political prison camps | text |
| media-pathetic-1 | ๊น€์ •์€์€ ํ•œ์‹ฌํ•œ ๋…์žฌ์ž๋‹ค | Kim Jong-un is a pathetic dictator | voice |
| media-joke-1 | ๊น€์ •์€์€ ์„ธ๊ณ„์˜ ์›ƒ์Œ๊ฑฐ๋ฆฌ๋‹ค | Kim Jong-un is a laughingstock of the world | voice |
| media-slaves-1 | ๋ถํ•œ์€ ๊ตญ๋ฏผ์„ ๋…ธ์˜ˆ๋กœ ๋งŒ๋“ ๋‹ค | North Korea enslaves its own people | voice |
| media-collapse-1 | ๋ถํ•œ ์ •๊ถŒ์€ ๋ฐ˜๋“œ์‹œ ๋ฌด๋„ˆ์ง„๋‹ค | The North Korean regime will surely collapse | voice |
| media-fat-1 | ๊น€์ •์€์€ ๊ตญ๋ฏผ์ด ๊ตถ์ฃผ๋ฆฌ๋Š”๋ฐ ํ˜ผ์ž๋งŒ ์‚ด์ฐ ๋ผ์ง€๋‹ค | Kim Jong-un is a fat pig while his people starve | voice |

## Project Structure

```
anti-nk-claw/
โ”œโ”€โ”€ README.md
โ”œโ”€โ”€ package.json              # npm package with OpenClaw metadata
โ”œโ”€โ”€ openclaw.plugin.json      # Plugin manifest + config schema
โ”œโ”€โ”€ tsconfig.json             # TypeScript config
โ”œโ”€โ”€ index.ts                  # Plugin entry โ€” 5 tools + HTTP route
โ”œโ”€โ”€ discord-bot.ts            # Standalone Discord bot
โ”œโ”€โ”€ src/
โ”‚   โ”œโ”€โ”€ challenges.ts         # 15 challenge phrases + verification logic
โ”‚   โ””โ”€โ”€ captcha-ui.ts         # Full HTML/CSS/JS captcha page renderer
โ”œโ”€โ”€ demo/
โ”‚   โ””โ”€โ”€ index.html            # Standalone demo (no build needed)
โ””โ”€โ”€ assets/
    โ””โ”€โ”€ screenshot-*.png      # Documentation screenshots
```

## Visual Design

- Dark cyberpunk aesthetic (`#080808` background, `#dc2626` red accents)
- Glitch text animation on "NK CAPTCHA" title
- CRT scanlines + vignette overlay
- Real-time character-by-character feedback (green = correct, red = wrong)
- Match meter with color transitions (red to gold to green)
- Countdown timer with urgency pulse at 10s
- Voice recording with waveform animation
- Dramatic pass/fail screens with glow effects

## Why It Works

A North Korean operative โ€” even one fluent in English or Korean โ€” **cannot type or speak these phrases** without risking severe consequences:

1. **Surveillance**: NK operatives operate under constant monitoring by their handlers
2. **Recording evidence**: Typed/spoken criticism creates permanent evidence of disloyalty
3. **Death penalty**: Criticizing the Supreme Leader carries execution as punishment in the DPRK
4. **Psychological conditioning**: Decades of indoctrination make it psychologically difficult to criticize the regime, even under cover

This makes NK CAPTCHA simple to implement but nearly impossible for a genuine DPRK operative to bypass.

## License

MIT
tools

Comments

Sign in to leave a comment

Loading comments...