Skip to content

A Node.js module implementing Privacy Pass Protocol. Bypass Cloudflare's CAPTCHAs by redeeming Privacy Pass tokens

Notifications You must be signed in to change notification settings

claabs/privacy-pass-redeemer-node

Repository files navigation

privacy-pass-redeemer-node

GitHub Workflow Status Coverage Status npm

A Node.js port of the privacypass Python module. See its Readme for more details on its background.

Usage

import axios from 'axios';
import { getRedemptionHeader, PrivacyPassToken } from 'privacy-pass-redeemer';

// 1. Obtain token from browser storage; pass into your program
const token: PrivacyPassToken = {
  input: [
    22, 154, 58, 240, 238, 122, 125, 23, 99, 108, 170, 68, 67, 115, 3, 224, 100, 163, 56, 223,
    34, 31, 212, 171, 39, 162, 217, 243, 224, 10, 16, 196,
  ],
  factor: '0xc1ddb8bce81bafe390578ba7e94ceaa9faabc48386aa58aa616f571256888cd9',
  blindedPoint:
    'BPmmboTSxbY3TYOIJljLkARBBhcLDuCQNohijoiEuqMLf6pmbTVwjOBIBZjmHwhp7WB9+Zjj9mYPmba4lf5xv7k=',
  unblindedPoint:
    'BCiOcZYeSZtH7zDCvYHqfkPqMwYlzIyuTSF2QW1XRysApO5QUOOADlWTez+9dkpokJsXRztt9u8OVP/GRS2lYbo=',
  signed: {
    blindedPoint:
      'BKB12x2wRsdv685koZOnlpJLbTfI8whIhtdVdAF/YmBpj1YqmJOApK5MCCs91WV1Dk74C0C1aXIIv+kcf86m/fQ=',
    unblindedPoint:
      'BK7d7UTyt4M5wKrAi8G1fC74CxHoNf7Jb711TkLsUPB1I7gfk3+LRkHuUDsRBqM3/3YY+thxy7xRoFEhxsLSeWM=',
  },
};

// 2. Create redemption token header
const redemptionTokenHeader = getRedemptionHeader(
  token,
  'https://example.com/some/path',
  'GET'
);

// 3. Make a request with the redemtion token. The token is expired after use
const resp = await axios.get('https://example.com/some/path', { headers: redemptionTokenHeader });

About

A Node.js module implementing Privacy Pass Protocol. Bypass Cloudflare's CAPTCHAs by redeeming Privacy Pass tokens

Topics

Resources

Stars

Watchers

Forks